Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The BEAM needs an APL-y language (2018) (medium.com/gordonguthrie)
27 points by lelf on Aug 5, 2020 | hide | past | favorite | 8 comments


  Well this is mine — the BEAM, which already has Prolog-y 
  (Erlang), Algol-y (Elixir) and Lisp-y (LFE)
As a full time Elixir Dev, I actually consider Elixir to be a lisp (albeit, pretending it's not one).

Elixir code is 100% expressible as Elixir data types (see quote/unquote [0]), and it supports hygienic macros in the same way lisp does [1][2][3]. Elixir steals other stuff straight out of lisp like protocols [4], the "loop" macro (Erlang has a form of this, but not as full featured)[5].

This is on top of the stuff that Erlang already took from lisp such as linked lists and symbols [6].

[0] https://elixir-lang.org/getting-started/meta/quote-and-unquo...

[1] https://elixir-lang.org/getting-started/meta/macros.html

[2] https://hexdocs.pm/elixir/Macro.html

[3] https://hexdocs.pm/elixir/Code.html#eval_quoted/3

[4] https://elixir-lang.org/getting-started/protocols.html

[5] https://elixir-lang.org/getting-started/comprehensions.html

[6] https://elixir-lang.org/getting-started/basic-types.html


it is of course entirely possible to program for years in Elixir without realizing it's a lisp; Despite having cut my teeth at the ripe age of 9 on scheme, I only realized Elixir "was a lisp" when I got into more advanced macro-writing, and noticed that macro writing is very similar to Julia (which actually has a lisp sitting in its core).

In any case, it definitely has algol syntax.


Dylan is another example of a Lisp with Algol syntax.


I've written quite a bit of Elixir and introduced a few people to it, and I totally agree. When people ask me what Elixir is like I basically say, "It's a Lisp with a Ruby-ish syntax." Anyone who has used a lisp before recognizes the patterns immediately.



I think those kinds of articles are really unfair.

Yes, Erlaing is 500 line for code -- but this includes text parsed and I/O, main loop, nice descriptive names, good test suite. The "shorter" APL version has none of this, it is just the main function.

Rewrite APL version to add I/O, text parsing and unit tests; rewrite erlang version to get rid of all the descriptive names and extra whitespace -- and then you can have a fair comparison.


How possible would it be to use APL as a DSL, or to include one file of it in a larger Erlang/Elixir project?


For anyone else wondering, I think this is the BEAM it's referring to: https://en.wikipedia.org/wiki/BEAM_(Erlang_virtual_machine)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: