Ymir is a modern programming language inspired by Norse mythology, designed to be powerful and efficient for quantum computing simulations. Ymir combines Python's ease of use with Go's concurrency model, featuring advanced mathematical support with GPU acceleration.
- LLVM-Powered Execution: JIT compilation via LLVM for high-performance native code execution
- Intuitive Hybrid Syntax: Clean syntax combining Python's readability with Go's structure
- Go-Style Concurrency: Spawn tasks and communicate via channels for easy parallel processing
- GPU-Accelerated Matrix Operations: Built-in matrix support powered by JAX with automatic CPU fallback
- Async HTTP Server & Client: Built on aiohttp for high-performance web applications
- Go-Style Package Management: Install dependencies directly from GitHub/GitLab repos
- Type Safety: Strongly typed with type inference and checking
- Dual Execution Modes: LLVM compilation (default) or pure interpretation for debugging
- Standard Library: Comprehensive stdlib including math, HTTP, server, collections, and more
- Cross-Platform: Runs on Linux, macOS, and Windows
brew tap bjornaer/ymir
brew install ymir
# to add gpu support, also install jax
pip install jax jaxlibOr install from source
poetry build
pipx install /Users/YOUR_NAME/ymir/dist/ymir-X.X.X-py3-none-any.whl --force
which ymirTo develop Ymir, use the package manager Poetry:
pip install poetryClone the repository and install dependencies:
git clone https://github.com/bjornaer/ymir.git
cd ymir
poetry installmodule example
func worker(id: int, ch: any) {
result = id * 2
ch <- result # Send to channel
}
func main() {
ch = make_channel(10)
# Spawn concurrent tasks
spawn worker(1, ch)
spawn worker(2, ch)
# Receive results
result1 <- ch
result2 <- ch
print("Results: " + str(result1) + ", " + str(result2))
}
module matrix_example
func main() {
# Check GPU availability
if matrix_gpu_available() {
print("GPU available!")
}
# Matrix operations
a = [[1.0, 2.0], [3.0, 4.0]]
b = [[5.0, 6.0], [7.0, 8.0]]
result = a @ b # Matrix multiplication
print(str(result))
}
module server_example
import stdlib.server
func handle_hello(request: Request) -> Response {
return Response(200, "Hello, World!")
}
func main() {
server = HTTPServer("0.0.0.0", 8080)
server.route("/hello", handle_hello)
server.run()
}
Ymir compiles and executes scripts using LLVM by default for maximum performance, if Ymir is installed simply execute the commands, otherwise prefix the commands with poetry run
# Run with LLVM compilation (default)
ymir run examples/main.ymr
# Run with interpreter mode (useful for debugging)
ymir run examples/main.ymr --interpreter
# or shorthand:
ymir run examples/main.ymr -i
# Skip standard library loading for faster startup
ymir run examples/main.ymr --no-stdlib
# Set execution mode explicitly
ymir run examples/main.ymr --mode llvm # LLVM only (fail if compilation fails)
ymir run examples/main.ymr --mode interpret # Pure interpretation
ymir run examples/main.ymr --mode auto # Try LLVM, fallback to interpreterYmir supports dual execution modes for flexibility and performance:
- JIT compilation for maximum performance
- Automatically falls back to interpreter for unsupported features
- Best for production use
- Supports: functions, arithmetic, control flow, basic types
- Pure Python interpretation
- Full feature support including concurrency, async, networking
- Better error messages for debugging
- Slower but more flexible
ymir run script.ymr # Auto mode: LLVM with fallback (recommended)
ymir run script.ymr --mode llvm # LLVM only: fail on unsupported features
ymir run script.ymr -i # Interpreter only: full feature supportSee LLVM_STATUS.md for detailed feature support and known issues.
Build Ymir scripts into standalone executables:
ymir build examples/main.ymr --output dist/myapp# Add a dependency from GitHub/GitLab
ymir add github.com/user/awesome-lib
# Install all dependencies
ymir install
# List dependencies
ymir list
# Remove a dependency
ymir remove awesome-libWe welcome contributions to Ymir! Please read our CONTRIBUTING.md for guidelines on how to contribute.
Ymir is licensed under the MIT License. See the LICENSE file for more information.
For any questions or feedback, please feel free to open an issue or contact me at max@schlk.in.

