Fun with Julia: julia> 3 ** 60 syntax: use ^ instead of ** julia> 3 ^ 60 -3535985420588157519 julia> factorial(45) -8797348664486920192 julia> factorial(75) 0 julia> 5 * 5555555555555555555 -9115710369641325457 julia> 5 * 55555555555555555555 syntax: invalid numeric constant 55555555555555555555 This isn't C. The expectations have changed thanks to scripting languages. If I'm supposed to use this promising language t…
Julia uses machine arithmetic for integer computations. The alternatives have serious drawbacks in technical computing, see
Honestly I'm convinced it's a lot more generally applicable than scientific computing. Much of heavy lifting I had to do in C, I can now do in Julia with nearly the same speed and efficiency. Plus, for a lot of the problems I would have chosen Python, Ruby, or even Clojure for, I could really see myself using Julia now.
+1 Besides libs and ecosystem in general, I don't see any advantage Python / Ruby / Clojure have over Julia.
Eh, in the case of Closure pervasive immutability, I don't want to write imperative code anymore. I am sure you could write in a functional style in Julia but all the code I have seen seems to rely pretty heavily on explicit stateful loops. At that seems to be a design choice not just for speed but, from what I have read elsewhere, to be familiar to Fortran and Matlab people, seems like a bad trade off to me.
Fun with Julia: julia> 3 ** 60 syntax: use ^ instead of ** julia> 3 ^ 60 -3535985420588157519 julia> factorial(45) -8797348664486920192 julia> factorial(75) 0 julia> 5 * 5555555555555555555 -9115710369641325457 julia> 5 * 55555555555555555555 syntax: invalid numeric constant 55555555555555555555 This isn't C. The expectations have changed thanks to scripting languages. If I'm supposed to use this promising language t…
Julia supports arbitrary precision arithmetic just fine, but you need to explicitly use it. Overflow checks don't matter in Python or Ruby where everything is relatively slow. See also: http://www.johnmyleswhite.com/notebook/2013/01/03/computers-...
My point wasn't that it can't be done. My point was about usability and what programmers have come to expect from a modern language. I understand that things get trickier when trying to implement arbitrary-precision arithmetic while keeping performance high.
Fun with Julia: julia> 3 ** 60 syntax: use ^ instead of ** julia> 3 ^ 60 -3535985420588157519 julia> factorial(45) -8797348664486920192 julia> factorial(75) 0 julia> 5 * 5555555555555555555 -9115710369641325457 julia> 5 * 55555555555555555555 syntax: invalid numeric constant 55555555555555555555 This isn't C. The expectations have changed thanks to scripting languages. If I'm supposed to use this promising language t…
Try wrapping each of these in BigInt. Example: factorial(BigInt(1000))
Julia defaults to what is fast on your machine. If you want to use BigInt you can do so but it doesn't do so by default.
You can also use 128bit integers in Julia. Example:
rand(Int128, 10)
+1 Besides libs and ecosystem in general, I don't see any advantage Python / Ruby / Clojure have over Julia.
Eh, in the case of Closure pervasive immutability, I don't want to write imperative code anymore. I am sure you could write in a functional style in Julia but all the code I have seen seems to rely pretty heavily on explicit stateful loops. At that seems to be a design choice not just for speed but, from what I have read elsewhere, to be familiar to Fortran and Matlab people, seems like a bad trade off to me.
Removing loops or mutability from Julia would be a terrible decision. There's nothing inherently wrong with mutability or imperative programming.
Julia supports arbitrary precision arithmetic just fine, but you need to explicitly use it. Overflow checks don't matter in Python or Ruby where everything is relatively slow. See also: http://www.johnmyleswhite.com/notebook/2013/01/03/computers-...
My point wasn't that it can't be done. My point was about usability and what programmers have come to expect from a modern language. I understand that things get trickier when trying to implement arbitrary-precision arithmetic while keeping performance high.
Do you have an example of a language with arbitrary-precision overflow by default and comparable performance?