top | item 7505819 A micro compiler in Ocaml 63 points| joaobatalha | 12 years ago |troydm.github.io | reply 22 comments order hn newest [+] [-] amirmc|12 years ago|reply As well as Real World OCaml (linked in the OP), there are also a number of tutorials/exercises at http://ocaml.org/learn/tutorials/The most visited of these pages is 99 problems: http://ocaml.org/learn/tutorials/99problems.html [+] [-] gsg|12 years ago|reply "Our program will preallocate 1000 bytes on stack for variables, since all of our variables are static."Oof, talk about cutting corners. Works well enough until you need function calls, I guess.Anybody who finds this intriguing might look at http://esumii.github.io/min-caml/index-e.html, which is also written in OCaml and goes into a bit more depth. [+] [-] toolslive|12 years ago|reply I don't know what the purpose is here, but I think it would be a lot smaller if the standard tools for lexing and parsing were used. http://caml.inria.fr/pub/docs/manual-ocaml-400/manual026.htm... [+] [-] seanmcdirmid|12 years ago|reply Most real production compilers don't use lexer or parser generators. load replies (3) [+] [-] kristianp|12 years ago|reply Informative comment, but surely the purpose of the article is to teach ocaml, not the lexing&parsing tools, which require more ocaml knowledge? load replies (1) [+] [-] greyfade|12 years ago|reply I hate this suggestion. What's the point of writing a toy compiler if you skip learning how to write one of its most critical parts? [+] [-] viciousplant|12 years ago|reply don't you see the purpose is purely the anime? load replies (1) [+] [-] vrotaru|12 years ago|reply And more mini-languages which are implemented in Ocaml, here:https://github.com/andrejbauer/plzoo [+] [-] gtani|12 years ago|reply this reminds me of a neglected bookmark, the original rust compiler in ocaml from 3 years ago http://www.reddit.com/r/rust/comments/18b808/is_the_original...
[+] [-] amirmc|12 years ago|reply As well as Real World OCaml (linked in the OP), there are also a number of tutorials/exercises at http://ocaml.org/learn/tutorials/The most visited of these pages is 99 problems: http://ocaml.org/learn/tutorials/99problems.html
[+] [-] gsg|12 years ago|reply "Our program will preallocate 1000 bytes on stack for variables, since all of our variables are static."Oof, talk about cutting corners. Works well enough until you need function calls, I guess.Anybody who finds this intriguing might look at http://esumii.github.io/min-caml/index-e.html, which is also written in OCaml and goes into a bit more depth.
[+] [-] toolslive|12 years ago|reply I don't know what the purpose is here, but I think it would be a lot smaller if the standard tools for lexing and parsing were used. http://caml.inria.fr/pub/docs/manual-ocaml-400/manual026.htm... [+] [-] seanmcdirmid|12 years ago|reply Most real production compilers don't use lexer or parser generators. load replies (3) [+] [-] kristianp|12 years ago|reply Informative comment, but surely the purpose of the article is to teach ocaml, not the lexing&parsing tools, which require more ocaml knowledge? load replies (1) [+] [-] greyfade|12 years ago|reply I hate this suggestion. What's the point of writing a toy compiler if you skip learning how to write one of its most critical parts? [+] [-] viciousplant|12 years ago|reply don't you see the purpose is purely the anime? load replies (1)
[+] [-] seanmcdirmid|12 years ago|reply Most real production compilers don't use lexer or parser generators. load replies (3)
[+] [-] kristianp|12 years ago|reply Informative comment, but surely the purpose of the article is to teach ocaml, not the lexing&parsing tools, which require more ocaml knowledge? load replies (1)
[+] [-] greyfade|12 years ago|reply I hate this suggestion. What's the point of writing a toy compiler if you skip learning how to write one of its most critical parts?
[+] [-] viciousplant|12 years ago|reply don't you see the purpose is purely the anime? load replies (1)
[+] [-] vrotaru|12 years ago|reply And more mini-languages which are implemented in Ocaml, here:https://github.com/andrejbauer/plzoo
[+] [-] gtani|12 years ago|reply this reminds me of a neglected bookmark, the original rust compiler in ocaml from 3 years ago http://www.reddit.com/r/rust/comments/18b808/is_the_original...
[+] [-] amirmc|12 years ago|reply
The most visited of these pages is 99 problems: http://ocaml.org/learn/tutorials/99problems.html
[+] [-] gsg|12 years ago|reply
Oof, talk about cutting corners. Works well enough until you need function calls, I guess.
Anybody who finds this intriguing might look at http://esumii.github.io/min-caml/index-e.html, which is also written in OCaml and goes into a bit more depth.
[+] [-] toolslive|12 years ago|reply
[+] [-] seanmcdirmid|12 years ago|reply
[+] [-] kristianp|12 years ago|reply
[+] [-] greyfade|12 years ago|reply
[+] [-] viciousplant|12 years ago|reply
[+] [-] vrotaru|12 years ago|reply
https://github.com/andrejbauer/plzoo
[+] [-] gtani|12 years ago|reply