diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/LispBM cheatsheet.pdf b/LispBM cheatsheet.pdf new file mode 100644 index 0000000..79c58b0 Binary files /dev/null and b/LispBM cheatsheet.pdf differ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..edd5c3b --- /dev/null +++ b/flake.lock @@ -0,0 +1,146 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1759362264, + "narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "758cf7296bee11f1706a574c77d072b8a7baa881", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "lispbm": { + "inputs": { + "flake-utils": "flake-utils", + "nix-filter": "nix-filter", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1760289916, + "narHash": "sha256-AtvVSTzhAyzAiycRWYE8pF9wrSx0w/B8i/TcQiD1vTU=", + "owner": "svenssonjoel", + "repo": "lispbm", + "rev": "5237bc1de9443765fa4f917c6d09746ac14761dc", + "type": "github" + }, + "original": { + "owner": "svenssonjoel", + "repo": "lispbm", + "type": "github" + } + }, + "nix-filter": { + "locked": { + "lastModified": 1710156097, + "narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "3342559a24e85fc164b295c3444e8a139924675b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1735563628, + "narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1754788789, + "narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "a73b9c743612e4244d865a2fdee11865283c04e6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1760038930, + "narHash": "sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0b4defa2584313f3b781240b29d61f6f9f7e0df3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "lispbm": "lispbm", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d1453c3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +{ + description = "Tataruuuuuuuu"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + lispbm.url = "github:svenssonjoel/lispbm"; + }; + + outputs = inputs@{ nixpkgs, flake-parts, lispbm, ... }: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = [ + "x86_64-linux" + ]; + + perSystem = {self', pkgs, system, ...}: { + _module.args.pkgs = import inputs.nixpkgs { + inherit system; + overlays = [ + lispbm.overlays.default + # # Above doesn't work due to segfault + (final: prev: { + lispbm-repl = lispbm.outputs.packages.${system}.repl; + lispbm-repl64 = lispbm.outputs.packages.${system}.repl64; + lispbm-c-doc = lispbm.outputs.packages.${system}.c-doc; + lispbm-doc = lispbm.outputs.packages.${system}.doc; + }) + ]; + }; + + # packages.default = self'.packages.tataru; + # packages.tataru = pkgs.stdenv.mkDerivation { + # pname = "Tataru"; + # version = "0.0.1"; + + # src = ./.; + + # nativeBuildInputs = with pkgs; [ ]; + # buildInputs = [ ]; + + # }; + + devShells.default = pkgs.mkShell { + packages = with pkgs; [ lispbm-repl ]; + }; + + }; + }; +} diff --git a/test.lispbm b/test.lispbm new file mode 100644 index 0000000..607e397 --- /dev/null +++ b/test.lispbm @@ -0,0 +1,10 @@ +(defun fac (x) + (match x + (0 1) + (1 1) + (_ (* x (fac (- x 1)))))) + +(defun mymap (f m) + (if (eq m nil) + nil + (cons (f (car m)) (mymap m f))))