[HN Gopher] Artichoke Ruby Architecture ___________________________________________________________________ Artichoke Ruby Architecture Author : ibraheemdev Score : 43 points Date : 2021-02-12 13:33 UTC (1 days ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | no_wizard wrote: | This looks really neat for the ruby community. It being modular I | imagine the target is for Embedding when you know you only need X | features of ruby so you get smaller and hopefully more performing | builds? At least if I understand this correctly. | | As an aside: is ruby easier to implement than other languages? | It's syntax and features seems more complex than say Python but | I've heard from others that implementing a new Python | distribution in say Rust is a real PITA | throwawaygimp wrote: | I hope so. I would love to use Ruby embedded one day | xutopia wrote: | I believe it is actually much harder to implement than many | other languages because the syntax is so complex. You have so | many edge cases to account for that it is rather difficult to | consider all scenarios. | danielheath wrote: | Parsing is hard, but that's only a small part of writing an | interpreter. | p4lindromica wrote: | For now Artichoke leans on mruby's parser, but I'm looking | forward to using https://github.com/lib-ruby-parser/lib- | ruby-parser which is a Rust port of MRI's parse.y. | p4lindromica wrote: | Code size in an embedded context is one use case for the | modularity here. Another is limiting access of Ruby code to the | host system. | | For example, one may wish to use Artichoke in a game engine for | scene scripting. It's probably undesirable for Ruby code run in | this context to modify the host environment, so `ENV` can be | disabled at compile time. But maybe you have existing code that | uses `ENV`. Toggle a compile time flag and you can get a | compatible `ENV` implementation that is backed by a hash map. ___________________________________________________________________ (page generated 2021-02-13 23:00 UTC)