How golang compiler made by golang!!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How golang compiler made by golang!!!

according to Google the newer go compiler how that even possible 😅😅😅

6th Sep 2018, 10:18 PM
Odsh
Odsh - avatar
5 Answers
+ 3
They write a compiler that's just complicated enough to compile the full compiler in another language (like C, or something), and then with the newly compiled Go compiler they can now compile Go. This technique is quite common, and it's called bootstrapping. The compiler itself is a self-hosting compiler.
6th Sep 2018, 10:38 PM
LunarCoffee
LunarCoffee - avatar
+ 3
LunarCoffee are there benefits of doing that or it's just a marketing strategy 🙄
6th Sep 2018, 10:41 PM
Odsh
Odsh - avatar
+ 3
I'm not sure what you mean by "marketing strategy," but either way, there isn't really a benefit to writing a self-hosted compiler. It's probably just because they enjoy using the language, which most language designers do, because they wrote the language.
6th Sep 2018, 10:44 PM
LunarCoffee
LunarCoffee - avatar
+ 3
LunarCoffee I mean by marketing strategy they basically saying that our languages is so cool and well done that we had to make it compiler by the language it self 😂😂
6th Sep 2018, 10:50 PM
Odsh
Odsh - avatar
+ 2
droftor yes go it also called golang
6th Sep 2018, 10:39 PM
Odsh
Odsh - avatar