v0.3 is a complete architectural rewrite using modern tooling:
- Deno replaces Node.js/npm
- ReScript for type-safe business logic
- WASM (Rust) for performance-critical code
- TypeScript as glue layer
Your data remains 100% compatible.
Before (v0.2):
npm install
node src/cli.js reportAfter (v0.3):
# No installation needed!
deno task report
# Or use just (recommended)
just reportBefore (v0.2):
import { createMapper } from './src/index.js';After (v0.3):
import { createMapper } from './src/index.ts'; // .ts extensionBefore (v0.2):
- package.json with npm dependencies
- node_modules folder
- Zod for validation
After (v0.3):
- deno.json with JSR imports
- No node_modules
- WASM for validation (10-100x faster)
- ReScript for business logic
Before (v0.2): No build needed (pure JS)
After (v0.3):
# Build ReScript + WASM
just build
# Or separate
deno task rescript:build
deno task wasm:build- Deno (required)
curl -fsSL https://deno.land/install.sh | sh- Rust (for WASM compilation)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown- ReScript (for business logic compilation)
npm install -g rescript # One-time global install- just (optional but recommended)
cargo install just# Using just (recommended)
just setup
just build
# Or using Deno tasks
deno task rescript:build
deno task wasm:buildBefore (v0.2): Zod runtime validation (~1ms per experience) After (v0.3): WASM validation (~0.01ms per experience)
100x faster validation
Before (v0.2): JavaScript (~50ms for 1000 experiences) After (v0.3): WASM (~5ms for 1000 experiences)
10x faster network generation
Before (v0.2): ~50MB for 1000 experiences After (v0.3): ~20MB for 1000 experiences (ReScript optimization)
60% less memory
just compile
./bin/ubicity report # Standalone binary!No Deno runtime needed for deployment.
ReScript provides compile-time type checking:
// This won't compile if types don't match
let experience = LearningExperience.make(
~learner=invalidLearner, // Compile error!
~context=context,
~experience=exp,
()
)// Immutable data, pure functions
let interdisciplinary = experiences
->Analysis.findInterdisciplinary
->Array.map(formatForDisplay)
->Array.filter(meetsThreshold)No tsconfig.json, no webpack, no babel.
Just deno.json and you're done.
# Deno
curl -fsSL https://deno.land/install.sh | sh
# Rust (for WASM)
curl https://sh.rustup.rs -sSf | sh
rustup target add wasm32-unknown-unknown
# ReScript
npm install -g rescript
# just (optional)
cargo install justjust setup
just build# Your data is still in ./ubicity-data/
just stats # Should show your existing experiencesjust test # Or: deno task testOld (v0.2):
npm run capture
npm run report
npm run visualizeNew (v0.3):
just capture
just report
just viz✅ 100% Compatible
All v0.2 experience files work in v0.3 without modification.
The JSON schema is identical. Only the runtime changed.
Install Deno:
curl -fsSL https://deno.land/install.sh | sh
# Add to PATH
echo 'export PATH="$HOME/.deno/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcInstall Rust and wasm32 target:
rustup target add wasm32-unknown-unknownInstall globally:
npm install -g rescriptDeno requires explicit permissions:
deno run --allow-read --allow-write src/cli.ts reportOr use the tasks (permissions pre-configured):
deno task reportIf v0.3 doesn't work for you, v0.2 code is still available:
git checkout tags/v0.2.0
npm install
npm testYour data works with both versions.
| Operation | v0.2 (Node.js) | v0.3 (Deno+WASM) | Improvement |
|---|---|---|---|
| Validation | 1.2ms | 0.012ms | 100x |
| Load 1000 | 45ms | 15ms | 3x |
| Network Gen | 52ms | 5ms | 10x |
| Hotspots | 8ms | 3ms | 2.7x |
| Full Report | 180ms | 45ms | 4x |
┌─────────────────────────────────────────────┐
│ Deno Runtime (TypeScript) │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ CLI/API │◄──────►│ Storage │ │
│ └──────┬───────┘ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────┐ │
│ │ TypeScript Glue Layer │ │
│ └────┬──────────────────┬──────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ ReScript │ │ WASM │ │
│ │ Business │ │ Performance│ │
│ │ Logic │ │ Critical │ │
│ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────┘
ReScript: Type-safe business logic (functional) WASM (Rust): Validation, analysis, computations TypeScript: Glue layer, I/O, CLI
just capture quick
just report
just vizsrc-rescript/UbiCity.res- Functional business logicwasm/src/lib.rs- Performance-critical Rustsrc/storage.ts- Deno file I/Osrc/*-bridge.ts- Integration glue
README.md- Updated architecture overviewjustfile- All available commandsdeno.json- Configuration and tasks
Q: Why Deno over Node.js? A: Built-in TypeScript, secure by default, modern tooling, no node_modules.
Q: Why ReScript over TypeScript? A: Stronger type system, better optimization, functional programming, OCaml heritage.
Q: Why WASM? A: 10-100x faster than JavaScript for computation-heavy tasks.
Q: Can I still use v0.2? A: Yes, it's still maintained. But v0.3 is recommended.
Q: Do I need to rebuild WASM every time?
A: No, only when you modify wasm/src/lib.rs.
Q: What if I don't have Rust installed? A: Pre-compiled WASM binaries will be provided in releases.
Issues: https://github.com/Hyperpolymath/ubicity/issues Discussions: https://github.com/Hyperpolymath/ubicity/discussions
Ready to migrate?
just setup
just build
just test
just reportWelcome to UbiCity v0.3! 🚀