4 ms·
Using a scheme subset seems like cheating almost. The no syntax, s expression languages allow one to avoid the entire lexing, parsing, ast generation aspect of
by marktangotango 12y ago
Using a scheme subset seems like cheating almost. The no syntax, s expression languages allow one to avoid the entire lexing, parsing, ast generation aspect of the endeavor.
Tratt has a blog post that expands on the bit about languages implemented in themselves and the consequences:
http://tratt.net/laurie/blog/entries/the_bootstrapped_compiler_and_the_damage_done http://tratt.net/laurie/blog/entries/the_bootstrapped_compil...
- ihnorton 12y ago"ML -- a domain-specific language for writing ML compilers." https://twitter.com/samth/status/481759160007004160 https://twitter.com/samth/status/481759160007004160
- pjmlp 12y agoML was created for the LCF theorem prover, not for writing compilers. It is just a nice side effect that functional programming, as well as, logic programming, make it so easy to write compilers.
- seanmcdirmid 12y agoDoes ML have any logic programming capabilities beyond algebraic pattern matching?
- cosmez 12y agoi don't mind this approach, you can waste an entire day with parsing even for the simplest language, this goes right to the point. "Parsing is mostly a distraction, because we want to study the parts of programming languages that are not parsing" http://cs.brown.edu/courses/cs173/2012/book/Everything__We_Will_Say__About_Parsing.html http://cs.brown.edu/courses/cs173/2012/book/Everything__We_W...
- seanmcdirmid 12y agoParsing is easy, you can hand write a recursive descent parser for a reasonably sane language in a couple hours. As the joke goes, XML and Lisp are languages for those who are afraid of parsers and syntax. Though I'm not sure I would want to argue this point with Shriram.
- pjmlp 12y agoI don't agree. Niklaus Wirth has bootstrapped all of his languages. I doubt anyone would say Algol W, Pascal, Modula-2 or Oberon(-7) have compiler development specific features.
- sklogic 12y agoActually, I always suspected that the tagged unions support in Pascal was added specifically for compiler development.
- sklogic 12y agoThe language used in the article had come to quite an elaborate syntax later in the bootstrap cycle ( http://www.meta-alternative.net/pfdoc.pdf http://www.meta-alternative.net/pfdoc.pdf ). So, yes, it's a cheating: using a Lisp-like language to bootstrap a compiler for a high level language with a complex parser.