Start with a very basic language, with very few features (maybe only support numbers)
Write a lexer, parser and AST for it
Write semantic analysis over the AST
Turn the AST into executable code (this is relatively easy if you use LLVM)
That's at least for a compiled language. Steps 4 and 5 would be replaced with an interpreter.
There are plenty of tutorials on the web on how to write you own language. What I always like to say is that a language is just a tool like "ls", "cat", or any application you develop: you take some input, analyze it and produce some output.
The tricky parts are:
Ending up with a language you like, but others like too
Ending up with a consistent language (this is really hard)
Thinking about all the language pieces at the same time
That's at least the technical part of it. The community part is a whole world of its own, tackling issues and PRs, and I'd say it's even more challenging (but also rewarding!) than developing the language itself :-)
In the shortest steps possible, how does one go about creating a new programming language?
That's at least for a compiled language. Steps 4 and 5 would be replaced with an interpreter.
There are plenty of tutorials on the web on how to write you own language. What I always like to say is that a language is just a tool like "ls", "cat", or any application you develop: you take some input, analyze it and produce some output.
The tricky parts are:
That's at least the technical part of it. The community part is a whole world of its own, tackling issues and PRs, and I'd say it's even more challenging (but also rewarding!) than developing the language itself :-)
Wow, one of the best answers I've ever heard about creating a programming language :) Thanks Ary!
Yeah, loved it!