https://github.com/williamcotton/webdsl/commit/34862739f6fe9...
I may have tweaked a couple of things in that (and refactored a hell of a lot since) but here's a Python script that I definitely did not write a single line of code:
https://github.com/williamcotton/webdsl/blob/main/tools/gene...
Embedding things into C is nothing new of course but I spent about 45 seconds getting the solution I needed:
https://github.com/williamcotton/webdsl/blob/main/src/server...
All of this is just boilerplate.
I spent most of my mental energies with this project on the grammar, the memory architecture, and fitting all of the pieces together. Cursor and Claude did most of the typing.
Keep in mind I'm iterating over the grammar and making rather large changes in the runtime all the while:
https://github.com/williamcotton/webdsl/commit/54efbb50c2e95...
FWIW, pipelines ended up being implemented like this:
https://github.com/williamcotton/webdsl/blob/main/src/server...
And used in this very simple example like:
website {
port 3445
database "postgresql://localhost/express-test"
api {
route "/api/v1/team"
method "GET"
pipeline {
jq { { sqlParams: [.query.id] } }
sql { SELECT * FROM teams WHERE id = $1 }
jq { { data: (.data[0].rows | map({id: .id, name: .name})) } }
}
}
}