Get the latest tech news

Write an Interpreter in Ruby


Talk for the RedDotRuby Conference 2024

a way • Cre a ted by Thorsten B a ll • It exists when you write it • C-like-JS-like synt a x • First-cl a ss a nd high-order functions • Integers, boole a ns, a rr a ys a nd h a shes • It h a s a reference implement a tion in Go, with unit tests 4 • INT, TRUE, FALSE, STRING, FUNCTION • IDENT, • BANG, MINUS, • LPAREN, LBRACKET, LBRACE • IF • Is there a nother token on the right, a nd does it h a ve the correct precedence? - w 3 'lua benchmarks.lua' Benchmark 1: lua benchmarks.lua Time (mean ± σ): 140.583 s ± 2.741 s [User: 140.575 s, System: 0.004 s] Range (min … max): 138.264 s … 147.545 s 10 runs 0 s 175 s 350 s 525 s 700 s Ruby 3.3.3 Python 3.12 Lu a 140.583 682.299 149.411 https://github.com/M a rioAri a sC/juliet a 20

Get the Android app

Or read this on Hacker News

Read more on:

Photo of ruby

ruby

Photo of interpreter

interpreter

Related news:

News photo

Tenjin (YC S14) Is Hiring a Senior Ad Attribution Engineer (Ruby, Go)

News photo

Show HN: I built a Ruby gem that handles memoization with a ttl

News photo

Kotlin, Swift, and Ruby losing popularity