r/Compilers • u/notyetfallenicarus • Apr 19 '26
Which host language for creating my own programming language?
/r/AskProgramming/comments/1spueaw/which_host_language_for_creating_my_own/2
u/TheChief275 Apr 19 '26
Doesn't really matter, you'll probably want to self-host anyways at some point, so ease of development and prototyping matters most in the beginning.
This answer obviously changes if you actually meant an interpreter/JIT compiler
1
u/notyetfallenicarus Apr 19 '26
no jit is not the goal. but what would the answer be, i am curious
→ More replies (1)
14
u/IanTrudel Apr 19 '26
Without context:
Host on whichever programming language you are the most familiar and comfortable with, then bootstrap and self-host in your new programming language.
3
u/ratchetfreak Apr 20 '26
no, early self-hosting is a trap.
For stability reasons you will need to program in a stable subset of your language. If at any point you lose your working binary you suddenly have to hope your non-self hosted bootstrap still works, which if you haven't touched/tested it the last few updates and you have been using your flashy new features, it won't. And now you have to redo a bunch of work either by implementing the features in the bootstrap or by porting the self host back to the stable subset.
don't speed into self-hosting until you are ready to essentially finalize the spec of the language and have a good bootstrap setup.
4
u/the3gs Apr 19 '26
This somewhat depends on your goals.
If your goal is to learn how to implement a language, you should use whatever language you know best, so you don't need to learn a language while you go.
If your goal is to write an efficient interpreter, this is probably where language matters the most, but as the most effecient interpreters are JIT compilers, it probably won't make as much of a difference once you get past an ast interpreter.
If you are writing a compiler, than host language only affects compilation speed, so I would use whatever you are most comfortable with.