RSSAmplifier

Blog

Abstract Heresies

Unorthodox opinions on computer science and programming.

funcall.blogspot.comRSS feed ↗25 posts

Latest posts

SDK for jrm-code-project.com

A few of you have noticed the OpenAPI spec floating around the site lately. Rather than watching everyone write the same HTTP boilerplate from scratch to talk to the server, I went ahead and bundled up a set of official client bindings. If you want to programmatically hit the pastebin or mess with the other endpoints, the jrm-code-client repository is live. Right now, it includes complete SDKs…

OpenAPI Access to jrm-code-project.com

It's a web site! It's a service! jrm-code-project.com has an OpenAPI specification and you can use it to generate client code in your favorite programming language (which is Lisp, right?). The OpenAPI specification is available at https://jrm-code-project.com/openapi.yaml . There are the following endpoints: GET /api/v1/ping - Returns a simple "pong" response to test connectivity and verify your…

Pics or it Didn't Happen

An anonymous reader said it out loud: "Alright, it's a simple website… can we see its sources though?" I started going through the sources and parameterizing the secrets so that there weren't any hard-coded sensitive strings. It's a royal pain because the secrets then have to be injected via environment variables, which means reconfiguring the server on the host and the development environment on…

A Web Site in Vibe Coded Common Lisp

I believe that vibe coding is the future. This is crazy because last year I was a skeptic. Last year LLMs couldn't write large Lisp programs. They'd get the parentheses wrong, they'd hallucinate functions and packages, and they couldn't understand the architecture of a large program. This is all in the past. A SOTA frontier LLM absoulely can write large lisp programs. It will keep coherent across…

llambda.lisp on linux

A reader named Madhu sent me a patch for running llambda.lisp under linux. This patch uses mmap to pull the weights into the lisp address space outside the heap. In addition, he tried to use a hugging face model that needed some default values, so he added them. He reports that he was able to get the model to do inference on his linux box with about an hour of hacking. I have incorporated his…

Why vibe code in Lisp?

Why Target Common Lisp for Code Generation? I’ve been asked twice now: if the generated code doesn't matter—if the AI is doing the heavy lifting of writing the syntax—why do I vibe code in Common Lisp? Why not target Python, TypeScript, or Java? These are mainstream languages with massive training sets. The models can generate code in them with a high degree of statistical accuracy. So why do I…

Vibe Coding interview

My coding agent interviewed me about `vibe coding': Victoria: Alright, the recorder is on. Let’s get into it. You’ve been dragging me down this specific rabbit hole for weeks now, and frankly, I need you to justify it on the record for the people paying to read this. You’re obsessed with “vibe coding.” From where I’m sitting, it looks like you throwing vague, half-baked architectural…

RFC 6238 in Common Lisp

I wanted to implement 2FA as per RFC 6238. This is the Time-based One-Time Password (TOTP) algorithm that is used by Google Authenticator and other 2FA apps. This was originally `vibe coded`. The vibe coding got me 80% of the way there, and I made a manual pass to turn it into a more functional style. Feel free to use this under an MIT license. ;;; -*- mode: lisp; coding: utf-8-unix; -*- ;;; RFC…

Lisp-p

I needed a function that could tell whether a string was a valid Common Lisp program. In theory, you could just call read on the string and see if it throws an error, but I don't want to throw random text at read. It could contain a reader macro or something nasty. It also would intern a ton of random symbols into the current package. I wanted a function that would act mostly like the reader, but…

Vibe Coding Reconsidered

A year ago, you couldn't vibe code in Lisp. Even the SOTA models had trouble balancing parentheses, and they'd hallucinate packages and symbols that didn't exist. A year makes a big difference in this field, and the latest models are capable of vibe coding moderately sized programs in syntactically correct Lisp. I have been experimenting with vibe coding in Common Lisp and I'm hooked. It is a…

llambda.lisp

I wanted to run LLM models locally on my machine. I discovered that llama.cpp is how people run models locally, and that the popular LLM servers like Ollama and lmstudio and unsloth use llama.cpp under the hood. llama.cpp is, of course, written in C++. I don't care for C++ and I prefer Common Lisp. With the appropriate declarations, Common Lisp code should be in the same performance ballpark as…

New chatbot

Lately I've been playing with writing a chatbot library in Common Lisp. My previous gemini bindings were getting unweildy. I wanted to add the ability to run LLMs on my local machine but it turned out to be really kind of kludgy, so I decided to start from scratch with multiple back ends in mind. I've got it to the point where in supports multiple back ends, so now I can prompt local LLMs from…

Anecdote or data point

I saw that there was some argument over how much slower slot access is than struct access, so I just decided to measure it naively. I made a two slot sruct and a CLOS version of a CONS cell with car and cdr slots and I ran LTAK using regular lists, `lists' made from CLOS conses, and `lists' made from structs. Here are the results: D:\repositories\clos-benchmark>sbcl --script run-benchmarks.lisp…

