-
Notifications
You must be signed in to change notification settings - Fork 212
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
Parsing issues: Babel, BigInt and Tildot #2503
Comments
I don't think tildot is giving us much of anything. It won't be a standard for a long time, it's confusing when we already have |
Coincidentally, I just ran into a piece of code that's crying out for underscores in numerals: const WEI_PER_ETHER = BigNumber(1000000000000000000) (though |
Not sure what |
That works for OTOH |
@dckc yes, |
@Chris-Hibbert I fixed the link in your initial comment. In that position the normal github #2502 was being taken as a URL fragment rather than the special github interpretation. |
No one made any arguments in favor of preserving tildot in the near term, or for continuing to rely on Babel. @warner is out till Monday, so I propose we consider this discussion closed and the decision made to drop Babel unless someone brings up countervailing reasons by EOD 3/1/2021. |
I like tildot for its conciseness in talking about code (I find I use it in comments all the time), but I'll admit I rarely use it in actual executed code, probably because it confuses my editor. (My editor is also really confused about I agree with @katelynsills 's point about the problem of having more than one way to do it. I find tildot easier to read than So I guess I'd support a plan to drop tildot for now. I think of @erights is the primary proponent for tildot, and I wouldn't want to abandon something that he cares deeply about, so I'd leave the decision up to him. If we do remove it, I can imagine a future release note that says "new and more pleasant way to invoke eventual-sends" when we bring it back. We currently support tildot in two ways. Contract code (that goes into a bundle) gets to use tildot because we've added a transformation function into the |
I fear I must confess I'm not in love with the tildot syntax the way I was with the |
It is It is about to be |
* feat(ava-xs): install as npm bin * chore(avaHandler): SES Compartment already has harden * feat(ava-xs): provide makeKind, weakStore to test compartment * feat(ava-xs): handle ava.files, ava.require from package.json - support -v / --verbose - xsnap: add glob, @agoric/assert dependencies. hm... having ava-xs in the xsnap package is increasingly awkward * chore(avaXS): log error before losing full message * feat(ava-xs): test.todo * feat(ava-xs): exclude takes a list of strings * test(zoe): XS test exclusions with reasons * test(zoe): add use --verbose on XS to know which script failed - add a separate test:xs-unit-debug script, since `ava-xs --verbose --debug` isn't yet supported * test(zoe): postpone _ in underscores until #2503 is done * test(zoe): be sure async tests wait for all promises * test(zoe): handle __dirname for bundling zcfTesterContract - clean up some lint * test(zoe): be flexible about error message from assertIssuerKeywords * test(zoe): support test.failing on XS foro test-zoeHelpersWZcf.js - elaborate diagnostics for checkExpectation * test(zoe): add test:xs-unit, test:xs-worker to test script * fix(ava-xs): handle missing ava-xs config section * feat(ava-xs): report count of tests, each in their own crank * test(ERTP): use ava-xs bin, ava-xs.exclude * fix(ava-xs): count where we can see crank boundaries The code running inside xsnap can't see crank boundaries, so don't bother to count planned assertions there. Count on the node parent side. * style(ava-xs): clarify type in avaHandler * fix(ava-xs): notThrows() success case * feat(ava-xs): summarize failed tests * test(zoe): update list of XS exclusions * test(zoe): postpone test:xs-worker * test(zoe): postpone test-scriptedOracle due to intermittent SEGV * refactor(ava-xs): export powerless main * test(zoe): try longer timeout * fix(ava-xs): use cjs rather than -r esm in #! * test(zoe): postpone zoeHelpers on XS * style(ava-xs): jsdoc idiom Co-authored-by: Kris Kowal <[email protected]> * style(ava-xs): jsdoc idiom Co-authored-by: Kris Kowal <[email protected]>
At #2951 we decided to remove tildot support. Use `E.G' when appropriate to get promises for properties without stalling. |
Or rather, |
TIldot has been removed. Somebody (@Chris-Hibbert ?), what's the next step for this issue? |
IIRC, the next step is to replace dependencies on I'm struggling to find the source of |
Fwiw, all Agoric forks are kept in agoric-labs. |
I looked in agoric-labs. I didn't find anything with a package.json that says its name is |
I was afk, but here I am again: https://github.com/agoric-labs/babel/pulls |
I think it doesn't matter. When I grep for Some of those are unused in imports, others only in tests and one comment.
|
Please excise it from everything except for |
What is the Problem Being Solved?
We're currently stuck on an old version of Babel in order to maintain Tildot support. This is preventing some upgrades, including support for BigInt literals. (We can now do
100n
, but100_000_000n
doesn't work in some places.)This issue is a place to settle on an approach.
Description of the Design
agoric-sdk doesn't currently support underscore separators (1_000_000 is legal javascript). The Babel parser version we're using in a few places doesn't support all the current JS syntax. We can't upgrade without breaking tildot
We have added support for tildot to Babel; it's currently only enabled in the REPL.
Use of
E.G()
was rhetorically connected to this discussion, but is pretty much separate, since tildot doesn't support destructuring assignments. soE.G()
will be discussed in a separate issue.One coherent proposal is to stop using Babel. This would drop our current support for tildot in the REPL. We could then move to most-recent versions of everything else, and get consistent support for parsing bigints everywhere. Tildot would then only get support by moving babel forward, and getting official support from TC39.
@michaelfig described the process to get tildot adopted:
Security Considerations
All paths lead to parsing javascript in standards compliant ways.
Test Plan
We probably need some new tests with underscores. The main plan is to verify that everything passes CI tests when we add tests that declare values with underscores. I'll also check the REPL parsing, which has its own tests.
The text was updated successfully, but these errors were encountered: