I assume you have done some research into the field of JS interpreters, or at least have some experience working on some (perhaps JavaScriptCore over at Apple). But I have to say, seeing you just jump into coding like that is truly inspiring to watch. Keep it up!
Hi krigun! I have fixed bugs and made a bunch of performance optimizations in JavaScriptCore yeah. So I did have a half decent idea of where to start. I’ve never implemented a language from scratch though, so this will be fun :)
An ExpressionStatement is very common for interpreters/compilers of languages that distinguish between expressions and statements as different syntactic categories, like js or also C++. In those languages, an expression evaluates to a value and a statement performs some action / control flow. You can turn an expression into a statement by putting a semicolon after it. The action performed by such an ExpressionStatement is simply to evaluate the underlying expression. An ExpressionStatement only really does anything if the expression has side effects (like a function call), but in principle it could hold any expression. Something like x+2; would be a valid ExpressionStatement where the expression is just a binary expression that doesn't have any effect.
Damn, from now on I'll be watching your videos from beginning to end, no minute missing. I always wanted to see you tackle such a project from ground up! Good luck!
Your own JS engine? Man, you're crazy :D I hope you realize that you just pushed the SerenityOS 1.0 release several years into the future... :P Seriously though, kudos for tackling such a big undertaking. I have a little experience implementing my toy language and always wanted to write my own browser so I might just feel like jumping in...
And just like that, you gave Serenity a big push. Looking back at this now feels almost comical, but you gotta start somewhere (and what an excellent start is has been!)
this is awesome to see, how you build something just out of your mind. All Developers have different features, some more a debugger and bug fixer and others can start from scrats.
I'm currently taking a Programming Languages course at university, so this is particularly relevant! Haven't learned about AST yet. We just covered Axiomatic Semantics
Not done yet watching the video, so ignore me if you point this out later, but shouldn't a function decleration only declare the function in the current scope rather than the global object? To my understanding, in js functions kind of work like variables in how they're declared (ex. you can do 'var foo = function() {}') and how the scopes work
Nah, you're probably right! Thanks for pointing this out. I've not written super much JS myself so I'm gonna get a lot of these little details wrong at first. We'll just fix it and learn as we go :)
A bit too late to watch this now, but anyway. The title is kinda catchy "let's build a JavaScript engine ...". Huh, not a small goal, I thought, I definitely must watch ;)
Hey Andreas, quick question. I've been looking at the source code for Libraries/LibJS and I see a lot of variable names prefixed with "m_", "g_", and "s_". What do those letters mean? Keep up the good work, thanks!
Hi Matthew! Those prefixes are meant to indicate the scope of the variable, and give you a quick visual clue about what kind of data you're operating on :) m_ = member g_ = global s_ = static
I'm in the middle of the video, and I'm just wondering why you don't just create different extensions of the Value class instead of having a property for as_bool, as_double, etc. when only one of the values will be set. On the surface it seems a little overcomplicated at least.
This guy is so good, he gives his compiler warnings, not the other way around
Lmao I love this comment!
Andreas: "it's obvious"
Me, sweating: "uh, yeah.... obvious... of course"
I assume you have done some research into the field of JS interpreters, or at least have some experience working on some (perhaps JavaScriptCore over at Apple). But I have to say, seeing you just jump into coding like that is truly inspiring to watch. Keep it up!
Hi krigun! I have fixed bugs and made a bunch of performance optimizations in JavaScriptCore yeah. So I did have a half decent idea of where to start. I’ve never implemented a language from scratch though, so this will be fun :)
You don't need to assume, he said it on the video. Watch it.
An ExpressionStatement is very common for interpreters/compilers of languages that distinguish between expressions and statements as different syntactic categories, like js or also C++. In those languages, an expression evaluates to a value and a statement performs some action / control flow. You can turn an expression into a statement by putting a semicolon after it. The action performed by such an ExpressionStatement is simply to evaluate the underlying expression. An ExpressionStatement only really does anything if the expression has side effects (like a function call), but in principle it could hold any expression. Something like x+2; would be a valid ExpressionStatement where the expression is just a binary expression that doesn't have any effect.
Hi Leo! I didn’t know that, thank you for explaining it :)
Damn, from now on I'll be watching your videos from beginning to end, no minute missing. I always wanted to see you tackle such a project from ground up! Good luck!
Now you have to write a C++ compiler and compile SerenityOS with it.
How about we start with this and see what we can do later when we get a bit more comfortable :)
@@chyza2012
> language with only the good parts of c++ in it
So, basically, C++.
@@emanuele6 C++++
@@emanuele6 Basically C
Holy C++
46:50 "...and execute all of his children" sounds terrible out of context
Your own JS engine? Man, you're crazy :D I hope you realize that you just pushed the SerenityOS 1.0 release several years into the future... :P
Seriously though, kudos for tackling such a big undertaking.
I have a little experience implementing my toy language and always wanted to write my own browser so I might just feel like jumping in...
Yes!! Holy cow, I am so excited for this. Gotta make some tea for this one
And just like that, you gave Serenity a big push. Looking back at this now feels almost comical, but you gotta start somewhere (and what an excellent start is has been!)
Dude, this is awesome!! I used JavaScript All the time but had no idea about it's guts. Thank you so much to open our minds!! You rock ;)
Been looking forward to this ever since the first time you mentioned the possibility that you might add a js engine to the browser 😊
Dude, who are you...? Respect!
Thanks for your videos; I'm learning a lot, and it's really interesting watching you code.
this is awesome to see, how you build something just out of your mind. All Developers have different features, some more a debugger and bug fixer and others can start from scrats.
never clicked so fast (not a fan of JS, but this is bound to be fun)
Remembered my college days. When I built a expression evaluator in a free period. it was fun.
I'm currently taking a Programming Languages course at university, so this is particularly relevant! Haven't learned about AST yet. We just covered Axiomatic Semantics
Hi Matthew! This will be extremely practical as I have no theoretical background whatsoever. Perhaps it’s interesting regardless :)
this guy is an actual wizard
Not done yet watching the video, so ignore me if you point this out later, but shouldn't a function decleration only declare the function in the current scope rather than the global object? To my understanding, in js functions kind of work like variables in how they're declared (ex. you can do 'var foo = function() {}') and how the scopes work
Nah, you're probably right! Thanks for pointing this out. I've not written super much JS myself so I'm gonna get a lot of these little details wrong at first. We'll just fix it and learn as we go :)
Holy shit that was impressive! ✨✨✨
You are such a legend👍🏻👍🏻👍🏻
This guy is Bob Ross scary good.
A bit too late to watch this now, but anyway. The title is kinda catchy "let's build a JavaScript engine ...". Huh, not a small goal, I thought, I definitely must watch ;)
Very cool! Will you use BNF in future for AST generation?
Hi Mati Mati! I don’t know. Maybe. :)
Hey Andreas, quick question. I've been looking at the source code for Libraries/LibJS and I see a lot of variable names prefixed with "m_", "g_", and "s_". What do those letters mean? Keep up the good work, thanks!
Hi Matthew! Those prefixes are meant to indicate the scope of the variable, and give you a quick visual clue about what kind of data you're operating on :)
m_ = member
g_ = global
s_ = static
What is make()?
make(Args) constructs an object of Type by passing Args to the Type's constructor and returns a NonnullOwnPtr to that object.
I'm in the middle of the video, and I'm just wondering why you don't just create different extensions of the Value class instead of having a property for as_bool, as_double, etc. when only one of the values will be set. On the surface it seems a little overcomplicated at least.
Maybe it is for type conversions? I dont know that would be my best guess
Why am I here, and why do the makefiles scare me?
ITS HAPPENING
What does "AK" mean?
I'm guessing. Andreas Kling
Agnostic Kit
"never written programming language" like we write programming language daily
Bro plz tell how you are so good at programing i love you as a person and i try to be like you.
Bro can you tell me how to be like you🙏
It's like re-acting the creation of Javascript Language. with a better code
Maybe you could add support for Electron JS apps. (NodeJS). So maybe the OS could get alot more productive and for developers.
I am not interested in supporting those kinds of applications. If someone else wants to port those things, they are free to do it :)
bro is so innocent, he doesn't even know about hoisting
You got my sub +
❤️
is this magic?
Imagine if he used vim. He would be blazing fast.
vim is slow. modal editing is dumb
10 minutes in and i cant understand anything.
c++ is so ugly omg!
its beatiful