5 ms·
Well, you can write your own guideline on how to prototype a language in SML, post it to NH, and profit. Now we don't see your guideline but do see Flex/Bison/
by ilyak 17y ago
Well, you can write your own guideline on how to prototype a language in SML, post it to NH, and profit.
Now we don't see your guideline but do see Flex/Bison/LLVM one.
- jrockway 17y ago"Let's intentionally do things wrong because nobody posted details about the right way to HN." Yeah, go for it...
- ilyak 17y agoHow would one do things right if there are no examples of comparable quality? Revisit the recent drama with twisted vs tornado.
- mahmud 17y agoHow would one do things right if there are no examples of comparable quality? By researching independently when given sufficient pointers. I posted a link to Abdul Azziz Ghoulum's paper which shows a full compiler in small baby steps, bootstrapped from the first line! Research and conference papers are fairly good for learning, almost as good as blog posts.
- calambrac 17y agoWTF is wrong with you? That was one of the most informative comments I've ever seen on this site. There was a ton of useful information in there, way more than the short little guide in the OP (which I'm not knocking at all).
- ilyak 17y agoI'd like it to be a stand-alone article. This way it would be a first-class citizen on HN. I mean, more meat, examples, and soon quite a few more people know how to prototype a language in SML.
- silentbicycle 17y agoAndrew Appel's _Modern Compiler Implementation in ML_ is probably what you want. (http://www.amazon.com/Modern-Compiler-Implementation-Andrew-Appel/dp/0521607647/ http://www.amazon.com/Modern-Compiler-Implementation-Andrew-...) While it uses SML, it's not hard to follow if you use OCaml, and the bibliography / references are also quite helpful. The Ghuloum paper referenced elsewhere in the thread is also quite good (and uses Scheme, for better or worse).
- ilyak 17y agoIt's a damn book, not a quick article. Sad.
- silentbicycle 17y agoCompilers are a big topic. Any "quick article" of substance will have references to underlying tools and concepts the author will expect you to know. If you're completely lost, try starting with interpreters first. Compilers build on many of the same ideas, but interpreters are generally simpler. Read "The Art of the Interpreter" and/or SICP, and do the exercises. The former is a short paper, the latter is an excellent book expanding on it.
- ilyak 17y agoPlease no books and no research papers. Just a short article showing how to get things done. Exactly as one we're discussing.
- deleted 17y ago[deleted]
- RiderOfGiraffes 17y agoI've written compilers, and even though I no longer have any reason to do so, I'd love to know more about writing better compilers in better languages. There are dozens and dozens, if not hundreds of articles and "how to" style pages on the web showing a concrete implementation of a small compiler for a toy language using lex/flex and yacc/bison, yet when asked for something similar in ML, SML, Haskell, whatever, the response is to be pointed at books and scholarly articles. Where are the popular accounts of better compiler building with ML? Are there any? If not, why not? Yes, building an industrial-strength compiler for a real-world langauge is a big and complex undertaking, but I feel the field would advance more quickly if more hackers had more access to more articles of the "Build a compiler in an afternoon" variety. And I'd appreciate learning from it too, despite, or perhaps because of, my existing knowledge.