Hacker News new | past | comments | ask | show | jobs | submit login

Actually a language compiler is more complicated than a web server when speaking about the data-structures and the algorithms used and represents the best test that you can have for a programming language.

Also, you would want a compiler written in a high-level language (versus C) precisely because you want to speed up the development of new features.




Yes, it's more complicated, but it doesn't really have much in the way of demands on the language used for implementation. It may royally suck to do, but you can write a compiler with nothing more than logic, data structures, and file I/O. That was my point.

> Also, you would want a compiler written in a high-level language (versus C) precisely because you want to speed up the development of new features.

Sure, but you'll need to pull people away to do that and will either have to stop your C-based compiler effort or resign yourself to prolonging the Go-based compiler development by playing catchup. In the meantime you aren't really as productive as you could have been. Go seems like it's about to slow down on language-level changes, which is the perfect time to start working on a Go-based compiler.


Actually a language compiler is more complicated than a web server when speaking about the data-structures and the algorithms used

That would depend on how much of the web environment you want to reproduce and what language we're talking about. The original Oberon fit into some 5500 lines of code, if I'm not mistaken. That's sort of smaller than Apache httpd. It's even smaller than nginx and lighttpd. And we're still talking about pretty weak languages, have you seen some of the self-hosting metacompiler stuff? (META-II, TREE-META, OMeta etc.) Don't forget that the design of the reference Go implementation is actually pretty close to the Oberon tradition of making things simple.


In terms of lines of code, I'm sure that things like OMeta are pretty small, but that doesn't mean the implementation is not complicated. And I'm not that familiar with the *Meta stuff, but AFAIK that stuff is just the frontend, whereas on the backend (the logic for generating the machine code / bytecode) things can get messy and complicated.

Also, I'm sure that the Go implementation is right now simple, but every mainstream compiler quickly evolves towards doing more and more AOT optimizations, like for performance or for better error messages. Again, performance optimizations can get really complicated and messy.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: