gemini-2.5-flash| input-price: 0.3 output-price: 2.5 max-context-length: 128_000 (cost: $0.005) Β· Anfrage: 2025-08-01T19:24:08.105543
Generated by rs-summarizer Version unbekannt
Abstract:
This blog post introduces "Pseudo," a novel Common Lisp macro that deeply embeds a large language model (LLM) directly into the programming language. This allows developers to write natural language pseudocode expressions within their Lisp code, which the LLM then expands into executable s-expressions. The pseudo macro achieves this by providing extensive contextual information from the Lisp environment to the LLM. While demonstrating the unique advantages of Lisp's s-expression-based macro system for such integration, the author sternly warns against using this in production due to inherent LLM limitations, including slowness, cost, unpredictability, and the potential for generating incorrect code.
Summary:
pseudo Macro (Start of text): Joe Marshall proposes pseudo, a Common Lisp macro designed to embed a Large Language Model (LLM) directly into the programming language, allowing pseudocode expressions to be expanded into s-expressions.pseudo macro accepts a string of pseudocode and uses an LLM to convert it into a Common Lisp s-expression. Demonstrated examples include simple arithmetic like (pseudo "multiply b by factorial of a.") and more complex operations such as computing the discriminant for a quadratic equation.pseudo enhances the LLM's generation by supplying comprehensive context, including lexically visible variables, bound symbols, overall and style directives (e.g., functional vs. imperative, loop preferences), and even the source code of the current file. The LLM is configured with a low temperature for more predictable results.pseudo in a production environment.pseudo was developed using Google's Gemini as the backend and requires the gemini library and a Google API key. It also has a dependency on a specific SBCL function for extracting lexical variables, requiring an equivalent function if ported to other Common Lisp implementations, plus several other standard Lisp libraries.ElegantREPL.jl) for broader code generation. Joe Marshall responds, stating that LLMs perform better when their scope is limited to smaller expressions to avoid issues like unpredictable function naming. He clarifies that pseudo intentionally avoids expanding into full definitions (starting with "def") and notes difficulties in generating complex structures like class definitions, as these often require user-provided names.