3 ms·
You pay enough attention to "is it fast" and you'll find yourself writing everything in assembler Not everything. Not even then. Just the good bits maybe. Some
by buff-a 15y ago
You pay enough attention to "is it fast" and you'll find yourself writing everything in assembler
Not everything. Not even then. Just the good bits maybe. Sometimes none of it. It might make me prefer C# over Java for example, because C# can lay down structs linearly in memory so I can throw them to the graphics card directly. Or maybe I'd do all the hard work in C and SWIG it so I could use Ruby.
But what I certainly wouldn't do is attempt to write a physics simulation in python, "idiomatic" or not.
- arethuza 15y ago"But what I certainly wouldn't do is attempt to write a physics simulation in python" Depends on whether performance is a hard requirement or not - I've written engineering simulations of parts of power stations (including one nuclear plant) in Lisp and they weren't particularly fast but nobody bothered because they weren't used interactively. Eventually I did write Lisp to generate C++ code for the same models when we did want better performance and it worked really well - but I only did that as an optional step when someone needed the extra performance.
- rbanffy 15y ago> I certainly wouldn't do is attempt to write a physics simulation in python, "idiomatic" or not. http://numpy.scipy.org/ http://numpy.scipy.org/ Life can be good.
- probably 15y agoBut that's the thing - I would argue that NumPy code is not "idiomatic" Python which uses built-in operations/structures, like list comprehensions, tuples, and dictionaries. I had a similar experience during extensive NumPy coding where I thought, why am I not just writing this in Fortran.