-
12 votes
-
The Val Programming Language
13 votes -
Coroutines for Go
9 votes -
Forth: The programming language that writes itself
10 votes -
Announcing TypeScript 5.2 Beta
6 votes -
What is the most advanced or creative program you can create using the LOX programming language?
Lox is a toy programming language that is designed in Java and C at craftinginterpreters.com. My challenge to you is: given the constraints of the Lox language, what are some creative or advanced...
Lox is a toy programming language that is designed in Java and C at craftinginterpreters.com.
My challenge to you is: given the constraints of the Lox language, what are some creative or advanced programs you can create?
This page provides a rundown of the design of Lox.
To kick it off, here's a simple function that estimates the value of pi:
fun estimatePi(rounds) { var pi = 0; var alt = 1; for (var i = 0; i < rounds; i = i + 1) { pi = pi + alt * 4/(2 * i + 1); alt = -alt; } return pi; } print "The value of pi is:"; print getPi(100000);
3 votes -
The Early History Of Smalltalk
7 votes -
Introducing Hurl, a terrible (but cute) idea for a language
27 votes -
Has anybody followed along with Crafting Interpreters?
21 votes -
The ideal backend language to write web apps in 2023?
I know quite a controversial and opinionated question, one that might easily get blasted with downvotes on a site like StackOverflow or even Reddit! Nevertheless, one which I believe is still...
I know quite a controversial and opinionated question, one that might easily get blasted with downvotes on a site like StackOverflow or even Reddit! Nevertheless, one which I believe is still relevant to ask and useful one even in 2023.
The problem with backend web technologies is that we are overwhelmed with choices. Whilst getting spoilt with choices seems like a useful thing sometimes, it might easily be an impediment in decision making too. Based on my experience, there are a bunch of useful stacks and I will work on any of them if you pay me to work as a freelance coder. Each has its own pros and cons but I'm yet to find the ideal one which according to me is something that should be easy to code and deploy while also better performing at the same time.
- ASP.NET: C# is the language I started coding web apps with in my last company and ASP.NET web forms was quite the rage back then. PHP was also gaining traction in the open source world and the webdev was mostly divided between the Enterprisey .NET aristocrats of Microsoft world and the poor PHP peasants of the FOSS world! One good thing about ASP.NET was performance. Since MS controlled the whole stack, they also put great efforts at making it work faster. The bad thing, of course, was dependence on a closed tech stack and a closed black box that generated JS functionality on its own.
- PHP: When I resigned from that company and started freelancing, I came to know about open source, linux, XAMPP, etc. That was when I realized that my own attitudes and thinking was more attuned to the FOSS peasant mindset than the wealthy aristocrat's! I didn't earn quite as much in freelancing with WP, Drupal, SuiteCRM, CodeIgniter, etc. but I found great happiness and contentment in being part of the open source process. Till date, PHP remains my favorite language for backend development and most of my web projects involve CodeIgniter or even pure PHP.
- Python: Flask is what got me interested in Python web development. The sheer minimalism and flexibility of that framework is what I found quite remarkable and quite a rarity in the frameworks world. And jinja2 template system was just fantastic. The other framework called django is more popular I think and I've worked on that too but Flask still remains my favorite. Flask is good in performance dept. too but I think it gets tricky once you start scaling with too many users.
- Java: I've never really bothered with Java web development except a few tutorial experiments on the Apache TomEE server. The multi-layered approach that Java takes not only has very steep learning curve but unless you're a very gifted programmer, it's practically impossible to beat the performance of interpreted PHP/Flask!
- NodeJS: Again, not much work here except brief hobby projects like http-live-simulator. The npm packaging system really turned me off initially with so many packages and issues with that system in the earlier days. Nowadays, I've heard that it's much usable but I've never gotten into it.
And now, we also have the evolving languages like Golang, Rust, etc. taking their baby steps towards web development too! Are any of them worth giving a try? If someone were to ask you for a backend tech stack recommendation while giving equal weightage to performance, developer productivity and ease of deployment, which one will you suggest?
23 votes -
DreamBerd, the perfect programming language
14 votes -
SourceHut will blocklist the Go module mirror
13 votes -
Go generics can make your code slower
3 votes -
Sigils are an underappreciated programming technology
3 votes -
Stack Overflow trends: Weekday vs weekend site activity
5 votes -
Statically recompiling NES games into native executables with LLVM and Go
6 votes -
Google introduces Carbon, an experimental replacement for C++
11 votes -
The Helios microkernel
10 votes -
Why store code as text files?
Code is usually version controlled nowadays in git or some other VCS. These typically operate on text files and record the changes applied to the files over their history. One drawback from this...
Code is usually version controlled nowadays in git or some other VCS. These typically operate on text files and record the changes applied to the files over their history. One drawback from this is that formatting of the code can introduce changesbto the files that make no semantic difference, e.g. newlines are added/removed, indentation is altered etc.
Consistent formatting makes the code easier to read, but the style used is an aesthetic preference. There might be objective reasons for readability in at least the extreme cases, but in many cases the formatting is purely a preferred style.
If we instead version controlled code in the form of an abstract syntax tree (AST) (possibly even as just a series of transformations on that tree), we could have any formatting we'd like! When editing the code we would just be changing a projection of the AST and when we've made our changes the transformations could be made to the stored AST. If two languages shared the same AST the choice of language even becomes a choice for the programmer. Sadly this has some limitations since ASTs are usually language specific... But we could possibly take this a step further.
Could we take a compiled binary and use that as the basis for generating an AST? This is essentially what decompilers do. For heavily optimized code this is severely limited, but for debug builds a lot of extra information is retained in the binary that can be utilized to construct a sensible representation. This way of storing code the language used becomes a style preference! Code compiled from one language might become alien when viewed in another language (thinking of lazy Haskell code viewed in C), but maybe that is a corner case?
There are issues when considering binaries for different platforms. A binary for the JVM isn't the same as one for ARM64 or one compiled to run on an x86. So there are some limitations there...
One (very) good thing about storing code as text files is the ubiquity of software capable of viewing and editing text. It would however be cool if we could make programming language a stylistic preference that is compatible with other languages! At least the AST part should be perfectly achievable.
16 votes -
Experience with Crystal programming language?
I have heard just a little bit about the language Crystal every so often, probably since it was first mentioned on /r/programming. From what I know, it's Ruby-like syntax but with a static type...
I have heard just a little bit about the language Crystal every so often, probably since it was first mentioned on /r/programming. From what I know, it's Ruby-like syntax but with a static type system, which seems like a big benefit to me.
I written just a little bit of Ruby, so the syntax isn't very familiar to me, and I haven't bothered trying Crystal out, but I'm curious to know what kinds of things people do with it.
So, my questions are: Do you have any experience with Crystal? If so, what have you used it for? Was it a professional or recreational project? How did you like it? What about it stood out to you compared to your experiences with other languages?
Thanks!
8 votes -
Nim Community Survey 2021 Results
2 votes -
Unix philosophy without left-pad, Part 2: Minimizing dependencies with a utilities package
9 votes -
Following the Unix philosophy without getting left-pad
4 votes -
VMware mouse driver for Windows 3.x
7 votes -
Rust Moderation Team resigns
20 votes -
The coming firmware revolution
15 votes -
It's time to get hyped about const generics in Rust
11 votes -
Taking the warts off C, with Andrew Kelley, creator of the Zig programming language
17 votes -
Common mistakes and bad habits in Rust
5 votes -
FD 100
7 votes -
Go proposal: expression to create pointer to simple types
4 votes -
A recent Python Enhancement Proposal targets adding "exception groups," as well as new syntax to catch and handle the groups
4 votes -
The lead developer of curl analyzed its known security vulnerabilities and determined that half of them are related to it being written in C
12 votes -
Nx (Numerical Elixir) is now publicly available
7 votes -
[Python] Buffer overflow in PyCArg_repr
5 votes -
Why I still Lisp (and you should too!)
10 votes -
Obituary of Dr. Brad J. Cox Ph.D.
9 votes -
What’s the point of pointfree programming?
6 votes -
Why nullable types in Dart?
11 votes -
Why scientists are turning to Rust
9 votes -
Why Raku is the ideal language for Advent of Code
5 votes -
The code that controls your money
8 votes -
Benno Rice: What UNIX Cost Us
10 votes -
What's coming in PHP 8
7 votes -
Real time communication at scale with Elixir at Discord
10 votes -
The Julia programming language is emerging as the tool of choice for large-scale numerical work in scientific research
12 votes -
Writing the same CLI application twice using Go and Rust: a personal experience
7 votes -
Go team publishes draft design proposals for a new read-only filesystem interface and a standard way to embed files into Go binaries
2 votes -
What is Zig's “colorblind” async/await?
8 votes -
Announcing sound null-safety for Dart
7 votes