6 ms·
> Julia is homoiconic It depends on what you understand by homoiconic: https://stackoverflow.com/questions/31733766/in-what-sense-are-languages-like-elixir-an
by kgwgk 8y ago
> Julia is homoiconic
It depends on what you understand by homoiconic:
https://stackoverflow.com/questions/31733766/in-what-sense-are-languages-like-elixir-and-julia-homoiconic/31734725#31734725 https://stackoverflow.com/questions/31733766/in-what-sense-a...
- lenticular 8y agoThat's a good point that it doesn't have the direct homoiconicity of Lisp, but it is not buried deep, since we have full access to the underlying AST as just an Expression type. In practice, this makes macros much less painful than in other non-lisp languages. This means that macros are used all the time, and idiomatically. The most proiminent non-lispy language with a macro system that I can think of is Scala. Macros there are a nightmare, and so tend to be only used in library code that really, really needs them.
- kgwgk 8y agoI agree that macros are better than in other non-lisp languages, but I find them ugly in Julia. Maybe not painful, but they don’t integrate seamlessly into the language.
- lenticular 8y agoThey are ugly, I agree. Personally, I prefer lisp (especially Clojure) syntax, but not many people agree with me there.
- Recurecur 8y agoWhat's actually sad (I learned this quite recently) is that the inventor of Lisp wanted to include a mechanism to evaluate formulas along the lines of FORTRAN. Something like: (math "x = sin(a) * b ^ 2") Lack of something like that turned me away from Lisp (LISP at the time) a (cough) long time ago, since I didn't like the impedance mismatch between Lisp code and math for numerics. At any rate, Julia looks like a fine general purpose language, I'm going to see if I can contribute somehow. I'm hopeful that GC pauses can be avoided for large classes of Julia programs, but we'll see...
- kazinator 8y agoThroughout Lisp history, this has been done. (Let's not count things like computer algebra systems written in Lisp that have some sort of actual math notation for input and output, just alternative syntax for programming in Lisp itself.) As early as 1973, there was https://en.wikipedia.org/wiki/CGOL https://en.wikipedia.org/wiki/CGOL That can actually be made to work today: http://abcl-dev.blogspot.com/2010/04/cgol-on-abcl.html http://abcl-dev.blogspot.com/2010/04/cgol-on-abcl.html
- eigenspace 8y agoThis is why the language creators usually avoid using the word 'homoiconic' because every time one uses that word there's a finite probability of being bogged down in an incredibly uninteresting semantic argument. Instead, people prefer to say that julia code is just another (tree-like) data-structure in the language and it can be manipulated at runtime with functions or compile time with macros or at parse time with string macros and now with Cassette.jl[1] we can even manipulate the form of code that has already been written and shipped by other packages all with first class metaprogamming tools. It seems to me that even if Julia is not 'truly homoiconic', that we seem to get the touted benefits of homoiconicity to the point that it seems like an unimportant distinction. [1] https://github.com/jrevels/Cassette.jl https://github.com/jrevels/Cassette.jl
- Athas 8y agoThen why not just say 'Julia has macros'? Lightly perusing the description of Julia's features, that seems like a clear way of expressing what it is. (I also vaguely recall Julia describing its type system as "dependent" in way that goes against convention. Maybe they just liked controversy in the early days!)
- eigenspace 8y agoWhat I just said is why Julia people don’t tend to call it homoiconic or dependantly typed. It lead to so many semantic arguments that most just talk about actual features such as macros and various multiple dispatch features instead of using words like homoiconicity and dependant typing.
- zem 8y ago"macros" are unfortunately used by C and lisp to describe two different things, and both usages are as widely popular as their parent languages (i.e. very).
- deleted 8y ago[deleted]