20 Apr '13, 4am

“Rubyist Magazine - YARV Maniacs 【第 2 回】 VM ってなんだろう”

# # RubiMaVM # module RubiMaVM class Instruction def initialize code, opts @code = code @opts = opts end attr_reader :code, :opts def inspect "#{code} <#{opts.join ', '}>" end end class Label @@id = 0 def initialize label @label = label @pos = -1 @id = @@id+=1 end attr_accessor :pos def inspect "#{@label} <#{@id}@#{@pos}>" end alias to_s inspect end class Evaluator def initialize @stack = [] @pc = 0 end def evaluate sequence while insn = sequence[@pc] dispatch insn end @stack[0] end def dispatch insn case insn.code when :nop when :push push insn.opts[0] when :pop pop when :dup popped = pop push popped push popped when :add push pop + pop when :sub push pop - pop when :mul push pop * pop when :div push pop / pop when :not push !pop when :smaller push pop < pop when :bigger push pop > pop when :goto @pc = insn.opts[0].pos return when :if if pop @pc = insn.opts[0].pos return ...

Full article: http://jp.rubyist.net/magazine/?0007-YarvManiacs

Tweets

“Rubyist Magazine - YARV Maniacs 【第 10 回】 例外処理(...

jp.rubyist.net 20 Apr '13, 4am

begin # BODY rescue Exception => e case e when E_C # RESCUE_C when StandardError # RESCUE else # ELSE end ensure # ENSURE end

“Rubyist Magazine - 標準添付ライブラリ紹介 【第 7 回】 net/http”

jp.rubyist.net 20 Apr '13, 12pm

xxx HTTPResponse 1xx HTTPInformation 100 HTTPContinue 101 HTTPSwitchProtocol 2xx HTTPSuccess 200 HTTPOK 201 HTTPCreated 20...

“Rubyist Magazine - YARV Maniacs 【第 11 回】 最近の YARV の事情”

“Rubyist Magazine - YARV Maniacs 【第 11 回】 最近の Y...

jp.rubyist.net 14 Apr '13, 9am

Tokens: the words that make up the Ruby language Parsing: how Ruby understands the code you write Compilation: how Ruby tr...

即ブクマした

jp.rubyist.net 01 May '13, 2am

test/ attributes definitions files libraries metadata.rb providers README.rdoc recipes resources templates

Whitespaceの魅力を語ってくれる学生を前にこれググってる。 

jp.rubyist.net 30 Apr '13, 6am

SSSTSSTSSS T SSSSSTTSSTST T SSSSSTTSTTSS T SSSSSTTSTTSS T SSSSSTTSTTTT T SSSSSTSSSSS T SSSSSTSTSTTT T SSSSSTTSTTTT T SSSSS...

重い腰をあげて、自動化をやろう。 / “Rubyist Magazine - Win32OLE...

jp.rubyist.net 25 Apr '13, 3am

include WIN32OLE::VARIANT def ie.navigate_post url,query_string header = "Content-type: application/x-www-form-urlencoded"...