- The language of regular expressions
- SQL queries
- In web frameworks, the language of routes
- etc.
Unfortunately we embed a lot of these languages as strings. This is problematic because the language usually sees just opaque strings—we can't apply any of our lovely static analysis tools to these little embedded languages.
I'm doing some research in this area. We just got a paper published at ECOOP. The big idea is that, with a little bit of clever metaprogramming, we can help the type checker understand these little languages better and give us more helpful hints or execute more efficiently. This isn't a new idea, but no one has given it a name before. Here's the blog post version: https://lambdaland.org/posts/2024-07-15_type_tailoring/
(HN discussion): https://news.ycombinator.com/item?id=40990232
https://github.com/williamcotton/guish
It is an experiment in using *nix pipelines to put languages on an even footing and not just treat them as strings embedded in strings.
I guess take a look at the screenshot and animated GIF for a better idea of what it does!
Some of the same articles, but with updates and added reader comments.
(I posted Amazon, but there is a ton on the used market)
This is a super minor correction on my part, but this is a weird phrasing because "the ACM" is a huge organization that publishes proceedings for a great range of interests --- it isn't a venue in itself. The name of the venue you're looking to reference is Communications of the ACM, more commonly just referred to as Communications or CACM.
As an aside, Communications is a sort of unique venue for publication. The submissions are peer-reviewed, but the nature of the submissions is more similar to a blog post or editorial article than traditional papers you'll find in other proceedings from conferences and journals (and, indeed, the ACM refers to CACM as a "magazine"). It makes for good "fun" reading!
To Vardi's credit (the previous CACM EIC), CACM clawed back some of its technical chops in the 2010s. I wouldn't claim it's near the quality of 1970s CACM, but it actually has technical content in it again. Equations, even, gasp!
You are correct, and I'll deny having a 1978 copy of the SIGPLAN (Programming Languages) Conference docs on the history of some of the languages that were popular then. :-)
“Little Languages” by Jon Bentley (1986) [pdf] - https://news.ycombinator.com/item?id=17881705 - Aug 2018 (17 comments)
You need to create:
- Grammar, parser, compiler, interpreter (delete as appropriate)
- Editor plugins for nice syntax highlighting
- Language server
- Packages for common things
- Nice website (or no one will use it)
- etc...
So the pressure is always to shoe-horn a big existing language into you problem. Maybe you can build a nice library if your language has decent syntax (or little to no syntax). If you have an AST representation, you probably dump it to JSON etc.
I am curious if any projects are trying to make this easier.
The key ideas are called Intentional Programming and Language Workbenches.
The best accessible implementation of that is JetBrains’ MPS (it is free). It allows you to define a language and “projectional” editors together.
It is really fascinating but it suffers from a learning curve where there is no small step from what people use in their everyday common languages and IDEs to building domain-specific solutions with MPS, so adoption is low.
Markus Voelter has some highly recommendable publications and elaborate applications of MPS for domains specific languages, see http://voelter.de/
I am sure there is something great in that area but it has not found the right form and shape yet, so keep exploring.
A rare mention of Intentional Programming aka IP (https://en.wikipedia.org/wiki/Intentional_programming) on HN. I first came to know of this from an article by Charles Simonyi titled "The Death of Computer Languages, The Birth of Intentional Programming" on MSDN. But alas, the promise never came to pass. The only other place i know of which covers it is a chapter in the book Generative Programming Methods, Tools, and Applications by Krysztof Czarnecki et al. IP is rather hard to understand (i still don't get it completely) and afaik there are no publicly available tools/IDEs to learn/play with it.
I don't believe Jetbrains MPS is a IP programming editor, it is meant for designing DSLs. IP has aspects of a DSL but is not the same.
Finally a huge upvote for mentioning Markus Voelter who is THE Expert in DSL design/implementation/usage. Checkout his articles/essays and the free ebook "Domain Engineering: Designing, Implementing and Using Domain-Specific Languages" from his above mentioned site.
Something that in theory sounds good but in reality means you have to build a bunch of extra tooling around it.
Feel like just text will be the way to go for a long time.
I think he mentions in his book that he was inspired by Bentley's above article to write his book. I remember also that the book was quite detailed (with the implementation in C) though not a full-blown compiler/interpreter book and the little language was something to do with image processing (i have to browse my copy again :-). This book deserves to be better known.
It's like SQL <-> RelationDB and jq <-> NonRelationalDB