SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
JS
Brendan Eich
Brave Software
@BrendanEich
Int64 & More
Brendan Eich Brave Software @BrendanEich
Always bet on JS
There are only two kinds of languages: the
ones people complain about and the ones
nobody uses. — Bjarne Stroustrup
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
Previous value/operator/suffix thinking…
• Int64(0) ==> 0L // as in C#
• Uint64(0) ==> 0UL // ditto
• Float32(0) ==> 0f // ditto
• BigInt(0) ==> 0N // N to avoid i/I
• Decimal(0) ==> 0m // m or M, C/F#
• User-defined suffixes and operators: | ^ & == < <= << >> >>>
+ - * / % ~ ToBoolean unary- unary+
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
Time passed, SIMD faded, new plan needed
• Old plan was to build on SIMD landing in living spec.html
• I hoped we would get more general “value type” semantics that way
• But time matters; as Waldemar said in July, “we should just do Int64”
• And @mikeal and I said exact same thing to each other in September
• Insight: inducting from hardcoded Int64/Uint64 (with future-proofing) is
strictly better than chained risk and complexity of layering on SIMD
• This slide deck presents the status quo and sketches future proofs
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
The @littledan / @brendan BBQ design
• After a BBQ joint after-meeting in January 2016 near PayPal,
@littledan and I worked out (written up via Twitter DM) a better
direct (no SIMD) plan, which is worth a recap for its constraints
• We agreed on no implicit conversions, so binary operator dispatch
needs no new magic: runtime semantics throw rather than convert
so both operands have same Type
• Unary operators could be single-dispatch or 1-ary functions
• Literals and operators are separate proposals, details mostly TBD
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
Notable future-proofing problem: ToBoolean
• Int64 and Uint64 zero values must be “falsy”, while SIMD all-zero
vectors are truthy
• Old sketch had ToBoolean operator on deck, but it would have to
be infallible, or optimizations suffer fatally (per Andreas Rossberg)
• New future-proof idea: numeric types (“value types”) declare their
canonical zero value (arithmetic identity; one of N in “zero cohort”)
• Bonus: also requiring numeric types to declare canonical unit (one,
multiplicative identity) wins for ++/— consistency and simplicity
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
Consequences/examples for Int64 usage
• 1L + 2L // 3L
• let x = 4; console.log(x * 5L) // TypeError
• console.log(Int64(x) * 5L) // 20L
• 0x1FFFFFFFFFFUL * 2L // TypeError
• 0x1FFFFFFFFFFUL * 2UL // OK
• 0x1FFFFFFFFFFUL * Uint64(scale) // also OK
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
Spec.html plan of attack and status
• Split “6.1.6 The Number Type” into subclauses of new Numeric Types
clause for Number, Int64, and Uint64
• Split “20.1 Number Objects” into subclauses of new Numeric Objects
clause for Number, Int64, and Uint64 constructors/prototypes/etc.
• Check all ToNumber uses to see which ones should be ToNumeric
• Refactor 12 Expressions semantics to delegate to Type(x)::op (see next)
• Revise Number uses such as SameValueNonNumber carefully (in that
case to be SameValueNonNumeric)
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
Future possible “value class” syntax
• value class Decimal {

constructor(x) {…}

static zero = Decimal(0);

static unit = Decimal(1);

static [Symbol.unaryMinus](x) {…}

static [Symbol.bitwiseNOT](x) {…}

// etc…

static [Symbol.add](x, y) {…}

static [Symbol.subtract](x, y) {…}

// etc…

}
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
Future possible literal suffix support
• value class Decimal {

suffix m = fromLiteral;

suffix M = fromLiteral;



static fromLiteral(s) {…} // may throw



// etc…

}

let three = 3M; // m and M in scope too
• Question: allow RegExp for early error on invalid literal?
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
Regular expressions for early errors?
• /(d{1,19}|

17d{18}|

18[0-3]d{17}|

184[0-3]d{16}|

1844[0-5]d{15}|

...

18446744073709551615)

UL/
• Very ugly, hard to handle other radixes, etc. Just say no! Let user-
defined numeric types’ literals throw at runtime if malformed
Brendan Eich Brave Software @BrendanEich
Always bet on JS
Spec Tour
Always bet on
Brendan Eich Brave Software @ BrendanEich
JS
Feedback requests and next steps
• Publish a browsable modified spec via brendaneich.github.io

(may move to tc39.github.io - stay tuned on Twitter!)
• Auto-generate an ins/del version of https://github.com/brendaneich/
ecma262/spec.html and publish via gh-pages
• Finish “20.1 Numeric Objects” spec changes
• Incorporate feedback on detailed changes in published spec

e.g., known bugs on 0L / 0L, 2L ** -3L, etc. to fix
• Propose operators and (separate, later) suffixes/value classes
Int64

Contenu connexe

Tendances

Migration Objective-C to Swift
Migration Objective-C to SwiftMigration Objective-C to Swift
Migration Objective-C to SwiftNattapon Nimakul
 
iOS NSAgora #3: Objective-C vs. Swift
iOS NSAgora #3: Objective-C vs. SwiftiOS NSAgora #3: Objective-C vs. Swift
iOS NSAgora #3: Objective-C vs. SwiftAlex Cristea
 
Optionals by Matt Faluotico
Optionals by Matt FaluoticoOptionals by Matt Faluotico
Optionals by Matt FaluoticoWithTheBest
 
Migrating Objective-C to Swift
Migrating Objective-C to SwiftMigrating Objective-C to Swift
Migrating Objective-C to SwiftElmar Kretzer
 
Railroading into Scala
Railroading into ScalaRailroading into Scala
Railroading into ScalaNehal Shah
 
Modern Compiler Design
Modern Compiler DesignModern Compiler Design
Modern Compiler Designnextlib
 
Basic Operator, String and Characters in Swift.
Basic Operator, String and Characters in Swift.Basic Operator, String and Characters in Swift.
Basic Operator, String and Characters in Swift.HSIEH CHING-FAN
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scalaRuslan Shevchenko
 
Functional Programming #FTW
Functional Programming #FTWFunctional Programming #FTW
Functional Programming #FTWAdriano Bonat
 
Денис Лебедев, Swift
Денис Лебедев, SwiftДенис Лебедев, Swift
Денис Лебедев, SwiftYandex
 
Dynamic Type Inference for Gradual Hindley–Milner Typing
Dynamic Type Inference for Gradual Hindley–Milner TypingDynamic Type Inference for Gradual Hindley–Milner Typing
Dynamic Type Inference for Gradual Hindley–Milner TypingYusuke Miyazaki
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N yearsRuslan Shevchenko
 
Swift Optional ??
Swift Optional ??Swift Optional ??
Swift Optional ??Chihyang Li
 
Java Tutorial Lab 2
Java Tutorial Lab 2Java Tutorial Lab 2
Java Tutorial Lab 2Berk Soysal
 

Tendances (20)

Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Migration Objective-C to Swift
Migration Objective-C to SwiftMigration Objective-C to Swift
Migration Objective-C to Swift
 
iOS NSAgora #3: Objective-C vs. Swift
iOS NSAgora #3: Objective-C vs. SwiftiOS NSAgora #3: Objective-C vs. Swift
iOS NSAgora #3: Objective-C vs. Swift
 
Optionals by Matt Faluotico
Optionals by Matt FaluoticoOptionals by Matt Faluotico
Optionals by Matt Faluotico
 
Migrating Objective-C to Swift
Migrating Objective-C to SwiftMigrating Objective-C to Swift
Migrating Objective-C to Swift
 
Monte Carlo C++
Monte Carlo C++Monte Carlo C++
Monte Carlo C++
 
Railroading into Scala
Railroading into ScalaRailroading into Scala
Railroading into Scala
 
Modern Compiler Design
Modern Compiler DesignModern Compiler Design
Modern Compiler Design
 
Basic Operator, String and Characters in Swift.
Basic Operator, String and Characters in Swift.Basic Operator, String and Characters in Swift.
Basic Operator, String and Characters in Swift.
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scala
 
Functional Programming #FTW
Functional Programming #FTWFunctional Programming #FTW
Functional Programming #FTW
 
C# basics
 C# basics C# basics
C# basics
 
