News for hackers. Stuff that matters.
Re:Julia 0.5 Highlights by pklausler on Tuesday October 11, 2016 @02:11PM (#12686976)
Is there anything like Julia, but with strong typing and pure FP?

addendum: read 'static' for 'strong', please

Re:Julia 0.5 Highlights by jamii on Tuesday October 11, 2016 @02:28PM (#12687154)
Julia is very strongly typed, much more so than most dynamic languages. Because the type inference can remove type checks in performance-sensitive code, the language and standard library are much more willing to throw type checks around all over the place, which means that errors get caught much closer to where they were caused compared to most dynamic languages.

    julia> xs = ["foo", "bar"]
    2-element Array{String,1}:
     "foo"
     "bar"

    julia> push!(xs, 42)
    ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type String
    This may have arisen from a call to the constructor String(...),
    since type constructors fall back to convert methods.
     in push!(::Array{String,1}, ::Int64) at ./array.jl:479
    
    julia> xs = Any["foo", "bar"]
    2-element Array{Any,1}:
     "foo"
     "bar"

    julia> push!(xs, 42)
    3-element Array{Any,1}:
       "foo"
       "bar"
     42 
If what you are looking for is a statically typed language, then Rust has a very similar approach to data, types and polymorphism but with much more emphasis on catching errors at compile-time, at the cost of poor interactive development.
Re:Julia 0.5 Highlights by pathsjs on Wednesday October 12, 2016 @02:15AM (#12690758)
Nim is statically typed, very similar to python syntax-wise, fast and with trivial c interop. This makes it a good target for scientific programming, although unfortunately there are not many libraries yet http://rnduja.github.io/2015/10/21/scientific-nim/

As for being functional, strictly speaking it is not, but still has some features like closures and higher order functions, immutable variables, the usual suspects (map, filter, ...) can be inlined with zero overhead, side effect tracking and so on (in addition to a very good macro system)

Re:Julia 0.5 Highlights by jahewson on Tuesday October 11, 2016 @02:14PM (#12687013)
That depends on what "like Julia" means. It's not a functional language, so the short answer is "no". Given that it lacks a true static type system and supports macros it's philosophically LISP-like; notably the Julia compiler includes a sizeable chunk of LISP code. But it's also clearly not a LISP.
Re:Julia 0.5 Highlights by StefanKarpinski on Tuesday October 11, 2016 @02:22PM (#12687086)
I realize that your use of the phrase "functional language" seems to entail having a static type system and purity, but most people seem to consider Lisp to be the original functional language and it doesn't have either property. If one considers Lisp to be functional then it seems like Julia should be as well. Do you not consider Lisp to be functional? Real question, not a rhetorical one – I'm trying to assess where people fall on this terminology.
Re:Julia 0.5 Highlights by pklausler on Tuesday October 11, 2016 @02:32PM (#12687213)
"Functional language" is ill-defined, hence my specific question about static typing and purity. I would really like to have a language for scientific computing that had good scalable performance as well as static types and referential transparency.
Re:Julia 0.5 Highlights by StefanKarpinski on Tuesday October 11, 2016 @02:42PM (#12687338)
As far as I know, no such system exists. Strict static typing and numerical computing are, I suspect, more at odds with each other than they casually appear to be. The seemingly simple `+` operator is the most polymorphic and overloaded function-like entity in many static languages (and often can't be defined as a normal function for that very reason). And `+` doesn't hold a candle to the polymorphism of array indexing and slicing, which is pretty crucial for productive numerical work.
Re:Julia 0.5 Highlights by pklausler on Tuesday October 11, 2016 @02:51PM (#12687414)
Thanks for your reply.

Someday, Haskell will get a good matrix library, and then I'll be happy.

Re:Julia 0.5 Highlights by omaranto on Tuesday October 11, 2016 @03:32PM (#12687762)
Oh, you meant static typing when you wrote strong typing above? That makes more sense.
Re:Julia 0.5 Highlights by pklausler on Tuesday October 11, 2016 @03:51PM (#12687957)
Yes, I sure did. Sorry for the confusion.
Re:Julia 0.5 Highlights by leephillips on Tuesday October 11, 2016 @03:17PM (#12687630)
Fortran?
Re:Julia 0.5 Highlights by pklausler on Tuesday October 11, 2016 @03:35PM (#12687796)
Modern Fortran is an awesome power tool and I love it. But it's hardly a pure functional programming language!
Re:Julia 0.5 Highlights by leephillips on Tuesday October 11, 2016 @09:56PM (#12689929)
Oh no, certainly not. Sorry, I didn't realize you were asking for that, too!
Re:Julia 0.5 Highlights by Avshalom on Tuesday October 11, 2016 @06:20PM (#12689008)
https://en.wikipedia.org/wiki/SAC_programming_language

Although I'm not sure if it's dead or just pining for the fjords

Re:Julia 0.5 Highlights by jimbokun on Tuesday October 11, 2016 @05:39PM (#12688739)
I'm not an expert on it or anything, but maybe Spark and Scala is what you're looking for?