Open strager opened 1 year ago
For core stuff, I think C++ and JavaScript are here to stay. C++ might be replaced with Rust if Rust build times improve. JavaScript is the language of web tooling, and I think that's fine.
For scripting, we currently use Ansible, Bash, Go, Node.js, and Python:
Other scripting options:
I'm leaning toward this resolution:
Some ideas:
I investigated Go a bit. I ran into an issue.
By default, if you use a command like go run
, then the toolchain will check if a vendor
directory exists. If vendor
does exist, Go will only load dependencies from that directory. If vendor
doesn't exist, Go will download and cache dependencies if needed.
quick-lint-js has a directory called vendor
which confuses Go. To work around this confusion, you can pass -mod=readonly
when running a go
command, making the toolchain ignore the vendor
directory.
An alternative to -mod=readonly
is go mod vendor
, which populates the vendor
directory. Unfortunately, this command also deletes everything else in the vendor
directory. Goodbye C++ code. You can work around this by undeleting the files, but this clearly isn't what the Go developers intended you to do.
Thinking about it more, maybe I should choose Node.js for the unorthodox tools. We would then have only two languages in quick-lint-js: C++ and JavaScript. I'm not sure Node.js will work well though; I'll have to play around with it.
Note: Ubuntu 18.04 (the crustiest distro we support) has Node.js version 8 in its repos.
Some things to investigate for Node.js:
node_modules
website/
using code from in tools/
(for example) without package.json
fanfare
node_modules
? Would Yarn get angry?I boiled it down to two options for unorthodox tools: C++ or Node.js.
I am experimenting with C++. I replaced gperf with a custom tool (written in C++), and am integrating it into the build. I plan to release this slowly:
If nobody complains about the second trial release, then I will move forward with C++ for the following tools:
I ported the translation infrastructure to C++ integrated into the build. It's been nice except for one issue: if a change is made which doesn't affect the unorthodox source, the generator will update the source's timestamp anyway, causing most files to rebuild. I should fix this with a write_file_if_different
function.
quick-lint-js has some complicated unorthodox tools which are required for some unorthodox artifacts or which are just used by contributors:
shasum
tools)My issues:
Related: #168