Live data from Hacker News

Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

github.com

31–40 of 46 posts

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#31

Main takeaway, it avoids SSA Earlier HN discussion 183pts 63 comments https://news.ycombinator.com/item?id=22098399 Whats the chance nateb2022? this is way too close (in name) to Lattner’s MLIR to ignore, i thought this morning as I was brushing my teeth. {not to mention LLVM’s own MIR} https://llvm.org/docs/MIRLangRef.html

SSA is used internally, but the instruction set does not require SSA, if that's what you meant

“ Using SSA simplifies the optimization implementations, but building and destroying this form is expensive. Using SSA for the MIR generator's short-pass pipeline makes little sense to me, so I don't use it.”

In his blogpost.

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#32

Pro jit hacker here. Super cool seeing folks build stuff like this. Thoughts: - great to see an SSA pipeline, but that implies that this jit is not ideal for baseline jiting. That’s fine. I guess I would explicitly call out that although it’s light, it is an optimizer. - which reminds me - a JIT based VM is most defined by how powerful its top JIT is, not how light it is. Maybe since MIR is an optimizer, it’s meant t…

“Using SSA simplifies the optimization implementations, but building and destroying this form is expensive. Using SSA for the MIR generator's short-pass pipeline makes little sense to me, so I don't use it.”

Thats from his blog motivating the project. https://developers.redhat.com/blog/2020/01/20/mir-a-lightwei...

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#33
post #16

Too bad it doesn't support SIMD. Would be nice for an easily embeddable SIMD-aware JIT to exist.

What do you mean by easily embeddable? There are JVM JITs that understand SIMD to some extent, and let you write manual SIMD code using the vector API.

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#34
post #16

Too bad it doesn't support SIMD. Would be nice for an easily embeddable SIMD-aware JIT to exist.

What do you mean by easily embeddable? There are JVM JITs that understand SIMD to some extent, and let you write manual SIMD code using the vector API.

It means you can easily use it from another program. Pretty much it has to be written in a language without a runtime that can expose a C interface, i.e. C, C++, Zig or Rust.

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#35

I think it would be worth mentioning GraalVM and https://github.com/oracle/truffleruby in competitors section.

LuaJit and PHP both use [DynASM]( https://luajit.org/dynasm.html ) as well.

TIL PHP uses dynasm, here I thought only LuaJIT did. Cool!

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#36

Earlier quoted context omitted.

What do you mean by easily embeddable? There are JVM JITs that understand SIMD to some extent, and let you write manual SIMD code using the vector API.

It means you can easily use it from another program. Pretty much it has to be written in a language without a runtime that can expose a C interface, i.e. C, C++, Zig or Rust.

I guess you can do something like emit code on a memfd, exec ispc to another memfd and dlopen the output but... clunky.

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#37
When I first read the blog post announcing this project, I got really excited, but unfortunately supporting Windows is not important to the author (correct me if I’m wrong?) and I am mainly interested in projects that are portable between at least windows and Linux, so it isn’t really an option for me.

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#38

Earlier quoted context omitted.

What do you mean by easily embeddable? There are JVM JITs that understand SIMD to some extent, and let you write manual SIMD code using the vector API.

It means you can easily use it from another program. Pretty much it has to be written in a language without a runtime that can expose a C interface, i.e. C, C++, Zig or Rust.

I don't follow. You can load every JITC I know of with C or C++ interfaces. And what is a JITC if not a runtime?

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#39

Earlier quoted context omitted.

It means you can easily use it from another program. Pretty much it has to be written in a language without a runtime that can expose a C interface, i.e. C, C++, Zig or Rust.

I don't follow. You can load every JITC I know of with C or C++ interfaces. And what is a JITC if not a runtime?

The runtime I'm talking about is for the language that the JIT compiler is written in.

If I want to use a JIT compiler that is written in Java in my C++ game I now have to distribute the Java runtime with my game. That's an example of "not easily embeddable".

Re: Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs

#40

Earlier quoted context omitted.

LuaJit and PHP both use [DynASM]( https://luajit.org/dynasm.html ) as well.

TIL PHP uses dynasm, here I thought only LuaJIT did. Cool!

Here’s the RFC for reference https://wiki.php.net/rfc/jit

It passed and landed in PHP 8.0.

Post reply on HN