Closed ambiguousname closed 2 months ago
Notes from 2024-06-20
Design doc: https://docs.google.com/document/d/1xRTmK0YtOfuAe7ClN6kqDaHyv5HpdIRIYQW6Zc_KKFU/edit#heading=h.b6hfjuxzqkmm
demo::hide
or demo::show
is easy to do. This would be a point in favor of a separate backend.Big issue right now is that build-test and gen throw errors. Pretty sure this is related to my modifications to attrs.rs in the core module. I have some ideas for fixing gen, but build-test requires testing against snapshots that I'm not entirely sure how to work with. Any help would be appreciated!
Ah, I've found the insta
crate, so I will run tests and verify that the snapshots look okay, then add them as a change to review. Still doesn't solve the gen
errors, unfortunately.
Mixed syntax for arguments, terminusArgs, and ...args. Cleaning up would be helpful, so using the argument names would be better than terminusArgs[3]
, say.
Move rendering.mjs
into templates, call it diplomatDefaultRendering.mjs
(maybe with the base .html and index.js file too, if index.html is not detected?) and copy it over every time it's run.
Some self notes:
Currently going through the pain of setting up a proof of concept demo in the ICU4X repo.
Based on how many things I'm having to move around to make this work, I think I'm in favor of Manish's idea to make the demo-gen part a flag on the JS2 backend. This would remove capabilities like #[diplomat::attr(demo_gen, disable])
, but I think that's small potatoes compared to making sure this works out of the box after running it once.
Edit: especially because renames (and disables!) that apply to JS2, do NOT apply to demo-gen.
but "opt out if it can't be constructed" is also fine i guess.
We're close to the WASM generator working out of the box with no annotations or configurations, and I'd like to keep it that way. I think the heuristic of "opt in if we know how to make a demo for this function signature" is good.
We're close to the WASM generator working out of the box with no annotations or configurations, and I'd like to keep it that way. I think the heuristic of "opt in if we know how to make a demo for this function signature" is good.
I believe the current heuristic is opt-out, not opt-in. Which is fine, but will potentially cause friction if the backend also produces errors when it's unable to do something, and might make it harder for ICU4X devs to add new FFI. I'm fine with that shift, but it's an angle of complexity we should definitely consider: not every terminus is going to be renderable.
(Potentially) Non-blocking Issues List:
.apply
.ParamInfo
, maybe to be clearer whether or not it's an external parameter or one that will be used inside a function.
Fine to do all fixes in a followup.
Rough implementation of the process described in https://docs.google.com/document/d/1xRTmK0YtOfuAe7ClN6kqDaHyv5HpdIRIYQW6Zc_KKFU/edit?usp=sharing
Proof of concept is live at https://ambiguous.name/diplomat/