3 ms·
>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 programmin
by AlienRobot 2y ago
>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?
- calebkaiser 2y agoThe 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/ https://bakpakin.com/ I don't think the average programming language enthusiast is maintaining multiple well-known languages.
- AlienRobot 2y agoInteresting. 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.
- lelanthran 2y ago> 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.
- AlienRobot 2y agoA bit but I don't like "set foo 32" One way I think I can get rid of that is like this 32 = foo; But why do we even need variables? I think the perfect language design would be if you could just do this: pow(x, 2); pow(y, 2); sqrt() = result; And maybe you could do this { pow(x, 2); pow(y, 2); sqrt(); } + 1; pow(2) = result; Instead of result = pow(sqrt(pow(x, 2), pow(y, 2)) + 1, 2); that we have today.
- tonymillion 2y agoAt that point you’re almost, but not quite into the realm of “forth”
- jodrellblank 2y agoCrafting interpreters by Robert Nystrom could be a place to start - https://craftinginterpreters.com/ https://craftinginterpreters.com/ The author posts on HN as ‘munificent’, I think.
- tmountain 2y agoGreat book—as an entry point for designing languages.
- ninalanyon 2y agoI 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.