Search a title or topic

Over 20 million podcasts, powered by 

Player FM logo
Artwork

Content provided by Surma and Jake Archibald. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Surma and Jake Archibald or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://podcastplayer.com/legal.
Player FM - Podcast App
Go offline with the Player FM app!

TC39 Roundup Drama Edition Part I: Shared Structs

30:47
 
Share
 

Manage episode 453471781 series 3588048
Content provided by Surma and Jake Archibald. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Surma and Jake Archibald or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://podcastplayer.com/legal.

In this episode, Surma talks about the Stage 2 proposal "JavaScript Struct", which introduces fixed-layout objects and the ability to share them between realms.

Notes & Corrections from Shu:

Surma was slightly wrong about why private fields were originally considered problematic for sharability. The problem occurs when a class can be evaluated multiple times:

function makeClass() { return class MyClass { #priv; getPrivateField(instance) { return instance.#priv; } }; } const C1 = makeClass(); const C2 = makeClass(); const i1 = new C1(); const i2 = new C2(); // this throws! i1.getPrivateField(i2);

This behavior makes it hard to compile private fields just as "slots" on an object, as clearly additional behavior is required. This is somewhat at odds with the goal of achieving a fixed layout.

Also, launching is mid-2025 is very optimistic.

Resources:
  continue reading

16 episodes

Artwork
iconShare
 
Manage episode 453471781 series 3588048
Content provided by Surma and Jake Archibald. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Surma and Jake Archibald or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://podcastplayer.com/legal.

In this episode, Surma talks about the Stage 2 proposal "JavaScript Struct", which introduces fixed-layout objects and the ability to share them between realms.

Notes & Corrections from Shu:

Surma was slightly wrong about why private fields were originally considered problematic for sharability. The problem occurs when a class can be evaluated multiple times:

function makeClass() { return class MyClass { #priv; getPrivateField(instance) { return instance.#priv; } }; } const C1 = makeClass(); const C2 = makeClass(); const i1 = new C1(); const i2 = new C2(); // this throws! i1.getPrivateField(i2);

This behavior makes it hard to compile private fields just as "slots" on an object, as clearly additional behavior is required. This is somewhat at odds with the goal of achieving a fixed layout.

Also, launching is mid-2025 is very optimistic.

Resources:
  continue reading

16 episodes

All episodes

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Listen to this show while you explore
Play