NOW LET US – AI RAG SaaS Studio TP.HCM
NOW LET US
Digital Product Studio
Back to news
DEV-TOOLS...1 min read

Lisp in the Rust Type System

Share
NOW LET US Article – Lisp in the Rust Type System

An experimental project demonstrates the power of Rust's trait system by implementing a Lisp interpreter entirely at the type level.

Lisp in Rust trait system.

  • Each symbol must be manually declared via defkey!()

macro - Numbers cannot be negative

  • Numbers are only in range of 0..8192, you can modify build.rs to generate more natural numbers but then you have to run with RUST_MIN_STACK increased.

  • No (defmacro ...)

  • No eval

  • I have not tested it extensively.

  • Recursive functions

  • Global and lexical environments (via let

bindings) - Function calls apply

properly workingcall/ec

type DefFac = expr!(defun SymFac (SymN) (if (= SymN 0) 1 (* SymN (SymFac (- SymN 1)))));
type Global2 = <DefFac as EvalForm<Global1, Lex0>>::GlobalOut;
type Fac5 = EvalValue<expr!((SymFac 5)), Global2, Lex0>;
assert_same::<Fac5, N120>();
println!("(fac 5) => {:?}", <Fac5 as ToRtValue>::to_rt());
// call/ec demo (escape continuation, explicit tag):
// (call/ec cc (lambda (k) (+ 1 (k 5)))) => 5
defkey!(SymCC, N10);
defkey!(SymK, N11);
type CallECExpr = expr!((call/ec SymCC (lambda (SymK) (+ 1 (SymK 5)))));
type CallECResult = EvalValue<CallECExpr, Global1, Lex0>;
assert_same::<CallECResult, N5>();
println!(
"(call/ec cc (lambda (k) (+ 1 (k 5)))) => {:?}",
<CallECResult as ToRtValue>::to_rt()
);
© 2026 Now Let Us. All rights reserved.

Source: Hacker News

Advertisement
Ad slot ready: 5887729102

More in this category

NOW LET US Related – Codex logging bug may write TBs to local SSDs

dev-tools

Codex logging bug may write TBs to local SSDs

A logging bug in Codex continuously writes massive amounts of data to local SQLite databases, potentially reaching 640 TB per year. This high write volume can quickly exhaust the write endurance (TBW) of consumer SSDs, destroying them in less than a year.

NOW LET US Related – GLM 5.2 vs. Opus

dev-tools

GLM 5.2 vs. Opus

A head-to-head comparison between the new open-weights model GLM-5.2 and Claude Opus 4.8 in building a 3D platformer from scratch using raw WebGL.

NOW LET US Related – Deno Desktop

dev-tools

Deno Desktop

Deno Desktop, introduced in Deno v2.9.0 (canary), compiles Deno projects into self-contained desktop applications with small binaries and native performance.

NOW LET US Related – Sakana Fugu

dev-tools

Sakana Fugu

Fugu-Ultra, a new AI agent system, has demonstrated superior performance over leading frontier models across six complex real-world benchmarks. From autonomously optimizing GPT training recipes and decoding classical Japanese manuscripts to playing blindfold chess and stock trading, Fugu-Ultra showcases the immense potential of orchestrated AI agents.

NOW LET US Related – Good results fine tuning a local LLM like Qwen 3:0.6B to categorize questions

dev-tools

Good results fine tuning a local LLM like Qwen 3:0.6B to categorize questions

A detailed guide on fine-tuning a tiny local LLM (Qwen 3:0.6B) to categorize household questions for metadata-aware RAG, boosting accuracy from 10% to 92% using Unsloth and opaque ID mapping.

NOW LET US Related – Did my old job only exist because of fraud?

dev-tools

Did my old job only exist because of fraud?

A software engineer reflects on a shocking realization that his early-career startup job, which relocated him to the US, might have only existed as a vehicle for a multi-million dollar venture capital fraud exposed by the SEC.

EXPLORE TOPICS

Discover All Categories

Deep dive into the specific technology sectors that matter most to you.