create-milost-app
Create MiLost apps with WASM and SharedArrayBuffer support out of the box
Create MiLost applications with WebAssembly, WebGL, and SharedArrayBuffer support out of the box.
You don't need to install this package globally. Use npx:
npx create-milost-app my-app
npx create-milost-app my-app
npx create-milost-app my-app --ui
Every MiLost app created includes:
- ✅ WebAssembly acceleration - 10-100x performance boost
- ✅ SIMD support - 1.7-4.5x additional speedup
- ✅ SharedArrayBuffer threading - Multi-threading support
- ✅ WebGL rendering - Hardware-accelerated UI
- ✅ Web Workers - Automatic parallelization
- ✅ Hot reload - Instant feedback during development
my-app/
├── src/
│ ├── main.ts # Application entry point
│ ├── internal/
│ │ └── bootstrap.ts # WASM/WebGL initialization
│ └── views/
│ └── MainView.ts # UI components (--ui mode)
├── public/
│ └── index.html # HTML template (--ui mode)
├── package.json
└── tsconfig.json
npm run dev # Start dev server with hot reload
npm run build # Build for production
npm run start # Start production server
npm run type-check # TypeScript type checking
npm run clean # Clean build artifacts
UI applications automatically use milost-dev-server
which provides:
- Automatic CORS headers for SharedArrayBuffer
- WebSocket-based hot reload
- WASM streaming compilation
- Proper MIME types for all assets
- Zero configuration required
- Basic WASM: 100% of modern browsers
- SIMD acceleration: 85%+ of browsers
- SharedArrayBuffer: ~70% of browsers (with proper headers)
- WebGL: 98%+ of browsers
- Automatic fallbacks ensure 100% compatibility
import { Vec, Option, Result } from 'milost';
const numbers = Vec.from([1, 2, 3, 4, 5]);
const doubled = numbers.batchMap(x => x * 2);
console.log('Doubled:', doubled.toArray());
import { MiLostUI, View, Text, VStack } from 'milost/ui';
export class MainView extends View {
build() {
return VStack([
Text('Hello from WebGL!').fontSize(24),
Text('Powered by MiLost').color('#667eea')
]).padding(20);
}
}
- Node.js >= 16.0.0
- Modern browser with WebAssembly support
MIT