5 ms·
4. Performance. There is software that can't be slow.
by quickben 9y ago
4. Performance. There is software that can't be slow.
- eloff 9y agoIncredulous that people would downvote this.
- eloff 9y agoSeriously with the downvotes? Dynamic languages are obviously slower than static languages in general. Some special cases aside. Performance is a concern for some projects - you wouldn't write an OS, database kernel, or mainstream game engine in a dynamic language. How is that not a valid concern in the dynamic vs static typing argument? The parent comment has a legitimate point.
- dnautics 9y agoTechnically, this is a strong/weak type distinction. Dynamic but strongly typed languages like Julia and erlang can be quite performant when given strong fences around the types their functions are passed.
- eloff 9y agoNo. Not at all. It has more to do with implementations. Python is strongly typed, but dynamic. But slow. JavaScript and PHP are weakly typed and dynamic as they will coerce types in strange ways during operations and comparisons. Lua is dynamically and strongly typed like Python, but LuaJIT can sometimes produce code on par with or even slightly faster than native code - because it's really JIT compiling the hot path to native code with some guards and offramps to interpreted code for special/unexpected cases. But there are limits to those techniques and it's doubtful that dynamic languages will ever perform at the same level as static languages because the compiler simply has more information and doesn't have to be as pessimistic or insert as many runtime guards.
- dnautics 9y ago> it's doubtful that dynamic languages will ever perform at the same level as static language I think these timing benchmarks come after the jit warmup procedure, so the presumption is that the compilation cost is amortized over lots of runs in an HPC-type setting: https://julialang.org/#high-performance-jit-compiler https://julialang.org/#high-performance-jit-compiler
- kobeya 9y agoI’m in the static camp myself, but there are dynamic language JIT runtimes that meet or exceed the performance of many static languages.
- eloff 9y agoIn special cases. It's not nearly as reliable. There are a lot of ways to get poor performance out of such JIT compilers, and writing performant code for them is a bit of a black art that varies from version to version. Just read a little about the "fun" people have had with V8 over the years.
- fulafel 9y agoIncluding the Java runtime - the JVM is basically dynamic.
- eloff 9y agoJava is a static language. While there are dynamic languages on the JVM like Jython, JRuby, Groovy, they don't get anywhere near the performance of the static languages.
- dozzie 9y agoOh, sure it's statically typed language with all things being constantly cast to and from Object. (Have you ever used collections? Have you ever heard of "type erasure" term?)
- eloff 9y agoThat it doesn't have reified generics like C# does not make it a dynamic language. Go doesn't have generics at all, but it's still a static language.
- hepta 9y agoThere is code that doesn't `constantly cast ti and from Object`, most code won't need to, anyway. Generic information is kept during type-checking and then is discarded, this can be considered an optimization. There are some warts that appear because of erasure, but I believe you're wrong in implying that most developers care (most java developers, maybe scala peole have more issues because of erasure).
- deleted 9y ago[deleted]
- alkonaut 9y agoRight - I was trying to avoid runtime considerations and keep it on language, but it's true there are some concerns that extend into language. The border is becoming fuzzier when you consider that many (most?) languages these days can run in a browser after some transformation. Some even have 3 or more runtimes including js, a managed runtime, or native.