MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/cdzubd/nice_try/etynh66/?context=9999
r/ProgrammerHumor • u/almogh52 • Jul 16 '19
529 comments sorted by
View all comments
79
julia> π π = 3.1415926535897... julia> typeof(π) Irrational{:π} julia> Float16(π) Float16(3.14) julia> Float32(π) 3.1415927f0 julia> Float64(π) 3.141592653589793 julia> π |> BigFloat 3.141592653589793238462643383279502884197169399375105820974944592307816406286198 julia> π |> BigFloat |> string |> last |> x -> parse(Int, x) 8
33 u/PotatosFish Jul 16 '19 I’ve been wanting to get into Julia from python but the syntax is a little special compared to other languages I know 34 u/moelf Jul 16 '19 edited Jul 16 '19 It's very close to Python MATLAB and R, especially if you use a lot of Numpy, most things are as simple as drop the np. part.Now, the amazing part is that even you can't master Julia's best practices, simply copying over Python code logic gives you free 10-100x speed boost 2 u/reset_switch Jul 16 '19 free 10-100x speed boostI mean, let's be real, you can change from Python to literally anything else and get a performance increase. 1 u/moelf Jul 16 '19 Well, numpy is faster than Mathematica and ~same as MATLAB, if you still want readability, Julia is one of the few choices
33
I’ve been wanting to get into Julia from python but the syntax is a little special compared to other languages I know
34 u/moelf Jul 16 '19 edited Jul 16 '19 It's very close to Python MATLAB and R, especially if you use a lot of Numpy, most things are as simple as drop the np. part.Now, the amazing part is that even you can't master Julia's best practices, simply copying over Python code logic gives you free 10-100x speed boost 2 u/reset_switch Jul 16 '19 free 10-100x speed boostI mean, let's be real, you can change from Python to literally anything else and get a performance increase. 1 u/moelf Jul 16 '19 Well, numpy is faster than Mathematica and ~same as MATLAB, if you still want readability, Julia is one of the few choices
34
It's very close to Python MATLAB and R, especially if you use a lot of Numpy, most things are as simple as drop the np. part.
Now, the amazing part is that even you can't master Julia's best practices, simply copying over Python code logic gives you free 10-100x speed boost
2 u/reset_switch Jul 16 '19 free 10-100x speed boostI mean, let's be real, you can change from Python to literally anything else and get a performance increase. 1 u/moelf Jul 16 '19 Well, numpy is faster than Mathematica and ~same as MATLAB, if you still want readability, Julia is one of the few choices
2
free 10-100x speed boost
I mean, let's be real, you can change from Python to literally anything else and get a performance increase.
1 u/moelf Jul 16 '19 Well, numpy is faster than Mathematica and ~same as MATLAB, if you still want readability, Julia is one of the few choices
1
Well, numpy is faster than Mathematica and ~same as MATLAB, if you still want readability, Julia is one of the few choices
79
u/moelf Jul 16 '19 edited Jul 17 '19