Quick Start
Get up and running with MetaScript in under 5 minutes. No complex setup required.
1. Create a new project
Run the create command to scaffold a new MetaScript project:
npm create metascript@latest my-app2. Navigate to your project
Change into the project directory:
cd my-app3. Run the dev server
Start the development server with hot reload:
npm run dev4. Write your first MetaScript
Open src/main.ms and try the @derive macro:
@derive(Eq, Clone, Debug)
class User {
name: string
age: number
}
const alice = new User(name: "Alice", age: 30)
const clone = alice.clone()
console.log(alice.equals(clone)) // true
console.log(alice.toString()) // User { name: "Alice", age: 30 }Pro tip: Run msc expand src/main.ms to see what code the @derive macro generates. This is a great way to understand how compile-time metaprogramming works.
What's Next?
- Three Runtimes - Learn how to compile to C, JS, or Erlang
- Compile-Time Power - Master @derive, @comptime, and custom macros