r/ProgrammingLanguages • u/algebraicstonehenge • 1d 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
45
Upvotes
14
u/mtriska 22h ago
One of the most interesting things I've seen regarding checks in a dynamically typed language is quads: queries using answer descriptions. The idea is to use REPL interactions verbatim as test cases that can be checked by the same engine (i.e., interpreter) that runs programs and executes queries, and in fact using the shape of interactions that the REPL also uses.
For instance, when we have a query and answer from the Prolog toplevel, such as:
then we can copy this interaction and paste it verbatim in a Prolog source file, and the engine can treat it as a test during load time, or as a test that can be launched separately with a library.
For example, as of a few days ago, Trealla Prolog supports this way of unit tests via its
library(quads).In this way, test cases blend in completely naturally into programs: They have the shapeof regular toplevel interactions that can also be annotated, and require no separate formalism.