Open strager opened 1 year ago
We have a few options:
I asked about option 2 in the LTTng mailing list: https://lists.lttng.org/pipermail/lttng-dev/2023-August/030593.html
In commit c0eeb811d15e986ffbc5f1da37adf6f73c7eef3a, I generated the CTF metadata file from using the C++ code (trace-types.h) as the schema. I'll do similar things to generate readers and writers soon.
JS parser generation implemented in commit 9581b8bfa42d9cd83dc3dd7feeb6d049980e0181.
C++ parser generation implemented in commit 98473f0feeb4455e064b4bd1db10bc75e6e2d396.
C++ writer generation implemented in commit b80c1e84fc36e4da45df4b5731db9c3373b8ac4f.
010 Editor template generation implemented in commit 9ce47bb582688289926a3893d198ff84bd0abe8c.
New raw line counts for non-generated sources: 4143 lines:
64 src/quick-lint-js/logging/trace-writer.cpp
69 test/test-trace-writer.cpp
80 src/quick-lint-js/logging/trace-writer.h
86 src/quick-lint-js/logging/trace-reader.h
111 src/quick-lint-js/logging/trace-types.cpp
118 test/test-trace-reader.cpp
169 src/quick-lint-js/logging/trace-reader.cpp
267 src/quick-lint-js/debug/public/trace.mjs
274 src/quick-lint-js/logging/trace-types.h
426 test/test-trace-reader-writer.cpp
683 src/quick-lint-js/debug/test/test-trace.mjs
1796 tools/generate-trace-sources.cpp
4143 total
So we have regressed. =\
quick-lint-js's trace format requires a lot of code:
Total: 3454 lines
In addition to being a lot of code, the code is tedious to write and a lot of places need to be updated.
It'd be nice if we should shrink this down to one source of truth and ~1k lines or less (for the current feature set).
Implementation status: