3 ms·
Often, there's more information at runtime than compile time. This may even be true at times for statically typed languages. I think the static/dynamic type d
by stcredzero 17y ago
Often, there's more information at runtime than compile time. This may even be true at times for statically typed languages.
I think the static/dynamic type debate is just a vestige of the state of interpreter/compiler technology in the 80's. I wish everyone would get over it and introspect and debug their knee-jerk reactions so we can get on with the next stage of language implementation.
- jrockway 17y agoSure, because static typing doesn't mean you picked the best type, it just means that you picked a type. If you statically type your function as Integer -> Integer because one invocation in a million uses an integer bigger than 2^63, you are taking a speed hit for the other 999,999 calls. But a tracing JIT can just use a machine integer those times, and only fall back to the arbitrary-size Integer when it needs to.
- amalcon 17y agoSuch as, for example, Java. Java probably had the first tracing JIT-based VM outside academia.
- silentbicycle 17y agoThat depends on whether you consider the Smalltalk and Self research at Sun and Xeroc PARC to be "academia". Much of the JVM optimization technology came directly from those. http://selflanguage.org/documentation/published/index.html http://selflanguage.org/documentation/published/index.html The paper "An Efficient Implementation of Self" (http://selflanguage.org/documentation/published/implementation.html http://selflanguage.org/documentation/published/implementati...) is a good overview. Lua is another language with a great JIT compiler, LuaJIT. There are several papers about Lua (http://www.lua.org/doc/jucs05.pdf http://www.lua.org/doc/jucs05.pdf, http://www.lua.org/papers.html http://www.lua.org/papers.html) and a bunch of good mailing list posts about LuaJIT (e.g. http://article.gmane.org/gmane.comp.lang.lua.general/58908 http://article.gmane.org/gmane.comp.lang.lua.general/58908).
- stcredzero 17y agoI was thinking Strongtalk + Tracing + Type inference.
- silentbicycle 17y agoSure. (I was replying more directly to, "Java probably had the first tracing JIT-based VM outside academia.".)
- scott_s 17y agoI think you're only considering static typing as an efficiency benefit. I'm equally as interested in its program-correctness benefits.
- silentbicycle 17y agoStatic typing and JIT compiling aren't mutually exclusive. You can do all the static analysis, checking, whole-program optimization, etc. that's feasible at compile time, compile to bytecode, and then do JIT compilation at runtime. Edit: We appear to be in fierce agreement.
- scott_s 17y agoExactly! I thought that was implicit in what I said. Maybe in the future static-typing's benefit would only be for program correctness.
- stcredzero 17y agoStrongtalk. Google. Read. Been done.
- stcredzero 17y agoStatic typing and JIT compiling aren't mutually exclusive, though Static/Dynamic typing are no longer mutually exclusive either. We need to get past this idea already. (I mean we as a field, not present company necessarily.)
- deleted 17y ago[deleted]