Денис Лебедев, Swift
Денис Лебедев, SwiftДенис Лебедев, Swift
Денис Лебедев, Swift
 
Dynamic Type Inference for Gradual Hindley–Milner Typing
Dynamic Type Inference for Gradual Hindley–Milner TypingDynamic Type Inference for Gradual Hindley–Milner Typing
Dynamic Type Inference for Gradual Hindley–Milner Typing
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
 
Session#2
Session#2Session#2
Session#2
 
Session 3#
Session 3#Session 3#
Session 3#
 
Swift Optional ??
Swift Optional ??Swift Optional ??
Swift Optional ??
 
Constructor and destructor
Constructor  and  destructor Constructor  and  destructor
Constructor and destructor
 
Java Tutorial Lab 2
Java Tutorial Lab 2Java Tutorial Lab 2
Java Tutorial Lab 2
 

En vedette

Always bet on JS - Finjs.io NYC 2016
Always bet on JS - Finjs.io NYC 2016Always bet on JS - Finjs.io NYC 2016
Always bet on JS - Finjs.io NYC 2016Brendan Eich
 
meetup adopting java8
meetup adopting java8meetup adopting java8
meetup adopting java8Filipe Portes
 
Resultaten serious game who is john galt
Resultaten serious game who is john galtResultaten serious game who is john galt
Resultaten serious game who is john galtRob Oostdam
 
The Street Kids of Calabar: A Punitive Approach is Not Enough
 The Street Kids of Calabar: A Punitive Approach is Not Enough The Street Kids of Calabar: A Punitive Approach is Not Enough
The Street Kids of Calabar: A Punitive Approach is Not EnoughPIND Foundation
 
SAPI Solutions for Distribution
SAPI Solutions for DistributionSAPI Solutions for Distribution
SAPI Solutions for DistributionEric Thornell
 
Client-Side Performance Monitoring (MobileTea, Rome)
Client-Side Performance Monitoring (MobileTea, Rome)Client-Side Performance Monitoring (MobileTea, Rome)
Client-Side Performance Monitoring (MobileTea, Rome)Andrew Rota
 
Doctor, Lawyer, Poker Player, Physicist: The Best Engineers We're Not Competi...
Doctor, Lawyer, Poker Player, Physicist: The Best Engineers We're Not Competi...Doctor, Lawyer, Poker Player, Physicist: The Best Engineers We're Not Competi...
Doctor, Lawyer, Poker Player, Physicist: The Best Engineers We're Not Competi...Carina C. Zona
 
Iapmei incentivos industria 4.0 apt v4
Iapmei   incentivos industria 4.0 apt v4Iapmei   incentivos industria 4.0 apt v4
Iapmei incentivos industria 4.0 apt v4Pedro Cilínio
 
Onde é que nos encontramos para aonde estamos a ir e onde devemos estar
Onde é que nos encontramos para aonde estamos a ir e onde devemos estarOnde é que nos encontramos para aonde estamos a ir e onde devemos estar
Onde é que nos encontramos para aonde estamos a ir e onde devemos estarJorge Moreira
 
専修大学文学部50年小史
専修大学文学部50年小史専修大学文学部50年小史
専修大学文学部50年小史LettersSU
 
Commerce 2.x lessons learned
Commerce 2.x  lessons learnedCommerce 2.x  lessons learned
Commerce 2.x lessons learnedBojan Živanović
 
25 Quotes to Inspire your Operational Excellence Initiatives
25 Quotes to Inspire your Operational Excellence Initiatives25 Quotes to Inspire your Operational Excellence Initiatives
25 Quotes to Inspire your Operational Excellence InitiativesCarla Gregory
 
Node.JS error handling best practices
Node.JS error handling best practicesNode.JS error handling best practices
Node.JS error handling best practicesYoni Goldberg
 

En vedette (18)

Always bet on JS - Finjs.io NYC 2016
Always bet on JS - Finjs.io NYC 2016Always bet on JS - Finjs.io NYC 2016
Always bet on JS - Finjs.io NYC 2016
 
meetup adopting java8
meetup adopting java8meetup adopting java8
meetup adopting java8
 
Resultaten serious game who is john galt
Resultaten serious game who is john galtResultaten serious game who is john galt
Resultaten serious game who is john galt
 
