The programmer who turns complex languages into elegant symphonies.
15 comments
At university the by far coolest and most fun course was compiler construction. We had to write something which would compile a small subset of Java (Javalette) into the Java Virtual Machine instruction set.
I wrote my compiler in Haskell because it seemed that it'd be much less hassle compared to do it in a object oriented or procedual language.
But it definitely was, oh and when you compared the results, I don't remember the exact number anymore but compared to especially the solutions in Java and C++ the haskell ones used around 1/10 of the lines of code to solve this particular problem. Because in the end this problem really has a recursive nature.
I have an idea for a Rust-like language with total functional methods bouncing around in my head. Lord knows when I'll get around to building it.
The programmer who made the OS
Actually compilers are more complex than operative systems, and incredibly they are built using compilers.
Compilers are built using compilers?
I belive you. I made a basic OS in around a month and now i'm starting a C compiler, I think I underestimated it a bit
When you write a compiler, you eventually have to write it twice. Once in a pre-existing language, then again in the language it compiles.
At university the by far coolest and most fun course was compiler construction. We had to write something which would compile a small subset of Java (Javalette) into the Java Virtual Machine instruction set.
I wrote my compiler in Haskell because it seemed that it'd be much less hassle compared to do it in a object oriented or procedual language.
It ain't pretty but it's honest work: https://github.com/jeena/CC/blob/master/Compiler.hs
But it definitely was, oh and when you compared the results, I don't remember the exact number anymore but compared to especially the solutions in Java and C++ the haskell ones used around 1/10 of the lines of code to solve this particular problem. Because in the end this problem really has a recursive nature.
I have an idea for a Rust-like language with total functional methods bouncing around in my head. Lord knows when I'll get around to building it.