Has anyone heard of this Ruby project?

245 views
Skip to first unread message

Star Light

unread,
Dec 21, 2014, 3:55:26 PM12/21/14
to rubyonra...@googlegroups.com

If it's true. It sounds like some pretty wild stuff.  Anyone care to comment about this?

Colin Law

unread,
Dec 21, 2014, 5:03:04 PM12/21/14
to rubyonra...@googlegroups.com
Am I being overly cynical or are you the author of jackbox?

Colin

Matt Jones

unread,
Dec 22, 2014, 8:15:43 AM12/22/14
to rubyonra...@googlegroups.com


On Sunday, 21 December 2014 15:55:26 UTC-5, Star Light wrote:

If it's true. It sounds like some pretty wild stuff.  Anyone care to comment about this?

I'll "comment" that this is the second place I've run across this, which is pretty remarkable for a project that currently contains specs but no implementation. ALL ABOARD THE HYPE TRAIN

As to the functionality, an awful lot of what's proposed there sounds like things you could do more clearly using modules / concerns directly. Hard to say for sure without code.

--Matt Jones

Star Light

unread,
Dec 23, 2014, 9:36:35 PM12/23/14
to rubyonra...@googlegroups.com
I am not the author. But, I am having some trouble trying to understand
it. There is currently, I think only the binary implementation form
http://rubygems.org, but looking into the actual gem it seems there are
some c extensions.

My concern comes from the following code from the github posting:

cup = Coffee.new.enrich(milk).enrich(sprinkles).enrich(sprinkles)
# or even..
cup = Coffee.new.enrich milk, sprinkles, sprinkles

cup.cost.should == 2.10
cup.should be_instance_of(Coffee)
cup.injectors.should == [:milk, :sprinkles, :sprinkles]

What does this mean?

--
Posted via http://www.ruby-forum.com/.

Matt Jones

unread,
Dec 26, 2014, 5:56:39 PM12/26/14
to rubyonra...@googlegroups.com


On Sunday, 21 December 2014 15:55:26 UTC-5, Star Light wrote:

If it's true. It sounds like some pretty wild stuff.  Anyone care to comment about this?

Followup to my original comment: the Github page only has specs. Rubygems has a gem, but it's got binary components without source and obfuscated source (RubyEncoder). I certainly wouldn't load this code anyplace that wasn't heavily sandboxed. I have no evidence that it's malicious, but have the same amount that it *isn't*.

There's some interesting ideas in there, but nothing interesting enough that I'd want to bring un-debuggable, un-updatable mystery code in that also locks me to MRI.

The barrage of "announcement" posts across rails-talk, ruby, ruby-dev, and ruby-core certainly haven't helped make a positive impression.

--Matt Jones

Matt Jones

unread,
Dec 26, 2014, 8:47:46 PM12/26/14
to rubyonra...@googlegroups.com
A final addon: the thing doesn't even WORK. Brand-new Ruby install on a brand-new Vagrant VM:

vagrant@precise32:~$ irb
irb(main):001:0> require 'jackbox'
TypeError: can't create instance of singleton class
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:188:in `new'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:188:in `block (2 levels) in decorate'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:51:in `suppress_warnings'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:179:in `block in decorate'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:208:in `[]'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:208:in `decorate'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox/examples/dir.rb:18:in `block in <class:Dir>'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox/examples/dir.rb:17:in `class_eval'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox/examples/dir.rb:17:in `<class:Dir>'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox/examples/dir.rb:15:in `<top (required)>'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:404:in `require_relative'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:404:in `<encoded>'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:2:in `RGLoader_load'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jackbox-0.9.3.1/lib/jackbox.rb:2:in `<top (required)>'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /home/vagrant/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from (irb):1
from /home/vagrant/.rbenv/versions/2.1.5/bin/irb:11:in `<main>'
---------------------------------------
System info:

vagrant@precise32:~$ ruby -v
ruby 2.1.5p273 (2014-11-13 revision 48405) [i686-linux]

vagrant@precise32:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
-------------------------------------

I'd add that EVEN IF THIS WORKED, it would be terrible - it's loading the file from lib/jackbox/examples/dir.rb, which redefines - ahem, "decorates" - methods of the stdlib Dir class to have entirely different semantics. For instance, `Dir.new(some_path)` now writes to the filesystem...

Some of the rest, on further examination, feels like over-abstraction / sugaring. For instance, here's how `lets` is implemented:

def lets(sym = nil, &block)
  if sym.class == Symbol
    define_method(sym, &block)
  else
    sym ? sym : block
  end
rescue StandardError
  raise LetsError
end

(BTW: RubyEncoder just makes this harder, not impossible. Not even particularly difficult, once you get used to reading YARV bytecode. RubyVM::InstructionSequence.disasm FTW!)

Digging into this, the first example for `lets` is USELESS. `lets bar =->(arg){ arg * arg }` is actually parsed as `lets(bar = ->(arg){ arg * arg })`. This works, but `lets` does exactly fuckall since the actual local-variable-setting part is a side-effect of its argument.

Other fun things, in no particular order:

* attempting an install on Ruby 1.9.3 fails, since the gem was built expecting `byebug` to be available but that gem requires Ruby 2.0.0. The gemspec appears to be *attempting* to deal with this by including a conditional on RUBY_VERSION, but that code runs at gem-build time, not gem-load time. :(

* `with` appears to work by decorating `method_missing`, using `instance_exec` on the target, and then undecorating. Bonus points if you wondered what happens if the block exits the scope abnormally (via `raise` or `throw`).

* the directory example reimplements Dir.exists? to do exactly the same thing as the Ruby version, only in Ruby instead of C. This is unlikely to be a performance issue, but it makes one wonder why it was included at all.

* disassembly of the included libraries shows additional oddities - there are two Mach-O format libs (ext/jackbox/jackbox.so and ext/jackbox/jackbox.bundle) and a DLL, but no corresponding library for Linux. The OS X libraries also don't appear to DO anything - just FFI stubs and utility functions.

* I'll leave the detailed object-oriented theory criticisms to somebody who's passionate about it, but some of the examples seem like classic is-a / has-a reversals to my eye. A Spaceship isn't a fuel line, or a capsule - it HAS those things. Mixins seem like the exactly wrong choice for that case.

* there's a namespace whose purpose I'm still unclear on under Jackbox::Meta::Abstract and Jackbox::Meta::DSL. Neither of the latter have (at first inspection) any methods of interest.

* needless to say, thanks to the RubyEncoder non-security garbage, the gem doesn't even WORK on 2.2.0.

LHA, if you're reading this, you've got some interesting ideas. You need to work on packaging and presentation, though - shipping useless binary extensions and obfuscated source isn't going to endear you to many people. It would be a great deal easier to discuss these ideas without having to trawl through YARV disassembly.

--Matt Jones

Jason Fleetwood-Boldt

unread,
Dec 27, 2014, 10:45:48 AM12/27/14
to rubyonra...@googlegroups.com

"enhance the Ruby language and/or provide additional software constructs" sounds like a really, really bad idea. 

Every Ruby dev trying to re-invent the wheel is exactly why Ruby has the (poor) reputation that it has in some circles. 



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f9156a84-6a9a-4d96-8d68-3e2628ea6373%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

----

Jason Fleetwood-Boldt

All material © Jason Fleetwood-Boldt 2014. Public conversations may be turned into blog posts (original poster information will be made anonymous). Email ja...@datatravels.com with questions/concerns about this.

Star Light

unread,
Dec 30, 2014, 3:49:09 PM12/30/14
to rubyonra...@googlegroups.com
Well, I tried on my Unix box running Ruby 2.1.1 and 1.9.3 through RVM
and I woke on both platforms. I also ran the specs provided with the
gem after I copied them to a woking folder and I got no errors. But of
course we have to wonder, what is the nature of this project?

Anyone care to comment on their experience?

Star

Matt Jones

unread,
Jan 1, 2015, 4:26:32 PM1/1/15
to rubyonra...@googlegroups.com


On Tuesday, 30 December 2014 15:49:09 UTC-5, Ruby-Forum.com User wrote:
Well, I tried on my Unix box running Ruby 2.1.1 and 1.9.3 through RVM
and I woke on both platforms.  I also ran the specs provided with the
gem after I copied them to a woking folder and I got no errors.   But of
course we have to wonder, what is the nature of this project?


Sock puppets gotta sock, yo.

--Matt Jones 

Star Light

unread,
Jan 4, 2015, 4:49:51 PM1/4/15
to rubyonra...@googlegroups.com
YOU seem to have an ANGER MANAGEMENT problem! Why don't you let the guy
peddle his stuff. Then MAYBE you can go an do your own instead of
trying to down talk or even worse steel someone else's work.

See yo,

Star L

Scott Ribe

unread,
Jan 5, 2015, 1:01:30 AM1/5/15
to rubyonra...@googlegroups.com
On Jan 4, 2015, at 2:49 PM, Star Light <li...@ruby-forum.com> wrote:
>
> YOU seem to have an ANGER MANAGEMENT problem! Why don't you let the guy
> peddle his stuff. Then MAYBE you can go an do your own instead of
> trying to down talk or even worse steel someone else's work.

Nobody is stealing anything. And nobody here objects to anyone who peddles their stuff honestly.

--
Scott Ribe
scott...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




Star Light

unread,
Jan 23, 2015, 5:19:23 PM1/23/15
to rubyonra...@googlegroups.com
Oh, so now the guys at Jackbox are the dishonest ones!!

Who are the ones bad mouthing them while on the flip side trying to
de-compile the product.

We for one find Jackbox to be pretty cool stuff, and we here at CAS will
be using in one of our upcoming projects even under the current
licensing.

And, if the guys at Jackbox want some money for the license, as long as
it is WITHIN REASON we will gladly pay it.

Jim

unread,
Jan 23, 2015, 10:45:09 PM1/23/15
to rubyonra...@googlegroups.com
Well, I know this is just feeding the troll, but eventually it can get pretty difficult to resist...


On Tuesday, December 23, 2014 at 9:36:35 PM UTC-5, Ruby-Forum.com User wrote:
I am not the author.  But, I am having some trouble trying to understand it.  
[snip one of the dumbest examples I have ever seen] 
What does this mean? 

On Friday, January 23, 2015 at 5:19:23 PM UTC-5, Ruby-Forum.com User wrote:
We for one find Jackbox to be pretty cool stuff, and we here at CAS will
be using in one of our upcoming projects


I have to admit I find it amusing that you are talking both about the trouble you are having understanding it, and also how you think it is cool and will be using it in your project.  Too bad for the client, I suppose...maybe they like sprinkles in their coffee too.


Jim

Star Light

unread,
Jan 24, 2015, 4:47:40 PM1/24/15
to rubyonra...@googlegroups.com



I have to admit I find it amusing that you are talking both about the trouble you are having understanding it, and also how you think it is cool and will be using it in your project.  Too bad for the client, I suppose...maybe they like sprinkles in their coffee too.


Jim

What is it you don’t understand?

Star
 

lha

unread,
Jan 25, 2015, 2:06:59 PM1/25/15
to rubyonra...@googlegroups.com

lha

unread,
Jan 25, 2015, 5:01:25 PM1/25/15
to rubyonra...@googlegroups.com
Thanks Star we will try to keep it WITHIN REASON… Right now its free!

I think they’re on to us though… lol


On Friday, January 23, 2015 at 5:19:23 PM UTC-5, Ruby-Forum.com User wrote:
Reply all
Reply to author
Forward
0 new messages