An Introduction to Ruby Parsing with Prism
blog.appsignal.com·4d·
Discuss: Hacker News
📝Concrete Syntax
Preview
Report Post

You might have heard about Prism, the new Ruby parser. Perhaps you’ve heard it’s faster, more reliable, and more powerful than what we had before. Or maybe you never took a compilers class and aren’t sure about what this actually means.

I’m here to tell you all about it, and how it’s changing our lives as Ruby developers. Today, I want to take you from square one to writing your first transpiler.

Interpreters 101

Before we begin our journey, let’s start with the basics of how an interpreter works, so we’re all on the same page. Interpreting a programming language usually involves three main steps:

  1. Tokenizing input (a.k.a. lexing): Breaking the input text into a list of meaningful tokens. That’s like converting your code into something like this:

  2. Parsing:…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help