kofigumbs / Codec Beam
Licence: other
Generate Erlang VM byte code from Haskell
Stars: ✭ 152
Programming Languages
Projects that are alternatives of or similar to Codec Beam
Lumen
An alternative BEAM implementation, designed for WebAssembly
Stars: ✭ 2,742 (+1703.95%)
Mutual labels: compiler, beam
Redacted Compiler Plugin
A Kotlin compiler plugin that generates redacted toString() implementations.
Stars: ✭ 168 (+10.53%)
Mutual labels: compiler, codegen
Lightbeam
Lightbeam has moved and now lives in the Wasmtime repository!
Stars: ✭ 253 (+66.45%)
Mutual labels: compiler, codegen
Gatsby Plugin Typegen
High-performance TypeScript/Flow code generation for GatsbyJS queries.
Stars: ✭ 144 (-5.26%)
Mutual labels: codegen
Ebooks
A repository for ebooks, including C, C plus plus, Linux Kernel, Compiler, OS, Algorithm, Security, Database, Network, ML and DL
Stars: ✭ 151 (-0.66%)
Mutual labels: compiler
Crust
C compiler toolchain in Rust. [WIP, early development stage]
Stars: ✭ 150 (-1.32%)
Mutual labels: compiler
Glslang
Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Stars: ✭ 2,034 (+1238.16%)
Mutual labels: compiler
Typelang
🌳 A tiny language interpreter implemented purely in TypeScript's type-system
Stars: ✭ 149 (-1.97%)
Mutual labels: compiler
Xcassetpacker
A command line tool for converting a folder of images into an .xcasset package for Xcode
Stars: ✭ 150 (-1.32%)
Mutual labels: codegen
Prom ex
An Elixir Prometheus metrics collection library built on top of Telemetry with accompanying Grafana dashboards
Stars: ✭ 149 (-1.97%)
Mutual labels: beam
Assemblyscript
A TypeScript-like language for WebAssembly.
Stars: ✭ 13,152 (+8552.63%)
Mutual labels: compiler
NOTE: Participation is encouraged! Make issues, ask questions, submit pull requests (even if it’s your first time contributing to open-source — you’ll get lots of help), and give feedback!
Erlang VM byte code assembler for implementing compile-to-beam languages. The goal is to a provide delightful API for generating BEAM instructions from pure Haskell.
Usage
This example writes a simple module to a file:
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.ByteString.Lazy as LBS
import Codec.Beam.Instructions (func_info, label, move, return')
import qualified Codec.Beam as Beam
main :: IO ()
main =
LBS.writeFile "test_module.beam" $
Beam.encode "test_module"
[ Beam.export "tuple_of_one" 0
]
[ label (Beam.Label 1)
, func_info "tuple_of_one" 0
, label (Beam.Label 2)
, move (Beam.Tuple [Beam.Integer 1]) (Beam.X 0)
, return'
]
After you run that program, you can load the resulting module from the Erlang shell!
$ erl
1> l(test_module).
2> test_module:tuple_of_one().
{1}
You can find a small example on GitHub and a larger one in my elm-beam
project.
Build
Use Stack:
stack build --test
Acknowledgements
Thanks to the following projects, which helped me understand the BEAM file format:
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].