• V H@lemmy.stad.social
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    My terminal is written in Ruby, and it uses a font-renderer that’s 100% Ruby ( https://github.com/vidarh/skrift - I didn’t write it from scratch, it’s a port from C ), and it’s definitely possible to get things “fast enough” for a surprising portion of code in Ruby these days, but you may end up writing Ruby code that is “surprising”. For faster Ruby, see e.g. Aaron Patterson’s walkthrough of speeding up a lexer which ends up doing things most Ruby devs would not usually do because at least some of the things he ends up doing goes against the readability (e.g. the TrueType renderer I linked above definitely sacrifices speed and assumes you’ll memoize heavily to maintain readability). For an interpreter, you’re probably right to drop to something lower level.

    • swordsmanluke
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      That was a super cool article!

      …As it happens, I’m writing a parser in Ruby right now, so this is incredibly timely. Thanks!