Hacker News new | ask | show | jobs
by phoe-krk 1608 days ago
As always, I'm very glad to see that structural, Common Lisp-style macro systems with the whole language available for macro construction, have been successfully adopted in other languages to the point where it's possible to explain them without a single mention of Lisp in the article, or even better - where a mention of Lisp anywhere else except for the very beginning would make the article worse by making a unnecessary detour.

pg's article on the topic, "What Made Lisp Different", [0] has aged poorly, and points 8 and 9 it makes (a notation for code using trees of symbols and the whole language always available) are no longer Lisp-specific. The final point, about "inventing a new dialect of Lisp", doesn't hold true either - as seen here, Julia is doing just fine not claiming to be another dialect of Lisp, even though many sources mention directly that it's Lisp-inspired.

Congrats to Julia people for the macro system and to the author for the article!

[0] http://www.paulgraham.com/diff.html

1 comments

One could argue that Julia is just Lisp with a syntax that appeals more to popular taste.

There is also a secret option to get into a lisp repl in Julia "julia --lisp".

> There is also a secret option to get into a lisp repl in Julia "julia --lisp".

Wtf....... what? I just tried it, it's true. Is this some easter egg?

Julia's parser is written in Scheme using femtolisp. Look for *.scm files and the 'flisp' directory in the repo[1].

[1] https://github.com/JuliaLang/julia/tree/master/src

I will not look for such files, I'd rather forget this ever happened.
yeah it doesn't take much eye squinting to see lisp in julia. given these similarities i wonder if julia users could start to appreciate the s-expression syntax. i come from matlab then python background and i have come to really enjoy the s-expression syntax. modern IDE tools have made s-expression code as readable as pythonic pseudo-code-like syntax while affording the programmer unrivaled editing power
As it happens, in addition to the femptolisp in the Julia parser, there is actually a secret s-expression syntax for Julia itself. There's no built in REPL mode for it, but you can hack one in about a dozen lines: https://gist.github.com/brenhinkeller/44051118c2f9d18b26dc76...
nice! one annoying nit pick for me though is using commas as data separators. when you need to input data by hand into a multi dim array this can get annoying very quickly
It's true; I think this syntax was probably made more for reading than writing since the main place it appears in the base language is just `Meta.show_sexpr`, but it's still interesting to play around with, and parsing it has some fun properties like that you can use Julia's standard syntax as effectively a preprocessor syntax for the s-expression syntax.
Sure, that's always an option - same as Dylan, in a way!
Julia does take inspiration from Dylan and Scheme(the parser is even written in it) so it makes sense I guess