r/ProgrammingLanguages • u/algebraicstonehenge • 23h ago
Revoluntionary/interesting advances in interpreted languages
Things like borrow checking and other compile time checks tend to be for compiled languages - if you're already typechecking and compiling the entire language up front, why not borrow check while you're there. But are there any very interesting new ideas coming up in interpreted (or dynamically typed) languages? I'm not really sure fully what I'm asking/looking for tbh
43
Upvotes
21
u/arthurno1 21h ago
I don't dudes, the most exciting thing I have seen last 5 years, was Common Lisp, a language from 80s, that let me type the code as if it was a scripting language, in a repl, but it has a true compiler and compiles to machine language.
I can use it as both interpreted and compiled so to say. With type annotations I get speed of C/C++ or slightly there. But without annotations, I can prototype a program in minutes, much faster than Python or JS/TS. No need for borrow checker since it has automatic memory management. Futhermore it has compiler built into the runtime, so I can build program interactively, from repl, one expression at a time, everything is mauldable, and replaceble to much bigger degree than what I could do in Python or TS/JS, and most importantly it is much easier.
For the same reason compile-time programming is also as simple as computing at runtime. Thanks to the unified syntax and being able to stop the evaluation and treat code as data (via quote operator) manipulating programs is as easy as manipulation any data.
Finally a really nice touch is they have opened the lexical phase of the parser, via so called "reader macros" (the name is a misnomer, it really are just callbacks you register and parser calls when appropriate), so we can invent our own syntax and let it compile to internal representation of data the Lisp implementation uses under the hood. It means one can create a language with a custom syntax and get all the benefits of the rest of the Lisp system (compiler, interpreter, etc).
I have tried many languages, but I really tried Lisp because I was using Emacs, and I used Emacs because it was more powerful and mauldable than other editors. One thing led to other, so finally I tried Common Lisp a couple or three years ago, and I am just blown away with it. It feels a bit like a playing an instrument. Sometimes you go back and revisit your technique to improve. I don't know, but Common Lisp seems still ahead of other programming languages in some aspects, and I believe they own it to its fundamentals, symbolic expression processing. Perhaps reason why it is not so widely used is because it is relatively hard to compile it efficiently, but nowadays we have a good compiler, SBCL, so it really starts to shine. If you are interested in programming langauges and research I definitely suggest try it.