A powerful semantic parser for Lojban that converts Lojban text into logical forms and canonical representations.
Live Demo: https://lojban.github.io/tersmu/ (or your GitHub Pages URL)
The web application runs entirely in your browser using WebAssembly, with two implementations to choose from:
- Haskell: Original implementation
- Rust: High-performance port
- Semantic Parsing: Converts Lojban text to logical forms
- Canonical Form: Generates normalized Lojban output
- Graph Visualization: Interactive semantic graph rendering
- Dual Implementation: Switch between Haskell and Rust parsers
- Browser-Based: No server required, runs via WebAssembly
Visit the live demo or run locally:
cd wasm-web-app
python3 -m http.server 8000
# Open http://localhost:8000cd rust
cargo build --release
./target/release/tersmu "mi klama le zarci"cabal build
cabal run tersmu -- "mi klama le zarci"For Haskell:
- GHC 9.x
- Cabal 3.x
- Docker (for WASM builds)
For Rust:
- Rust 1.70+
- wasm-bindgen-cli (for WASM builds)
Haskell WASM:
./build_wasm.shRust WASM:
cd rust
cargo build --release --target wasm32-unknown-unknown --lib
wasm-bindgen \
--target web \
--out-dir ../wasm-web-app \
--out-name tersmu-rust \
target/wasm32-unknown-unknown/release/tersmu.wasmThe project uses GitHub Actions to automatically build and deploy both implementations to GitHub Pages.
Workflow: .github/workflows/deploy-wasm.yml
On every push to master:
- Builds Haskell WASM (~9MB)
- Builds Rust WASM (~200KB)
- Packages web application
- Deploys to GitHub Pages
See CI/CD Documentation for details.
tersmu/
├── .github/
│ ├── workflows/
│ │ └── deploy-wasm.yml # CI/CD pipeline
│ └── CI-CD.md # Pipeline documentation
├── rust/ # Rust implementation
│ ├── src/
│ │ ├── lib.rs
│ │ ├── wasm.rs # WASM bindings
│ │ └── ...
│ └── Cargo.toml
├── wasm-web-app/ # Web application
│ ├── index.html # Main UI with tab switcher
│ ├── tersmu.js # Haskell WASM wrapper
│ ├── tersmu-rust-wrapper.js # Rust WASM wrapper
│ ├── tree-viz.js # Graph visualization
│ ├── DEPLOYMENT.md # Deployment guide
│ └── .nojekyll # GitHub Pages config
├── Dockerfile.wasm # Haskell WASM build
├── build_wasm.sh # Haskell build script
└── tersmu.cabal # Haskell project file
Rust:
cd rust
cargo testHaskell:
cabal testcd wasm-web-app
python3 -m http.server 8000| Feature | Haskell | Rust |
|---|---|---|
| WASM Size | ~9 MB | ~200 KB |
| Load Time | 3-5 sec | <1 sec |
| Build Time | 15-20 min | 2-3 min |
| Parse Speed | Fast | Fast |
| Maturity | Original | Port |
Both implementations produce identical output.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
The CI/CD pipeline will automatically build and test your changes.
- CI/CD Pipeline - Automated build and deployment
- Deployment Guide - GitHub Pages setup
- Rust Implementation - Rust-specific documentation
- Chrome/Edge 57+
- Firefox 52+
- Safari 11+
Requires WebAssembly support.
GPL-3.0
- Lojban.org - Official Lojban website
- Lojban Wiki - Community wiki
- Discord - Live chat
Built with:
- GHC WebAssembly Backend
- wasm-bindgen
- Cytoscape.js - Graph visualization