On Thu, 21 Aug 2003, Tom Locke wrote:

> Hi Michal
> 
> > > My first choice is whether to go for a VM, or a C-Python style
> > > implementation. Right now I'm leaning towards VM.
> >
> > I'm not sure what you mean by the difference here. CPython
> > does have a VM, it's just a stack-based one.
> 
> OK so I'm learning already :)
> 
> I thought CPython was more of a conventional interpreter, and the .pyc files
> were pretty much 'pre-parsed' equivalents of the original source file. So
> CPython has more of a traditional VM structure, with a byte-code intruction
> set and all?

Yep.
 
> What do you know about other scripting languages, e.g. Rhino JavaScript. Is
> everyone choosing a VM approach these days? My background has been in
> compiled, statically typed languages so I'm a bit behind the curve in the
> scripting world.

It's more an issue of distance to be jumped from the compiler to the
target. With a relatively low level language such as C, the conceptual
distance to the hardware's pretty small. With higher-level languages the 
distance to the hardware's much larger and the difficulty in bridging that 
gap doesn't seem to grow linearly with the size of the gap, so it's a lot 
easier to build a middle layer in there, which is what VMs are, after all.

A VM also makes portability easier, which is nice.
 
                                        Dan

Reply via email to