Environments & Variable Storage - Programming Language From Scratch

preview_player
Показать описание
This episode covers the topics of environments and scope resolution. This is how we can define multiple environments and traverse them for lookup of variables as well as declarations and determining if a variable even exists.

We will also re-work the null type and add two more types true and false.

🔔 JOIN THE COMMUNITY 🔔
----------------------------------------

-- Social Links --
Рекомендации по теме
Комментарии
Автор

I don't understand why you are removing the declaration around the null literal? You are still using it inside macro MK_NULL

NootNooter
Автор

Great stuff! Personally I'm starting to branch out by making booleans and nulls literals, since then they can't really be overridden

arcticyeti
Автор

Really enjoying this series! At this point it looks like in this interpreter we will be able to reassign true, false and null. Is that correct?

tsurumaruwordpress
Автор

I don't know why I want to make a scripting language from scratch but I do wanna make one for my game engine😅

sterlydolce
Автор

what is going on:
Repl v0.1
> x
Unexpected token found during parsing! { value: "x", type: undefined }
im at 14:17

TerraCurse
Автор

my null variables are not working its saying that the variable doesn't exist since its a identifier

aMelonGodv
Автор

I have a question, is this how languages are made? For example, JavaScript is executed with the JavaScript engine v8, which is written in C++, what I want to know is if I create a variable or an object in JavaScript, does the engine create an object in C++ and stores it in a hashmap ?

hamidhamri
Автор

I have a question, maybe it's silly but ever since I started watching this series I've been wondering, why did you use "frontend" as a name for parser/lexer directory?

marcelijankowski
Автор

Null, true and false being re-assignable? This will be troublesome somewhere

Voltra_
Автор

"as it does not exist" is kind of a lie though.

this resolve function can only check backwards in the chain of enviroments so if there is this variable ahead or beside then the variable exist however it can't be found.

logangraham
Автор

I have a question: How do I make it assign a variable instead of throwing an error?
In assignVar
And what VsCode Theme do you use?

alexanderjarfjall
join shbcf.ru