on master help sign in
join
803fb83iko
nock/flake.lock+54−1
@@ -1,5 +1,24 @@
1{
1{
2 "nodes": {
2 "nodes": {
3+ "fenix": {
4+ "inputs": {
5+ "nixpkgs": "nixpkgs",
6+ "rust-analyzer-src": "rust-analyzer-src"
7+ },
8+ "locked": {
9+ "lastModified": 1724221791,
10+ "narHash": "sha256-mKX67QPnUybOopVph/LhOV1G/H4EvPxDIfSmbufrVdA=",
11+ "owner": "nix-community",
12+ "repo": "fenix",
13+ "rev": "e88b38a5a3834e039d413a88f8150a75ef6453ef",
14+ "type": "github"
15+ },
16+ "original": {
17+ "owner": "nix-community",
18+ "repo": "fenix",
19+ "type": "github"
20+ }
21+ },
3 "flake-utils": {
22 "flake-utils": {
4 "inputs": {
23 "inputs": {
5 "systems": "systems"
24 "systems": "systems"
@@ -18,6 +37,22 @@
18 }
37 }
19 },
38 },
20 "nixpkgs": {
39 "nixpkgs": {
40+ "locked": {
41+ "lastModified": 1723991338,
42+ "narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=",
43+ "owner": "nixos",
44+ "repo": "nixpkgs",
45+ "rev": "8a3354191c0d7144db9756a74755672387b702ba",
46+ "type": "github"
47+ },
48+ "original": {
49+ "owner": "nixos",
50+ "ref": "nixos-unstable",
51+ "repo": "nixpkgs",
52+ "type": "github"
53+ }
54+ },
55+ "nixpkgs_2": {
21 "locked": {
56 "locked": {
22 "lastModified": 1723637854,
57 "lastModified": 1723637854,
23 "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
58 "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
@@ -34,8 +69,26 @@
34 },
69 },
35 "root": {
70 "root": {
36 "inputs": {
71 "inputs": {
72+ "fenix": "fenix",
37 "flake-utils": "flake-utils",
73 "flake-utils": "flake-utils",
38− "nixpkgs": "nixpkgs"
74+ "nixpkgs": "nixpkgs_2"
75+ }
76+ },
77+ "rust-analyzer-src": {
78+ "flake": false,
79+ "locked": {
80+ "lastModified": 1724153119,
81+ "narHash": "sha256-WxpvDJDttkINkXmUA/W5o11lwLPYhATAgu0QUAacZ2g=",
82+ "owner": "rust-lang",
83+ "repo": "rust-analyzer",
84+ "rev": "3723e5910c14f0ffbd13de474b8a8fcc74db04ce",
85+ "type": "github"
86+ },
87+ "original": {
88+ "owner": "rust-lang",
89+ "ref": "nightly",
90+ "repo": "rust-analyzer",
91+ "type": "github"
39 }
92 }
40 },
93 },
41 "systems": {
94 "systems": {
nock/flake.nix+11−8
@@ -2,23 +2,26 @@
2 inputs = {
2 inputs = {
3 nixpkgs.url = "nixpkgs/nixos-unstable";
3 nixpkgs.url = "nixpkgs/nixos-unstable";
4 flake-utils.url = "flake-utils";
4 flake-utils.url = "flake-utils";
5+ fenix.url = "github:nix-community/fenix";
5 };
6 };
6
7
7− outputs = { self, flake-utils, nixpkgs }:
8+ outputs = { self, flake-utils, nixpkgs, fenix }:
8 let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
9 let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
9 in flake-utils.lib.eachSystem supportedSystems (system:
10 in flake-utils.lib.eachSystem supportedSystems (system:
10 let pkgs = import nixpkgs { inherit system; };
11 let pkgs = import nixpkgs { inherit system; };
11 in {
12 in {
13+ inherit fenix;
12 devShells.default = pkgs.mkShell {
14 devShells.default = pkgs.mkShell {
13 # CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER =
15 # CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER =
14 # "lld"; # LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
16 # "lld"; # LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
15− buildInputs = with pkgs; [
17+ buildInputs = with pkgs;
18+ with fenix.packages.${system}.latest; [
16− wasm-pack
19+ wasm-pack
17− rustc
20+ rustc
18− wasm-tools
21+ wasm-tools
19− cargo
22+ cargo
20− llvmPackages.bintools
23+ llvmPackages.bintools
21− ];
24+ ];
22 };
25 };
23 });
26 });
24}
27}
nock/src/jets.rs+12
@@ -36,6 +36,7 @@ pub fn generate_jets() -> Jets {
36 (215071416104742929357520800152622002342, FLOP),
36 (215071416104742929357520800152622002342, FLOP),
37 (127000845647123308421702512578230020206, GULF),
37 (127000845647123308421702512578230020206, GULF),
38 (224124632134128248273067864092142254001, INTO),
38 (224124632134128248273067864092142254001, INTO),
39+ (22365719601138689598430859488399820563, JOIN),
39 ])
40 ])
40}
41}
41
42
@@ -272,3 +273,14 @@ static INTO: Jet = |_ctx, n| {
272 ),
273 ),
273 }
274 }
274};
275};
276+
277+static JOIN: Jet = |_ctx, n| {
278+ let (sep, list) = n.as_cell().unwrap();
279+ Noun::list_refs(
280+ list.list_iter()
281+ .intersperse(sep)
282+ .collect::<Vec<_>>()
283+ .iter()
284+ .map(|x| x.clone()),
285+ )
286+};
nock/src/lib.rs+1
@@ -1,3 +1,4 @@
1+#![feature(iter_intersperse)]
1pub mod interpreter;
2pub mod interpreter;
2mod jets;
3mod jets;
3pub mod noun;
4pub mod noun;