https://github.com/monkfromearth/monk-lang
A minimalist, readable, and performant language for the modern age
https://github.com/monkfromearth/monk-lang
language programming
Last synced: 2 months ago
JSON representation
A minimalist, readable, and performant language for the modern age
- Host: GitHub
- URL: https://github.com/monkfromearth/monk-lang
- Owner: monkfromearth
- License: mit
- Created: 2024-09-18T13:03:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-27T13:58:44.000Z (5 months ago)
- Last Synced: 2025-09-24T13:55:40.707Z (3 months ago)
- Topics: language, programming
- Language: TypeScript
- Homepage:
- Size: 3.14 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Monk Lang

A minimalist, readable, and performant programming language for the modern age
### **Design Goals:**
- **Performance**: Powered by Bun's ultra-fast JavaScript runtime and native single-executable bundling
- **Readability**: Clean, Python-inspired syntax without unnecessary ceremony
- **Memory Safety**: Simplified borrowing model inspired by Rust
- **Static Type Safety**: First-assignment type inference, optional types, and structural validation
- **Minimal Syntax**: No semicolons, no `func` keyword, clean and concise
- **Error Handling**: Explicit error handling with `guard`/`against`/`throw` patterns
## Quick Start
### Installation
#### Direct Installation
**Linux/macOS:**
```bash
curl -fsSL https://bit.ly/monk-lang | bash
```
or
```bash
curl -fsSL https://raw.githubusercontent.com/monkfromearth/monk-lang/main/install.sh | bash
```
**Windows:** Download from [GitHub Releases](https://github.com/monkfromearth/monk-lang/releases/latest)
#### Package Managers (Recommended)
**Homebrew (macOS/Linux):**
```bash
brew install monkfromearth/monk-lang/monk-lang
```
**APT (Ubuntu/Debian):**
```bash
# Add repository (one-time setup)
curl -fsSL https://monk-lang.github.io/apt/gpg.key | sudo apt-key add -
echo "deb https://monk-lang.github.io/apt stable main" | sudo tee /etc/apt/sources.list.d/monk-lang.list
# Install
sudo apt update
sudo apt install monk-lang
```
**Chocolatey (Windows):**
```bash
choco install monk-lang
```
**Snap (Linux):**
```bash
sudo snap install monk-lang
```
#### Build from Source
```bash
git clone https://github.com/monkfromearth/monk-lang.git
cd monk-lang
bun install && bun run build
```
### VS Code / Cursor / Windsurf Extension
Get the official VS Code extension from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=monkfromearth.monk-lang) for syntax highlighting, autocomplete, and integrated development features:
```bash
code --install-extension monkfromearth.monk-lang
```
### Hello World
```monk
const message = "Hello, World!"
show(message)
```
```bash
monk run hello.monk
```
### Interactive REPL
```bash
monk repl
```
## Language Features
✅ **Core Language**
- Variables and constants (`let`, `const`)
- All basic data types (numbers, strings, booleans, references)
- Arithmetic, comparison, and logical operators
- Control flow (if/else, while, for loops)
- Functions with closures and recursion
- References and memory safety
- Comprehensive error handling
✅ **Static Type System**
- First-assignment type inference with enforcement
- Optional types with `?` syntax (`int?`, `string?`, arrays)
- Definite assignment analysis preventing uninitialized reads
- Array and record element type enforcement
- Function return type validation across all paths
- Closed record literals with structural validation
- Property access validation with static errors
- Multi-line record literals with proper syntax support
✅ **Development Tools**
- Command-line interface with linting and formatting
- Interactive REPL
- VS Code extension with syntax highlighting
- Comprehensive linting and formatting system
- Complete test suite (491 tests passing)
## Documentation
📚 **[Complete Documentation](docs/website/docs/intro.md)** - Comprehensive guides and tutorials
Quick Links:
- **[Getting Started](docs/website/docs/getting-started/)** - Installation and first steps
- **[Language Reference](docs/website/docs/language-reference/)** - Complete language documentation
- **[Development Tools](docs/website/docs/development-tools/)** - LSP, linting, formatting, and more
- **[Built-in Functions](docs/website/docs/builtin-functions/)** - Complete function reference
- **[Examples](examples/index.md)** - 20 comprehensive example programs
## Development
```bash
bun run test # Run comprehensive test suite (491 tests)
bun run dev # Development mode with file watching
bun run lint # Code linting with Monk's built-in linter
bun run format # Code formatting with Monk's formatter
monk lint src/ # Lint Monk source files
monk format src/ # Format Monk source files
```
## Contributing
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
**Quick Steps:**
1. Fork the repository
2. Create a feature branch
3. Add tests for new features
4. Ensure all tests pass (`bun run test`)
5. Submit a pull request
## More Information
- **[Language Specification](ABOUT.md)** - Complete language design and syntax
- **[Build Guide](docs/development/build-guide.md)** - Detailed build instructions
- **[Development Tasks](docs/development/tasks.md)** - Implementation roadmap
- **[Changelog](CHANGELOG.md)** - Release history
## License
MIT License - see [LICENSE](LICENSE) for details.
---
Happy coding with Monk! 🕯️
Candle icons created by Freepik - Flaticon
---