Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

2 dynamic language myths

Name: Anonymous 2012-06-03 18:07

the 2 biggest myths I see all the timethat get spouted by noobs are that:
1) JIT makes huge speed gains in VM languages
2) a VM language will run as fast as C if its compiled to machine language

This is simply not true, Lua's JIT does not make any significant speed gains. Python's compile-to-platform implementations are not much faster than fast VM languages like Lua

Name: Anonymous 2012-06-03 18:16

javascript

Name: Anonymous 2012-06-03 18:19

well that's pretty obvious

Name: Anonymous 2012-06-03 18:21

>>1

it is possible, but requires more effort on the part of the developers of the native code compiler implementation.

Name: Anonymous 2012-06-03 18:30

>>4
VM developers have had nearly 17 years to accomplish this, but no one has managed it. It's a myth, and yet proponents of dynamic languages continue to believe in it. They're no different than Marxists who continue to believe in the myth/big lie of egalitarianism and equality. They're no different from creationists who continue to believe the Earth was formed in 6 days some 6000 years ago.

Name: Anonymous 2012-06-03 18:53

>>1
fagburst@x:~/Desktop$ cat prop.lua
local data = { properties = { test = { } } }
function data.properties.test.get (value) return value * 8 end
function data.properties.test.set (newvalue) return newvalue / 3 end

local objectmt = { }
function objectmt:__index (key)
    local prop = data.properties[key]
    if prop then
        return prop.get(data[key])
    end
    error("idk what `" .. tostring(key) .. "' is", 2)
end
function objectmt:__newindex (key, value)
    local prop = data.properties[key]
    if prop then
        data[key] = prop.set(value)
        return
    end
    error("idk what `" .. tostring(key) .. "' is or why i should set it to: " .. tostring(value), 2)
end

local object = setmetatable({ }, objectmt)

-----
local b = 0
for i = 1, tonumber(arg[1]) or 60 do
    object.test = i
    b = b + object.test
end
print(b)

fagburst@x:~/Desktop$ time lua prop.lua 1e7
1.3333334666667e+14

real    0m4.104s
user    0m4.092s
sys    0m0.008s
fagburst@x:~/Desktop$ time luajit prop.lua 1e7
1.3333334666667e+14

real    0m0.099s
user    0m0.092s
sys    0m0.004s

nigger i don't care if this is slower than C but i think it's slightly faster at least

Name: Anonymous 2012-06-03 18:58

>>6
and by faster i'm talking about luajit compared to lua

Name: Anonymous 2012-06-03 19:21

>>5
Java does it properly. Minecraft is the proof.

Name: Anonymous 2012-06-04 1:43

>>8
dude, love minecraft, but java weighs that shit down.

Name: Anonymous 2012-06-04 1:51

>>9
That's just your opinion man.

Name: Anonymous 2012-06-04 3:24

No shit, providing dynamic capabilities like reflection is naturally going to slow the code down even when compiled to a native binary.

Name: Anonymous 2012-06-04 4:08

>>1
1) It does unless the writers of said VM or JIT are total dolts.  A macro system may also relieve the JIT of a lot of work.
2) If you statically compile a statically-typed "CPU-friendly" "VM language" to machine code then it's as fast as C.  Unfortunately, such languages are utter shit (just look at Haskell).  If you try to apply the same process to a dynamic abstract language, then ahead-of-time compilation will lead to an incredible expansion in binary size and little performance gains; that kind of compilation is simply not suited for the language.

Name: Anonymous 2012-06-04 4:23

The following document describes the only kind of scripting language proggleskind will ever need: gameenginebook.com/gdc09-statescripting-uncharted2.pdf

Name: Anonymous 2012-06-04 16:17

shitbump

Don't change these.
Name: Email:
Entire Thread Thread List