4 ms·
Do your snippets write this kind of boilerplate? https://github.com/williamcotton/webdsl/commit/34862739f6fe9866d0fe215768c23ef24a543c74 https://github.com/wil
by williamcotton 2y ago
Do your snippets write this kind of boilerplate?
https://github.com/williamcotton/webdsl/commit/34862739f6fe9866d0fe215768c23ef24a543c74 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/generate_embedded_scripts.py 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/generated_scripts.c 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/54efbb50c2e9549150a2b8aaa2d2743a41d225aa https://github.com/williamcotton/webdsl/commit/54efbb50c2e95...
FWIW, pipelines ended up being implemented like this:
https://github.com/williamcotton/webdsl/blob/main/src/server/pipeline_executor.c 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})) } }
}
}
}
- wruza 2y agoThis is not boilerplate, what are you comparing it with? The root commenter and their replies clearly stated that they use AI for things which they know how to do but too tedious to type. General code generation abilities are out of this scope.
- williamcotton 2y agoAll of that Lua-meets-Jansson setup code is indeed boilerplate! A python script that embeds data in a "static const char*" is boilerplate!