On 03/22/2011 05:10 PM, Alexandre Bergel wrote:
I see your point and I suspected you spoke according to your experience. I am
just trying to make people innovate, in my own way.
Another thing. Keeping the VM small will definitely help when moving to a
different executing platform. It would be amazing to have the Pharo running on
Javascript VM.
That's not even that hard. I even had Pharo running on top of my own
SchemeTalk already, after 2 days of hacking. I only stopped where I
bumped into traits, since I didn't find any bootstrapping script for
traits.
I would basically compile all the smalltalk code to equivalent
schemetalk code (very easy since the models are very similar), and
compile all the natives to function-calls that perform what the native
should perform. These functions had names that wouldn't clash with the
Smalltalk names so you couldn't refer to it directly.
Obviously in the end you would have all the smalltalk code running with
SchemeTalk syntax, but all the code was virgin Pharo code. Very fun stuff :)
And if you do it this way, it doesn't really depend on your VM anyway,
since I was executing Smalltalk code as Scheme code, not as Smalltalk
bytecodes interpreted by schemecode. That's a lot faster.
cheers,
Toon
Alexandre
Ok, I very much understand this point of view. That's exactly why I started
Pinocchio.
I'm currently building my 4rd iteration. I started building a Smalltalk by
having AST evaluation (actually I started out with self-evaluating AST objects
that got evaluated by sending message... :D) . Then moved on to stack-based
bytecodes. Then moved on to registered-based bytecodes (where I am now). All of
my progress has been made by careful scrutinizing of the problems at hand. I
did reevaluate and question all steps; and I'm a bit sad that I ended up doing
it this way... But then I guess there is some inevitability in it.
For example the register-based bytecodes, I had no idea that what I was doing
were register-based bytecodes until I read the Lua VM description and noticed
that it was exactly the same.
However I do think that I learned a lot by doing it. I made the trade-offs
myself and understand them a lot better than I did before. What I'm defending
in this discussion isn't based on estimates but experience from building it
from the ground up.
And this is where I welcome everyone to do the same! It took me 2 years to get
to where I am now, but maybe it goes faster for you ;) It is definitely a very
worthwhile exercise. And I think because of it I'm finally at the point where I
can contribute something...
cheers,
Toon