This Library Make Parsing in C Easier

  Рет қаралды 26,769

Tsoding Daily

Tsoding Daily

Күн бұрын

Streamed Live on Twitch: / tsoding
Enable Subtitles for Twitch Chat
More Episodes: • RandomArt
Wallpapers: penger.city/wa...
References:
github.com/tso...
github.com/tso...
Support:
BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9
Pay for my VPS: zap-hosting.co...

Пікірлер: 56
@ChrisSchepman
@ChrisSchepman 2 ай бұрын
a-who? a-meester a-zozin.
@cold5528
@cold5528 2 ай бұрын
I love the idea of having your own library for lexing and parsing, dedicating the time to the actual language development. Guido van Rossum has a very nice series about implementing a left recursive PEG parser which can be adapted to register the parsing rules at runtime instead of generating a parser.
@Lofen
@Lofen 2 ай бұрын
I just made my first contribution to one of your projects! A simple change, but still. I was impressed by how simple it was download and install, just followed the instructions and I got everything working in minute. Super easy to contribute. Great project! :)
@SlinkyD
@SlinkyD 2 ай бұрын
Not even 5 minutes in, your explanation got me thinking of MUMPS from the old days when I was too young to know wtf a programming language was. Damn intellectual PTSD.
@conscious-agent
@conscious-agent 2 ай бұрын
These subjects that you cover are absolutely interesting and worthwhile! Thanks for sharing your explorations with the world.
@RickeyBowers
@RickeyBowers 2 ай бұрын
I'm glad you took the project in this direction.
@theevilcottonball
@theevilcottonball 2 ай бұрын
The original genetic art which inspired the randomart paper used quarternions to generate the colors.
@pagenotfound_code_404
@pagenotfound_code_404 2 ай бұрын
tbh im here to skip to the parts where there are pretty colors
@JeersNX
@JeersNX Ай бұрын
there are none lmao. it is coding
@alh-xj6gt
@alh-xj6gt 2 ай бұрын
The labelled breaks at 38:30. I mean C can have labels too but will have to use goto. With a few nested long ifs I tend to add comments on the longer closing curly brackets anyway to keep track of the different scopes. So the c3 example would have _/* \FOO */_ or _// \FOO_ at the closing curly brackets anyway and with that it wouldn't look much different from the C equivalent. Here that C3 example in C with comma operator lhs to resemble C3s example a bit to indicate that this if is breakable with goto and the label. Also it is handy to have the label right there to use editor jutsu and jump. void test(int i) { if ( (void)"FOO: breakable outer if", 1 > 0 ) { while (1) { printf("%d ", i); // Break out of the top if statement. if (i++ > 10) goto FOO; } } FOO:; } Could also use a more descriptive label than FOO. The use of comma operator lhs was to get near a c3 feel could also use comments to convey that the outer if breaks. YMMV.
@SimGunther
@SimGunther 2 ай бұрын
Might have said it before, but stb_c_lexer is NOT the super fast lexer Sean Barrett wrote in 2015 that involved state machine tables with an array for equivalent characters. It's easier to just implement the concept ourselves instead of waiting for Sean to have that fast version of the lexer in his library.
@flobuilds
@flobuilds 2 ай бұрын
This could be a gamechanger for creating video backgrounds for product shoots and it just shouts apple
@flobuilds
@flobuilds 2 ай бұрын
For my own safety a little disclaimer: I do NOT like apple.
@delian66
@delian66 2 ай бұрын
@@flobuilds no one cares
@flobuilds
@flobuilds 2 ай бұрын
@@delian66 good so
@pimesonhadron
@pimesonhadron Ай бұрын
Thank you for these recreational programming sessions my code gopnik friend!
@froop2393
@froop2393 2 ай бұрын
Great series! 😃 I wonder if the same/similar approach can be used to generate random music?
@theevilcottonball
@theevilcottonball 2 ай бұрын
I think that grammar approach might make a good fantasy name generator. But tsodinh already made one in C3.
@moussaadem7933
@moussaadem7933 2 ай бұрын
Has anybody explored music as a "language" with a grammar
@Mozartenhimer
@Mozartenhimer 2 ай бұрын
1:08:10 amen it's still better than C++
@janhorak5363
@janhorak5363 2 ай бұрын
Iam gonna glaze.. Wtf it feels like a virtuoso piano concert. How the fuck is he flying from the logs in to he files. Like when he lexed the file and each log stepped on the given punct or symobol. :o
@annybodykila
@annybodykila 2 ай бұрын
Another stream on making this into a music visualizer would be really cool
@bobby9568
@bobby9568 2 ай бұрын
Managers sure love having him on their team to boss around xD
@Kknewkles
@Kknewkles 2 ай бұрын
I'm only a year younger than you, and I've NEVER heard anyone(in Russia) refer to the quote marks as paws or pines 😂
@cryptonative
@cryptonative 2 ай бұрын
nom in rust is great for this kind of parsing
@bobby9568
@bobby9568 2 ай бұрын
135k subs? since when? deserved!
@oserodal2702
@oserodal2702 2 ай бұрын
Hello Mr. rexim. What do you think of tools like GNU Bison and Yacc for lexing/parsing in C?
@theevilcottonball
@theevilcottonball 2 ай бұрын
I once used the mpc parser generator following the buildyourownlisp tutorial.
@CoderDBF
@CoderDBF 2 ай бұрын
Regarding the breaking out of nested code like you mentioned early on in the video. I use goto statements for that. Create a label underneath the block of code to where you wish to escape to. From what I understand about goto statements, they shouldn’t be a problem as long as you jump downwards in your code. Use loops if you need to jump back upwards. Would you disagree with this methodology?
@vatsalrajchauhan2983
@vatsalrajchauhan2983 2 ай бұрын
I think numbers would be better instead for setting probabilities (that's just my opinion). Something like '|*3' or '3|' you get the idea.
@thobiasknudsen1730
@thobiasknudsen1730 2 ай бұрын
This is really interesting! Who are you working for?
@arcxm
@arcxm 2 ай бұрын
39:33 🤣
@zlatkovidlanovic6454
@zlatkovidlanovic6454 2 ай бұрын
It is interesting ..and complex for my brain... make something simplier with just tokens ...like token interpreter
@EdwardPsCL
@EdwardPsCL 2 ай бұрын
Called Guillements
@XeZrunner
@XeZrunner 2 ай бұрын
I wonder what it would look like if time kept going, instead of ping-ponging with sine.
@Marthas84
@Marthas84 2 ай бұрын
He showed case when he used time.. it goes into "infinity" and it basically stabilise into non moving colours
@imMortAlDA2
@imMortAlDA2 2 ай бұрын
2:45:26
@badstep495
@badstep495 2 ай бұрын
can you make a chart/plotting library using shaders to plot lines and grids?
@theevilcottonball
@theevilcottonball 2 ай бұрын
Why? Performance? I always wanted an STB style single header plotting library. Do you know one?
@badstep495
@badstep495 2 ай бұрын
@ yes, performance when working with large timeseries datasets. It’s a pretty interesting challenging when incorporating panning/zooming, axis grid, triangulated lines, etc. And no, I have not really found one, just bits and pieces here and there.
@hubstrangers3450
@hubstrangers3450 2 ай бұрын
Thank you....
@didyoustealmyfood8729
@didyoustealmyfood8729 Ай бұрын
Alexer is a cool library lol
@Wosser1sProductions
@Wosser1sProductions 2 ай бұрын
Why not use existing parsers like yacc/bison?
@delian66
@delian66 2 ай бұрын
because they are too complex for no good reason
@delian66
@delian66 2 ай бұрын
also the programming experience with them is very far from "recreational programming" ... it is more like "frustrating torturous adventure"
@Wosser1sProductions
@Wosser1sProductions 2 ай бұрын
@@delian66 Yes that's true lol I made a grammar for an assembly language once based on But How Do It Know by J. Clark Scott and that also used a self-made parser. Later in uni we had to make a yacc based parser for a simplified Ruby language, and that was a real struggle since there were little delimiting tokens to recognize expressions properly.
@itsmenewbie03
@itsmenewbie03 2 ай бұрын
I miss Haskell ☹️
@RustIsWinning
@RustIsWinning 2 ай бұрын
Can this guy recreate my mama?
@EdwardPsCL
@EdwardPsCL 2 ай бұрын
Can your Rust do that?!?
@RustIsWinning
@RustIsWinning 2 ай бұрын
@EdwardPsCL No that's why I'm asking and also because I have mommy issues lol
@lonky_
@lonky_ 2 ай бұрын
пора уже свою ос написать
@bobby9568
@bobby9568 2 ай бұрын
This guy programs on a windows 95 pc in his basement xD
@moussaadem7933
@moussaadem7933 2 ай бұрын
He programs in Linux, using i3wm and Emacs
Hacking C compiler
2:00:24
Tsoding Daily
Рет қаралды 39 М.
Introducing Clay - High Performance UI Layout in C
35:19
Nic Barker
Рет қаралды 268 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
More C string parsing with strtok_r, strsep (and strdup)
4:15
Jacob Sorber
Рет қаралды 24 М.
They Made a Sequel to C
1:53:24
Tsoding Daily
Рет қаралды 117 М.
I tried React and it Ruined My Life
1:19:10
Tsoding Daily
Рет қаралды 163 М.
Arenas, strings and Scuffed Templates in C
12:28
VoxelRifts
Рет қаралды 107 М.
Butterfly App / 4x4 Sudoku Game in Zig: Appendix C
1:02:15
I Made The Ultimate Cheating Device
9:39
ChromaLock
Рет қаралды 1,9 МЛН
I Beat Minecraft From One Grass Block
35:27
Beppo
Рет қаралды 7 МЛН
Why Are Threads Needed On Single Core Processors
16:07
Core Dumped
Рет қаралды 258 М.
You Don't Know Network Programming
2:20:44
Tsoding Daily
Рет қаралды 75 М.
Why I Use C | Prime Reacts
13:00
ThePrimeTime
Рет қаралды 197 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН