>by the same author
What? People are just creating new languages these days as if they were Javascript libraries?
Let's say I wanted to make my own programming language. What's the easiest way to prototype it in a way I can share it with the world? Are the programming language development toolkits that come with a tokenizer library and things like that? Should I write my own program to output machine code? Or maybe it's easier to just transpile to Javascript?
The author, Calvin Rose, is a (I assume pretty great) compiler engineer at NVIDIA who has a personal affinity for LISPs and Lua: https://bakpakin.com/
I don't think the average programming language enthusiast is maintaining multiple well-known languages.
Interesting. I saw another link here of someone who insists on making C# run everywhere, now someone who insists on LISPs.
I really want to try making a language that is imperative, like really imperative, where every line must start with a verb, just to see what it would look like.
> I really want to try making a language that is imperative, like really imperative, where every line must start with a verb, just to see what it would look like.
It would look like Tcl.
A bit but I don't like "set foo 32"
One way I think I can get rid of that is like this
But why do we even need variables? I think the perfect language design would be if you could just do this: And maybe you could do this Instead of result = pow(sqrt(pow(x, 2), pow(y, 2)) + 1, 2); that we have today.At that point you’re almost, but not quite into the realm of “forth”
Crafting interpreters by Robert Nystrom could be a place to start - https://craftinginterpreters.com/
The author posts on HN as ‘munificent’, I think.
Great book—as an entry point for designing languages.
I thought almost all programmers created a language or two in the course of their careers or hobbies.
You can make a simple language very easily if you design the syntax carefully and restrict its capabilities. It all depends on what you need it for.
In my case I needed a way to create reports from a Turbo Pascal program (TP3 for DOS I think) without having to edit the program and ship a new version. So I made a simple report generating language. It had simple for loops, all variables were global, tokens were all separated by white-space, no user defined sub-routines or functions, a set of predefined procedures specifically designed for the report generating function, arithmetic expressions that were only allowed in assignment statements, interpreted not compiled.
It was actually quite easy to do but of course was not a general purpose language. These days it might be simpler to embed Lua.