babel / proposals

✍️ Tracking the status of Babel's implementation of TC39 proposals (may be out of date)
https://github.com/tc39/proposals
433 stars 39 forks source link

Extensible Numeric Literals: Stage 1 #30

Open hzoo opened 7 years ago

hzoo commented 7 years ago

Champion: @littledan Repo: https://github.com/littledan/proposal-extensible-numeric-literals Slides: https://docs.google.com/presentation/d/13Ej08CCqXGCTF46GabGdzBepWBgU5d70TtPPYFkkZcs/edit#slide=id.p First presented at the Sept 2017 meeting

Examples

1236536253453n      BigInt (special case)
4525i           Imaginary numbers
235435.461m     IEEE 754-2008 64-bit decimal
300px           CSS Typed OM
jridgewell commented 7 years ago

What is there for us to do here in babel? Parsings fine, but what's the transform?

hzoo commented 7 years ago

Just parsing I believe, same as BigInt? Don't have that transform either and it's not meant to be used for prod https://github.com/babel/babel/pull/6015

benjamn commented 7 years ago

Despite advancing to Stage 1, this proposal is very early-stage, and it didn't meet with overwhelming confidence or enthusiasm in the September TC39 meeting. I can't imagine using this yet, or encouraging anyone else to use it, until it's much more fleshed out.

I'm also reluctant in principle to add new types to the AST for a syntax that is so likely to change. What would that look like, exactly?

hzoo commented 7 years ago

Yeah we can wait, like some of the other ones; either way unlikely to be really supported with Babel anyway like BigInt other than when it's natively supported?

littledan commented 7 years ago

I agree with @benjamn . This is really much less certain than most of the other Stage 1 proposals. I haven't written out any spec text, and the text I was imagining is likely to change significantly from what I was imagining based on committee feedback.