r/Python • u/alexis_placet • Jul 20 '26
News LLVMLite and first step to get Numba in the browser
Hi,
Anutosh Bhat, a colleague of mine, just posted this on Linkedin:
What if real compiler infrastructures could run entirely inside the browser?
I’ve successfully patched llvmlite for JupyterLite, making it possible to build >LLVM IR, run optimization passes, visualize control-flow graphs, compile to >WebAssembly and execute the result — without a native LLVM setup or server-side >kernel.
I’ve shared a step-by-step notebook showing how a loop evolves from stack-based IR >to SSA, then to an LICM-style form, into a fully optimized closed form, eventually >to benchmark all of these steps.
The bigger idea is a zero-install compiler workbench for reproducible optimization >experiments, lightweight compiler prototyping, IR debugging, custom code->generation pipelines, shareable research demos, and eventually interactive >tutorials and compiler courses.
Try out the interactive notebook using notebook.link: https://notebook.link/@anutosh491/llvmlite
I’m also in the process of bringing MLIR Python bindings into the same JupyterLite >and WebAssembly environment, starting with a 2D CNN-style Conv2D + bias + ReLU >kernel. I’ll share the full pipeline in a separate technical blog post soon.
I’ve also started patching Numba for Wasm and have simple scalar u / jit functions >running inside JupyterLite. Array and tensor workloads are the next challenge.
I’m keen to take this further. If you’re working on LLVM, MLIR, Numba, WebAssembly >or browser-native developer tools — or see a real use case for this — I’d be >interested in connecting with teams looking to collaborate, support the work or >explore what we could build together.
Next step is to patch Numba to get scalar jit !: https://www.linkedin.com/feed/update/urn:li:ugcPost:7485014172934541312/?dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287485014751178211329%2Curn%3Ali%3AugcPost%3A7485014172934541312%29
2
u/Individual-Flow9158 Jul 20 '26
Wow. What a time to be alive.
2
u/Grouchy-Trade-7250 Jul 24 '26
Cool. Nontheless most performance sensitive applications have a native app for x86_64 prebuilt that you can download and run. ( tbh on ARM YMMV) . Or they don't run on CPUs at all... Seems like this is targeted at AI somehow. Which runs on custom hardware.
While Linux may be a bit messy and lacking standards lots of games have been released for it now. Im a believer in machine code. And not adding too many layers above it. Sorry.
When you're targeting deveolpers they can be expected to learn how to run something natively rather than a browser tab.
0
u/Outrageous-Sea-9256 Jul 23 '26
To get Numba running in the browser with scalar JIT, you'll need to focus on a few key aspects:
@jitdecorator should be adapted to generate WebAssembly-compatible code.For the array and tensor workloads, you'll face additional challenges due to the complexity of managing large data structures in Wasm. You might need to use techniques like memory pooling or offloading heavy computations to the Web.
Here are some resources and tools that might help:
Good luck with your project, and feel free to reach out if you have more specific questions!