The Street Kids of Calabar: A Punitive Approach is Not Enough
 The Street Kids of Calabar: A Punitive Approach is Not Enough The Street Kids of Calabar: A Punitive Approach is Not Enough
The Street Kids of Calabar: A Punitive Approach is Not Enough
 
SAPI Solutions for Distribution
SAPI Solutions for DistributionSAPI Solutions for Distribution
SAPI Solutions for Distribution
 
Client-Side Performance Monitoring (MobileTea, Rome)
Client-Side Performance Monitoring (MobileTea, Rome)Client-Side Performance Monitoring (MobileTea, Rome)
Client-Side Performance Monitoring (MobileTea, Rome)
 
Doctor, Lawyer, Poker Player, Physicist: The Best Engineers We're Not Competi...
Doctor, Lawyer, Poker Player, Physicist: The Best Engineers We're Not Competi...Doctor, Lawyer, Poker Player, Physicist: The Best Engineers We're Not Competi...
Doctor, Lawyer, Poker Player, Physicist: The Best Engineers We're Not Competi...
 
Iapmei incentivos industria 4.0 apt v4
Iapmei   incentivos industria 4.0 apt v4Iapmei   incentivos industria 4.0 apt v4
Iapmei incentivos industria 4.0 apt v4
 
DevLOVE仙台の野望
DevLOVE仙台の野望DevLOVE仙台の野望
DevLOVE仙台の野望
 
Par30 led spotlight 12w
Par30 led spotlight 12wPar30 led spotlight 12w
Par30 led spotlight 12w
 
Onde é que nos encontramos para aonde estamos a ir e onde devemos estar
Onde é que nos encontramos para aonde estamos a ir e onde devemos estarOnde é que nos encontramos para aonde estamos a ir e onde devemos estar
Onde é que nos encontramos para aonde estamos a ir e onde devemos estar
 
専修大学文学部50年小史
専修大学文学部50年小史専修大学文学部50年小史
専修大学文学部50年小史
 
Un Kano pour Mammy
Un Kano pour MammyUn Kano pour Mammy
Un Kano pour Mammy
 
Commerce 2.x lessons learned
Commerce 2.x  lessons learnedCommerce 2.x  lessons learned
Commerce 2.x lessons learned
 
25 Quotes to Inspire your Operational Excellence Initiatives
25 Quotes to Inspire your Operational Excellence Initiatives25 Quotes to Inspire your Operational Excellence Initiatives
25 Quotes to Inspire your Operational Excellence Initiatives
 
Los presupuestos públicos en estados y municipios
Los presupuestos públicos en estados y municipiosLos presupuestos públicos en estados y municipios
Los presupuestos públicos en estados y municipios
 
Docker: uma visão geral
Docker: uma visão geralDocker: uma visão geral
Docker: uma visão geral
 
Node.JS error handling best practices
Node.JS error handling best practicesNode.JS error handling best practices
Node.JS error handling best practices
 

Similaire à Int64

2 BytesC++ course_2014_c1_basicsc++
2 BytesC++ course_2014_c1_basicsc++2 BytesC++ course_2014_c1_basicsc++
2 BytesC++ course_2014_c1_basicsc++kinan keshkeh
 
Cs1123 11 pointers
Cs1123 11 pointersCs1123 11 pointers
Cs1123 11 pointersTAlha MAlik
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overviewTAlha MAlik
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013midnite_runr
 
Math with .NET for you and Azure
Math with .NET for you and AzureMath with .NET for you and Azure
Math with .NET for you and AzureMarco Parenzan
 
Programming in C [Module One]
Programming in C [Module One]Programming in C [Module One]
Programming in C [Module One]Abhishek Sinha
 
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxMarco Parenzan
 
CSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfCSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfssusera0bb35
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageRakesh Roshan
 
AVR_Course_Day3 c programming
AVR_Course_Day3 c programmingAVR_Course_Day3 c programming
AVR_Course_Day3 c programmingMohamed Ali
 
Developer’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageDeveloper’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageAzilen Technologies Pvt. Ltd.
 
Chap_________________1_Introduction.pptx
Chap_________________1_Introduction.pptxChap_________________1_Introduction.pptx
Chap_________________1_Introduction.pptxRonaldo Aditya
 

