I fixed Lua

preview_player
Показать описание
References:

Support:
- BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9

Chapters:
- 00:00:00 - Announcement
- 00:00:35 - Intro
- 00:03:10 - First Impression
- 00:12:13 - Source Code Tour
- 01:01:22 - New Block
- 01:03:32 - Extending lua-mode
- 01:13:41 - Adding New Token
- 01:28:24 - Implementing Double Block
- 02:00:00 - 0-based Arrays
- 02:08:13 - Goto in Double Block
- 02:15:30 - Outro
Рекомендации по теме
Комментарии
Автор

I like how the most difficult thing in the whole video is the lua syntax highlighting

cobbcoding
Автор

teachers: there is not a bad question
tsoding: its just a bad question 😎

chriscoyc
Автор

Lua is a great little language. Tables as data structures work surprisingly well, closures, iterators, everything can be a key and value, ... Even module import just fits so neatly into the language, usually just returning a table (but Lua just lets you do whatever! No restrictions is really cool)

asdfmonstrosity
Автор

The code is actually pretty well documented with helpful comments. It really makes it easy to follow the code and get what it's doing. I'll remember this next time I cross paths with one of those clean-code advocates who defend that you should never use any comments in code.

skaruts
Автор

A good reason for the app to use the vm is to test whether ALL of the functions of the VM work. Because lua isn't just an app it's value is also in the vm you can embed in literally any other app - like how the vm is embedded in this c app that interprets lua

oblivion_
Автор

Gonna take note of, Asserting dominance, when joining a new project.

elgalas
Автор

Yes Portuguese is Latin based, and Lua is our word for Moon yes.
It's to note that Lua (the language) was made in Brazil where Portuguese (of the Brazilian variation (duh)) is spoken. Reading the wiki tells me that there were some trade barriers on software importation which lead to its creation, also seems that Lua was preceded by a language called SOL (Simple Object Language) but in Portuguese Sol mean Sun, so Sun and Moon.

Muttisuri
Автор

Gotta implement this fix to the embedded Lua interpreter in my app.

IamPyu-v
Автор

27:00 I like this little side tangent here. This is something that was difficult for me to understand when I was starting out. When people used to tell me the choice of language isn't that important I was confused because the different languages looked SO different and it felt like they required a whole different skillset. But now after years of solving software problems professionally, I realize that writing the actual code is usually the least of my concerns and it wouldn't have made much difference if I had to implement the same solutions in a different language.

EvilTim
Автор

Finally, arrays in Lua (tables reference)

enderman
Автор

Chat Question: "Is there a [programming] language he [=Tsoding] cannot code [in]?" (around 30:00)
This is not really a question, or only a question and not what it looks like in the first place. It shows the respect of the questioner, because he is impressed of your computer programming skills. The person asking in fact implies, that there is no language (to his knowledge), that he thinks of that you couldn't possibly learn and use. This is a highly meta-level question and it lives in the context and also in a social context. That is btw. very impressive and in contrast to programming languages something that computers CAN NOT understand and possibly will never understand (Including large language models. There is no such thing as "understanding something".

Thanks for the great video, Tsoding and also to Lua, that actually fixed you! Hehehe:)

dieSpinnt
Автор

Make it a PR. They would commit a sin not accepting it.

glowiak
Автор

I'm not going to say it's better, because it's really just a different way of doing things, but Vim makes it pretty easy to add keywords for highlighting. I defined null as an alias for NULL that I use in my header for every project, and I just added it to the list of keywords and it was highlighting from then on. The weird error you had when trying to compile later was that you added 'a' to the start of lua_load() at around the 41:00 mark.

As for adding 0-based indexing, I'd name it Lua++ and use .lpp for the file extensions to differentiate it. And as far as using a double block, you could either convert it into a for loop that runs twice, or convert it to a while loop and use a local inner variable to determine the exit condition of the loop.

anon_y_mousse
Автор

Next, let's add nullptr to Rust.

ErikBongers
Автор

...sometimes you gotta do "die Scheiße"

whatevermait
Автор

"tylko jedno w głowie mam"... lua 5.1gram

brivism
Автор

1:05:00 man gets frustrated its hard to add new syntax highlighting to a language specifically designed to never add new syntax

TankorSmash
Автор

With the complication of non-local jumps and `goto`, my first thought was to instead just transform `double` into `for i=1, 2 do`, i.e. make double less a macro and more a loop so it plays nicely with the relative jumps. I probably would've done this from the start, but it's neat to see you took the code duplication approach first and found out interesting things about the byte code.
(edit: I clicked post about 5 seconds before you mentioned the easy solution was to implement it as a loop, forgive me for my hubris haha)

nashiora
Автор

Impressive, very nice.

Now lets see Paul Allen's fix for Javascript.

MyriadColorsCM
Автор

The priority limit was first invented/discovered by Bob Floyd.

JamesSjaalman