(Replying to PARENT post)
Also, if this language isn't just going to be a toy, they need to write some sort of specification document about it. I'm tired of seeing new language websites announcing version 0.9 of the new language, accompanied by a statement that โwe haven't yet written a language manual, but here are some example programs and some obsolete papers about prior versionsโ.
I used to work in a senior position at a multinational firm. At one point, I went to the site of a company that had been recently purchased by my employers. Their major product was a large online system that was substantially written in a custom language. At that point, since the principals in the original company had left, there was not one employee left who understood this language completely.
(Replying to PARENT post)
[0]: https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index...
(Replying to PARENT post)
(Replying to PARENT post)
Yes, if your language doesnโt fit C, your implementation could be more efficient (potentially a lot), but getting there isnโt easier.
I think we got a lot of complexity and options since then that distract from โwriting your own languageโ.
I think a claim that we can do better than lex and yacc nowadays (e.g. using Haskell) would be a much stronger argument for โitโs much easier nowโ
(Replying to PARENT post)
Eg. Cowboy say "Hi there." Wait for 2 seconds. Cowboy run to Point P2 in 3 seconds.
It has been an eye opening and learning exercise. The advantage is even first time users can start using our language. Disadvantage natural language has such a wide variety of usage styles that it's a challenge.
(Replying to PARENT post)
(Replying to PARENT post)
And while you are at it, why not try to write a parser to reverse the process? :)
(Replying to PARENT post)
And citing parsing isn't a great example. Parser generators have been around for ages. And they're usually not the hard part anyways. Defining a simple grammar and parsing it, even manually, isn't that terrible of a task. Getting decent error messages and figuring out recovery? That's trickier.
Code generation has certainly gotten easier. But you still need to go through the process of figuring out how to lower your abstractions. My language is still extremely basic but I've still had to map my high level types and control structures down to WebAssembly. LLVM won't do that for you.
There's also more that your average user expects if you want a language that people use. Decent tooling is important, so a language server and some syntax highlighting packages in different editors. Good error messages. Decent type inference. Most of these you can eschew in the first few iterations of your language but eventually you'll need them.
I feel bad criticizing this post because writing a language has been one of the most instructive experiences I've had. I've learned so much about code generation, typechecking, the WASM spec, etc. But it's still a lot of tough work to get to something people can use. I'm not sure parser generators and LLVM make it that much easier.