Skip to content

Instantly share code, notes, and snippets.

View leostera's full-sized avatar
🛠️
ars longa vita brevis

Leo Ostera leostera

🛠️
ars longa vita brevis
View GitHub Profile
use anyhow::*;
use std::collections::HashMap;
use std::collections::HashSet;
use std::path::PathBuf;
use zap_core::{Action, Artifact, ComputedTarget, Label, Rule, Target, ToolchainManager};
use zap_toolchains::ErlangToolchain;
#[derive(Debug, Clone)]
pub struct ErlangLibrary {
label: Label,
.file ""
.section .rodata.cst8,"a",@progbits
.align 16
caml_negf_mask:
.quad 0x8000000000000000
.quad 0
.align 16
caml_absf_mask:
.quad 0x7fffffffffffffff
.quad -1
use anyhow::{anyhow, Context, Error};
use std::fmt;
mod ffi;
#[derive(Clone, Debug)]
pub enum Sexp {
Atom(String),
List(Vec<Sexp>),
Nil,
use anyhow::{anyhow, Context, Error};
use std::fmt;
mod ffi;
#[derive(Clone, Debug)]
pub enum Sexp {
Atom(String),
List(Vec<Sexp>),
Nil,
use anyhow::{anyhow, Context, Error};
use std::fmt;
mod ffi;
#[derive(Clone, Debug)]
pub enum Sexp {
Atom(String),
List(Vec<Sexp>),
Nil,
use anyhow::{anyhow, Context, Error};
use std::fmt;
mod ffi;
#[derive(Clone, Debug)]
pub enum Sexp {
Atom(String),
List(Vec<Sexp>),
Nil,
./node_modules/.bin/prettier --write grammar.js
grammar.js 61ms
tree-sitter generate
tree-sitter test
s_expressions:
✗ atom
✓ empty
✓ single line
✓ multiple parts
✓ nested s-expressions
import load_lam from "./fib.js";
import run_js from "./fib_in_js.js";
document.onclick = () => {
run_js().then((_) => load_lam().then(lam => {
const run = () => {
lam.step();
requestAnimationFrame(run);
}
-module(fib).
-export([main/1]).
-export([add_entry/2]).
add_entry(_, _) -> ok.
fib(_, _, _, _) -> ok.
main(_) -> fib([], 1000, 1, 0).
-module(fib).
-export([main/1]).
add_entry(DomNode, Text) ->
NewNode = dom_document:create_element(<<"div">>),
dom_element:set_inner_text(NewNode, Text),
dom_element:append_child(DomNode, NewNode).
fib(DomNode, N, B, A) ->