Hacker News new | ask | show | jobs
by dronemallone 3537 days ago
Something I've never understood: what's the deal with all these newfangled programming languages? Are they somehow better at being translated to assembly? Every program eventually becomes a bunch of instructions anyway...
1 comments

It depends on what the language developers are after, I suppose. Haskell's actually not that new [1], and its goal has been to both act both as an academic language for pushing the boundaries of CS research and as a foundation for more reliable practical programs.

Idris is an experimental language exploring the practical benefits of dependent types, and providing a modular backend for code generation (e.g. it can emit either C or Javascript currently).

I wouldn't say that Haskell is somehow better at being translated to assembly than, say, C. The real power is in the ability for the language to express the author's intent, and for that intent to be reflected in the resultant machine instructions. It's something that's surprisingly difficult to do, and part of why there are so many languages with different syntax and semantics [2].

One way to try and guarantee that the author's intent is translated accurately is to try and add constraints in the form of a strong type system (e.g. Haskell). I think this is a rather neat idea, and at the very least worthy of some time skimming through papers or listening to talks.

As software gets more and more complex, more people are finding that these ideas are useful in non-academic settings. I think my favorite example is Galois' SMACCMpilot project, which seeks to write secure, verified autopilot code in a Haskell DSL [3].

[1] First appeared around 1990

[2] n.b. I'm not a subject matter expert, just an interested hobbyist

[3] http://smaccmpilot.org

[*] Addendum: CS isn't my original field of education, so take all of these opinions with a heaping spoonful of salt. Corrections and clarifications to any of the above would be appreciated!