Code Monkey home page Code Monkey logo

amber's Introduction

amber logo

Amber

Programming language that compiles to Bash. It's a high level programming language that makes it easy to create shell scripts. It's particularly well suited for cloud services.

Warning

This software is not ready for extended usage.

Join our Discord or #amber-lang on irc.oftc.net (irc://irc.oftc.net/#amber-lang) or Join our Matrix room

Install

Amber compiler currently works on:

  • Linux x86 and ARM
  • macOS x86 and ARM (Apple Silicon)
  • Nix (NixOS)

macOS / Linux

Make sure that the operating system meets the following prerequisites

  • Bourne-again shell (Bash)
  • Curl tool for downloading the installation script
  • Basic calculator bc command (On Debian run sudo apt install bc)

system-wide install

curl -s "https://raw.githubusercontent.com/Ph0enixKM/AmberNative/master/setup/install.sh" | /bin/bash

local-user install

curl -s "https://raw.githubusercontent.com/Ph0enixKM/AmberNative/master/setup/install.sh" | /bin/bash -s -- --user

Via a package manager

Amber is packaged in the following distros:

Arch (AUR) - amber-bash-bin

Nix

See NIX.md

Windows support

As windows does not come with bash installed it makes no sense to support it. Please install WSL 2 on your windows machine and install Linux version of Amber compiler inside.

In order for it to work you may need to run the following code that pulls all the prerequisites.

sudo apt install curl bc
sudo mkdir /opt /usr/local/bin

Contributing

In order to contribute, you have to add couple of build targets:

rustup target add x86_64-unknown-linux-musl
rustup target add x86_64-apple-darwin
rustup target add x86_64-pc-windows-gnu
rustup target add aarch64-apple-darwin

And linkers (macos):

brew install messense/macos-cross-toolchains/aarch64-unknown-linux-musl
brew install messense/macos-cross-toolchains/x86_64-unknown-linux-gnu

Compile it:

git clone https://github.com/Ph0enixKM/Amber
cd Amber
cargo build

In order to build the installer scripts run:

amber build.ab

Debugging Amber:

// Shows the AST
AMBER_DEBUG_PARSER=true cargo run <file.ab>
// Shows the time it took to compile each phase
AMBER_DEBUG_TIME=true cargo run <file.ab>

// Flamegraph is a profiling tool that is used to visualize the time each function took to execute
sudo cargo flamegraph -- <file.ab> <file.sh>

Github Actions

We are using cargo-dist to build the binaries for all the platforms. The binaries are then uploaded to the release page once a new release a tag is created.

amber's People

Contributors

ph0enixkm avatar b1ek avatar mte90 avatar arapower avatar kilianc avatar akihiro17 avatar soumyadghosh avatar karshprime avatar cymdeveloppement avatar klausi avatar federicoceratto avatar clysto avatar brumik avatar boushley avatar lxl66566 avatar aleksrutins avatar martan404 avatar pmbuko avatar ramseyharrison avatar mimikun avatar plbertrand avatar setop avatar uncenter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.