Live data from Hacker News

Some fun with π in Julia

julialang.org

21–30 of 69 posts

Re: Some fun with π in Julia

#21
post #6

I have always been skeptical about 'scientific' languages. Why do you need a special language when any general language + some libraries will do? This is a good example of a feature that only really makes sense in a scientific language.

Because in R NA is built into a language.

So it understand the concept of missing value and works with logical operation. Also it have factor concept into the language too.

General Language may not have the tool to deal with missing value and having a library doesn't necessary means it's good as a built-in concept NA.

Python panda and such does not handle NA as beautifully as R. (http://pandas.pydata.org/pandas-docs/stable/missing_data.htm...)

Python Panda default to Null and before that it uses something else to represent missing data. Null value in general is the last thing you do when you don't know how to represent a certain type. If you have a type language with sum type and pattern matching then you don't even need null. And yes R have its own Null type so NA is separate from it.

Erlang have PID as a primitive.

I think any domain specific languages are smaller in rules and syntax, and it makes it very very easy to learn for experts and people of those domains.

Re: Some fun with π in Julia

#22

Genuine question, As a professional developer, why would you restrict yourself to such technology? what we should be asking here is why? give me one scenario where this language is more appropriate than the plethora of other domain specific languages. would you bet your company on such language when there is more mature languages already ?

It's much faster than Python, has optional typing (good thing), and will soon support real multi-threading (support is currently experimental). It can also import anything in Python in a breeze, if it needs to, but this is secondary imho. But still, as you see, there is a lot of upside.

Re: Some fun with π in Julia

#23

Genuine question, As a professional developer, why would you restrict yourself to such technology? what we should be asking here is why? give me one scenario where this language is more appropriate than the plethora of other domain specific languages. would you bet your company on such language when there is more mature languages already ?

I'm not sure about their implementation of pi in particular. To me it seems elegant, and as someone who has needed arbitrary precision arithmetic, I can see the appeal for how they are handling pi, and appreciate this attention to detail.

As for your broader question, Julia definitely fills a gap that I have been pained by for years. I've used R since it was in beta, and it is slow, which is a pain when you are discussing numerical needs. Yes, you can program in something like C/C++, but that is painful because of its overhead and dependency complexity (although it's surprisingly become less painful over time). Python could be used too, and probably is better at this point in that regard, but it has many of the same problems as R.

Julia is open-source, fast, and well-thought out with regard to modern numerical programming problems. I can write something in Julia and it performs essentially as well as something in C, which is a huge time saver in multiple respects.

I do wish Julia were more general-purpose in its orientation, or that the solutions it offers were coming from a more general-purpose language, but at the moment that doesn't seem to be in the cards. Maybe as it grows it will find use as a more general-purpose language, which is possible; maybe as languages like Rust or Go grow they will occupy this niche as well. Rust is interesting to me in this way, but currently it has little to offer in terms of simplification over C++ for numerics, and Go is not friendly to numerics. I personally like Stanza, but it's in its infancy, and no one probably even knows what I'm talking about.

For whatever reason, my experience has been that numerical programming has been a kind of isolate in programming. Numerical computing has always seemed slightly neglected in programming languages, and languages that have targeted numerical computing have often never been able to shake the "domain specific" label. I've just sort of come to see it as part of the territory.

There's nothing wrong with Python, C, or R. Also, languages change rapidly, so who knows what will happen. At the moment, though, Julia offers the best of all three and the only big downside is lack of libraries, which is becoming less and less of an issue every day (I wouldn't say there's a lack of libraries, more that there's fewer libraries). So I think it's deserving of its current attention.

I guess the question is, why would a systems programmer use C, or a web programmer use Javascript, or a network infrastructure programmer use Erlang, etc. etc. etc.?

Re: Some fun with π in Julia

#24
post #6

I have always been skeptical about 'scientific' languages. Why do you need a special language when any general language + some libraries will do? This is a good example of a feature that only really makes sense in a scientific language.

Languages like Julia, R and Matlab offer a whole lot in the way of built-in syntax, data structures, functions and constants for scientific computing that you would have to get from libraries in general purpose languages. But unless those languages have the kind of libraries that Python offers, such as Numpy and Pandas, you're not going to have that kind of support.

In addition, scientific languages will have libraries mostly in that domain. You can't beat R's library when it comes to statistics. They will also have good plotting libraries.

What you also get with Julia and Fortran is code designed to be optimized for numerical computing. Python attempts to offer this kind of performance via Numpy, which is Python wrapper on C or Fortran BLAS library. Or by JIT compiling with Numba, which is something Julia does automatically the first time you call a function.

Re: Some fun with π in Julia

#25
post #6

I have always been skeptical about 'scientific' languages. Why do you need a special language when any general language + some libraries will do? This is a good example of a feature that only really makes sense in a scientific language.

In R, I can import a CSV, plot a histogram of each column, and fit a linear regression of one column against the others in about 5 minutes and 15 lines of code. In Python, I can do the same thing if I install the Pandas and Statsmodels libraries first. Try that in Ruby, Perl, C++, C, Java, Rust, Haskell, Common Lisp, or just about any language you can think of. Good luck.

The other great thing about R is the amount of information it outputs when you run a stats function.

Re: Some fun with π in Julia

#26

Most times a julialang.org blog post is posted to HN, I wonder whether the choice of content is well chosen to spread awareness of and interest in Julia. I write this as a huge Julia fan; I use Julia daily, and it is both my favorite language and the language I know best. So I already think Julia is great. But reading many Julia blogs, especially those from julialang.org, would make me think Julia is only useful for…

> Most times a julialang.org blog post is posted to HN, I wonder whether the choice of content is well chosen to spread awareness of and interest in Julia. Or you know.. it's Pi day.

Today yes. Doesn't address the "most times" the parent mentions...

Re: Some fun with π in Julia

#27
post #6

I have always been skeptical about 'scientific' languages. Why do you need a special language when any general language + some libraries will do? This is a good example of a feature that only really makes sense in a scientific language.

>Why do you need a special language when any general language + some libraries will do?

Because you need special math support, easy access to suitable operators (and/or overloading), etc.

Re: Some fun with π in Julia

#28

Most times a julialang.org blog post is posted to HN, I wonder whether the choice of content is well chosen to spread awareness of and interest in Julia. I write this as a huge Julia fan; I use Julia daily, and it is both my favorite language and the language I know best. So I already think Julia is great. But reading many Julia blogs, especially those from julialang.org, would make me think Julia is only useful for…

What's your working setup with Julia? I'm looking at switching over from MATLAB as soon as the semester is over.

Re: Some fun with π in Julia

#29
post #6

I have always been skeptical about 'scientific' languages. Why do you need a special language when any general language + some libraries will do? This is a good example of a feature that only really makes sense in a scientific language.

People don't "need" special languages. They just like them.

Re: Some fun with π in Julia

#30
post #6

I have always been skeptical about 'scientific' languages. Why do you need a special language when any general language + some libraries will do? This is a good example of a feature that only really makes sense in a scientific language.

I've done mathematical programming in both C++ and MATLAB. As much as I hate MATLAB as a language, it's way faster and easier to prototype things. There's a huge library of vetted functions for scientific things I'm interested in, and having matrices built into the language is great. MATLAB has tons of warts though, so I'm looking forward to switching to Julia this summer.
Post reply on HN