Effective module systems should avoid using tables as the underlying implementation because tables can be copied and mutated, leading to unexpected behavior; instead, modules should be designed as distinct entities with proper public-private visibility semantics, simple import syntax, and support for hot module reloading without relying on table mutation.
Deep Dive
Voraussetzung
- Keine Daten verfügbar.
Nächste Schritte
- Keine Daten verfügbar.
Deep Dive
It's how modules work that mattersHinzugefügt:
Honestly, this is beautiful. I think I love this so much. So, we have actual dog comments in here and we have an actual module system which I don't think I told anybody about like ever uh if I remember it correctly. But yeah, modules can look like this. You can define modules inside files but files by themselves are modules. So, uh this is quite standard before this. Uh modules just used to be tables which is suboptimal. You do not want modules to be tables cuz uh then your module is just equal to the value of it which is you know not not always what you want here. Uh so yeah that's what you have.
You also have like this fancy uh dog generator here. Uh right so it gives you markdown. Um you also have a what's yeah oh you also have like normal public versus private semantics which is always good. It doesn't [ __ ] suck. Uh /ample/docsv looks like this. So if you print like the module um it sort of looks like a table because it's a hashmap as well. Uh but it's not a hashmap like as much as a table if that makes sense. You know you can you can optimize it a lot better than that. You can probably like do a linear scan over it. Uh in case you export less than 50,000 billion trillion items which is what which is what you should probably do here. So yeah dogs just look like this. Uh triple uh triple those. They like uh remove the y space at the start. So this this is stolen from bash but it's like northern syntax is super confusing. Uh so yeah yeah is that is that we also have a what? Yeah this is the module demo and yeah they're going to look like this. They're going to look like this. So I'm thinking build should look like this. But let me first of all um import are going to look like that right? They look like like this now. Um so you just import the file and that's it. And that's the end of the story. and B is just bound to that name space to that mole. Uh and then you can like reload it whatever whatever when you access it is like not equal to it value whatever um yeah is that uh kind of similar to how tables used to work but now we have a lot more possibilities here like uh hot module reloading doesn't rely on like mutating the table and hoping that like the hoping that it's not copied cuz what if what if it's copied somewhere down the line. Uh and you have this right. So um you can you can import a module like that. Uh so let's say it's B.V or it's B slash. So if it's B slash it's going to be like yo if it has root uh import this is just root right. So it's the same as root. RV possibly maybe not. I feel like I feel like not doing it low key but um yeah maybe maybe it's that but if it doesn't have root you just import all of the tables. So B/ Av and all of that is imported as like A equals um it's imported as A equals B/ A.Vav. Uh same for the other modules, you know, that makes sense. And obviously since you're just given it table, right, it's going to be a macro here. Um possibly, maybe not. It should probably be a macro though. Uh you can buy some, right? You can say, yo, JSON is JSON final fast forever. uh you give it like a proper name instead of just hoping that it's like this. Uh you probably want it to be like that. Um and you're gonna have like get modules like actual git modules. But for that I need to like design a normal system uh a system that doesn't [ __ ] suck uh somewhere in your home directory which caches all of them. Add like certain tags. Um I'll also do like tags like this, but I'm thinking I don't I don't like have this right. I don't let it like auto increment by semantic version because there's a lot of um there's a lot of possibilities for a lot of like people to get bones which I I don't I don't want that. Now obviously you can still get boned whether you like specify a tag or not as long as it's like from the internet. Anybody can just rewrite the get history. So for that you can like ship a little like log file and then for log file you just you just like lock it forever like you don't you don't update uh the hash has to method uh and that's that that's like the end of the story and that's how you don't get phoned. Uh but that's probably not what's going to happen soon. Right? So for now it's just going to be this. Um right you don't specify like the protocol you specify just like the link.
Uh you can do it like that obviously.
You can like have it be a computed key which is like of any name. Uh yeah. So that that's just all of that. Well, obviously you're not going to have it like that. Um you're going to have it like that. Um but yeah, that's that.
That's just that. Uh I'm also thinking like a normal build system like like a super regular build system that everybody has. Uh which is the Zigish build system. Well, not everybody has that, but Zig has that and Zig is everybody, right? Everybody is probably going to try to copy the zig bill system in the next 10 years. Uh that's my prediction. Uh I I I I can put money on it low key. Uh so you'll be able to like bstep whatever whatever whatever fnc uh and then run whatever whatever. Uh but it's going to be a lot simpler than zig cuz uh there's just a lot less complexity in language like this than in zig. Um so you can you can have it like that. B package is all of this name is going to be the display name. the actual name is going to be different. Uh this is probably going to get not going to be here. Um this is probably going to exist. The desk is going to exist. Uh so uh it's going to be like I don't know um like triple triple quote and then this package does blah blah blah whatever it does whatever right all of that all of that and then and then you have the description like that. And the thing with that is that you can actually pass a like a revo file without uh that much trouble. Now obviously uh you can't you can't pass that easily. So you can actually execute it normally, right? You you can execute it with an actual um VM, but you sandbox you don't give it like IO. Uh you don't uh you make sure that IO any like IO functions are you make sure that IO functions are not imported, right? I'm I'm like I'm stumbling over words. I slept for two hours today. Uh but yeah. Yeah. Yeah. That's what you have. That's what you're going to have.
Um today we just have moles and dark comments. I'm probably going to add dog test as well if you're familiar with elixir as that. Um, but yeah. Yeah. Uh, give me some objections cuz you probably have objections here. High key. So, uh, did I forget? No, I didn't forget anything. Let's go.
Ähnliche Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
Re: 🗣️📍theprophedu📍2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 views•2026-06-04
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Instagram accounts got PWNed
EricParker
13K views•2026-06-03











