23:38 was my moment. Many, many videos of nagging about the beauties of multi-cursor editing vindicated in a single statement. At 23:00, when you highlighted that text and started holding down the "select next occurrence" keybind, it made it all worth it lol.
@@awesomekling You can also use the "Refactor this" functionality to quickly rename all occurrences or update a signature. It's found under the "Refactor" settings
It really is. It feels like web devs invent a new way to produce some of the most bloated js output you've ever seen from their TS compilers or babel or whatever every two weeks. Not to mention the insane framework overhead.
You did actually use your twitter account as a test case for WebKit in two separate commits, you just bungled the search at 54:12. Searching WebKit myself, it was referenced in 1b178ce0a52bf66a195f2fb7a65c96329684c9c1 and 4a06e61f8088e777acb271812f5ef3b6ba69d421. :^)
Yeah, I was heartbroken when I saw the typo and he concluded that he hadn't used it Edit: watching until the end, Andreas found the commits after all :^)
It can be probably improved a bit more, but with a bit complex API, extra perf overhead and complexity. Instead of storing offset from the start of the file, store the offset from the start of the AST Node as u16. Then add up offsets from the root. But then, you will also need some method to have fallback for larger offsets (i.e. separate ASTNode template to store more data). Definitively good to shave just a little first. Also it might be possible to just store offset for functions, and nothing else. Then if the offset if required (i.e. when accessing stack of the exception), the source code of that function is reparsed. But that is really really tricky.
I think "start_offset=0, end_offset=filesize" is a valid value the parser uses. Also, I don't think saving 2 bytes will bring the size below the next 16-byte alignment boundary.
I can imagine JS generators outputting a ridiculous amount of lines of Javascript, although I still think you're right on 4 billion being pretty difficult to achieve (especially since these values are only used for exceptions whose location is illegible in that sort of situation anyways). That did make me pause a little to figure whether it could happen, though 😄
@@Mustafaq9 That's the second thought I had, yeah. Not completely impossible, if a malicious website sends a user some ridiculous payload to try to cause an overflow-related exploit (think especially a fake site to download movies or something)
@@Alkex0 I tried to open a 4 million line html file with no js in Chrome and Firefox a little while ago. They both crashed. It was a generated file from a documentation tool.
My observation of why this was not approached by anyone else before, is that you need at least an above average understanding of C++. That said (based on the contents of this video), it also seems a great way to learn more about LibJS and get a better understanding of C++ by "just do it". I must admit that in new code creation I often use these types of pre-whatif (for me tho its usually related to "blocking" vs "non-blocking", where faster machines can mask the underlying issue).
@@driedurchin I would have assumed that it was a type system feature, and checked at compile time. Compare with the Maybe type in eg. Haskell, or Option/Result in Rust, which do not carry their state as runtime. Of course you actually need to check at runtime, but if you don't do the checks the program won't compile, so the state can be erased from the binary.
Multicursor on 154 lines?! Such bravery!
It is kinda incredible for me that Twitter front-end is built on top of three layers of abstraction: React -> React Native -> React Native for Web
Ah, that's why the mobile app feels so similar!
@@kreuner11 that's also why its equally slow and doesn't work equally often
@@chyza2012 no, I often forget I'm using the website instead of the app
Sort of painful, the modern web...
Many more than 3 layers
23:38 was my moment. Many, many videos of nagging about the beauties of multi-cursor editing vindicated in a single statement. At 23:00, when you highlighted that text and started holding down the "select next occurrence" keybind, it made it all worth it lol.
Thanks for the nags!
@@awesomekling You can also use the "Refactor this" functionality to quickly rename all occurrences or update a signature. It's found under the "Refactor" settings
_are you really gonna have more than 4 billion lines in your javascript file?_
A dangerous game to play with web devs.
It really is. It feels like web devs invent a new way to produce some of the most bloated js output you've ever seen from their TS compilers or babel or whatever every two weeks. Not to mention the insane framework overhead.
You won't have 4 billion lines because all the lines will be packed into just one lines two shave a couple of bytes from your bloated bundle
"Eventually you have the shave the yak yourself" -- This should be on a t-shirt.
Go on Zazzle and design one yourself. lol
330 MB to load up twitter. Compared to Google Chrome ... seems about right 😋
The VERIFY() calls should check that the values are less than invalid_marker, otherwise it is technically possible to create an invalid one
6:30 hello! :D
Fantastic! Cannot wait to see the equivalent work on the Mastodon interface :^)
xD
You did actually use your twitter account as a test case for WebKit in two separate commits, you just bungled the search at 54:12. Searching WebKit myself, it was referenced in 1b178ce0a52bf66a195f2fb7a65c96329684c9c1 and 4a06e61f8088e777acb271812f5ef3b6ba69d421. :^)
Yeah, I was heartbroken when I saw the typo and he concluded that he hadn't used it
Edit: watching until the end, Andreas found the commits after all :^)
@@alakis Indeed. This is what I get for commenting before making it to the end of the video. :^)
It can be probably improved a bit more, but with a bit complex API, extra perf overhead and complexity. Instead of storing offset from the start of the file, store the offset from the start of the AST Node as u16. Then add up offsets from the root. But then, you will also need some method to have fallback for larger offsets (i.e. separate ASTNode template to store more data).
Definitively good to shave just a little first.
Also it might be possible to just store offset for functions, and nothing else. Then if the offset if required (i.e. when accessing stack of the exception), the source code of that function is reparsed. But that is really really tricky.
I think "start_offset=0, end_offset=filesize" is a valid value the parser uses. Also, I don't think saving 2 bytes will bring the size below the next 16-byte alignment boundary.
Why do you get runtime errors for undefined symbols? Shouldn't the linker complain about missing symbols when linking ladybird?
maybe -k 0?
I can imagine JS generators outputting a ridiculous amount of lines of Javascript, although I still think you're right on 4 billion being pretty difficult to achieve (especially since these values are only used for exceptions whose location is illegible in that sort of situation anyways). That did make me pause a little to figure whether it could happen, though 😄
4 billion bytes would be ~4gb. Good luck downloading that web page 😅
@@Mustafaq9 That's the second thought I had, yeah.
Not completely impossible, if a malicious website sends a user some ridiculous payload to try to cause an overflow-related exploit (think especially a fake site to download movies or something)
@@Alkex0 I tried to open a 4 million line html file with no js in Chrome and Firefox a little while ago. They both crashed.
It was a generated file from a documentation tool.
My observation of why this was not approached by anyone else before, is that you need at least an above average understanding of C++. That said (based on the contents of this video), it also seems a great way to learn more about LibJS and get a better understanding of C++ by "just do it". I must admit that in new code creation I often use these types of pre-whatif (for me tho its usually related to "blocking" vs "non-blocking", where faster machines can mask the underlying issue).
Kling-wrapped nicely!
nice, keep up the good work :^)
What OS is Andreas using?
Ubuntu mate
Yes!
Now we can watch the blue bird burn from Serenity ❤️🔥
It's burning so bright that even Nero would get jealous lol
Don't worry Elon's crack team will be optimising the site further 😜
Huzzah!
I'm not a C++ programmer, but I wouldn't expect an "Optional" wrapper to contain the state at runtime.
Then how would you check if it contains a value?
@@driedurchin I would have assumed that it was a type system feature, and checked at compile time.
Compare with the Maybe type in eg. Haskell, or Option/Result in Rust, which do not carry their state as runtime.
Of course you actually need to check at runtime, but if you don't do the checks the program won't compile, so the state can be erased from the binary.
@@FreeScience Oh I see what you mean. What do the checks compile down to if the type doesn't carry presence information?
Can't wait until Twitter just responds with 502
What a diet!