-
Notifications
You must be signed in to change notification settings - Fork 0
Session idea: sample implementations in js/ts #20
Comments
https://npmjs.com/es-abstract is ecma262's Abstract Operations implemented in JS; you can look at http://npmjs.com/~es-shims to find a lot of shims/polyfills implemented using it. |
I'd call these example implementations unless you intend them to supersede the spec. |
@ericprud what is the difference between an "example" or a "reference" implementation? Isn't any implementation that conforms to the conformance tests a reference implementation? Why would something being a "reference implementation" supersede the spec? |
Technically, or at least originally, a "reference implementation" is essentially a spec. This means that every other implementation MUST be bug-compatible with it. It's a somewhat arcane distinction these days when people don't intend that interpretation, but I find it best to use "example implementation" or "sample implementation", which has the benefit of clarifying that the spec does indeed have primacy. |
Ah, I was wondering the same thing. With specs that target browsers, it's been my experience that "reference implementations" have generally been throwaway JS implementations. Eventually browsers implementations supplant the reference implementation (with their own quirky engine behaviour and priv/sec improvements). But @ericprud is right that the name of these things is somewhat confusing. |
Meta: I renamed the issue to "sample implementations" to capture apparent consensus not to use "reference". I vaguely prefer "sample" over "example" because it seems to elevate it above an example which might be less comprehensive. At any rate, we get to invent terms of art to guide practiced readers more efficiently through docs. |
"Prototype implementation" might also work 🤔. I don't have a strong opinion. |
From #17, it might be fun to have a session that explores how reference implementations of a spec can be written in JS or TS. And how this is very useful for verification of a spec.
The text was updated successfully, but these errors were encountered: