A Ruby-inspired programming language that compiles to JavaScript
# Clone the repository
git clone https://github.com/mostypc123/duck.git
# Navigate to compiler directory
cd duck/compiler
# No need to install dependencies
- Create a file
hello.duck
:
mainfunc;
console "Hello Duck!";
end;
- Run it:
npm run compile -- --run hello.duck
- 🎯 Ruby-inspired syntax for JavaScript ecosystem
- 🚀 Direct compilation to JavaScript
- 📦 Support for JavaScript libraries (WIP)
- 🔍 Built-in run support
- 🛠️ Type declarations
- 🌈 Simple and expressive function syntax
# Just compile
npm run compile yourfile.duck
# Compile and run (method 1)
npm run compile-run yourfile.duck
# Compile and run (method 2)
npm run compile -- --run yourfile.duck
Duck supports importing any JavaScript library:
import express {app}; // NPM packages
import fs {fileSystem}; // Node.js built-ins
Note: While you can import any JavaScript library, full functionality depends on implementing corresponding Duck language features.
Check out examples/
directory for sample programs, including:
hello_world.duck
- Basic hello world- More examples coming soon!
Duck is currently in early development. Features being worked on:
- Enhanced type system
- Array support
- Object support
- More control structures
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Inspired by Ruby's elegant syntax
- Built with Node.js
Got questions? Found a bug? Open an issue!