Controlled Unclassified Information

Back in the day, the US government had a program called SBIR (Small Business Innovation Research) that funded small businesses to do research and development. I recall sitting in our dorm in college, reading through a giant printed catalog of SBIR grants just to amuse ourselves by brainstorming solutions over bad pizza. . So, I got curious the other day: what does the SBIR landscape look like now?…

Regression

Last year I wrote some Lisp related AI apps. There was a syntax highlighter that used the LLM to determine how to colorize and highlight syntax, and a prompt refiner that takes a wimpy LLM prompt and creates more elaborate prompt from them. I took the apps down last week. They were `vibe coded' and therefore approximate and had bugs (but that's to be expected), but they had a security hole where…

CLRHack: Meta-object Protocol

Metaobject Protocol (MOP) Implementation in CLRHack The Metaobject Protocol in CLRHack is a high-performance implementation of the Common Lisp Object System (CLOS) integrated into the .NET 8.0 Common Language Runtime (CLR). It provides a complete meta-compilation pipeline that bridges the gap between dynamic Lisp semantics and the static CIL (Common Intermediate Language) execution model. Core…

CLRHack: signal and error

Implementation of SIGNAL and ERROR in CLRHack In CLRHack, the condition signaling system is implemented in the Lisp.HandlerControl class within the LispBase library. It leverages .NET's [ThreadStatic] storage to maintain a per-thread dynamic stack of active condition handlers. SIGNAL Implementation The Signal(object condition) method performs the following logic: Retrieval: It fetches the…

CLRHack: handler-bind and handler-case

In the CLRHack compiler, handler-bind is a primitive form used to register condition handlers in the dynamic environment. It operates by managing a thread-local list of active handler objects, ensuring that condition signaling follows the standard Common Lisp search and execution rules. Handling of handler-bind When the compiler processes a handler-bind form, it generates CIL code that performs…

CLRHack: restarts

In the CLRHack compiler, restart-bind is a primitive form that manages the dynamic lifecycle of Common Lisp restarts by manipulating a thread-local stack of active restart objects. Handling of restart-bind When the compiler encounters a restart-bind form, it generates CIL code that performs the following steps: Capture Previous State: It calls Lisp.RestartControl::GetActiveRestarts() to retrieve…

CLRHack: unwind-protect and catch-throw

Handling of unwind-protect The CLRHack compiler maps Lisp unwind-protect semantics directly onto the Structured Exception Handling (SEH) infrastructure of the .NET Common Language Runtime (CLR). Specifically, it utilizes the try...finally construct provided by the Common Intermediate Language (CIL). Lisp semantics require that the cleanup forms in an unwind-protect block be executed regardless of…

CLRHack: Multiple return values

Multiple Return Value Implementation in CLRHack The CLRHack compiler implements Multiple Return Values (MRV) by extending the single-value limitation of the .NET Common Intermediate Language (CIL) stack through a thread-local side-channel. This allows Lisp forms to communicate multiple values (up to 64) across function boundaries. 1. The Side-Channel Storage Because a CIL method can only return a…

CLRHack: Tail Recursion

Tail-Call Handling in CLRHack I decided to make proper tail recursion a fundamental requirement in CLRHack. This prevents stack overflow errors during standard recursive patterns and ensures the runtime remains stable regardless of recursion depth. Technically, Common Lisp isn't required to be tail recursive, but I want mine to be. 1. Tail Position Identification The compiler performs a structural…

CLRHack Lexical Variables

Lexical Closures in CLRHack CLRHack implements lexical closures by transforming dynamic Lisp environments into static CIL class structures. Since the .NET Common Language Runtime (CLR) does not have a native concept of "nesting" functions within the lexical scope of another function's local variables, the compiler employs Lambda Lifting and Explicit Closure Conversion . 1. Lambda Lifting Every…

CLRHack argument passing

Common Lisp Argument Passing in CLRHack The CLRHack engine translates the dynamic, flexible argument-passing semantics of Common Lisp into the static, strongly-typed environment of the .NET Common Language Runtime (CLR). It achieves this through a combination of CIL method overloading , sentinel-based defaulting , and runtime list construction . 1. The Overloading Architecture Since CIL methods…

CLRHack: FibBenchmark

The first thing to look at is the Fibonacci benchmark. The source code is here: (in-package "CLRHACK") (progn (defun fib (n) (if ( And it compiles to this IL code: (commentary after the code) .assembly extern mscorlib {} .assembly extern LispBase {} .assembly 'FibBenchmark' {} .module 'FibBenchmark.exe' .class public auto ansi beforefieldinit Program extends [mscorlib]System.Object { .field public…