lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


And Java isn't slower...




Best Regards
Jakub Sztandera


> From: hyperhacker@gmail.com
> Date: Sun, 12 Apr 2015 18:30:03 -0400
> To: lua-l@lists.lua.org
> Subject: Re: Why does the Lua VM use bytecode?
>
> On Sun, Apr 12, 2015 at 6:28 PM, Jonne Ransijn <yoyoyonny@gmail.com> wrote:
> > Why does the Lua VM use bytecode? Wouldn't it be faster if Lua code was
> > converted to assembly (Mainly because of the efficient assembly optimizers
> > out there). I searched on Google and found that Lua and Java were alot
> > slower, and some people claimed that this had to do with the bytecode. While
> > I myself dont think bytecode would be that slow, I am still wondering if Lua
> > would be faster if the VM used assembly. My two questions thus are: Why does
> > the Lua VM use bytecode, and how much faster would it be to use assembly?
>
> Because generating assembly is more difficult and requires code
> specific to each platform.
>
> Also look at LuaJIT which does generate assembly (or more precisely,
> machine code).
>
> --
> Sent from my Game Boy.
>