Live data from Hacker News

A Lisper's first impression of Julia

p-cos.blogspot.com

11–20 of 41 posts

Re: A Lisper's first impression of Julia

#11

It seems weird to try to characterize Julia in terms of object-oriented programming. Is that just me? Julia's approach to subtyping and multiple dispatch is sufficiently different from the C++ and Python approaches to OOP that I don't even put them in the same bucket, and it seems about as far away from CL's objects as well. Julia doesn't really advertise itself as OO; you can't even find the word "object" on the fro…

I'm not familiar with Julia, but from a Common Lisp perspective it is very natural to closely link OO and function dispatch. Generic functions were added to lisp as part of its object system and make up a large part of it.

Re: A Lisper's first impression of Julia

#13

It seems weird to try to characterize Julia in terms of object-oriented programming. Is that just me? Julia's approach to subtyping and multiple dispatch is sufficiently different from the C++ and Python approaches to OOP that I don't even put them in the same bucket, and it seems about as far away from CL's objects as well. Julia doesn't really advertise itself as OO; you can't even find the word "object" on the fro…

It seems like a stretch to classify Julia as Object Oriented. It has types and record structures, but these aren't strongly coupled to functions like you'd see in most OO-style approaches. It also doesn't encourage hiding data behind a bunch of "accessor" methods on objects.

There also isn't OO-style inheritance and polymorphism. Julia's multi dispatch reminds me most of Clojure's protocols, which is a great feature. It achieves polymorphic behavior of functions without having to do ugly things to the objects. That Julia can make this fast and ubiquitous in the language is pretty awesome.

I'm also new to Julia, but I really like the above design decisions, among others features.

Re: A Lisper's first impression of Julia

#14
As an aside (and please do not take it as a flame), this is a very neat article that shows a class of languages in a paradigm I have never considered: Lispy languages (semantically) without Lisp morpho-syntax. I had heard of Julia of course, and see a few mentions here and there of Dylan. It is interesting Dylan had such little interest, or even similar projects, because everyone complains about Lisp syntax (as I see here, I am an amateur Lisper and I understand its history and appreciate it), but bemoans not having other languages with the power of homo-iconicity and other core parts from which the macro system and others gem are based upon (I forget the guy with that quote: keeping adding features to a lang, and you get a much shittier Lisp).

Why did these languages not take off (at least pre-Julia)? I have heard other people "debate" (and I use it hear to say disagreement on principle not on details of said debate that Ruby and other langs are Lisp-like, but fall short. Dylan seems to have been Lisp (proper) without Lisp syntax on purpose (after intentionally moving from the design phase). So why do languages with such powerful expressiveness (for your value of the word, I do not want to start that discussion either) never take off, Dylan or otherwise? It seems that is what all programmers, at least the ones more advanced than me, clamor for.

Re: A Lisper's first impression of Julia

#15
post #14

As an aside (and please do not take it as a flame), this is a very neat article that shows a class of languages in a paradigm I have never considered: Lispy languages (semantically) without Lisp morpho-syntax. I had heard of Julia of course, and see a few mentions here and there of Dylan. It is interesting Dylan had such little interest, or even similar projects, because everyone complains about Lisp syntax (as I see…

Greenspun's Tenth Rule, is the one you're thinking of :)

Re: A Lisper's first impression of Julia

#16

This is a refreshingly specific post. Many articles of this kind ham-fistedly define various philosophical criteria throughout the post and make sketchy judgements within these. Here however there is just "here's the main comparative languages, here's the difference, here's where there may be issues". NB. I'm very much in favour of a principled (qua philosophical) approach to language comparison (etc.) but its rarely…

It's always great to see post from real Lisper instead of yet another Lisp philosopher.

Re: A Lisper's first impression of Julia

#17
post #14

As an aside (and please do not take it as a flame), this is a very neat article that shows a class of languages in a paradigm I have never considered: Lispy languages (semantically) without Lisp morpho-syntax. I had heard of Julia of course, and see a few mentions here and there of Dylan. It is interesting Dylan had such little interest, or even similar projects, because everyone complains about Lisp syntax (as I see…

Dylan was a victim of bad timing if anything. Apple was in the middle of its worst period when they shelved it. And then Java came along and the third parties that were working on independent implementations got steamrolled by that. It's a shame, because despite its verbosity, Dylan is a powerful language and still one of my favorites.

Re: A Lisper's first impression of Julia

#18

It seems weird to try to characterize Julia in terms of object-oriented programming. Is that just me? Julia's approach to subtyping and multiple dispatch is sufficiently different from the C++ and Python approaches to OOP that I don't even put them in the same bucket, and it seems about as far away from CL's objects as well. Julia doesn't really advertise itself as OO; you can't even find the word "object" on the fro…

It seems like a stretch to classify Julia as Object Oriented. It has types and record structures, but these aren't strongly coupled to functions like you'd see in most OO-style approaches. It also doesn't encourage hiding data behind a bunch of "accessor" methods on objects. There also isn't OO-style inheritance and polymorphism. Julia's multi dispatch reminds me most of Clojure's protocols, which is a great feature.…

I know that much about Julia, I just meant to say I'm not an expert or authority :). Anyway, "objects are not strongly coupled to functions", as you said, nails it.

Re: A Lisper's first impression of Julia

#19
post #14

As an aside (and please do not take it as a flame), this is a very neat article that shows a class of languages in a paradigm I have never considered: Lispy languages (semantically) without Lisp morpho-syntax. I had heard of Julia of course, and see a few mentions here and there of Dylan. It is interesting Dylan had such little interest, or even similar projects, because everyone complains about Lisp syntax (as I see…

Aside from Apple having abandoned the language, the basic issue is that Dylan projects were very ambitiois. Dylan was aimed at C++, so Harlequin and CMU spent a huge amount of time developing sophisticated native code compilers, thread-safe GC, compilation to native executables, etc. Harlequin also did a whole IDE, with GUI toolkit and Emacs-like editor, all written in Dylan and self-hosted. Ruby, Python, etc, showed there was a market for simple dumb implementations that were nonetheless useful, and got to market quickly because it was easy to do a little C interpreter that did a dictionary lookup every other operation.

There's a renaissance in native-compiled languages now, mainly thanks to LLVM and the JVM. Having a fast optimizing compiler back end that generates binaries on many platforms is a huge head start, and goes a long way to making the language immediately useful. The JVM gives you those and then some.

Re: A Lisper's first impression of Julia

#20

It seems weird to try to characterize Julia in terms of object-oriented programming. Is that just me? Julia's approach to subtyping and multiple dispatch is sufficiently different from the C++ and Python approaches to OOP that I don't even put them in the same bucket, and it seems about as far away from CL's objects as well. Julia doesn't really advertise itself as OO; you can't even find the word "object" on the fro…

It only seems weird in so far that you are ignorant (aren't we all?) of the generic function approach to object orientation.

In the message passing approach you dispatch based on the type of the first argument to the method. Because it would be redundant to explicitly write down the argument it is commonly syntactically elided (though not fully in Python) and you get coupling of the methods and the object. This is not a fundamental property of OO but accidental feature found in most OO languages.

In the generic function approach, the dispatch is extended so one can dispatch on the type (among other things) of (ideally) all of its arguments. Julia follows this approach afaik and if one is familiar with the generic function approach it is not a controversial claim at all.

Erik Naggum explains it here in more depth: http://www.xach.com/naggum/articles/3243735416407529@naggum....

Post reply on HN