Live data from Hacker News

Announcing Topaz: A New Ruby

docs.topazruby.com

101–110 of 190 posts

Re: Announcing Topaz: A New Ruby

#101
post #85

Earlier quoted context omitted.

Hi to be clear, this is project undetaken by me (Alex) independently, it wasn't funded out of the PyPy funds or anything like that. There were 3 primary motivations: a) Because it's fun b) To prove RPython is a great platform c) To mess with people's heads, it's crazy!

Hey Alex, let me tell you I completely understand points a) b) c) and more. It seems we started our competing Ruby on PyPy implementations at about the same time [0]! My goal was to build a robust and documented Ruby parser, and hope PyPy make it magically fast. To that end I embedded PLY and modified it to not require kwargs. Then a thunder of work fell from the skies, and I was just recently unearthing PyPy 1.9 to…

Holy snakes[0]. It seems you pursued the exact same approach[1] as me :-)

[0]: https://github.com/topazproject/topaz/blob/master/topaz/lexe...

[1]: https://github.com/alex/rply

Re: Announcing Topaz: A New Ruby

#103

Completely unscientific, but if these outputs are any indication, this is going to be great news for Rubby users in the future... $ time ruby -e "puts 'hello world'" hello world real 0m0.184s user 0m0.079s sys 0m0.092s $ time ~/Downloads/topaz/bin/topaz -e "puts 'hello world'" hello world real 0m0.007s user 0m0.002s sys 0m0.004s

There is a neural net example benchmark in the topaz git repo. Don't know how representative that example is, but at least startup time shouldn't be dominating the results...

  $ ruby -v
  ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]
  $ ruby bench_neural_net.rb
  ruby bench_neural_net.rb  17,74s user 0,02s system 99% cpu 17,771 total

  $ bin/topaz bench_neural_net.rb
  bin/topaz bench_neural_net.rb  3,43s user 0,03s system 99% cpu 3,466 total

Re: Announcing Topaz: A New Ruby

#104

Earlier quoted context omitted.

That's probably not a fair test to use on JRuby, as the JVM is notoriously slow to start.

That doesn't make it unfair to JRuby, it just means JRuby will probably lose that benchmark. :)

In production server apps the JVM always running anyway, and under some degree of Hotspot optimization, so for a JRuby benchmark to be informative and worth anything to you, you'll want to account for that.

Re: Announcing Topaz: A New Ruby

#105
post #80

Completely unscientific, but if these outputs are any indication, this is going to be great news for Rubby users in the future... $ time ruby -e "puts 'hello world'" hello world real 0m0.184s user 0m0.079s sys 0m0.092s $ time ~/Downloads/topaz/bin/topaz -e "puts 'hello world'" hello world real 0m0.007s user 0m0.002s sys 0m0.004s

In order to eliminate the potential bias of startup time I run similar test in many iterations. Here's what I got: $ time ruby -e "10000.times { puts 'hello world' }" > /dev/null real 0m0.102s user 0m0.096s sys 0m0.005s and $ time ./topaz -e "10000.times { puts 'hello world' }" > /dev/null real 0m0.098s user 0m0.071s sys 0m0.026s Any idea why I don't see such big difference?

what is your 'ruby'?

Re: Announcing Topaz: A New Ruby

#106

It would be nice to see Rpython/pypy turned into a project not unlike WebKit where many different projects benefit from the same open-source core. If pypy is flexible enough to implement all of ruby and all of Python, has a reasonable amount of maturity, and is already rather fast it seems like a good candidate for such a thing.

https://bitbucket.org/cfbolz/pyrolog/ https://bitbucket.org/pypy/lang-smalltalk/ https://bitbucket.org/pypy/lang-js/ https://bitbucket.org/pypy/lang-scheme/

http://tratt.net/laurie/tech_articles/articles/fast_enough_v... is probably the best example, because — as far as I know — outside of having reimplemented his Converge in RPython Laurence Tratt is not affiliated with the pypy project in any way, shape or form.

Re: Announcing Topaz: A New Ruby

#108

Completely unscientific, but if these outputs are any indication, this is going to be great news for Rubby users in the future... $ time ruby -e "puts 'hello world'" hello world real 0m0.184s user 0m0.079s sys 0m0.092s $ time ~/Downloads/topaz/bin/topaz -e "puts 'hello world'" hello world real 0m0.007s user 0m0.002s sys 0m0.004s

    $ time ruby -e "puts 'hello world'"
    The program 'ruby' can be found in the following packages:
     * ruby1.8
     * ruby1.9.1
    Ask your administrator to install one of them

    real	0m0.060s
    user	0m0.040s
    sys	0m0.016s

Re: Announcing Topaz: A New Ruby

#109

Implementing other languages on top of the PyPy toolchain is an interesting concept, and I'd like to see it happen more often. But calling this "Ruby in Python" is sure to invite flamewars from all sides. The actual Topaz site seems to be careful not to do this, but if this thread is any indication, a fair number of people are already mistakenly calling it that.

There are already a few other language implementations on PyPy. For e.g. - Javascript | https://bitbucket.org/pypy/lang-js - Smalltalk | https://bitbucket.org/pypy/lang-smalltalk - Schema | https://bitbucket.org/pypy/lang-scheme - Io | https://bitbucket.org/pypy/lang-io

- Converge | http://tratt.net/laurie/tech_articles/articles/fast_enough_v...

Re: Announcing Topaz: A New Ruby

#110

Implementing other languages on top of the PyPy toolchain is an interesting concept, and I'd like to see it happen more often. But calling this "Ruby in Python" is sure to invite flamewars from all sides. The actual Topaz site seems to be careful not to do this, but if this thread is any indication, a fair number of people are already mistakenly calling it that.

Topaz does not, and that's not its point, but technically since RPython is still Python Topaz is indeed a Ruby interpreter in Python. Although a very slow one. Hence the final two lines of the readme:

> To run Topaz directly on top of Python you can do:

> $ python -m topaz /path/to/file.rb

Post reply on HN