4 ms·
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
by sischoel 5y ago
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".
- phoe-krk 5y agoSure, that's always an option - same as Dylan, in a way!
- borodi 5y agoJulia does take inspiration from Dylan and Scheme(the parser is even written in it) so it makes sense I guess
- dfghdfhs 5y ago> 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?
- cygx 5y agoJulia'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 https://github.com/JuliaLang/julia/tree/master/src
- dfghdfhs 5y agoI will not look for such files, I'd rather forget this ever happened.
- medo-bear 5y agoyeah 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
- cbkeller 5y agoAs 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/44051118c2f9d18b26dc765466f749ba https://gist.github.com/brenhinkeller/44051118c2f9d18b26dc76...
- medo-bear 5y agonice! 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
- eigenspace 5y agoThere's https://github.com/swadey/LispSyntax.jl https://github.com/swadey/LispSyntax.jl for that.
- cbkeller 5y agoIt'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.