• It has stack and heap for data store • All value is a signed Integer • It has goto and subroutine for flow control • It has 22 commands to manipulate stack and so on ◦ All commands are encoded only with whitespace chars
whitespace.ws $ cat whitespace.ws sep fizzbuzz.ws sep | gows whitespace.ws gows is a Whitespace interpreter written in Go. https://github.com/pocke/gows
a subset of Ruby • It supports ◦ Local vars, method call and def, Integer, Array, Hash, true, false, nil, if, case, while • It does not support ◦ Most built-in methods, String, class, module, meta programming, and so on
classes • Wsrb needs to distinguish classes ◦ e.g. `hash[1]` and `array[1]` should call different method • So, each value should have class information
types • For example ◦ Value is 42. (42.to_s(2) #=> 101010) ◦ Integer class is 0b01 ◦ In wsrb, the value is 10101001 see: http://i.loveruby.net/ja/rhg/book/object.html
item ◦ Size: Same as Array#size ◦ Capacity: Allocated items count (default: 10) ▪ size <= capacity ▪ If cap is too small, it’s re-allocated • Items Addr of First Item Size Capacity Item 1 Item 2 Item 3 ...