Similaire à Int64 (20)

2 BytesC++ course_2014_c1_basicsc++
2 BytesC++ course_2014_c1_basicsc++2 BytesC++ course_2014_c1_basicsc++
2 BytesC++ course_2014_c1_basicsc++
 
Cs1123 11 pointers
Cs1123 11 pointersCs1123 11 pointers
Cs1123 11 pointers
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Math with .NET for you and Azure
Math with .NET for you and AzureMath with .NET for you and Azure
Math with .NET for you and Azure
 
Programming in C [Module One]
Programming in C [Module One]Programming in C [Module One]
Programming in C [Module One]
 
C Programming
C ProgrammingC Programming
C Programming
 
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
 
CSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfCSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdf
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
 
AVR_Course_Day3 c programming
AVR_Course_Day3 c programmingAVR_Course_Day3 c programming
AVR_Course_Day3 c programming
 
embedded C.pptx
embedded C.pptxembedded C.pptx
embedded C.pptx
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
C#
C#C#
C#
 
Return of c++
Return of c++Return of c++
Return of c++
 
Theory1&amp;2
Theory1&amp;2Theory1&amp;2
Theory1&amp;2
 
Developer’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageDeveloper’s viewpoint on swift programming language
Developer’s viewpoint on swift programming language
 
Python
PythonPython
Python
 
Chap_________________1_Introduction.pptx
Chap_________________1_Introduction.pptxChap_________________1_Introduction.pptx
Chap_________________1_Introduction.pptx
 

Plus de Brendan Eich (16)

dotJS 2015
dotJS 2015dotJS 2015
dotJS 2015
 
Fluent15
Fluent15Fluent15
Fluent15
 
The Same-Origin Saga
The Same-Origin SagaThe Same-Origin Saga
The Same-Origin Saga
 
Taysom seminar
Taysom seminarTaysom seminar
Taysom seminar
 
My dotJS Talk
My dotJS TalkMy dotJS Talk
My dotJS Talk
 
Mozilla Research Party Talk
Mozilla Research Party TalkMozilla Research Party Talk
Mozilla Research Party Talk
 
Splash
SplashSplash
Splash
 
JSLOL
JSLOLJSLOL
JSLOL
 
Capitol js
Capitol jsCapitol js
Capitol js
 
Paren free
Paren freeParen free
Paren free
 
Txjs talk
Txjs talkTxjs talk
Txjs talk
 
Mozilla's NodeConf talk
Mozilla's NodeConf talkMozilla's NodeConf talk
Mozilla's NodeConf talk
 
ES.next
ES.nextES.next
ES.next
 
MSR Talk
MSR TalkMSR Talk
MSR Talk
 
Future Tense
Future TenseFuture Tense
Future Tense
 
Proxies are Awesome!
Proxies are Awesome!Proxies are Awesome!
Proxies are Awesome!
 

Dernier

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 

Dernier (20)

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 

