 You don't get the original object that was garbage collected fast into the finalizer because the object is already garbage collected if you Some other systems like job like maybe that original object that this causes a lot of problems So at a high level both we preferences and finalized finalization groups finalizers are unreliable making the garbage collector might never Collect these objects or might do it after a very long period of time And it also may differ between different versions or different runs of the same program so It's important to not rely on this too much. There's a yeah Could you name like in finalization group like maybe finalize maybe? Register like something that's explicitly says it might not run or might not run Super that's an interesting idea. I don't think maybe register Anybody has any extra names that's that's great to include How this is a sort of failure from mechanism what I did in this document was like I wrote lots of text about The different cases that include failing And then when I got to use people putting in my additional pieces of text about Yes Well Can you can you say more about the use cases But I definitely Use case Years that Developers want this capability and it's been specifically denied because there was a fear about it being Misused the current calculation to add this feature is largely based on web assembly if you have things that are in web assembly that you're trying to expose to JavaScript's Web assembly memories is sort of like see memory. It's this big It's this figure a basically you want to allocate chunks of it for a particular purpose And then you have to later explicitly freedom and we craft and finalization through this capability At the same time experience going to be useful for a lot of different things in JavaScript as well, so we're This is the work of like till shatter. I from Mozilla. It's actually gonna second round from Google as well as others from work and Yeah, so we're going to present it for stage three of this upcoming Any other thoughts They're not right should they be I want my Yeah, so the experience with Java is a big reason why we didn't have Like a lot of people in the JavaScript VM Implemented community come from a you know, there's a lot of parentage and over that and It my understanding is that a lot of large Java programs put complex logic in their finalizers that need that are needed for the program to sort of do its thing and see And We really I really want to figure out how to discourage that in JavaScript because if this pattern Liferates it's going to make it harder for garbage collectors to you to evolve over time It's going to be like really useful for garbage collector containers So I Think making making things like finalizers never well, I mean so one thing is Java has this Thing where you can it passes the object into the finalizer and we specifically don't do that here I think we I think we should not include such an option Exit because that will give another kind of case where people will get this unreliability And they'll be unable to base the program books would be more obvious Yeah, I don't have a particular use Well, I think I definitely agree but like passing in the object concept all sorts of crazy things We animate the object Yeah, yeah, I mean, I do you do you think that it will cause big problems to not have this option to I don't have any but I don't have any reason why It's trivial to wrap the API and Create something that does like as a process Exit and every note around the same code Something you can do Great and I encourage you know to not do that I mean I think herds. I've no corner not to that. Of course. He kisses We are currently using the weak crack mechanism that is provided by Yeah, who sold some issues with the whole and deprecated the main model So that's so that you know that we had some issues and that sold it and We might use the press for implementing some some sort of For with us in books Context locker storage Things that's saying that this is on the on the radar domain essentially need to solve the exact same exact same problem and That could have been a solution that's so that You know it's feedback is not but yeah, so I'm curious Did you get a chance to look at the new graph API? Do you think it would suit these use cases? Okay, so but I just you know, yeah, I mean I thought there was some design for async books where it was gonna Maybe not need some of those Yes, yes, no, no, no, we are going in that path, but it's it's still the solution for domain has been to use The super specific yeah, it's provided by the because we don't like this So cool, well you can experiment with this API today in Chrome or I Don't know which no version it would have landed in but at least know the LKG are would okay with I Think it's dash-dash harmony dash week-dash refs Okay, and this day that means the end of heating. Okay Thank you No, the dismantling will be suddenly different, but probably is Interesting different about the thing The semantics are slightly different, but the API is My my time is to work out this the cell details right up the formal top API already worked out before I So so top of the wave Maybe maybe this is about models everyone will run out of the room to avoid the controversy But if you don't then Anyway, I think it's really cool feature which is good for script writing which is a big use for node where you just You know people use the node sink IO API is a lot because they're they're more convenient because you don't well Historically you have to use callbacks, but even with from side things you put everything in a function So if you just have a little script where you just want to do something You have to like write it in a main function and then like call it But instead what if you could just You just have a way at the top look And with this proposal It works not just with modules as the main function, but also Modules and like the top level the module graph, but it also works with modules and other things to thin down so if your module needs to do some Utilization which might want to contact a database or read some file Then rather than doing sync IO for that you could do an async IO with promises using top-level away and a really important feature of this which I guess Has the potential to improve startup time is that if you import multiple modules and they all have top-level away The their initialization code runs in parallel so If one module depends on another then that second one won't run until the first one is already initialized But if you have two different modules that each need to do their you know read their different files off of disk to figure out how to configure themselves or something then Then those five ways can proceed in parallel Because it's based on easy to wait And without that like there could be some conventions with promises like what each module returns a promise of the export objects, but that that all gets really messy and Kind of unscalable if you have a big model graph that all depends on something that's easy So that's why this proposal is added to the core of the language Yeah, and so Guy guy Bedford and Miles and I collaborated on this sort of the details of semantics and it also a Long FAQ so here is any any thoughts on this proposal. It's from space. No thoughts A lot of people are waiting for this Who's waiting for this? I Just have a question about the theme that argument against greatness I'm just wondering what the argument would be against this. I don't know that anybody here wants to volunteer an argument against it Again stop the right. Yeah This is like the static thing where models are supposed to be parsable stuffy and everything is synchronous you can see the imports and exports easily, but if you have top level weight, then the actual model body can Do a sequence stuff and then the exports might not be available synchronously and that might be it's always confusing semantics where That's so there's this idea that you expect multiple loading to be synchronous. I think Particular hazard that you described is present in like this buggy example here like in the absence of top-level weight you can just Yeah in the absence of top-level weight you could just you know have an async Function that you call immediately initializes some variable to get exported But this is obviously immediately racing this shit people something worse actually they export it then Then because of promise of simulation But that only works with that it doesn't make any sense like They're being reasonable in their own perspective, but it's not the way I would approach this particular Well, so I'm really I'm really happy to see this this positive response like working through these proposals been talking with with a lot of people who have these various different Concerns and we're trying to work through the concerns. There were some concerns about the execution order. I think you've landed on This is back here. Well, like especially through guys work We've landed on a really I think predictable and and like regular Execution model that matches how long we've worked today There were some ideas for like a slightly more radical change that we decided not to go with and Yeah, I mean there's also like the cgs interoperability issue There's no way that you could require a module that hasn't awaited it because you can't like re-entry lead but Yes, that answer the question People say a little more about all their positive feelings about this You know as someone I I was very much used to the no style and by that I mean, yes, I And as someone who's like beginning doing beginning to do my closing a six I was seeing a lot of examples in the internet of like he's away and all those examples did not Just like a tiny post Assumed you have it in a comp. So from like a learner perspective It's nice because you're not gonna get bitten by that of like what am I doing wrong? I'm gonna spend three hours figuring this out This doctor this this was assuming knowledge I didn't have and so from that perspective it's like you're making it easier for learners and beginners to Use the platform and like I understand these weird Yeah, we're moving the weird barriers. That's great I'm also I'm wondering also if people have run into use cases where they have a module that's not at the top level of module graph or ones that one that Is sort of deeper in the graph that others depend on that would make sense to use this Topable waiting for like I mentioned accessing configuration files or databases when starting up a module But then other people say this is an anti pattern You must not have this proposal because it would hurt people to do that stuff Yeah, it's essentially yes No, I know people would do it and To some extent it would make their cause a little bit less brittle Essentially because it's so it's a both a good thing and a bad thing at the same time So it is kind of new problem. What's that? What's the good part that I think so the good part is that Currently I see a lot of people creating Good as arts so essentially they they said they sign a module in the node They're starting a model.export We've been an awesome function one while this yes, they will call it Yeah, don't look at me like that Having top level of weight on a module would solve That type of a dark even though it's an anti-pattern anyway, so what should it do? So they should be having an asynchronous bootstrap phase for their application, right? Okay, that's what they should be doing. However asynchronous is hard and People coming on know they don't have the knowledge of setting up the project in a way that is That is reliable, okay, it really gets very easy to set up the project in a way that makes you do like initialization in a No, it's a great way. Do you think top-level weight provides like an acceptable default? Yes, they could eventually migrate to that part. Yes That is the answer I can I can run down a paragraph for you if you want to That'd be extremely helpful if you could file an issue on the repository with that paragraph That would be the best way to get it out to people. Yeah Yeah, you can't see but github.com slash tc39 slash proposal top-level weight So that's a that's a really good question Rebels need to have more changes than just top-level weight In addition to top-level weight, you also want to be able to like redefine and concentrate your goals and you want Like something in curly brackets that you want that to be treated as an object literal rather than as a block Well, but then other times if you want to include as a block and There's so there's a proposal for making a different grammar for rebels Yeah, top-level weight obviously needs to be supported in this in this context this proposal was Started by Bradley Various. I can get a good job of it and they can use a co-champion if you want to get involved in Pushing forward the state of the art of what he can do in the node repel and making sure that this is common across the ecosystem because Everyone I everyone I've got to agree to make sense to be comment across the different places you put in JavaScript What the snagging some ripple is? I Let's be in touch I wrote I wrote a summary of this whole thing that I can send to somebody who's interested in being more involved in So yeah, I think we send it to you Any other questions or comments? Yeah, so I'm wondering Should we now like write ASD based like little like transforms or like taking all the like async If he's you know top of like like async if he's ever created to like Exist problem, you know, I just like to move it to the Is the constitutes a genetic change because when you have a weight in the top level what that means is that things that depend on your module We'll wait for that But if you have an async if he it's just gonna go and basically like spawn off another thread and run the background So you might want that. Yeah, I don't know if the grammar Syntax is expressing this in a very clear way, but that's that's like how it all works out in JavaScript Like if you make a promise and just sort of drop it on the floor like okay great You've run something maybe it's gonna have a side effect like in the background. Yeah, and if you await it, then it's going to you know not let the outer async function resolve until That happens so that's sort of what top of the way to sign it to That's a really good point can I convince you to Great, thank you so much. Yeah, if anybody wants to get involved in helping out with education materials for this I think this is gonna be really important and helpful But also same with the other one, but I think we press is like an expert feature and the top of the way is like everyone feature So So finally Well the temporal proposal This proposal adds a new date except one that's like good It's a little different from something like moment which is based around one big type So it is immutable which is different, but the bigger thing is that there's a family of different There's a family of different date types when you have different pieces of data So say you have just a date But you don't have a time so we're talking about like May 29 2019 like a calendar date. This comes up sometimes an application programming With date or with moment you could say like, oh, yeah, like midnight. I guess because I don't have a time With temporal it's all based on a data model where based on the information you have you choose the appropriate type So for that you could choose like civil date and you have If you have a like a time that happened a point in in global time, then you would use an instant sort of on the other end of the The spectrum where instant doesn't have a time zone But you can also have something that doesn't have a time zone if you compare this with something like JavaScript The JavaScript data model is just entirely broken because it doesn't have a time zone in it, but then it has things that act on behalf of the Do calculations based on a time zone based on whatever the sort of local time zone is Which is just just really weird and then moment and cruise on that by having a data model It's basically like zone date time where you have a time on the global timeline and a time zone but This still lets you fall into your sort of logic areas where you might round back by a day because You're looking at the wrong midnight and anyway So here you just provide the information that you have and it has We have a reading and a polyfilth and it's at stage two we're Looking into proposing it as a built-in module. Maybe it could be like STD Poland temporal They would export these different classes. Yeah, so here's like this really detailed documentation that Bill Duncan wrote up and It'd be great to have your your feedback on this proposal Yeah, yeah, can't probably look more about built-in modules like is there any Existing ones or like are there some rules that are going to be put in place for new features What do you mean by rules like If we just introduce this as built-in modules, then that I would expect that other Features in the future would follow the same pattern and that was built-in modules as well. Yeah, right So are there some guidelines of being discussed for? What is building models would be and there are guidelines being discussed I don't think there's a great right about it right now and so this is The the hope from many people is that rather than adding properties to the global objects Like we just put saying okay, so they instant zone daytime. Okay, they're all properties of all Just like URL and text encoder at date and string Eventually we might write into problems due to that with compatibility because it overlaps with somebody else's Usage it could be confusing but also it's you know JavaScript developers are Importing things from you know NPM and they're they're requiring things and if people are using this Ergonomic syntax of modules when we talk about built-in modules in DC 39 It's always something that yes, it's not about you know, it's not about cgs. We're only meaning the native modules with the import statement and The hope from many of us is that new features would be added in modules. This is something that that has been agitating for a while and We haven't really made up the decision yet So there are various different ideas being thrown around about how built-in modules would work Apple has a proposal that they would all be Frozen which is interesting To be brought up import maps, which is a proposal being discussed at the WICT, which seems to have pretty broad buying display for Allowing polyfilling of built-in modules and allowing sort of this extra layered interaction when we're solving a module Specifier, okay resolving a module specifier. What I mean by that is when you see import and it's a string There's something that translates from that into liking node filing or the web To figure out what to fetch To figure out where to get the module from so import maps lets you In add for each one of those in a fall back place So you can say for a built-in module if that built-in module doesn't exist actually resolved it to this other thing That has the polyfill or even if it does exist actually resolve it to it this thing that will Replace it and take it as something else And so that layers sort of on top of counter scripts I'd like us to continue using web ideal for built-in models What is web ideal? What is web ideal? Web ideal also lacks in getting started back But by deal is a special language that you can use to describe interfaces Most web API's not JavaScript API's use web ideal in this specification And this is so for example texting coder and URL are in their specification They include it sort of like a header file for web ideal. So you could think of this as like a Dts file, but it's a little different from that because So here instead of classes interface instead of extends it says colon And then when you have Like a getter-center pair it says attribute You know you have you know methods those are called operations. Anyway, this all comes from like Corba It's historical Yeah What's Corba, I don't know I don't know It's in the 90s They could be transparently across computers and anyway, we sort of Walks back from that. I think it's good to think about Network boundaries that was like one of the takeaways But anyway, one thing that they had was this cool language to describe interfaces And so this could they said we have a class with these sort of methods and fields And it's really useful because when you have a method for example like this this drawing tango that takes these doubles Okay, it's really weird that it says double. It should really say a number, but Double basically just means number. It's just the funny way that web ideal needs it And so in down script when we have a function in the down script center library There's actually an origin that happens. So if you pass in a string Where it says double it'll cast the string to a number So it'll call like to as if you're calling the number constructor on the string So they'll like first the first the string and with ideal this these conversions are the semantics of The ideal so it's responsible for adding these type checks So it could either throw an exception or if it convert one value to another value And this is really useful any get in your core. There's a lot of checks and Casts that happen at entry points to functions And I think historically they're right in security issues based on Chicks not happening. I don't know about the details. Anyway, or at least the checks it'll allow some over time and so I Think this is a nice rigorous way to specify APIs And so I want to look into whether we use this for you know The new generation of the JavaScript Center library adding a lot more things to sort of get good quality I'm wondering if it makes sense for note Also, and if there are changes that we can make when I deal to make it more interesting Or for both in JSF projects in general So like this down is based on parsing these parts of the specification and automatically generating JavaScript code which does the same thing Okay, any comments or questions Hey About using with ideal in court and wondering if people will feel comfortable with generating the interfaces You know with something for example that measured like Just on or other reference simplification of all extender users They have a generator that like parsed the Web IDL, you know Files and then like generate a bunch of draca file that Get in an implement like generate the interfaces while living the invitation for the implementer to like actually fill in I'm wondering if people will be comfortable with using this for new web API vision or Like convert existing web API invitations to it For example, like converting the URL Invision to use this Generated thing instead of like currently what we are like him writing the classes in the web LL Specification and it's not nice. There's some holes there So yeah, just wondering I'm really excited about this this effort from Jay You know browsers went through a similar evolution where they used to just have a hand written c++ thing that kind of corresponded to the specification and then everybody figured out I don't know Maybe almost 10 years ago now that it makes more sense to generate this stuff automatically and Just let both the browsers and the specifications to get more like rigorous and Good any concerns Okay, so are there any other topics that people would be interested in in reviewing? So, yeah, well, it sounds like I was out of the room for top level. It's sorry I was there. Oh, it was so positive. Okay, cool Want to summer is for miles So I'm wondering like in the future would people be interested in maybe remotely having a conversation like this because for me This was really interesting to hear all your all your thoughts. Yes, okay Cool, I guess I guess one thing that's worth clarifying. They don't know if they came up in the discussion Never heard me. Yeah Top of the wait right now is only targeting the module cool. It's not targeting the circle So that means common JS but not yet top of the wait They would only be That would have talked about today. It doesn't mean that at This tc-39 we couldn't in the future Try to standardize it in this for cool or alternatively that the node engine couldn't try to implement Inside of like our kind of Common JS, but it would like break everything. There's horrible applications And so our script So I think motivation for don't ever wait I'm saying is like you need to conditionally load models Inside the inside the model utilization and because like we have secrets api's and have like required sickness Like I don't think there's like I was like a bunch of time. So when I needed to talk about more weight in the Yeah, was anyone here effort stuck to talk about more in common. Yes, like other than saving writing Yeah, but I'm trying to do something as a conch as well as being stuck because I mean, that's that's what I'm starting earlier, but I don't And I think that's for scripts, but I've never had like an assassin You're just reading a lot of script. You can just write it in the module I think the thing that will introduce is like this pattern That are not capable of being recreated in the module goal today that you'll be able to do the top That's maybe the main benefit of like hey, I have this like asynchronous work But I want like whatever is done after that work exported as simple Like that is the pattern that it will make possible that is not currently possible In the module goal that we are used to in common JS and use that pattern a lot on the server side of JavaScript That we will lose as people transition to models, but this will help us retain a lot of those patterns Yeah, I'm really excited about that Aspect of it. I want to encourage people whatever possible to still use the import statements And to not just switch everything to using topload weight with import if only because it's It's more parallelizable on startup You can see further ahead in time the engine can see further any time which modules you're using and it can initiate those like file reads and by pro generation a bit earlier So, uh, and it's more safely analyzable by tools. So please don't just Start using top of the weight for a really uh, I don't know Anybody has suggestions for how to document that because this is I Are people gonna listen to that? I I don't see why they shouldn't I don't know why they Would want to do that But people have frequently get this misunderstanding on top of the weight that like that means the patients are clean And so I want to yeah Yeah Is All right, um, so I have an idea so I think um, I don't know anyone Everyone caught when I was saying earlier around the education around like You know if he's and why you maybe shouldn't automatically just change everything to top of the weight Like so I think there's a lot of opportunity to do a lot of education around modules and I'm wondering if um You guys would want to collaborate on a full project. That's like, I don't know modules dot dev I bet like mildly owns that domain and maybe you can like give it to us Fuck you. No, I want it first now Three g sorry Um, but uh, so But basically to just have like a simple Sat like one page site that like like a like a fun explainer. That's super low Like low floors. Um, because I think there's A lot of misconceptions and I think like hearing like like learning about this stuff in a way that's kind of like Um, no contributor approved, right? Uh, and and like like from folks on the tc or like In the no community folks that are actually working on these things Um, would be great like and uh, very good for like the education and the ecosystem as a whole And you know having examples and you know and having a place to also funnel questions From the community around like what's confusing and then like extending out the educational aspect of the one page site With like videos and work content Um, I don't know. It would be a fun project if anyone's interested in collaborating on that Like thoughts I'm excited by that idea I knew you would be But yeah, so I don't know maybe we can I guess what would be the best place to Um, should just find the issue in the summit repo on this and we can see the discussion there for you Yeah, so uh, you know, thanks everybody for for this really interesting discussion and Let's let's keep this going Thank you