gosling.js icon indicating copy to clipboard operation
gosling.js copied to clipboard

feat(api): rename specProcessed to specResolved

Open thomcsmits opened this issue 2 years ago • 2 comments

Fix # Change api name based on https://github.com/gosling-lang/gosling.js/pull/978#discussion_r1359666778 Toward #

Change List

  • Change name of api subscribe event specProcessed to specResolved

Checklist

  • [ ] Ensure the PR works with all demos on the online editor
  • [ ] Unit tests added or updated
  • [ ] Examples added or updated
  • [X] Documentation updated (e.g., added API functions)
  • [ ] Screenshots for visual changes (e.g., new encoding support or UI change on Editor)

thomcsmits avatar Oct 19 '23 14:10 thomcsmits

The input spec is modified to have default values filled in, and some of the users' incorrectly-specified properties are fixed. Some parts of the spec are not touched by the program (e.g., when values are already specified by users, so no need to add default values), which I think is what @thomcsmits was referring to by "it is just partially processed".

Hmm hard for me to visualize the "state" of the spec at this moment. Similar to our discussion in the developer meeting, perhaps it would be useful to think of the spec in stages of transformations (e.g., a different type for each stage) and then name the event based on the stage.

My only comment about both specProcessed and specResolved is that these both are ambiguous and don't capture the "partial" nature of the processing. Imagine a pipeline of processing steps in the compiler:

inputSpec ---(pass 1)--> specStage1 --(pass 2)--> specStage2 --(pass 3)--> finalSpec

Let's say right now we emit the specStage2 version of the spec. What would we call events publishing the finalSpec or specStage1? My suggestion was to try to come up with a more specific name than either specProcessed or specResolved that appropriately captures the state of the data being sent.

I don't think we need to bikeshed about processed vs resolved, both are totally fine for me. Since the only current subscriber for this event is alt-gosling, maybe we could use something like alt-gosling:specProcessed in lieu of codifying the names/types for the steps of the Gosling compiler.

manzt avatar Oct 19 '23 16:10 manzt

I am down with alt-gosling:specProcessed given that alt-gosling is the only use case for this at the moment.

sehilyi avatar Oct 26 '23 16:10 sehilyi