6 ms·
Where are the fast dynamic languages?
- pius 19y agoHere, for starters: http://www.strongtalk.org/ http://www.strongtalk.org/ http://rubini.us/ http://rubini.us/ http://www.cons.org/cmucl/ http://www.cons.org/cmucl/
- baha_man 19y agoDoes anyone here have a single example of a performance problem caused by using a 'dynamic' language rather than a 'static' language? The only performance problems I've ever encountered 'in the wild' have been down to things like database access, I/O, bad sorting algorithms, string concatenation, etc.
- ardit33 19y agoYes. You are thinking of dynamic langauges merely on the function of being used on web apps. Embeded programming, programs in mobile applications, Javascript, Actionscript in flash.... you name it. Performance is important, especially on applications that are intesive (computing wise), and not i/o wise. Eg. Games: A lot of games use something like Lua for scripting their UI, but for the hardcore game engine they use C or C++
- cperciva 19y agoYes. A couple of years ago, I was implementing the Quadratic Sieve integer factorization algorithm in Maple (technically, I was implementing PP-SIQS). Taking a routine which used the Pollard rho algorithm to factor 12-16 digit values from MAPLE (a dynamically typed language) and implementing it in C -- using calls to exactly the same GMP primitive functions as Maple was using -- resulted in a tenfold speedup; this routine was used commonly enough that the overall routine was sped up by roughly a factor of two.
- chollida1 19y agoDynamic languages like Perl, Python and Ruby all do. Many of their core features have been written in C to give them more performance.
- sah 19y agoFundamental limitations of Python are responsible for most of the memory footprint and performance difference between the old official Python implementation of BitTorrent and C++ implementations like libtorrent. The kind of obsessive optimization that made uTorrent so tiny and fast is just not achievable in Python, due to things like per-object memory overhead and reference counting. I've also done audio processing projects in Python, and ended up switching to D because Python couldn't do floating point additions and multiplications across large lists fast enough.
- hugov 19y agoObjective-C?
- ardit33 19y agoLua? It is very simple language. Unfortunately, there is a performance penalty with dynamic langues, which wont go away.
- icky 19y ago> Unfortunately, there is a performance penalty with dynamic langues, which wont go away. You'd be amazed at the sorts of aggressive optimizations that can be done at compile-time.
- Tichy 19y agoStill, how do you get around the fundamental problem of symbol lookup? Maybe sometimes you can infer the type, but I doubt that it is possible in general. If the symbols are "hard linked", it is not dynamic anymore. I wonder what strategy the LISP dialects out there typically use? I was impressed how easy it is to create an object system in a LISP, but somewhat dismayed because all examples just used (cond) for symbol lookup. Maybe because they were just academic examples, or perhaps they really don't care about performance at all?
- icky 19y ago> If the symbols are "hard linked", it is not dynamic anymore. Lies, slander! ;-) Anything that happens within a function can be treated as a black box, and compiled down to the metal, if you like. The language can be as dynamic as you like; that doesn't preclude the output format from being tightly optimized machine code.
- Tichy 19y agoWhat about the things you pass into the function? You can't know their properties in advance, in general, or can you?
- icky 19y ago> What about the things you pass into the function? You can't know their properties in advance, in general, or can you? You can know that, e.g. a function passed in as an argument can be dereferenced as a pointer stored in a specific offset on the stack. If your typechecks are compiler-generated statements inserted before a function call, then if you know at compile-time (via declarations or type inference, or type propagation) that a certain variable (to be passed as an argument) will always be of the correct type T, then you can omit the typecheck, as well as boxing/tagging. You can get really close to the metal this way, and still have your language be as dynamic as can be.
- mhartl 19y agoSolving this problem is the main goal of the Cobra language: http://cobra-language.com/docs/why/ http://cobra-language.com/docs/why/ I'll be curious to see if it succeeds.
- mullr 19y agoThanks for the link, that is an interesting language. It seems like it's mostly a lot of C# features / programming style with python syntax and optional dynamic typing. Generally a good idea, though the code samples didn't feel right to me - lack of punctuation, perhaps? Maybe I've just gotten used to symbol-filled code.
- vegai 19y agohttp://www.factorcode.org http://www.factorcode.org