JS Bytecode VM (Part 1): Let's build a JavaScript bytecode VM!

Ғылым және технология

SerenityOS is open source on GitHub: github.com/SerenityOS/serenity
Discord: discord.gg/29gCcKsXkF
Merch: serenityos.creator-spring.com/
Follow me on Twitter: awesomekling
Sponsor me on GitHub: github.com/sponsors/awesomekling
Support me on Patreon: patreon.com/serenityos
Donate via Paypal: paypal.me/awesomekling
I drink Twinings Earl Grey tea! If you want to order some for yourself, you can support me by using my affiliate link: tidd.ly/3e9TfZG
SerenityOS is a Unix-like operating system that I'm implementing from scratch. serenityos.org

Пікірлер: 88

  • @TigreXspalterLP
    @TigreXspalterLP3 жыл бұрын

    Me: Fixing one bug in eight hours Andreas: Writes a complete JavaScript bytecode VM in the same time

  • @salman8562

    @salman8562

    2 жыл бұрын

    which bug

  • @tervicke487
    @tervicke4873 жыл бұрын

    My man just uploaded the whole playlist at once nicee

  • @Miles-co5xm

    @Miles-co5xm

    3 жыл бұрын

    isme se kuch samajhta hai ? mere ko bas maja aata hai

  • @tervicke487

    @tervicke487

    3 жыл бұрын

    @@Miles-co5xm same bhai

  • @Miles-co5xm

    @Miles-co5xm

    3 жыл бұрын

    @@tervicke487 banaega koi project mere saath ?

  • @tervicke487

    @tervicke487

    3 жыл бұрын

    @@Miles-co5xm discord pe baat karte Brokenhammer #1475 mag dal de na class chal raha he

  • @Miles-co5xm

    @Miles-co5xm

    3 жыл бұрын

    @@tervicke487 req accept karlo

  • @pako_powr
    @pako_powr3 жыл бұрын

    "Hmm Andreas hasn't uploaded for a while I wonder what he's up-" ... omg

  • @awesomekling

    @awesomekling

    3 жыл бұрын

    :^)

  • @johnnic431
    @johnnic4313 жыл бұрын

    Seven at once? A gold mine!

  • @FruchteisMitErdbeer
    @FruchteisMitErdbeer3 жыл бұрын

    I love how easy it is to follow your coding. The way you write programs, by sketching them out and then filling in the required parts, really appeals to me.

  • @SrIgort
    @SrIgort3 жыл бұрын

    That's awesome, JIT is just in the corner xD

  • @louis1001
    @louis10013 жыл бұрын

    I will shamelessly(fully?) copy your path and code along because I've been meaning to study this topic. Thanks!

  • @jmpjns
    @jmpjns3 жыл бұрын

    I'm currently reading the books "Writing an interpreter in Go" and "Writing a Compiler in Go" by Thorsten Ball, these videos are perfect timing :D

  • @127.

    @127.

    3 жыл бұрын

    Wew, I am reading same book!

  • @Mustafaq9
    @Mustafaq93 жыл бұрын

    I was kinda disappointed that there's not been a new video out for a while considering you've been working on Serenity full-time now, but then you come along and bless us with 7 videos. I know what I'm going to be doing at nights all week! Really appreciate all this content, I have learned so, so much from these... These are really perfect for when you're in that intermediate phase where you're comfortable with programming and C++, but are still trying to get your head around how to architect complex projects like this. Thanks for not staging these videos out one per week and just letting us have all of it 😁

  • @_nit
    @_nit3 жыл бұрын

    One of my biggest problems when programming is overthinking and wasting time on re-analyzing the implementation. Watching your videos and seeing how you avoid this countless times has helped me so much :)

  • @LKokos
    @LKokos3 жыл бұрын

    Great video! There was a weird black screen for a moment at around 1:04:30 and again at 1:18:10

  • @HarshitSharma-kk6yz
    @HarshitSharma-kk6yz3 жыл бұрын

    i am too stupid to understand all of this...yesterday I had my interview(i got selected btw ) they asked which open source project you like the most I said serenity they asked me about serenity ....like what is serenity ...and then what is POSIX compliant means .... and thanks just because of your videos i was able to answer them properly

  • @JannisAdmek

    @JannisAdmek

    3 жыл бұрын

    that's so awesome, congratulations on the hire!

  • @HarshitSharma-kk6yz

    @HarshitSharma-kk6yz

    3 жыл бұрын

    @@JannisAdmek thanks

  • @sebastianmestre8971
    @sebastianmestre89713 жыл бұрын

    I started making an interpreted language at about the same time you started working on Serenity's Javascript engine. I've been meaning to implement a bytecode interpreter ever since, and even started working on it a few months ago, but felt like it was more work than it was worth, since the slow part of my interpreter was not the tree-walking, but other things, like my very bad GC, etc. I recently made some large improvements to how we handle temporaries in my interpreter (just standard things, like putting temporaries, some of them unboxed, on a software stack, optimizing the function call convention around it, etc), and was ready to give outputting bytecode a second go... but aw man, you beat me to it

  • @moody54324
    @moody543243 жыл бұрын

    Honestly , ive seen great engineers out there , but the way you sketch that code is awesome. Easy to follow, work on it, and contribute to. Complex topics gets down so that even beginners love and understand , Well done mr. Senerity OS

  • @Moonify
    @Moonify3 жыл бұрын

    Im so Hype for this series.

  • @chrissimpson6088
    @chrissimpson60883 жыл бұрын

    Andreas, this is amazing! This playlist should be required watching at the start of every CS degree.

  • @mzmzgreen
    @mzmzgreen Жыл бұрын

    I love this format where you start a new thing from scratch! Most of the videos are about improving the existing stuff, please do more of this sort of streams where you start something completely new and build it piece by piece :)

  • @fredleckie5880
    @fredleckie58803 жыл бұрын

    Woah, seven videos! I know what I'll be watching for the next 6 videos. Tack Andreas!

  • @nonamehere4195
    @nonamehere41953 жыл бұрын

    7:15 Oooh, you just made RISC-V! 8:15 With the same register names!

  • @11hbishop
    @11hbishop3 жыл бұрын

    Good job man! Will be interesting to see some performance benchmarks

  • @tommytomtomtomestini3894
    @tommytomtomtomestini38943 жыл бұрын

    @31:30 My brain went "Why is he asking me? I'm a moron" 😂

  • @giovannisolimeno5040
    @giovannisolimeno50403 жыл бұрын

    Looks like i have a new series to binge today

  • @eXfilPr4tik
    @eXfilPr4tik Жыл бұрын

    The best thing i stumbled upon on KZread!

  • @PreyMa
    @PreyMa3 жыл бұрын

    Wow, I thought you would upload them one by one. So much great content :)

  • @awesomekling

    @awesomekling

    3 жыл бұрын

    Trying the Netflix approach instead :^)

  • @PreyMa

    @PreyMa

    3 жыл бұрын

    @@awesomekling That's probably the best fitting description :) Really excited about the bytecode VM!

  • @diggymels
    @diggymels3 жыл бұрын

    Best channel on KZread, bar none.

  • @TheDumpap
    @TheDumpap3 жыл бұрын

    Oooh this is gonna be fun to watch :D

  • @iyadahmed3773
    @iyadahmed37733 жыл бұрын

    your videos are an invaluable resource for developers!!

  • @WannesMalfait

    @WannesMalfait

    3 жыл бұрын

    Didn't expect to see you here. I totally agree

  • @iyadahmed3773

    @iyadahmed3773

    3 жыл бұрын

    @@WannesMalfait Hi 😄

  • @JustATempest
    @JustATempest3 жыл бұрын

    I've realized you make talking about code fun. Most coding channels try too much entertain.

  • @manjoos4906
    @manjoos49062 жыл бұрын

    thank you for this, ive learned so much :D

  • @juan-tj1xf
    @juan-tj1xf2 жыл бұрын

    as a programmer, worth it for watching every vids in playlist

  • @swedishpsychopath8795
    @swedishpsychopath87959 ай бұрын

    We should say thank you Norway for inventing object oriented programming! Hipp, hipp HURRAAA!!!

  • @shreeya5319
    @shreeya53192 жыл бұрын

    Very interesting and useful..

  • @VACatholic
    @VACatholic3 жыл бұрын

    Curious to see how you like the Op:Add::execute, Op:Load::execute, Op:Add::to_string, Op:Load::to_string() with the switch. Having worked on stuff like this, that usually gets tedious to manage and I just end up instantiating the object and calling the methods, making adding new ops a bit more self contained and less disruptive. Nicely done!

  • @spamatica
    @spamatica3 жыл бұрын

    Hi Andreas, I'm usually watching your videos in my living room with a subwoofer connected and the microphone picks up a low frequency rumble when you type on the keyboard. Can't see what microphone you have but sometimes they have a hi-pass switch to remove this kind of thing. Another suggestion is to remove any physical connection between the keyboard and the microphone, maybe the mic is mounted on the desk? Thirdly, I looked into hi-pass filtering in OBS but equalization seems a weirdly omitted feature.. It can be done with VST plugins but it seems unnecessarily complex, especially on linux.

  • @tarik2662
    @tarik2662 Жыл бұрын

    I'm more of a C guy, and this OOP stuff confuses me, but thank you for the content.

  • @smiley_1000
    @smiley_10003 жыл бұрын

    thank you based Andreas Kling

  • @shantanugadgil
    @shantanugadgil3 жыл бұрын

    There goes the week ... Watching videos now.

  • @Railrat420
    @Railrat4202 жыл бұрын

    I want to be a god like this one day

  • @zxcghoul1275
    @zxcghoul12753 жыл бұрын

    code master, who builds a task in his head and writes it on the fly,

  • @RyanCampbell-ve8yz
    @RyanCampbell-ve8yz3 жыл бұрын

    Nice.

  • @MrSmokedTurkey
    @MrSmokedTurkey3 жыл бұрын

    Holy crap

  • @devashishjaiswal6037
    @devashishjaiswal60373 жыл бұрын

    You can switch between recent tabs in the editor with Ctrl + Tab. Think you know this but just in case you didn't :^)

  • @weeb3277
    @weeb32779 ай бұрын

    0:47 ok, but what is that "js" command? is it something your wrote yourself? do you have it posted somewhere? what did you use to generate that abstract tree? Do I have to build SerenityOS form source?

  • @slowhumancentipad
    @slowhumancentipad3 жыл бұрын

    You can see Git errors in CLion by enabling VCS console, links to your PRs will be there too

  • @echoptic775
    @echoptic7753 жыл бұрын

    When will serenty be able to compile itself? It would be very cool to be able to work on itself

  • @Siminfrance
    @Siminfrance3 жыл бұрын

    7 updates at once ... well, I guess I know what I am doing for the next 8 hours or so ... I have always wanted to learn more about ByteCode VM in general, a Javascript one is a perfect example.

  • @hugosales8102
    @hugosales81023 жыл бұрын

    What is the `Badge`? The code doesn't have any comments and couldn't find a relevant commit message either

  • @awesomekling

    @awesomekling

    3 жыл бұрын

    awesomekling.github.io/Serenity-C++-patterns-The-Badge/

  • @robstone9628
    @robstone96283 жыл бұрын

    rip my sub feed, but i appreciate it! :)

  • @Mr.James404
    @Mr.James4043 жыл бұрын

    How decode Marshall byte code?

  • @CYXXYC
    @CYXXYC3 жыл бұрын

    Oh, a VM with a register machine instead of a stack machine?

  • @awesomekling

    @awesomekling

    3 жыл бұрын

    That's right!

  • @notnow4068
    @notnow40683 жыл бұрын

    Hi friends!!!!

  • @hugosales8102
    @hugosales81023 жыл бұрын

    My man really went and done us like that? 7 at once?

  • @awesomekling

    @awesomekling

    3 жыл бұрын

    :^)

  • @yeppiidev
    @yeppiidev3 жыл бұрын

    hello Andreas

  • @wChris_
    @wChris_3 жыл бұрын

    I can see a lot of problems with the current architecture, like most (if not all) registers will only be used once, which will increase memory.

  • @chillydill4703

    @chillydill4703

    Жыл бұрын

    So how do you solve it?

  • @driedurchin
    @driedurchin3 жыл бұрын

    You gotta address the "File does not belong to any project target; code insight features might not work properly."! It's killing me!

  • @adammontgomery7980
    @adammontgomery79802 жыл бұрын

    Was excited till I saw all the OOP

  • @aryelol
    @aryelol3 жыл бұрын

    tfw he just started and brain is full of question marks 😫

  • @nielsdegroot9138
    @nielsdegroot91383 жыл бұрын

    I've started watching this series and are only at 50 minutes, but I get an immediate question in my head: why no research into the Java bytecode and its instructionset? Or is there a reason you don't try to be compatible with it?

  • @awesomekling

    @awesomekling

    3 жыл бұрын

    I don't understand why being compatible with the bytecode of a random unrelated language VM would be useful :)

  • @nielsdegroot9138

    @nielsdegroot9138

    3 жыл бұрын

    @@awesomekling Now that you mention it: I don't know why my brain decided to forget JAVA JavaScript. I know better (usually), sorry! 🤐

  • @whatthefunction9140
    @whatthefunction91403 жыл бұрын

    Is this code 💁‍♂️ 🦋

  • @awesomekling

    @awesomekling

    3 жыл бұрын

    Yup, all of it is in the SerenityOS repo on GitHub :^)

  • @moody54324
    @moody543243 жыл бұрын

    You never worked on Xcode 😂♥️, Bro you will throw your computer out from the window, clang so so crachy ! You will hate apple for that

  • @Quaker763
    @Quaker7633 жыл бұрын

    2/10, not enough '%' symbols in the assembly language