I love how pragmatic the approach is here. We still don't have parser generators which generate human understandable/readable recursive descent parser with good error recovery baked in. But i am guessing the ruby syntax is too complicated/irregular anyway. On a macro side, i am always surprised with the length and effort company will go to keep working with solution design and selected at their young age, and try to…
Where is the “more bang for the engineering buck”?
Rewriting the Ruby parser
31–40 of 182 posts
Re: Rewriting the Ruby parser
#32It feels to me like Shopify is single-handedly keeping Ruby alive. A little bit like Jane Street and O'Caml.
This is wholly irrelevant, but I love the spelling of O'Caml like an Irish last name. I'd definitely frequent a pub called O'Caml's.
Re: Rewriting the Ruby parser
#33Re: Rewriting the Ruby parser
#34... open parenthesis character is ambiguous in this context. To get around it they made their grammar more ambiguous and then enforced that the actual grammar was enforced in their tree builder.
I'd change the second "more ambiguous" to "more lenient"
i.e. lenient meaning "grammar accepts more strings", ambiguous meaning "grammar is invalid"
I have seen this issue in Python's grammar as well, and it's mitigated by the new PEG parser
Re: Rewriting the Ruby parser
#35Nice article! In this sentence ... open parenthesis character is ambiguous in this context. To get around it they made their grammar more ambiguous and then enforced that the actual grammar was enforced in their tree builder. I'd change the second "more ambiguous" to "more lenient" i.e. lenient meaning "grammar accepts more strings", ambiguous meaning "grammar is invalid" I have seen this issue in Python's grammar as…
Re: Rewriting the Ruby parser
#36Earlier quoted context omitted.
I don't know why, there are tons of smaller companies using it. I have a lot of languages and experience on my resume and the one that consistently gets me the most inquiries at the highest pay grades is still Ruby. Anecdotal I know, but from the moment that it appeared on my resume in 2012 it's been non-stop. Probably 80% of everything I hear about. Ruby and it's ecosystem brings the closest thing to natural Aspect…
i think if rails continues to push hotwire (turbo + stimulus, and perhaps strada?) and get a coherent story on view components, it will continue to take mindshare from the js hype of the last decade. mobile dev is in decline, and browser makers just released web notifications, web app support, webtransport, page transitions, etc., so the backend has largely reached parity for cross-platform development. no longer is…
Re: Rewriting the Ruby parser
#37Re: Rewriting the Ruby parser
#38Nice article! In this sentence ... open parenthesis character is ambiguous in this context. To get around it they made their grammar more ambiguous and then enforced that the actual grammar was enforced in their tree builder. I'd change the second "more ambiguous" to "more lenient" i.e. lenient meaning "grammar accepts more strings", ambiguous meaning "grammar is invalid" I have seen this issue in Python's grammar as…
Ambigious does not mean invalid
But Python's pgen rejects such grammars as invalid ... The other strategy is just to pick an arbitrary interpretation
Re: Rewriting the Ruby parser
#39> Chad Fowler and I over basically 2 weeks, took the Java Debug Wire Protocol specification [...] turned it into a DSL in Ruby, and used that DSL to generate the packets for sending and receiving data. So we used the DSL in Ruby as a generator to generate Ruby code, as the whole protocol and then I used that at Darpa. They were trying to say “we could freeze the agent society from within the agent society will send messages, and it took about 7-8 minutes for all the messages to propagate and everything to freeze and then go quiet. I had a Ruby process that was running all 300 VM’s were underneath it, and I could freeze it in about a half of second. All 300 of them! And you actually could watch the CPU use because we had a monitor and the CPU use has dropped to zero. And it freaked them out. And what was great was you could turn it back on, and all the agents came back on. But time had been lost. And it was like alien abduction lost time, ten minutes went away, “what happened to us?” It was a bizarre thing because they were agents and they were planning on things and all of sudden 10 minutes just went away. But it was interesting to show how Ruby could actually be used as this kind of harnesses to wrap around things like systems.
Re: Rewriting the Ruby parser
#40It feels to me like Shopify is single-handedly keeping Ruby alive. A little bit like Jane Street and O'Caml.
The continuing work on the language and its performance is impressive, but Ruby (and Rails) themselves have the honour of being stable, tried-and-tested solutions for rapid application development. Is it as exciting as the latest and greatest serverless lambda framework in Typescript? Not really. Is it a dependable workhorse? Absolutely.
At some point you might be successful enough to justify a rewrite into something else, but a simple Rails app will take you a long way with little effort.