https://github.com/kimmyxpow/jolly-lang
Jolly - A Fun, Fresh Language Compiler for JavaScript!
https://github.com/kimmyxpow/jolly-lang
javascript javascript-compiler jolly jolly-lang typescript
Last synced: 2 months ago
JSON representation
Jolly - A Fun, Fresh Language Compiler for JavaScript!
- Host: GitHub
- URL: https://github.com/kimmyxpow/jolly-lang
- Owner: kimmyxpow
- License: mit
- Created: 2024-11-23T19:55:09.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-25T02:41:13.000Z (6 months ago)
- Last Synced: 2025-01-25T07:26:42.347Z (4 months ago)
- Topics: javascript, javascript-compiler, jolly, jolly-lang, typescript
- Language: TypeScript
- Homepage: https://jolly.pow.kim
- Size: 3 MB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.MD
- License: LICENSE
Awesome Lists containing this project
README
# π Jolly - A Fun, Fresh Language Compiler for JavaScript! π₯³
Welcome to **Jolly**, the happiest way to write and compile JavaScript! π
With Jolly, you can write your code in a **fun, playful syntax** and compile it into plain old JavaScript. Let's make coding a joyful experience again! πβ¨## β οΈ Disclaimer: This is NOT a Serious Project! π
**Jolly** was created purely for fun, learning, and exploration.
If you're looking for a professional-grade language or compiler, this might not be the right choice. π€·ββοΈ
However, if you want to add some joy to your coding life, experiment with playful syntax, or just have a good laugh, Jolly is here for you! π
## π Features
- πͺ **Custom Syntax**: Use playful keywords like `fun` (function), `lock` (const), `loopy` (for), and more!
- β‘ **Fast Compilation**: Blazing fast transpilation to JavaScript.
- π§ **CLI & Programmatic Support**: Use Jolly via the command line or in your Node.js project.
- π¨ **Minify & Prettify**: Automatically beautify or shrink your compiled code.
- π **Clear Error Reporting**: See exactly where your mistakes are with line numbers and helpful hints.## π§ Installation
### Install Globally (for CLI)
To use Jolly as a command-line tool:
```bash
npm install -g @jolly-lang/compiler
```### Install Locally (for Programmatic Use)
To use Jolly in your Node.js projects:
```bash
npm install @jolly-lang/compiler
```## π Usage
### CLI Commands
#### Compile Jolly Files
Compile a `.jolly` file into JavaScript:
```bash
jolly compile path/to/your/file.jolly --output path/to/output.js
```#### Run Jolly Files
Run a `.jolly` file directly:
```bash
jolly run path/to/your/file.jolly
```#### Additional CLI Options:
- `--minify`: Minify the compiled JavaScript.
- `--prettify`: Prettify the compiled JavaScript.### Programmatic Usage
Use **JollyCompiler** in your Node.js projects to compile Jolly code programmatically:
#### Example:
```javascript
import { JollyCompiler } from '@jolly-lang/compiler';const compiler = new JollyCompiler();
const jollyCode = `
lock greeting = "Hello, Jolly!";
console.log(greeting);
`;// Compile Jolly code to JavaScript
const compiledCode = compiler.compile(jollyCode, 'example.jolly');// Output the compiled JavaScript
console.log(compiledCode);
```#### Output:
```javascript
const greeting = 'Hello, Jolly!';
console.log(greeting);
```## ποΈ Jolly Syntax Overview
Hereβs a quick peek at the **Jolly syntax** and its JavaScript equivalents:
| Jolly Keyword | JavaScript Equivalent | Description |
| ------------- | --------------------- | ----------------------------------- |
| `fun` | `function` | Define a function. |
| `lock` | `const` | Declare a constant variable. |
| `free` | `let` | Declare a mutable variable. |
| `fam` | `class` | Create a class. |
| `loopy` | `for` | Create a for loop. |
| `aslong` | `while` | Create a while loop. |
| `when` | `if` | Conditional statement (if). |
| `maybe` | `else if` | Additional condition. |
| `meh` | `else` | Fallback case. |
| `yay` | `return` | Return a value. |
| `pls` | `await` | Await an async task. |
| `call` | `new` | Instantiate a class. |
| `pick` | `switch` | Switch statement for branching. |
| `option` | `case` | Case in a switch statement. |
| `fallback` | `default` | Default case in a switch statement. |## β¨ Example Code
Hereβs how a Jolly file looks compared to JavaScript:
### Jolly:
```jolly
lock score = 85;when (score >= 90) {
console.log("You got an A! π");
} maybe (score >= 80) {
console.log("You got a B! π");
} meh {
console.log("You need to work harder! π’");
}
```### Compiled JavaScript:
```javascript
const score = 85;if (score >= 90) {
console.log('You got an A! π');
} else if (score >= 80) {
console.log('You got a B! π');
} else {
console.log('You need to work harder! π’');
}
```## π Community & Contribution
We believe coding should be fun, fresh, and inclusive. Join us on this journey to make coding a little brighter and more enjoyable!
- Found a bug or have an idea? Open an issue or submit a pull request. π
- Share your love for Jolly by starring the repository! π
- Want to contribute? Check out the [CONTRIBUTING.md](./CONTRIBUTING.md) guide.## π License
**Jolly** is licensed under the [MIT License](./LICENSE). Feel free to use it, modify it, and share it with the world! π
---
> **Letβs bring some joy back into coding with Jolly! ππ» But remember, donβt take this too seriouslyβitβs just for fun! π**