J
Jim Moy
Interesting stuff for Python, is any work like this being done in Ruby?
http://psyco.sourceforge.net/introduction.html
Jim Moy
http://psyco.sourceforge.net/introduction.html
Jim Moy
Interesting stuff for Python, is any work like this being done in Ruby?
http://psyco.sourceforge.net/introduction.html
Jim Moy
Maybe, but first you should do static type inference as much as you can,Jean-Hugues ROBERT said:Impressive !
They could produce better code (less memory overhead) if Python's
syntax was expanded so that user could provide "hints" about what
deserves to be optimized. Today they suggest profiling as an
heuristic.
There was a time when C compilers had #pragma register, whereby
users worried about speed could help the compiler produce faster
code (when you need speed, you need it hard).
Better have some user directed optimizations than nothing.
Maybe, but first you should do static type inference as much as you can, see
http://www.python.org/pycon/dc2004/papers/1/paper.pdf
and if you then want to give hints there is no need to extend the syntax;
simply add a private method on Module for attaching type hints to methods
etc. I think the StarKiller has some kind of type annotation language like
that.
But speed may not be very important anyway...
For sure, nowadays C optimizing compilers do a great job and
it is rare that you have to resort to "register" (which is not a #pragma,
sorry for my distorted memory) anymore. Yet, at its time, register
helped.
MinMax strategy: Minimize work for Ruby implementors, Maximize
user profit. In a perfect world, only implementors would work,
in today's world, users' skills could legitimately be leveraged.
I believe that a syntax oriented solution is often
better looking and is worth the effort for frequent constructions.
As an example, think about the attr() method family. It is great,
for sure. Yet attr :myAttr is kind of surprising for a newbie, attr myAttr
would seem more direct (of course, once you understand that attr: is just
another method and that you may have your own variations of it... you
love that !).
I suppose that I would be using C++ if it were
Me too. When you express something very clearly, the compilerThe Psyco motto is that "higher level languages should actually
outperform lower level ones in terms of speed". I totally agree with
that statement, but I am slightly impatient.
The ultimate would probably be a compiler with a customizable syntax.
I mean, if I could change Smalltalk's syntax, I would use Smalltalk.
I would make it look like Ruby of course ;-)
BTW: Any one knows about some Ruby API to walk the Ruby compiler's
AST ? (I had a look at node.h and for sure such an API could exist).
il Sat, 24 Apr 2004 16:27:58 +0900, Jean-Hugues ROBERT
I believe you want the Agile Object System from the SmallScript/S#
guys
http://www.smallscript.com
K> A good way to speed up Ruby's method calling would be to
K> cache Class-information. It should cache only one value,
K> because mostly methods are called on the same class,
K> except the generic ones (like each, etc..). If it finds
K> the same class, it could directly call the associated method,
K> (with a dirty bit, if the method was changed recently). Otherwise
K> it would look up the method.
What do you think that ruby do actually ?
svg% fgrep cache? eval.c
/* is it in the method cache? */
/* is it in the method cache? */
svg%
It is small but there might be licensing troubles. It was also a longJean-Hugues ROBERT said:It takes some courage to figure out what this is about.
What makes you feel this is what I want ? I have a hard time
understanding how Smallscript could let me redefine its syntax
to make it look like ruby's one.
As a side note, besides the total lack of documentation, this is
an impressive piece of work.
Agreed.
I wonder how much work that would be to generate Smallscript
code from Ruby's AST (using nodedump or Guy Decoux's fl_ii) ???
The impedance mismatch between Ruby and Smallscript seems rather
small (syntax put aside).
At 21:29 24/04/2004 +0900, Garbriel wrote:
It takes some courage to figure out what this is about.
What makes you feel this is what I want ? I have a hard time
understanding how Smallscript could let me redefine its syntax
to make it look like ruby's one.
I agree with this; I was very into this at one point and talked to DavidI meant to say that this is a system/platform that gives you all the
basics to let you build ruby on top of it with little effort.
Yeah, I don't think you can put a simple parse.y in it and get out a
ruby implementation
But it should be quite easy to show ruby working over AOS, given that
most every ruby feature is found in it
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.