Have you ever wished TypeScript felt more functional? Meet Zenoscript — a new language built with the power of functional programming and the practicality of the TypeScript ecosystem. It compiles directly to TypeScript, meaning there's zero runtime overhead and complete interoperability with existing TS codebases.
🚀 What Is Zenoscript?
Zenoscript is a functional-first programming language that compiles to clean, idiomatic TypeScript. It’s built for developers who want features like pattern matching, structural typing, and immutable data structures—without giving up access to TypeScript libraries or tools.
Highlights:
- ✅ Functional by default — immutable, pure functions, expressive patterns
- ⚡️ Zero runtime dependencies — compiles to plain TS
- 🔁 Seamless TypeScript interop
- 🔧 Modern DX — CLI, REPL, VS Code extension
- 🧪 Built for Bun — fast, lightweight, dev-friendly
🧠 Core Features
🎭 Pattern Matching with Atoms
let handleResponse = match response {
:success(data) => processData(data)
:error(msg) => logError(msg)
:loading => showSpinner()
_ => defaultHandler()
}
🔗 Pipe Operator
Zenoscript makes chaining transformations readable and elegant:
let activeUsers = users
|> filter(user => user.status === :active)
|> map(user => user.name)
|> sort
🧱 Structural Typing with Traits
struct User {
id: number;
name: string;
email: string;
status: UserStatus;
}
trait Serializable {
serialize(): string;
deserialize(data: string): Self;
}
🛡 Immutable by Default
let numbers = [1, 2, 3]
let doubled = numbers |> map(x => x * 2)
// numbers stays unchanged, doubled = [2, 4, 6]
✨ Why Use Zenoscript?
No runtime bloat
Your code compiles straight to efficient TypeScript.Use TS libraries
Import.zs
files directly into Bun + TypeScript projects:
import { User } from "./types.zs"
import { processData } from "./handlers.zs"
-
Great Dev Experience
- Live REPL (
zeno repl
) - VS Code plugin
- Helpful errors
- Hot reloading
- Live REPL (
📦 Getting Started
🛠 Installation
# macOS / Linux
curl -fsSL https://zeno.run/install.sh | bash
# Windows (PowerShell)
iwr https://zeno.run/install.ps1 | iex
# Or via Bun
bun install -g zenoscript
🧪 Your First Project
mkdir my-app && cd my-app
zeno init
bun dev
You’ll get a ready-to-run dev setup with hot reloading.
🧾 Basic Example
// user.zs
struct User {
name: string;
email: string;
status: Symbol;
}
let users = [
{ name: "Alice", email: "[email protected]", status: :active },
{ name: "Bob", email: "[email protected]", status: :inactive }
]
let getActiveUsers = () => users
|> filter(user => user.status === :active)
|> map(user => user.name)
let statusMessage = (status) => match status {
:active => "User is currently active"
:inactive => "User is inactive"
_ => "Unknown status"
}
console.log("Active users:", getActiveUsers())
🔮 What’s Next for Zenoscript?
- ✨ Guard clauses in pattern matching
- 🧠 Smarter type inference and compile-time checks
- 📚 Expanded standard lib with functional utilities
- 🛠 Debug tooling + improved IDE support
- 🕸 WebAssembly compilation targets
💡 Contribute & Explore
Zenoscript is open-source and welcoming contributors:
- GitHub: wess/zenoscript
- VS Code Extension: Available on the releases page
- Docs & Examples: Explore tutorials and example apps
Ready to Try It?
curl -fsSL https://zeno.run/install.sh | bash
zeno init my-app && cd my-app
bun dev
Then explore the language and share what you build! ✨
Let me know what you think of Zenoscript in the comments below. Are you ready to go functional without leaving the TypeScript universe?
✍️ Originally published on zeno.run/blog
🏗 Project site: https://zeno.run
Top comments (1)
I like your design and how you are creative!😀
P.S: I have my own language called faceonescript. Here’s a example: