KenoFischer
yesterday at 5:28 PM
I don't think there's anything we need to do here that couldn't be expressed in MLIR representationally. That said, I also haven't studied MLIR's representation in too much detail myself, so it's possible there's subtle corner cases. For example, in LLVM you end up getting quadratic processing times even for linear time passes, because it needs to restore the ordering count for instructions (I think the trick in this PR may be backportable to LLVM to improve that, but I haven't looked into it yet). We ran into that badly with larger functions, so it's possible there'd be similar corner cases in MLIR if we used it e.g. for the tree structuring that's proposed in this PR.
Not using MLIR here is more about other considerations:
1. It'd probably be more of a pain to write high performance bindings than just to write the data structure in julia itself.
2. We will be targeting WasmGC in the near future, so we need our core runtime and compiler data structures to be compilable without the assumption of necessarily having linear memory available.
3. It's designed to be used by downstream julia users, so it's easier for them to not have to deal with another system in another language.
4. It's experimental and we need to be able to make changes quickly without having to necessarily have a big upstream discussion.
That said, like I mentioned in the other comment, easy interop with MLIR is an explicit design goal.
Archit3ch
yesterday at 8:09 PM
> 2. We will be targeting WasmGC in the near future, so we need our core runtime and compiler data structures to be compilable without the assumption of necessarily having linear memory available.
Big if true. Does that mean we'll get a no-alloc iOS backend?
KenoFischer
yesterday at 8:25 PM
I'm not sure I understand the connection, but I also know basically nothing about iOS.
Archit3ch
yesterday at 11:27 PM
1. iOS doesn't allow JIT for apps distributed through the App Store. However, WASM (including JIT) is allowed. Effectively, this would allow Julia to run on i(Pad)OS.
2. Technically, one could port the Julia compiler itself to WasmGC and get full REPL/eval semantics. However, App Store Guideline 2.5.2 states "Apps [...] nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps.". It's not clear if this only applies to downloaded code or also local code (e.g. a playground app). If you attempt it, there is a good chance Apple will update their guidelines specifically to ban it. :P
andyferris
today at 3:14 AM
1. Don't forget that there are parallel efforts for static compilation in Julia - a static artifact should be able to get through the App Store.
gregdaniels421
yesterday at 6:51 PM
The WasmGC and the lack of good support in LLVM is a pain, but having yet another IR may be worse decision in the long run compared with just using MLIR and submitting changes to have it work for you
KenoFischer
yesterday at 7:24 PM
Not sure the MLIR folks would appreciate a vibe-rewrite PR from C++ into Julia, but guess we could give it a go ;).