Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rubinius & The Eternal Yak

Rubinius & The Eternal Yak

Talk at FOSDEM 2015 about Rubinius and maintaining Ruby implementations.

Slide 6 is a GIF which can be found here: http://i.imgur.com/5DzWJRx.gifv

Yorick Peterse

January 31, 2015
Tweet

More Decks by Yorick Peterse

Other Decks in Programming

Transcript

  1. • Just In Time Compiler • Concurrent GC • Manual

    control over the JIT • C extension support • Largely written in Ruby itself • Periodically updated metrics
  2. Yak Shaving “Any seemingly pointless activity which is actually necessary

    to solve a problem which solves a problem which, several levels of recursion later, solves the real problem you're working on.”
  3. String#scrub “If the string is invalid byte sequence then replace

    invalid bytes with given replacement character, else returns self”
  4. rb_str_scrub() in string.c, 230 lines of C, little documentation, confusing

    tests string.c: http:/ /bit.ly/1weprdR tests: http:/ /bit.ly/1uar5xp
  5. def test_scrub_replace_default assert_equal("\uFFFD\uFFFD\uFFFD", u("\x80\x80\x80").scrub) assert_equal("\uFFFDA", u("\xF4\x80\x80A").scrub) # examples in Unicode

    6.1.0 D93b assert_equal("\x41\uFFFD\uFFFD\x41\uFFFD\x41", u("\x41\xC0\xAF\x41\xF4\x80\x80\x41").scrub) assert_equal("\x41\uFFFD\uFFFD\uFFFD\x41", u("\x41\xE0\x9F\x80\x41").scrub) More …
  6. it "replaces invalid byte sequences" do "abc\u3042\x81".scrub.should == "abc\u3042\uFFFD" end

    it "returns a copy of self when the input encoding is BINARY" do input = "foo".encode('BINARY') input.scrub.should == "foo" end More ...