Hello,
I am a newcommer in Julia. I have read almost entire never ending boring manual, read a couple books, watched some videos, and practicing probability theory with julia with much enthusiasm. I spend great of time to understand the type system and parametric types. But the more I get into the language, the more I get annoyed. I give these issues to my lack of knowledge and try not to give up.
Here is major one:
I was trying to do the calculation of famous birthday problem with julia.
I am supposed to calculate this formula, (my interpretation of solution to julia)
Probability of n people having the same birthday in a room: (It does not matter if the solution is correct, the point is the calculation) It is basically 1 - (Permutation(365 by n)/365^n)
p(n) = 1 - prod(collect(365:-1:(365-n+1))) / 365^n
This overflows, I receive no warning etc. Since the probability is bigger than 1, after checking the compound statement part by part and convincing myself with correct syntax, I realized that.
Then I tried do the math with BigInt at RELP. Julia says no, I can not create typed variable at global scobe in RELP, (why? I am sure there is very detailed reasoning but, hey this language supposed to replace other math environment, and help people interactive analysis right?)
I bumped into chicken and egg problem. The equation overflows, but I can not create typed (BigInt) variables to handle the issue? Now I had to go back and write a script with BigInt etc. instead of doing in one line on the console.
After strugling with no method errors for BigInt, I could finally calculated the result.
I am novice in Julia but I am quite sure there can be something done.
If variable can overflow, then provide some sort of typing mechanism for RELP at global scope, give exception or some sort of control mechanism for that and let the programmer know.
If checking overflow is too costly in performance, then let the programmers decide what to do, or auto promoto to BigInt. Many languages automatically do that.
Make overflow check a configuration parameter or something. Overflow problem can be very difficult to track in bigger and deep calculations.
I believe such a promising new programming language, claiming the best of everthing, ease of use, speed etc. at 2020 should handle this.
In my part, I have seen not much ease of use so far other than zillions of cryptic ugly looking method errors and types issues with does not help much contrary to my expectation for identifying errors in so called typed language. (I am really fed up trying to decipher cryptic constructors by looking damm source codes of modules)
I have watched a video on youtube stating on Julia con stating that julia is the has the most type sharing language. I find it hard to believe. Other than native types and some well knows ones, DataFrame, I see zillions of different things. I am always forced to figure out some weird constructors.
This are my too cents for anyone interested.
Sincerely.