Hacker News new | ask | show | jobs
by rkangel 1723 days ago
I think Elixir would be interesting for your usecase.

It's a dynamic, garbage collected language. It's easy to pick up and get going with. As a functional programming language there isn't a lot to learn in the way of language constructs, and you don't even have to do the 'wrestling with the type system' thing that you have to do in compiled functional languages like OCaml or Haskell (like you do in Rust).

Its processing 'horsepower' is probably comparable to Python, but it's much better for building low latency things if you want to run something in a bit more of a production use case. This is also improving due to the recent addition of a JIT.

The addition of NX is making Elixir an increasingly interesting place to do ML - write Elixir, have it run on GPU etc. See https://dashbit.co/blog/nx-numerical-elixir-is-now-publicly-...

Python integration is probably best done using the Erlang 'port' system - running Python as a managed process and communicating with it using messages over stdin/stdout. I use it for C interop and it works well (and fits well with the Elixir/Erlang process model). It's not difficult to roll your own in Python e.g. https://github.com/fujimisakari/erlang-port-with-python/blob... or look at something like http://erlport.org/

1 comments

Thank you! So this looks interesting but it seems like there's no easy way to share numpy arrays?

The main use case for a language other than python is a more robust codebase but also performance. We need to be able to efficiently ship lots of large arrays between the languages and the Rust-Python interop supports zero copy arrays for example.

Elixir and Rust are very good friends, so to speak. Writing a library in Rust that you can use from Elixir is only slightly worse than trivially easy.

But I agree somebody has to put the work.

I've made a good career with Elixir but I still don't think it's a good fit for a hedge fund. IMO invest in Rust.

Ah, no. I'm sure that's build able in Elixir using a NIF (function built into the VM, in a similar manner to Python modules written in C) but you'd have implement it, I'm not aware of anything out of the ox.