3 ms·
What prompted you to want static typing? What did it help you do better?
by francoisdevlin 16y ago
What prompted you to want static typing? What did it help you do better?
- prog 16y agoThat particular project (simulation) required a lot of bit twiddling and working with data of various sizes 8-bit, 16-bit, 32-bit. So having the specific types nailed at compile time helped. Lack of unsigned data on the JVM was a pain though. Two other reasons I picked scala for that particular project was OO support and mutability. The problem fit OO better and performance was very important (I was anyway taking a bit of a hit choosing JVM over C), so with scala I had the option of for e.g. setting up a C like while loop with a counter rather than mapping a function. This was maybe 6-8 months back. Since then clojure has added neat concepts like transients[1] which allowing mutability in a controlled manner within a function. So thats worth a look. I just preferred to go for a multi-paradigm language rather than a semi-pure functional language as I wasn't sure how the project needs would evolve. What I would have really liked to do was use Python. I actually created an early prototype but the performance didn't meet the needs. I look forward to unladen-swallow :) Python did have some neat libs like struct[2] that would have worked. IMO the choice of static or dynamic should be decided by the problem at hand. I feel dynamic tends to work for majority of projects so thats what I usually prefer but sometimes static works best. [1] http://clojure.org/transients http://clojure.org/transients [2] http://docs.python.org/py3k/library/struct.html#module-struct http://docs.python.org/py3k/library/struct.html#module-struc...