4 ms·
After reading this FAQ I got an impression that language with built-in AST reflection capabilities (i.e. equivalent of quasiquotes) should be considered homoico
by densh 12y ago
After reading this FAQ I got an impression that language with built-in AST reflection capabilities (i.e. equivalent of quasiquotes) should be considered homoiconic in a sense that the language exposes code as data. For example: Scala [1], Elixir [2] and Julia [3] all have native AST manipulation capabilities. But are those languages homoiconic?
[1] http://docs.scala-lang.org/overviews/quasiquotes/intro.html http://docs.scala-lang.org/overviews/quasiquotes/intro.html
[2] http://elixir-lang.org/getting_started/meta/1.html http://elixir-lang.org/getting_started/meta/1.html
[3] http://julia.readthedocs.org/en/latest/manual/metaprogramming/ http://julia.readthedocs.org/en/latest/manual/metaprogrammin...
- aaron-lebo 12y agoElixir's creator (Jose Valim) says no. "PS: Elixir is not homoiconic but we do have Lisp-style macros." https://news.ycombinator.com/reply?id=8337087&whence=threads%3fid%3djosevalim https://news.ycombinator.com/reply?id=8337087&whence=threads...
- lispm 12y ago'Homoiconic' might want to require that the code and the code as data have the same internal (internal code and internal data) AND external representation (external code and external data). Also it would be really good if we don't need special AST data structures. Thus we can read source code and then printing it makes it look the same (usually with some delta). CL-USER 6 > (let (program) (format t "~%Enter a program: ") (finish-output) (setq program (read)) (format t "~%~%The entered program is: ~a" program) (finish-output) (format t "~%~%The result is: ~a~%~%" (eval program)) (values)) Enter a program: (+ 1 2) ; user input of a program The entered program is: (+ 1 2) ; program output The result is: 3