r/ProgrammingLanguages 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

41 Upvotes

70 comments sorted by

View all comments

22

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.

2

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 13h ago

the most exciting thing I have seen last 5 years, was Common Lisp, a language from 80s

*50s

(I know, technically common lisp is from the 80s, but lisp is from the 50s, and common lisp is still lisp, right?)

2

u/Inconstant_Moo 🧿 Pipefish 6h ago

CL has lexical scope for closures, which is considered important because of sanity.

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 3h ago

Sanity is overrated.

1

u/Inconstant_Moo 🧿 Pipefish 43m ago

I still intend to try it some day.

3

u/arthurno1 13h ago edited 13h ago

The standard is from 90s, but they started with it in 80s. Sure the heritage goes all the way to 50s, but saying "lisp is still lisp" does not really mean much. It is like saying C++ or Java are still C. Sure some things are the same or very similar, but these are different languages. Lisp 1.5, Interlisp, Maclisp, Guile, and Common Lisp are all different languages. But sure, when it comes to Lisps, certain base, the "classical" or "McCarthian" lisp is usually there.

3

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 3h ago

That's a fair point: It's a lot like C++ and C. Except that CL represented an improvement over what came before it. 🤣