GithubHelp home page GithubHelp logo

leostera / lam Goto Github PK

View Code? Open in Web Editor NEW
252.0 14.0 15.0 21.04 MB

:rocket: a lightweight, universal actor-model vm for writing scalable and reliable applications that run natively and on WebAssembly

Home Page: https://lam.run/manual

License: Apache License 2.0

Rust 82.35% Erlang 0.50% Assembly 1.34% C 0.09% Makefile 0.60% JavaScript 5.01% Shell 0.42% TLA 2.94% Handlebars 6.74%
beam erlang virtual-machine webassembly native actor-model runtime-system vm elixir actor-machine wasm

lam's Introduction

LAM logo

ย 

Main workflow

LAM is a lightweight, universal virtual machine for writing scalable and reliable applications that run natively and on WebAssembly.

It is inspired by Erlang and Lua, and it is compatible with the Erlang VM.

LAM lets you reuse the same programming paradigm, known for being productive, across your entire application stack.

Come join us on Discord! (Ps: we share a server with Caramel)

Features

  • Runs Natively and on WebAssembly -- pick and choose your runtime!
  • Easy to Target -- a small and specified bytecode with a text and binary format
  • Erlang VM compatibility -- run your existing Erlang, Elixir, Caramel, and Gleam code
  • Seamless multi-core -- built to scale from one to thousands of cores for free
  • Extreme reliability -- use Erlang's OTP supervision patterns

Status

Still under heavy development!

There's plenty of work to be done for it to be fully usable, but we keep a few tracking issues here:

The Erlang and Elixir ecosystem compatibility is tracked here:

Getting Started

You can download the latest binary from the releases page. After unpacking it you should be able to add it to your PATH env and start playing around with the lam binary.

Like this:

# in this example I'm running linux with glibc
$ wget https://github.com/AbstractMachinesLab/lam/releases/download/v0.0.7/lam-v0.0.7-x86_64-unknown-linux-gnu.tar.gz
$ tar xzf lam-*
$ export PATH=$(pwd)/lam/bin:$PATH

Now we can do a quick test. Make a file test.erl with this contents:

-module(test).

-export([main/1]).

main([]) -> ok;
main([Name|T]) ->
  io:format(<<"Hello, ~p!\n">>, [Name]),
  main(T).

And we can compile it to BEAM byte code and use LAM to build a binary for it, like this:

$ erlc test.erl
$ lam build test.beam --output test.exe --target native --entrypoint test
$ ./test.exe Joe Robert Mike
Hello, Joe!
Hello, Robert!
Hello, Mike!

How does it work?

LAM compiles your .beam files ahead of time into a representation that's optimized for running them.

Then it bundles that with the appropriate target runtime into some binary output.

                       binary
                    instructions
                   +------------+              output
 .beam files +---->| 1001101110 |-----+    +-----------+
                   +------------+     |    | .exe      |
                                      |--->| .wasm     |
                   +-------------+    |    | .wasm/.js |
                   | LAM RunTime |----+    +-----------+
                   +-------------+

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.