[squeak-dev] Re: Using V8 for other languages

Eliot Miranda eliot.miranda at gmail.com
Sun Sep 7 14:14:55 UTC 2008


On Sun, Sep 7, 2008 at 4:56 AM, David Griswold <david.griswold.256 at gmail.com
> wrote:

>
>
> On Sun, Sep 7, 2008 at 4:22 AM, Paolo Bonzini <bonzini at gnu.org> wrote:
>
>>
>> > Also, compiling code that isn't in a hotspot is a waste of time, since
>> > you spend much longer compiling the code than you would have spent
>> > interpreting it, and can cause big compile pauses if the compiler does
>> > much optimization.
>>
>> You can use a simple 1-pass compilation (without even register
>> allocation) that takes just a few ms for any reasonable amount of code.
>>  Don't forget that V8 runs (mainly) in a browser--if the browser is
>> sufficiently snappy, the user won't notice a compilation pause of a few
>> milliseconds.
>>
>
> Such a compiler is fast, but it produces verbose code.  I was talking about
> a large body of code, the sort that might begin to be used if V8 is used
> on the desktop for things like running an entire Smalltalk image, for
> example.  In those sorts of cases, there is a difficult trade-off: if you
> use a fast compiler like the one you are talking about, it produces verbose
> code that consumes a lot of space, which was the problem for Self.  On the
> other hand if you use a good compiler that produces more compact code, then
> you get large compilation pauses.
>
> Using a code cache like in Visualworks or mixed-mode hotspot compilation
> like we did in Strongtalk and the JVM is how to get around that trade-off.
> The question is, what does V8 do to solve this problem?  That is not yet
> clear.  If they don't have some compact way of representing and executing
> uncommonly-used code, then it will have problems with large bodies of code.
>

David is exactly right.  I think v8 does not yet have to face this problem
because it is compiling javascript programs in web pages where the largest
programs are a few hundred k bytes of source (e.g. the lively kernel at
around 300k).

That doesn't invalidate v8 for its intended use.  As they find it doesn't
scale they'll have to evolve the implementation.  But right now v8 is the
fasted js engine on the planet and it works just fine :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080907/68f47301/attachment.htm


More information about the Squeak-dev mailing list