Get the latest tech news
How do you prototype a nice language?
I’ve spent the past month prototyping my codeCAD language. However, while I’ve made tons of zero-to-one-type progress (an EBNF grammar, parser, function definitions, evaluation, and numeric solving!), the current possible demos are all terribly underwhelming — think the game programmer’s “triangle with color gradient” or the hardware engineer’s “PCB with a single blinking LED”.
So far I’ve punted on doing proper (whitespace and comment preserving) unparsing in favor of brute force canonicalizing abstract-syntax-tree -> string rendering, but I expect I’ll need to flesh that out along with LSP support sooner rather than later. I have been reading around to learn about unified approaches for building a language with first-party support for editor tooling — where the LSP engine isn’t a from-scratch duplication of the compiler/interpreter’s analyzer, but is rather integrated as part of a single codebase. It records every intermediate value created during code execution, which lets you not just step forwards/backwards in time, but also to search so you can say “this number I see in this JSON response, where did it come from?” and trace it back to the exact database call or whatever.
Or read this on Hacker News