Skip to content

Instantly share code, notes, and snippets.

Created May 13, 2022 23:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
First Letlang module compiled
mod symbol_a {
use llcore_runtime::*;
pub fn const_a(context: Arc<Mutex<Context>>) -> Value {
pub mod symbol_main {
use llcore_runtime::*;
pub struct func_main;
impl Function for func_main {
fn call(&self, context: Arc<Mutex<Context>>, args: Vec<Value>) -> FunctionContinuation {
async fn code_block(
co: FunctionCoroutine,
context: Arc<Mutex<Context>>,
args: Vec<Value>,
) -> Value {
let args_type = types::TupleType {
members_types: vec![],
let return_type = types::ValueType { llval: PrimitiveValue::Atom(context.lock().unwrap().get_atom("@ok")) };
let args_tuple = Value::Tuple(args);
format!("function main expected {}", args_type.to_string(context.clone())),
let result = Value::Primitive(PrimitiveValue::Atom(context.lock().unwrap().get_atom("@ok")));
format!("function main should return {}", return_type.to_string(context.clone())),
FunctionContinuation::new_boxed(|co| code_block(co, context, args))
module "hello.main";
const a := 42;
pub func main() -> @ok {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment