Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wish them all the best. Julia seems to a good idea -- a high performance language with easy syntax (easy for Python users to jump to Julia), very good features for threading/multiprogramming, good type system...

...here it seem like any other modern language, until you see that Julia has something that many other languages lack: true macros (true metaprogramming.) A big feature. And multiple dispatch on all functions! (a very nice feature that puts it above many other languages in use.)

You can even program Julia in s-expressions if you feel like it. (Some argue that Julia should be considered a Lisp dialect.)

Compared to the other languages with Python-like, C-like or Algol-like syntax, Julia stands out from them as a more powerful alternative. (If you need more power and flexibility than Julia with good processing speed, i think only Common Lisp will clearly provide it.)

A very recommendable language, especially now with this initiative for giving more "enterprise-like" support, and worth looking in depth, if you are also considering moving to Go and Rust.



Julia is a great language, but it is still focused on the numerical computing world and is not "1.0" (language and API's are not locked down). I wouldn't really compare it to Go or Rust at this point. Go is focused on building services at its core (e.g. external event driven workflows). Aka microservices. Rust is focused on being a "traditional" systems programming language. Things like web browsers (duh), office suites, games, etc.

Julia is focused on taking the best of R, Python/Numpy, and Matlab. It is a _great_ language. But as far as I can see it's really focused on a different problem space.


If you take a look at the features (esp. macros and multiple dispatch) you can see that is readily extensible for lots of applications. Thus the reason it is also sold as a "general purpose" language.

Additonally, the very good support for threading and multiprocessing means it has a good future with services, async IO, and with event-loop web servers (a la node.js and friends).

Finally, the focus on fast speed for numerical computation is particularly suited to games (as is the support for threading).


This sounds like a small thing, but with 1-based arrays, I'd bet more on it taking share from MatLab/R than from Rust or Java.


I didn't think 1 based arrays would be a big deal, but whenever I try to port code from Julia to almost any other environment (C++, python/numpy, scala, JS), it becomes one of the hardest things to reason about quickly and correctly.


1-based arrays, and column-major layout of arrays annoyed me at first, however, one of the beautiful things is that much of Julia is written in Julia. If you want 0-based (or arbitrary based!) arrays, then simply use the https://github.com/JuliaArrays/OffsetArrays.jl package, and PermutedDimArrays have been added to Base, to handle some of the issues of dealing with row-major (and other sorts of memory layout) matrices.


Doesn't this mean that instead you're now dealing with inconsistent data representations?


Games are not going anywhere from a mostly C++ code base. New languages get adopted if they are too good to be true or they have enterprise adoption like Go. Even Python took 20 years to reach where it is now. Julia will take a long time to become a general programming language for all purposes.

Scientific Computing is a realistic goal just like Golang is a realistic language with Enterprise adoption. It may not be the most elegant language like Lisp but it is practical. (People don't want the perfect solution but one that works most of the time) (P.S I am vaguely quoting this from some anecdote about a discussion on Lisp and C)


> good future with services, async IO, and with event-loop web servers [...] particularly suited to games

This all seems extremely unlikely (compared to e.g. widespread success in scientific computing, which is still far from assured). Good luck though.


Handling technical/scientific/numeric programming well is rather a hard nut to crack, and that is where the developers of Julia wanted a better solution for their own "greedy" programming needs, but Jeff Bezanson has been clear that it is also for general purpose programming (which is what I use it for). Many Julians are working to improve Julia for places that hadn't yet gotten as much attention (such as database access). I think in a couple of years, the canard of it being a "niche" language will be laid to rest.


> Julia is a great language, but it is still focused on the numerical computing world and is not "1.0"

Word on the street is that Julia is supposed to get a 1.0 announcement at JuliaCon, which started today.


Unfortunately 1.0 is delayed for a couple of months. 0.6 was released yesterday though, which already includes many of the features that were originally scheduled for 1.0.


I have yet to fully jump into Julia but it is one language that has impressed me for a while, and I've seen a good number of them that impress me but Julia has a few things that to this day I think back to like code_native() and how it returns assembly code for whatever you throw at it, might seem trivial to others and y'know you can do it with C too but it's still cool you can just do it.

Your description of it makes it very intriguing and makes me want to revisit it.


For non-CS scientific computing users, "a high performance language with easy syntax" is a big feature.


Exactly, that's why I think Julia is a good idea.

For scientific users used to R or Python, the performance should knock their socks off. (But users doing their work in C, C++ or Fortran will probably see little or no improvement).


Do we really need Julia given that Python has Numpy which does a lot of the heavy lifting in numerical computation and is pretty fast?


Numpy is good for vectorized calculations on dense multidimensional arrays of homogenous 64 or 32 bit floating point numbers, or integers. If that describes your problem and you like Python, by all means use numpy. If that doesn't describe your entire problem, you'll need more tools.


It should be understood that numpy is written in C, and is an example of the "2 language problem" that Julia solves rather well.

The question really is the converse ... given how deft Julia is with general programming as well as numerically intensive programming, do you really need Python + numpy(C).


Numpy is great as long as you're using Numpy. There's lots of aspects of scientific computing that may not be using Numpy.


On top of what others have mentioned, there is something to be said about getting numerical linear algebra tools as native citizens of a language.

There are many things I hate about MATLAB, having matrices built into the syntax is nice.


It's why the horror that is MATLAB exists. I'm looking forward to replacing MATLAB with the much more ergonomic Julia soon though.


Yes, do it! It was an easy transition years ago, now Julia seems light-years ahead.


Would that not be true for all technical / scientific use cases if not most use cases in general?


> (If you need more power and flexibility than Julia with good processing speed, i think only Common Lisp will clearly provide it.)

Common Lisp is terrible for numerical computing, and the type system is really quite weak IMO.


Maybe it is terrible for you...

But good enough for doing numerical computing for the NASA and for Raytheon.

The NASA used it for complete command of the Deep Space 1 spacecraft. "The Remote Agent" wasn't just entirely written in Common Lisp, it also won the NASA's Software of the Year Award...

https://ti.arc.nasa.gov/tech/asr/planning-and-scheduling/rem...

    "It's one small step in the history of space flight. 
    But it was one giant leap for computer-kind, with a state of 
    the art artificial intelligence system being given primary 
    command of a spacecraft. Known as Remote Agent, 
    the software operated NASA's Deep Space 1 spacecraft 
    and its futuristic ion engine "
... and i don't think they did it without heavy numerical computation.

Want another application? Analyzing HDTV video images of the Discovery launch in real-time. Again, NASA.

Another one? Mind you, i'm only citing examples where numerical computation is heavily involved...

How about simulation of missile defense systems at Raytheon?

http://www.lispworks.com/success-stories/raytheon-siglab.htm...

    "SigLab simulates an incoming warhead intercepted 
    by the Exo-atmospheric Kill Vehicle (...) 
    The system is capable of solving any computable system 
    of difference equations. "
Another one?

    "the new version of the complete Piano aircraft analysis tool, 
    used by several major aircraft and engine manufacturers worldwide."
http://piano.aero/

As for the "type system being weak", the comment puzzles me, considering that Common Lisp has one of the best (if not the best) OOP system, CLOS. There is an automatic correspondence between objects and types in CLOS so I can argue it has one of the best type systems out there.


> Maybe it is terrible for you...

It is. I know of the examples you mention (and some of them like planning may not really involve much numerical work) but the fact is that unless you're doing things by scratch (like starting from GEMM), numerical libraries are often badly documented, slow or otherwise incomplete (or a mixture thereof). You can disagree with me, but Tamas Papp who maintained a bunch CL libraries seems to have moved over to Julia entirely.

> As for the "type system being weak",

I meant weak in the sense that it's not very expressive, so as to allow better static type inference. I'm not saying CL should be static for "correctness" reasons, but for removing the user from having to have declarations all over the place.

Let's reify. If I were to create a bunch of matrix classes (matrix-float, matrix-double, ignoring the lack of sugar), CL provides no way to declare a generic method 'mref' to be intelligent enough to know what the output will be, given the input type. Even getting the type in the compiler-macro is implementation dependent. In C++ this is extremely easy with templates, and in Haskell you do it via a type declaration (AFAIK).

Yes, you can get around it via lots of macro magic, but this is so fundamental that you might as well create a new language (like Qi/Shen).


> Let's reify. If I were to create a bunch of matrix classes (matrix-float, matrix-double, ignoring the lack of sugar), CL provides no way to declare a generic method 'mref' to be intelligent enough to know what the output will be, given the input type.

I am not sure if I follow you.

If you have "matrix-float, matrix-double" you are perfectly able to define a "mref" generic method that acts smartly depending on the input type. This is one of the most basic features of the CLOS OOP system. Maybe there is something missing on your explanation?


Have done exactly that using GOOPS which is Guile's equivalent of CLOS:

  scheme@(guile-user)> (use-modules (aiscm sequence) (aiscm element))
  scheme@(guile-user)> (define a (arr (1 2 3) (4 5 6)))
  scheme@(guile-user)> (get a)
  $1 = #<sequence<sequence<int<8,unsigned>>>>:
  ((1 2 3)
   (4 5 6))
  scheme@(guile-user)> (get a 1)
  $2 = #<sequence<int<8,unsigned>>>:
  (4 5 6)
  scheme@(guile-user)> (get a 0 1)
  $3 = 4
  scheme@(guile-user)> (get (get a 1) 0)
  $4 = 4
That's the whole point of macros: To be able to create embedded domain specific (mini) languages.

[1]: https://github.com/wedesoft/aiscm


I don't dispute the effectiveness of Common Lisp, but

> There is an automatic correspondence between objects and types

is almost never what is meant by a "strong type system" -- it more commonly means that types are checked at compile time, rather than run time. I don't doubt that any given lisp hacker could slap together a type inference system on top of CLOS, but as far as I can tell it's not built in.

So, on the strong-to-weak type system spectrum, I would say:

* Idris (lawful good, first-class dependent types)

* Haskell (very strong, some support for dependent types)

* Java (strong, some generics)

* Julia (hybrid, code is analyzed for type inference during JIT, invariant types)

* Common Lisp (weak by default, afaict)

* Python (very weak)

* Javascript (weakest)

* PHP5, Perl (chaotic evil)


Types checked at compile time is called "static".

Strong has various meanings. Ada is "strong" versus C being "weak" though the basic Algol-like model is not so different, and if we don't count tagged types, neither language is dynamically typed in any way. (So if "strong" means "static", we would not be able to use the strong/weak terminology to contrast these languages!)

"Strong" in this context mean various things, ranging from C having holes in the type system that allow punning and bad memory references, to C having automatic conversions that are unsafe: for instance assigning a floating-point value to an integer location without an explicit conversion operator which handles situations when the conversion is impossible. Or not having a character type distinguished from an integer type.

C++ has more "strongly typed" enums than C; and what that means is that you can't assign an integer value to an enum object without a cast.

ANSI Lisp is fairly strong, but allows some relaxations: car on an empty list, integers usable where floating-point values expected (a bit like C) and such.


You are confusing "strong/weak" typing with "static/dynamic" typing.

CL is for the most part strongly typed. Python too. In CL there are almost no automatic typecasts.

Javascript and PHP and Perl are textbook examples of weakly typed systems. The interpreter (or compiler) can even allow things like 1 == "1".

With implementations like SBCL, CL also allows for static type checking with the "declare" and "proclaim" keywords, this checks types before runtime, if they can be inferred before executing the code.


Common Lisp is strongly typed (type mismatches result in a sensible error), but is by default dynamically typed, unless you annotate.

The type system is not capable of useful, extensible polymorphic types, though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: