Questions tagged [yarv]

YARV (Yet another Ruby VM) is a bytecode interpreter for the Ruby programming language developed by Koichi Sasada and has become the official Ruby interpreter for Ruby 1.9.

25 questions
20
votes
2 answers

Why is a Regexp object considered to be "falsy" in Ruby?

Ruby has a universal idea of "truthiness" and "falsiness". Ruby does have two specific classes for Boolean objects, TrueClass and FalseClass, with singleton instances denoted by the special variables true and false, respectively. However, truthiness…
Jörg W Mittag
  • 363,080
  • 75
  • 446
  • 653
17
votes
2 answers

Rubinus or MRI 1.9.3 (YARV)?

So, I have a few questions that I have to ask, I did browse the internet, but there weren't too many reliable answers. Mostly blog posts that would cancel each-other out because they both praised different things and had benchmarks to "prove their…
omninonsense
  • 6,644
  • 9
  • 45
  • 66
10
votes
2 answers

Ruby 2.0 Bytecode Export / Import

I've been reading about the new ruby 2.0 features, and found that it will support bytecode import / export: Ruby 2.0 is expected to make it simple to save pre-compiled Ruby scripts to bytecode representations and to then run these directly. I've…
lucas clemente
  • 6,255
  • 8
  • 41
  • 61
9
votes
2 answers

How can I redefine Fixnum's + (plus) method in Ruby and keep original + functionality?

This throws me a SystemStackError in 1.9.2 Ruby (but works in Rubinius): class Fixnum def +(other) self + other * 2 end end but there is no super for + (based on other errors). How can I access the original + functionality?
karatedog
  • 2,508
  • 19
  • 29
8
votes
1 answer

Does Ruby's Enumerable#zip create arrays internally?

In Ruby - Compare two Enumerators elegantly, it was said The problem with zip is that it creates arrays internally, no matter what Enumerable you pass. There's another problem with length of input params I had a look at the implementation…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
7
votes
5 answers

Which ruby interpreter are you looking forward to?

There are multiple Ruby implementations in the works right now. Which are you looking forward to and why? Do you actively use a non-MRI implementation in production? Some of the options include: Ruby MRI (original 1.8 branch) YARV (official…
Chris Cherry
  • 28,118
  • 6
  • 68
  • 71
7
votes
3 answers

How can I store and read a RubyVM::InstructionSequence?

is there a way to store a RubyVM::InstructionSequence to a file and read it in later? I tried Marshal.dump without success. Im getting the following error: `dump': no _dump_data is defined for class RubyVM::InstructionSequence (TypeError)
Daveman
  • 1,075
  • 9
  • 26
7
votes
3 answers

RVM 1.9.1 & nokogiri

Having trouble installing the nokogiri gem under rvm ruby 1.9.1. gem install nokogiri I'm getting ... /usr/include/libxml2... no libxml2 is missing. try 'port install libxml2' or 'yum install libxml2-devel' *** extconf.rb failed *** but i…
scaney
  • 1,746
  • 13
  • 16
6
votes
1 answer

Any performance disadvantages of GC.disable?

Are there any circumstances where GC.disable can degrade performance? Is it ok to do, so long as I'm using real RAM rather than swap memory? I'm using MRI Ruby 2.0, and as far as I can tell, it's 64 bit, and using a 64 bit Ubuntu: ruby 2.0.0p0…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
5
votes
1 answer

How to profile garbage collection in Ruby

I'm trying to profile GC in a non-Rails application, preferably using YARV Ruby. perftools.rb is telling me that the majority of my CPU time is spent in garbage_collector (6061 (61.4%)). I'm also able to get how many objects are created by which…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
4
votes
1 answer

Are YARV Arrays' push/pop methods thread-safe?

Suppose I have a pair of (producer, consumer) YARV threads (Tp,Tc) sharing an Array q - Tp pushes to q, and Tc pops from it. If the order in which the pushes and pops get executed is unimportant, does the code work without any synchronization…
bsam
  • 880
  • 1
  • 8
  • 18
4
votes
2 answers

Lazy symbol binding failed: symbol not found

I have three header files in my project which describe objects Rational, Complex, and RubyObject. The first two are templates. All can be interconverted using copy constructors, which are defined in the header files — except for those that construct…
Translunar
  • 3,739
  • 33
  • 55
4
votes
1 answer

Is the information displayed in ruby --dump available at runtime?

In 10 Things You Didn't Know Ruby Could Do, slide 30, James Edward Gray II mentions ruby -e 'puts { is_this_a_block }' --dump parsetree which produces ########################################################### ## Do NOT use this node dump for any…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
4
votes
1 answer

Documentation on RubyVM::InstructionSequence?

With Ruby 1.9, the YARV-VM was merged into Ruby. So http://www.atdot.net/yarv seems to be outdated. Where can I find documentation on RubyVM::InstructionSequence? Especially on #compile_file? Where can I find an up-to-date Instruction Table like…
Julius Eckert
  • 1,481
  • 4
  • 16
  • 24
2
votes
2 answers

MRI and YARV Ruby implementations - what happened in Ruby 1.9?

As I understand it, prior to Ruby 1.9, MRI and YARV were two separate implementations of the Ruby programming language. What exactly changed in Ruby version 1.9? Was MRI abandoned in favour of YARV? Or were the two codebases merged in some way? I…
user200783
  • 13,722
  • 12
  • 69
  • 135
1
2