3 ms·
Back when I was looking at hosting Ruby on Smalltalk VMs, I was playing around with parsers and compiler-compilers. From what I saw, the Ruby language has abou
by stcredzero 16y ago
Back when I was looking at hosting Ruby on Smalltalk VMs, I was playing around with parsers and compiler-compilers.
From what I saw, the Ruby language has about 108 terminals+nonterminals in its grammar.
Python has something like 29 term+nonterm.
Smalltalk (an advanced dialect with namespaces and syntactically distinct class bindings) has 8 term+nonterm.
The Ruby syntax is about 3X bigger than Python's, which in turn is about 3X bigger than Smalltalk's.
I'd like to peruse the syntax of Fancy. If it's significantly smaller than Ruby's, then programming tools will appear in the Fancy community at a much faster rate than they did in Ruby. If large swathes of it are homomorphic to Ruby, then lots of Ruby library code could appear in Fancy at a high rate.
EDIT: Yes, size of the syntax is a real consideration. Just two guys wrote the widely used Refactoring Browser for Smalltalk, which includes a recursive meta-syntax parser engine. I have hand written a top-down parser for Smalltalk, and I completed it in just one afternoon. Contrast this with the situation several years ago, of multiple teams of Ruby syntax "study groups" that each labored many months to produce parsers outside of the Matz Ruby VM. (Yes, an "interpreter" is still a VM! The distinction is nonsense at this point.) Smaller syntaxes mean faster language/tool innovation!
- cygwin98 16y agoOut of curiosity, by parsers and compiler-compilers did you mean Lex and Yacc? It is always a significant undertaking to implement a dynamic language in that way.
- stcredzero 16y agoLex, Yacc, the RBParser, and SmaCC, and perhaps some others.
- cygwin98 16y agoThanks for the info. Surprisingly, when I was googling RBParser, I got two different results: one being the RBParser class from Smalltalk (I guess that's the one you meant), the other is a new project with the same name hosted on github [1] -- a Ruby code parser written in OCaml. Both make perfect sense in my search. [1] "Pure and fast Ruby source code parser for OCaml" https://github.com/m2ym/rbparser https://github.com/m2ym/rbparser