Is it wrong to think of Julia as a Lisp that uses m-expressions?

977 views
Skip to first unread message

Ben Racine

unread,
Jun 26, 2013, 4:38:33 PM6/26/13
to julia...@googlegroups.com
I stumbled across this on wiki... 

The use of S-expressions which characterize the syntax of Lisp was initially intended to be an interim measure pending the development of a language employing what McCarthy called "M-expressions". As an example, the M-expression car[cons[A,B]] is equivalent to the S-expression (car (cons A B)). S-expressions proved popular, however, and the many attempts to implement M-expressions failed to catch on.

I've seen the (awesome) language designers mention that Julia can be thought of a Lisp (in different words)... and I'm just wondering if anybody cares to confirm, expound, or deny this.

Andrew Dabrowski

unread,
Apr 10, 2014, 12:41:29 PM4/10/14
to julia...@googlegroups.com
I'm neither a Julia nor even a competent programmer, but since no one else has responded I'll take a shot at it.

I think that might be fair description of Mathematica, but not of Julia.

Julia is very much a multi-paradigm language, it's not pure enough in any sense to be considered a member of any family.

Mike Innes

unread,
Apr 11, 2014, 6:16:06 AM4/11/14
to julia...@googlegroups.com
Lisp has certainly had a strong influence on Julia. First class functions, homoiconicity, running code at compile time and compiling code at runtime, the interactive REPL, dynamic typing and GC, everything you could really want from a Lisp is there.

But, syntax does make a difference, I think. For example, deeply nesting expressions concisely is far less natural in Julia than Lisp. Macros, while just as powerful, are a little more awkward thanks to Julia's more complex syntax and the fact that you have to often write @foo begin rather than just (foo. Don't get me wrong, Julia's syntax is great, and it's entirely the right choice for the technical space, but for that reason I think I'd say that Julia isn't a Lisp as such. Yes, they're similar in terms of raw language power, but each for different problems.

I've often thought that a Lisp which compiles to Julia would be a cool project, though.

If you're interested, this Paul Graham essay is an interesting read. It seems he was spot on about languages with algol-like syntax adopting more Lisp features.

Stefan Karpinski

unread,
Apr 11, 2014, 10:05:51 AM4/11/14
to Julia Users
We contemplated giving Julia macros function call syntax, but decided not to. These were a few of the reasons:
  1. The @foo syntax serves as a warning to the reader that something unusual is about to happen. Macro invocation isn't at all like a function call and doesn't look like it – it looks like a user-defined keyword, which is basically what it is.
  2. If you write map(m,v) where m is a macro, what happens? If you write map(@m,v), there's no expectation that this should do anything but apply the @m macro to zero arguments and then map the result of that over v.
  3. We want to discourage excessive use of macros. Macros are the ultimate escape hatch, but using them too much is usually a sign of bad library design or a language deficiency. Having a jarring macro syntax keeps us honest.

Chris Kohlhepp

unread,
Nov 30, 2014, 5:28:13 PM11/30/14
to julia...@googlegroups.com
Try typing "julia --lisp" and see what happens.

Matt Gushee

unread,
Nov 30, 2014, 10:45:24 PM11/30/14
to julia...@googlegroups.com
On Sun, Nov 30, 2014 at 3:28 PM, Chris Kohlhepp
<chris.k...@gmail.com> wrote:
> Try typing "julia --lisp" and see what happens.

Wow, that is some easter egg! Is there a serious purpose for this? Any
documentation?

--
Matt Gushee

John Myles White

unread,
Nov 30, 2014, 10:49:03 PM11/30/14
to julia...@googlegroups.com
This isn't documented because it's not meant to be an official part of Julia. At present, Julia's parser is written in Scheme. That command lets you use the Scheme implementation that Julia uses internally.

-- John

cdm

unread,
Dec 1, 2014, 3:24:53 PM12/1/14
to julia...@googlegroups.com

from the Julia License.md file   ( https://github.com/JuliaLang/julia/blob/master/LICENSE.md ):

The Julia language links to the following external libraries, which have their own licenses:
interested individuals can view the Readme.md and remainder of the repo there ...

enjoy !!!

cdm
Reply all
Reply to author
Forward
0 new messages