is a much more robust and stable language. • Lots of refactoring of internal codebase. • Little shift in Rubex’s goals - from simply speed to portability/readability of C extensions.
= warmth_factor data$.blanket.owner = owner data$.blanket.len = len data$.blanket.breadth = breadth end def warmth_factor return data$.blanket.warmth_factor end # ... more code for blanket interface. end
= warmth_factor data$.blanket.owner = owner data$.blanket.len = len data$.blanket.breadth = breadth end def warmth_factor return data$.blanket.warmth_factor end # ... more code for blanket interface. end
= warmth_factor data$.blanket.owner = owner data$.blanket.len = len data$.blanket.breadth = breadth end def warmth_factor return data$.blanket.warmth_factor end # ... more code for blanket interface. end
= warmth_factor data$.blanket.owner = owner data$.blanket.len = len data$.blanket.breadth = breadth end def warmth_factor return data$.blanket.warmth_factor end # ... more code for blanket interface. end
= warmth_factor data$.blanket.owner = owner data$.blanket.len = len data$.blanket.breadth = breadth end def warmth_factor return data$.blanket.warmth_factor end # ... more code for blanket interface. end
= warmth_factor data$.blanket.owner = owner data$.blanket.len = len data$.blanket.breadth = breadth end def warmth_factor return data$.blanket.warmth_factor end # ... more code for blanket interface. end
= warmth_factor data$.blanket.owner = owner data$.blanket.len = len data$.blanket.breadth = breadth end def warmth_factor return data$.blanket.warmth_factor end # ... more code for blanket interface. end _
= warmth_factor data$.blanket.owner = owner data$.blanket.len = len data$.blanket.breadth = breadth end def warmth_factor return data$.blanket.warmth_factor end # ... more code for blanket interface. end
= warmth_factor data$.blanket.owner = owner data$.blanket.len = len data$.blanket.breadth = breadth end def warmth_factor return data$.blanket.warmth_factor end # ... more code for blanket interface. end
compiler declaration. • Supply only the compiled binary and API files to like most C libraries. • Portal implementations across Operating Systems. • Auto-generated packaging and compiling scripts.
each line into memory Read line 0 – 1_25_000 Read line 1_25_000 – 2_50_00 Read line 2_50_000 – 3_75_000 Read line 3_75_000 – 5_00_00 Compute sum of values at each line Compute sum of values at each line Compute sum of values at each line Compute sum of values at each line Get all values and compute the average
each line into memory Read line 0 – 1_25_000 Read line 1_25_000 – 2_50_00 Read line 2_50_000 – 3_75_000 Read line 3_75_000 – 5_00_00 Compute sum of values at each line Compute sum of values at each line Compute sum of values at each line Compute sum of values at each line CPU 1 CPU 2 CPU 3 CPU 4
each line into memory Read line 0 – 1_25_000 Read line 1_25_000 – 2_50_00 Read line 2_50_000 – 3_75_000 Read line 3_75_000 – 5_00_00 Compute sum of values at each line Compute sum of values at each line Compute sum of values at each line Compute sum of values at each line Global Interpreter Lock CPU 1 CPU 2 CPU 3 CPU 4
GIL in Ruby 1.000 i/100ms with GIL in C 1.000 i/100ms Calculating ------------------------------------- without GIL in C 36.210 (± 2.8%) i/s - 183.000 in 5.059510s with GIL in Ruby 0.102 (± 0.0%) i/s - 1.000 in 9.830386s with GIL in C 18.591 (± 0.0%) i/s - 93.000 in 5.005381s Comparison: without GIL in C: 36.2 i/s with GIL in C: 18.6 i/s - 1.95x slower with GIL in Ruby: 0.1 i/s - 355.96x slower
raising error. • rb_rescue(), rb_rescue2(), rb_protect(), rb_ensure() for rescue and ensure blocks. • rb_errinfo() for getting the last error raised. • rb_set_errinfo(Qnil) for resetting error information.
• No support for blocks/closures (yet). • Must specify return keyword to return from functions. • No support for ‘value of’ operator *. • No support for -> operator for struct pointers. Differences from C
writing Ruby C extensions. • Provides users with the elegance of Ruby and the power of C while following the principle of least surprise. • Provides abstractions in C extensions at no performance cost.
view’ of contiguous Ruby types. – Will work with NMatrix and NArray gems. • Direct interfacing with GPUs through native kernels. – Zero-abstraction interfacing with GPUs for accelerating computation. – Possible use in cumo. • Integration with GDB.
have a single native plotting solution that even comes close to the likes of matplotlib/bokeh/something else. • Rubyists don’t have a single go-to solution for their visualization needs that can scale. • I think this situation is ridiculous for such a mature language ecosystem.
via pycall. • Nyaplot – Bokeh like web visualization but abandoned by author. • Google charts/high charts/etc. – too much dependence on 3rd party web tools, some of which are paid/non-free. • Various GNU plot frontends.
in C++ with a Ruby wrapper. • Will directly interface with image-magick, GTK and GR to create a powerful plotting tool. • Unlike matplotlib, will be eventually a language neutral C++ library to leverage contributions from other language communities.
array libraries. • Important to bridge this divide and build on a library that is robust and well supported. • Potential answer is plures – a language independent C backend to numpy.