Hacker News new | ask | show | jobs
by djha-skin 483 days ago
Elixir is just Lisp with a facelift[1], and lisps can be built on Python[2]. It stands to reason that an elixir-like can be built on Python too, so you could embed the Python runtime in Elixir but Elixir-likes are used to code for both.

1: https://wiki.alopex.li/ElixirForCynicalCurmudgeons

2: https://hylang.org/

2 comments

The operating environment of the BEAM is what's great about elixir. Hy still has the GIL.
In a way Python is a bad Lisp, still looking forward that catches up in native code compilation and multiline lambdas.

Could be better, but that is what mainstream gets.

We can sort of make a shitty multi-line lambda in Python by making a dummy function called progn, and using it, like this:

  >>> def progn(*args):
  ...   if args:
  ...     return args[-1]
  ...   else:
  ...     return None
  ...
  >>> fun = lambda x : progn(print('abc'),
  ...                        print(x),
  ...                        print('def'))
  >>>
  >>> fun(42)
  abc
  42
  def

:)