Skip to content

A small multi-paradigm transpiled (soon compiled) programming language. 💫

Notifications You must be signed in to change notification settings

amukh1/ambrosia-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version

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

About

A small multi-paradigm transpiled (soon compiled) programming language. 💫

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published