kip

kip

ex_cldr Core Team

Mojo by Chris Lattner looks very similar to the Nx approach for Elixir

Interesting Hacker News item on Mojo which is Chris Lattner’s take on adapting Python to the numerical computing / machine learning world. Reads a lot like the work that @josevalim, @polvalente and @seanmor5 (and others) have been delivering for Elixir for the last couple of years although it seems his work its more focused on direct compilation to MLIR.

I wonder if there is room to see a native MLIR integration layer somewhere in the Elixir future? Perhaps a more evolved JIT?

Marked As Solved

jackalcooper

jackalcooper

now in Elixir you can already JIT compile a native function with beaver
a small example: beaver/guides/your-first-beaver-compiler.livemd at main · beaver-lodge/beaver · GitHub

project:
https://github.com/beaver-lodge/beaver

Like what Jose said MLIR integration’s low-level bits are ready now. I just don’t have enough knowledge (and time perhaps) to pursue further. In other words with beaver you can implement a mojo DSL in pure elixir.

Anyone interested in this please feel free to message me~

Also Liked

josevalim

josevalim

Creator of Elixir

Hi @kip!

My understanding so far is that we can describe Mojo as a system-level language (like Rust, Zig, C++) with Python-like syntax and a Rust-like type system, with a Python runtime embedded within itself. The approaches are somewhat different to Nx (which in itself is closer to Python’s JAX).

One of the interesting things about Mojo is that it is also described as a front-end (aka syntax) to MLIR and you can specify MLIR types and instructions directly in Mojo and their goal is to build the entirety of Python from this (including the Object system). Although note they say Mojo is a superset of Python but it definitely isn’t one right now - e.g. you can’t define classes - and I think it will be very very very hard to keep full Python compatibility, especially if you include the C API.

In other words, Nx is about embedding low-level bits inside a high-level language, and Mojo is about a low-level language with a high-level runtime inside. I know @jackalcooper is working on MLIR integration but I believe his work so far is more akin to embedding low-level bits inside Elixir.

EDIT: it is also interesting that Mojo is borrowed by default - which brings its semantics closer to a functional programming language and mutation needs to be explicitly enabled. More info: https://docs.modular.com/mojo/programming-manual.html#argument-passing-control-and-memory-ownership

18
Post #3
D4no0

D4no0

I totally agree with reasoning behind this, if we had in erlang/elixir a subset of commands that could compile to native code, it would be much easier to work with the native interface, no need for a secondary language, tool-chain and other nasty things that always blow up when you try to build the project.

Where Next?

Popular in Discussions Top

jswny
I would like to better understand what the advantages/disadvantages of umbrella applications are compared to structuring your app as as s...
New
PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
sashaafm
I’m trying to evaluate the best combo/stack for a BEAM Web app. Right now I’m exploring Yaws a bit, after having dealt with Phoenix for a...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
tmbb
This is a post to discuss the new Phoenix LiveView functionality. From Chris’s talk, it appears that they generate all HTML on the serve...
342 18243 126
New
ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
fireproofsocks
This is more of a general question, but I’m wondering how other people in the community think about the pattern matching in function sign...
New
sashaafm
Piggy backing a bit on @dvcrn topic BEAM optimization for functions with static return type?, I’ve been trying to understand in a deeper ...
New
Markusxmr
Since Drab has been developed for a while in the open, introducing the Liveview functionality in a way it happend appears to undermine th...
New

Other popular topics Top

New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement