Let's compile the plus '+' operator in LLVM so we can add numbers or concatenate strings!
About the Project: Natalie is a very early-stage work-in-progress Ruby implementation that compiles Ruby to an executable. It does so by compiling Ruby to C++ and feeding it to gcc or clang to produce a binary.
Our PEG-based parser is too slow. :-(
Let's DELETE the code and start over! I started working on a new lexer and will be working soon to build a parser by hand.
GitHub: https://github.com/seven1m/natalie
Twitter: https://twitter.com/timmrgn
#programming #ruby #cpp #compilers #parsers
...
https://www.youtube.com/watch?v=oyBZD-WXJhc
Our parser needs more than one level of precedence for different operators. After a bit of struggling, we finally make a breakthrough!
GitHub: https://github.com/seven1m/natalie
Twitter: https://twitter.com/timmrgn
#programming #ruby #cpp #parsers #compilers #peg
...
https://www.youtube.com/watch?v=Pt7yCmgYySQ
I wanted to learn a bit about how LLVM works so I made a tiny little compiler that compiles numbers and strings to LLVM IR, compiles it, and runs it!
Here's the LLVM example code I started with: https://gist.github.com/seven1m/2ca74265cca9ef6f493ef1de87e9252d
About the Project: Natalie is a very early-stage work-in-progress Ruby implementation that compiles Ruby to an executable. It does so by compiling Ruby to C++ and feeding it to gcc or clang to produce a binary.
GitHub: https://github.com/seven1m/natalie
Twitter: https://twitter.com/timmrgn
Discord: https://discord.gg/hnHp2tdQyn
YouTube: https://www.youtube.com/timmorgan
#programming #compiler #cpp #llvm #ruby
...
https://www.youtube.com/watch?v=QNdb6oqAlvk
Join me as we finish up step 1 of the Make a Lisp guide, adding a HashMap, Vector, and teaching our reader to handle more input!
This video is part of a series. You can find the Make a Lisp playlist here: https://www.youtube.com/watch?v=hCH5HhftB5Q&list=PLWUx_XkUoGTrXOU0pFa_OVGA-6voiIEAt
Make a Lisp (mal) is a fantastic little guide that will teach you how to build your own lisp using whatever language you want! mal was created by Joel Martin (not me), and is available here: https://github.com/kanaka/mal
...
https://www.youtube.com/watch?v=f13dTrBHDqY
Finally wrapping up our work on method calls, whew! Now our little parser can parse method calls with a receiver, with args, with parentheses, and without parentheses!
About the Project: Natalie is a very early-stage work-in-progress Ruby implementation that compiles Ruby to an executable. It does so by transpiling Ruby to C++ and feeding it to gcc or clang to produce a binary.
GitHub: https://github.com/seven1m/natalie
Twitter: https://twitter.com/timmrgn
#programming #ruby #cpp #parsers #compilers #recursivedescentparser #prattparser
...
https://www.youtube.com/watch?v=5S2WvzgKajM
Turning strings into a unique internal representation can certainly improve performance when the same string representation is used over and over. Let's do it!
About the Project: Natalie is a very early-stage work-in-progress Ruby implementation that compiles Ruby to an executable. It does so by transpiling Ruby to C++ and feeding it to gcc or clang to produce a binary.
GitHub: https://github.com/seven1m/natalie
Twitter: https://twitter.com/timmrgn
#programming #compiler #strings #interning #cpp #ruby
...
https://www.youtube.com/watch?v=tK3pAxc1A6U
Let's git rid of our error-prone sprintf function in favor of a compile-time checked string formatting function using a variadic template.
About the Project: Natalie is a very early-stage work-in-progress Ruby implementation that compiles Ruby to an executable. It does so by transpiling Ruby to C++ and feeding it to gcc or clang to produce a binary.
GitHub: https://github.com/seven1m/natalie
Twitter: https://twitter.com/timmrgn
#programming #compiler #templates #cpp
...
https://www.youtube.com/watch?v=pzeYeh-lKI8
I'm writing a programming language that resembles Ruby, called Natalie.
https://github.com/seven1m/natalie
In this video, we continue our work on Exceptions, trying to get everything figured out when there are multiple levels of begin/rescue blocks. Unfortunately, I didn't quite get to the finish line on this one, so there's another video coming with Part 3, the conclusion.
...
https://www.youtube.com/watch?v=xALhx6zFZTE