daniele-rapagnani / melon

The Melon programming language

Home Page:https://daniele-rapagnani.github.io/melon/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Melon is a small and modern programming language

CI Status

Actions Status Actions Status Actions Status Actions Status

What's Melon?

Melon attempts to combine the best features of popular high-level languages in something that feels modern but is still small and light enough to be easy to embed in your project. It's inspired mainly by ES6 JavaScript, Lua, Wren, Python and Ruby.

It looks like this:

let Language = {
    create = |name|  => {
        return { name = name } @ Language;
    },
    
    getName = -> {
        return this.name;
    }
};

let Melon = {
    create = => {
        return { } @ Melon;
    },
    
    helloWorld = -> {
        io.print("Hello world " .. this->getName() .. "!");
    }
} @ Language.create("Melon");

let melon = Melon.create();
melon->helloWorld();

Features

  • A simple but functional module system
  • Good for soft realtime applications such as games: it sports an incremental generational GC
  • Native integer and array types allow for faster code
  • Support for bytecode generation, you don't need to distribute your source files
  • Full support for operator overloading using ES6-style symbols
  • Prototype based: doesn't enforce the OOP paradigm while still making it possible
  • Dynamic typing without implicit conversions: lower chance of unintended behaviour
  • Entirely written in C, the number of dependencies can be counted on one hand
  • Extensive unit tests for both the VM and language

Where to start

Melon is very young and there's still no documentation available. At the moment you can get a taste for the language by browsing the unit tests.

Platforms

Melon supports the following platforms:

  • macOS
  • Linux (32/64bit)
  • Windows (MinGW-w64, 32/64bit)
  • Emscripten

Compiling

Melon uses CMake so you can use the standard way of building CMake projects:

mkdir build && cd build
cmake ..
make

Emscripten

Just run CMake with emcmake and you are good to go:

mkdir build && cd build
emcmake cmake ..
make

MinGW

In order to link Melon and its binaries with MinGW-w64 you'll need the lld linker. You can install it on MSYS2 with: pacman -S mingw-w64-x86_64-lld or pacman -S mingw-w64-i686-lld depending on your architecture.

Disclaimer

Melon is still in alpha and it's certainly not ready for production! In the unlikely event that you are considering it for your project, please keep in mind that development is very active and nothing is written in stone at the moment.

About

The Melon programming language

https://daniele-rapagnani.github.io/melon/

License:MIT License


Languages

Language:C++ 74.6%Language:C 17.7%Language:CMake 3.8%Language:Python 2.3%Language:Objective-C++ 0.2%Language:JavaScript 0.2%Language:MAXScript 0.2%Language:Lua 0.2%Language:Ruby 0.2%Language:Shell 0.2%Language:Roff 0.1%Language:PHP 0.1%Language:Objective-C 0.1%Language:Batchfile 0.1%Language:PowerShell 0.0%Language:Dockerfile 0.0%Language:Makefile 0.0%