HACKER Q&A
📣 bryanrasmussen

Is there an AI bot that works like a literate programming build step


My experiences with coding chatbots has been underwhelming. What I would like is something that works like the following:

I write a file with comments in the file of what I expect the code to be doing at this point in the code. When I run the agent to build or compile these descriptions

it should of course provide the methods outlined, if it feels the need to create other parts of the code than what I have specified it should make comments about why it decided this and what the code it makes does.

Essentially I want an agent that allows me to approach non-literate programming in a literate programming manner/workflow https://en.wikipedia.org/wiki/Literate_programming

If you have some ideas as to how I can get to this please share, if you think it will not ever be possible to produce something like go ahead and share that too (although I think it should be)

Note I do not want an interactive bot doing stuff WHILE I type, I want an AI build step. Why? Because I type really quick without errors having worked as a data entry guy in my early 20s. The interactive bots make me slower and generally don't have good inputs most of the time.

I bet this is probably doable and a lot of you are thinking why doesn't this guy just do X or Y, but that's the thing - all I've experienced so far is the non-satisfactory interactive bots, and researching the matter the world's most popular broken search engine has been unsatisfactory, so hopefully people here can explain what to do to get what I want.


  👤 huevosabio Accepted Answer ✓
I've been thinking about something like this as well, for Rust.

I went back and forth with chatgpt trying to get how this would work and look, asked chatgpt to write a doc (warning not proof read, just an AI doc) : https://docs.google.com/document/d/1Kd_cFOXCCm66o7UoIW9Shgxi...

The idea is to have a `llm_fill_in! `macro that runs as a first pass of the build step. Basically, a cargo utility that let's you do stuff like:

```rust

fn add(a: i64, b: i64) -> i64 {

    llm_fill_in!("Adds a and b and returns the result");
}

```

(excuse the LLM verbosity in the doc, I just was brainstorming with it and asked it to write it as if it was creating an eng spec)


👤 squircle
Have you considered using a README (or a ./docs folder) as a source of truth? I was working in this direction (before and after gaining access to LLMs.) I rolled about half the tooling for this (in Rust and JS) and have proven the effectiveness, at least for my own use cases. But, its so ridiculously fast that... I don't know what to do with it. Make a bunch of open source tools? Launch innumerable SaaS'?

The build step is crucial (along with solid system prompts.) This keeps the human in the loop and makes for something that truly feels like rapid/iterative development. Build steps also allow for checkpoints, and provide for something that, from a layman's perspective, feels like reversible computing.


👤 kasey_junk
I’d try Claude code. Just give it the instructions you’ve written here and see if it does what you want. You aren’t asking for anything particularly strange do I’d guess you’d get something very close without much iteration.

👤 maxcomperatore
i think what you want is a build step that acts like a “llm macro”, like you write comments or specs in the code, and the ai fills in the implementations automatically. its like literate programming but powered by llms.

theres a big gap now between interactive chatbots and fully automated code gen at build time. so a tool that integrates with the build pipeline and produces documented code would be a game changer.

also if it explains why it added code not in your specs that would improve trust a lot. this is possible with current models and some clever tooling but nobody cracked the ux yet.

personally ive tried a few hacks with rust macros and cargo steps to prototype this and it works ok but still rough around edges.

this will definitely be a hot area in next 1-2 years


👤 ingigauti
Not sure it's what you are looking for but I've been developing a new programming language that I think does what you are describing.

You can write natural language code like:

`read file.txt into variable` (or many other ways, as long as intent is clear)

If it is what you are looking for, you can dig through my profile for info