Int64

  • 2. Brendan Eich Brave Software @BrendanEich Always bet on JS There are only two kinds of languages: the ones people complain about and the ones nobody uses. — Bjarne Stroustrup
  • 3. Always bet on Brendan Eich Brave Software @ BrendanEich JS Previous value/operator/suffix thinking… • Int64(0) ==> 0L // as in C# • Uint64(0) ==> 0UL // ditto • Float32(0) ==> 0f // ditto • BigInt(0) ==> 0N // N to avoid i/I • Decimal(0) ==> 0m // m or M, C/F# • User-defined suffixes and operators: | ^ & == < <= << >> >>> + - * / % ~ ToBoolean unary- unary+
  • 4. Always bet on Brendan Eich Brave Software @ BrendanEich JS Time passed, SIMD faded, new plan needed • Old plan was to build on SIMD landing in living spec.html • I hoped we would get more general “value type” semantics that way • But time matters; as Waldemar said in July, “we should just do Int64” • And @mikeal and I said exact same thing to each other in September • Insight: inducting from hardcoded Int64/Uint64 (with future-proofing) is strictly better than chained risk and complexity of layering on SIMD • This slide deck presents the status quo and sketches future proofs
  • 5. Always bet on Brendan Eich Brave Software @ BrendanEich JS The @littledan / @brendan BBQ design • After a BBQ joint after-meeting in January 2016 near PayPal, @littledan and I worked out (written up via Twitter DM) a better direct (no SIMD) plan, which is worth a recap for its constraints • We agreed on no implicit conversions, so binary operator dispatch needs no new magic: runtime semantics throw rather than convert so both operands have same Type • Unary operators could be single-dispatch or 1-ary functions • Literals and operators are separate proposals, details mostly TBD
  • 6. Always bet on Brendan Eich Brave Software @ BrendanEich JS Notable future-proofing problem: ToBoolean • Int64 and Uint64 zero values must be “falsy”, while SIMD all-zero vectors are truthy • Old sketch had ToBoolean operator on deck, but it would have to be infallible, or optimizations suffer fatally (per Andreas Rossberg) • New future-proof idea: numeric types (“value types”) declare their canonical zero value (arithmetic identity; one of N in “zero cohort”) • Bonus: also requiring numeric types to declare canonical unit (one, multiplicative identity) wins for ++/— consistency and simplicity
  • 7. Always bet on Brendan Eich Brave Software @ BrendanEich JS Consequences/examples for Int64 usage • 1L + 2L // 3L • let x = 4; console.log(x * 5L) // TypeError • console.log(Int64(x) * 5L) // 20L • 0x1FFFFFFFFFFUL * 2L // TypeError • 0x1FFFFFFFFFFUL * 2UL // OK • 0x1FFFFFFFFFFUL * Uint64(scale) // also OK
  • 8. Always bet on Brendan Eich Brave Software @ BrendanEich JS Spec.html plan of attack and status • Split “6.1.6 The Number Type” into subclauses of new Numeric Types clause for Number, Int64, and Uint64 • Split “20.1 Number Objects” into subclauses of new Numeric Objects clause for Number, Int64, and Uint64 constructors/prototypes/etc. • Check all ToNumber uses to see which ones should be ToNumeric • Refactor 12 Expressions semantics to delegate to Type(x)::op (see next) • Revise Number uses such as SameValueNonNumber carefully (in that case to be SameValueNonNumeric)
  • 9.
  • 10.
  • 11.
  • 12. Always bet on Brendan Eich Brave Software @ BrendanEich JS Future possible “value class” syntax • value class Decimal {
 constructor(x) {…}
 static zero = Decimal(0);
 static unit = Decimal(1);
 static [Symbol.unaryMinus](x) {…}
 static [Symbol.bitwiseNOT](x) {…}
 // etc…
 static [Symbol.add](x, y) {…}
 static [Symbol.subtract](x, y) {…}
 // etc…
 }
  • 13. Always bet on Brendan Eich Brave Software @ BrendanEich JS Future possible literal suffix support • value class Decimal {
 suffix m = fromLiteral;
 suffix M = fromLiteral;
 
 static fromLiteral(s) {…} // may throw
 
 // etc…
 }
 let three = 3M; // m and M in scope too • Question: allow RegExp for early error on invalid literal?
  • 14. Always bet on Brendan Eich Brave Software @ BrendanEich JS Regular expressions for early errors? • /(d{1,19}|
 17d{18}|
 18[0-3]d{17}|
 184[0-3]d{16}|
 1844[0-5]d{15}|
 ...
 18446744073709551615)
 UL/ • Very ugly, hard to handle other radixes, etc. Just say no! Let user- defined numeric types’ literals throw at runtime if malformed
  • 15. Brendan Eich Brave Software @BrendanEich Always bet on JS Spec Tour
  • 16. Always bet on Brendan Eich Brave Software @ BrendanEich JS Feedback requests and next steps • Publish a browsable modified spec via brendaneich.github.io
 (may move to tc39.github.io - stay tuned on Twitter!) • Auto-generate an ins/del version of https://github.com/brendaneich/ ecma262/spec.html and publish via gh-pages • Finish “20.1 Numeric Objects” spec changes • Incorporate feedback on detailed changes in published spec
 e.g., known bugs on 0L / 0L, 2L ** -3L, etc. to fix • Propose operators and (separate, later) suffixes/value classes