Skip to content

tomstuart/something

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Programming with Something

This code accompanies the RubyConf 2021 talk “Programming with Something”.

It consists of some support files plus a few different evaluators for the encodings from an earlier talk, “Programming with Nothing”:

  • Nothing — the original proc encodings
  • Something — an AST to represent those proc encodings, and a translator to build ASTs from procs
  • Something::Interpreter — an AST interpreter
  • Something::RubyVM::Interpreted — a Ruby implementation of the SECD machine which interprets an expression
  • Something::NativeVM::Interpreted — a C implementation of the SECD machine which interprets an expression
  • Something::RubyVM::Compiled — a Ruby implementation of the SECD machine which compiles an expression to commands in advance
  • Something::NativeVM::Compiled — a C implementation of the SECD machine which compiles an expression to commands in advance

To run the tests:

$ make
$ bundle install
$ bundle exec rspec

To run one of the demo FizzBuzz implementations:

$ make
$ bundle exec ruby demo/something_native_vm_compiled.rb

Please see the talk page for more details.