-
Notifications
You must be signed in to change notification settings - Fork 120
Alternate design to implementing & testing jsnums #1839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: horizon
Are you sure you want to change the base?
Conversation
…stead of take them as explicit arguments everywhere
…er jsnums changes)
…dules obtain the correct jsnums library that now closes over an appropriate errbacks parameter
…hadowed the one we're trying to use.
…n array of values as second argument
Makes me a bit nervous that we have to make sure we account for every client of js-numbers here, because it is no longer exporting a bunch of functions it used to. Is there a way to do this that is backwards-compatible? Like, maybe all the existing functions are also exported, with an errbacks argument, and they call Sketch:
|
Properties this has:
|
I don't think that will quite work, because Do we have any library authors who write native JS libraries for Pyret that we're not aware of? Because if not, then as of this PR (and the counterpart for CPO), the only mentions of
and
|
Re: “it's not hard to find all the uses”. What about pyret-embed? What about pyret-npm? What about the Thinking more about the design options here. |
A few ideas that would make me more comfortable:
|
To be clear this PR is a vast improvement in ergonomics. I just really, really don't want to have some 5-alarm fire because we broke an interface that we didn't know something relies on (could be something we wrote and forgot about! could be a huge pain of a built file sitting in someone's |
Fair points.
I'm not sure I completely understand your latest suggestion, yet. Will think about it more... |
In case this is a useful data point: Neither Brown's nor NEU's autograder repos use pyret-lang's js-numbers.js as a JS library. |
Alternate design to #1818, where instead of manually placing
errbacks
parameters everywhere throughout the code, and where even a single missederrbacks
argument could be a brittle and hard-to-find failure later, this one changes js-numbers to only expose a module-creating function that closes over theerrbacks
parameter, and exports the createdjsnums
instance as a field onruntime
-- so that modules that previously imported jsnums directly can now access it off their respective runtimes.I've pulled in the tests from #1818, and they all pass, and I think I've pulled in any substantive changes to runtime.js as well.