An experimental hack to run other languages than python in solve.it.com.
- Python 3.12+
- https://solve.it.com
!pip install -U bridgeitBridgeIt enables running non-Python languages in SolveIt notebooks through a three-step process:
-
Compiler Installation: Automatically installs language compilers and toolchains (e.g., evcxr for Rust, Mojo via pixi)
-
Kernelspec Registration: Registers Jupyter kernelspecs that define how to execute each language
-
Cell Magic Binding: Creates IPython cell magics (e.g.,
%%rust,%%mojo) that bridge notebook cells to the installed kernels
When you use %%rust or %%mojo, BridgeIt sends your code to the appropriate kernel for execution and displays the results inline.
import bridgeit
# Show available commands
bridgeit.help()
# List supported languages
bridgeit.langs()# Install Rust kernel
bridgeit.install("rust")
# Activate Rust magic
bridgeit.use("rust")%%rust
fn main() {
println!("Hello from Rust 🦀");
}
main()%%rust
let value = 21;
println!("{}", value * 2);# Install Mojo kernel
bridgeit.install("mojo")
# Activate Mojo magic
bridgeit.use("mojo")%%mojo
fn main():
print("Hello from Mojo 🔥")
main()%%mojo
alias value = 10
print(value * 3)Apache 2.0