ambrosia-lang
v1.0.3
Published
[![npm version](https://badge.fury.io/js/ambrosia-lang.svg)](https://www.npmjs.com/package/ambrosia-lang)
Downloads
7
Readme
Ambrosia
A small transpiled programming language similar to Lua.
Contact me for help, because I will respond. Discord: amukh1#9613
Prerequisites
This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ npm -v && node -v
6.4.1
v8.16.0
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Installation
BEFORE YOU INSTALL: please read the prerequisites
To install and set up the library, run:
$ npm install ambrosia-lang
Or if you prefer using Yarn:
$ yarn add --dev ambroisa-lang
Usage
Import the library
import execute from 'ambrosia-lang';
Transpiling to Lua and executing
execute(`
import stdio;
fun main(x) {
return 0;
};
`, 'transpile');
$ Ambrosia-Lua: Hello World!
Compiling to LLVM and executing
Warning The LLVM Compiler is not yet completely implemented, and the version of the language that can be compiled depends heavily on the programming expicitly giving everything types.
console.log(execute(`
import stdio;
fun i32 main(i32 argc, i8** argv) {
return i32 0;
};
`, 'compile'));
$ [LLVM IR]
The language
Imports: [ stdio ]
import stdio;
println("Hello World!");
Functions:
fun name(a,b) {
return a + b;
}
let a = name(1,2);
println(a);
Variables:
let a = 1;
println(a);
If statements:
[Coming soon]
Loops:
[Coming soon]
Contributing
You can contribute to the project by making a pull request on GitHub.
Credits
Amukh1.
Built With
Authors
- Amukh1 - Github / amukh1#9613
See also the list of contributors who participated in this project.
License
MIT License © Amukh1