My Own 3b1b Animation Engine but in C

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 พ.ค. 2024
  • Streamed Live on Twitch: / tsoding
    Panim Playlist: • Panim
    References:
    - 3Blue1Brown Channel: / 3blue1brown
    - Tsoding - Musializer - github.com/tsoding/musializer
    - Tsoding - Tula - github.com/tsoding/tula
    - Easings - easings.net/
    Support:
    - BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9
    - Pay for my VPS: zap-hosting.com/en/shop/donat...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 100

  • @BboyKeny
    @BboyKeny หลายเดือนก่อน +167

    "Remember the code is more scared of you than you are scared of the code" - Zozin 2024

    • @no_name4796
      @no_name4796 16 วันที่ผ่านมา

      I mean, the code doesn't crash you, you cŕash the code...

  • @Lewdovico
    @Lewdovico หลายเดือนก่อน +110

    Looks like we're alive.

    • @TheMelopeus
      @TheMelopeus หลายเดือนก่อน +6

      He is alive and well, active on twitch and discord :D

  • @user-lc8gw8vl7h
    @user-lc8gw8vl7h หลายเดือนก่อน +49

    that "i can't even spell 'world' anymore, i haven't programmed in C for a while" caught me off guard

  • @Daniikk1012
    @Daniikk1012 หลายเดือนก่อน +116

    I think the main reason people love Lua is because of how incredibly simple, yet powerful it is (Same reason people like C, but it's a scripting language, so in a different way).
    The only structural data type in it is a table. Want arrays? Use integers as keys. Want an object? Use field names. Want a dictionary? Use whatever you want as the key.
    Want to access something that doesn't exist? It's nil. Want to delete something? Set it to nil. Applies to both fields in tables and variables.
    The syntax is minimal. No need for semicolons OR newlines, because it is always possible to infer where statement separation occurs. There are only 21 keywords, which is mostly control flow and primitive values.
    Want more power? That's what metatables are for. Use them to add operator overloading to your tables. Or use them to implement inheritance.
    The compiler/interpreter itself is also deliberately simple. It is a single pass compiler, written in pure ANSI C (Except for dynamic linking, but for embedding it is an understandable compromise), very fast and small (One of the fastest scripting languages), because it was designed to be embeddable.

    • @TheDolphiner
      @TheDolphiner หลายเดือนก่อน +16

      Reading the lua manual really gives the feeling of "we want the most power with the fewest features." It doesn't have traits I look for in a "real" language, but it's inspiring as a different perspective designed with a different use case than the mindset I usually work with.

    • @angryapplebombs914
      @angryapplebombs914 หลายเดือนก่อน +7

      This is actually one of the best comments I’ve read describing why I find Lua so enjoyable thank you for this. I might steal it later

    • @JH-pe3ro
      @JH-pe3ro หลายเดือนก่อน +7

      I switched over from Lua to Janet recently because it brings the mindset of Lua to a Lisp syntax, without the compromises of Fennel or the baggage of CL/Scheme systems. And it's more fleshed out as a standalone scripting system, which ended up being "bolted on" to Lua with Luarocks, and I've never been happy with how that worked. It takes a little while to get comfortable with the idioms specific to Janet, but I'm finding it cozy enough.
      Edit: Also, if we are after minimalism, Forth is a decent scripting environment for gluing together chunks of assembly, and probably enough for this usecase.

    • @jeremyjurksztowicz6278
      @jeremyjurksztowicz6278 หลายเดือนก่อน +1

      Metatables and coroutines elevates Lua to S-tier power. Also small and fast enough to run on a GameBoy Advance. Love Lua.

    • @no_name4796
      @no_name4796 16 วันที่ผ่านมา

      Honestly i descovered lua writing my neovim config, and yeah it's a very interesting language.
      It's nice that it's not polluted with 69 ways to do the same thing (cough cough c++ cough cough)

  • @adampaul7905
    @adampaul7905 หลายเดือนก่อน +27

    I want a full song from "Can you Rust doooo thaaaat ? i don't think soooo"

  • @toddkfisher
    @toddkfisher หลายเดือนก่อน +54

    The commentary on Stack Overflow alone makes this worth watching.

    • @rubenvis6568
      @rubenvis6568 หลายเดือนก่อน +10

      Starting at about 1:52:10 :-)

  • @HuntingKingYT
    @HuntingKingYT หลายเดือนก่อน +9

    "Remember - code is afraid of you more than you are afraid of code" - I really like this quote, until they start using it on dogs.

  • @SaidMetiche-qy9hb
    @SaidMetiche-qy9hb หลายเดือนก่อน +6

    Tosding the gordon ramsy of C programming 🤣🤣

  • @SiiKiiN
    @SiiKiiN หลายเดือนก่อน +2

    I'm excited to see what primitives you decide to use. I know that the what makes manim good is the choice of primitives, I'm assuming the same needs to happen with this library considering its a programming viz and not just a viz.

  • @skilz8098
    @skilz8098 6 วันที่ผ่านมา

    You can do all of this in Assembly if you know what you are doing. C/C++ just makes assembly much easier and more streamlined as they automate a bunch of repetitive tasks for you behind the scenes. You don't have to setup and tear down all the registers for the stack frame, you don't have to manage the stack pointer for every routine call, you don't have to query or access the hardware or interrupts directly, you don't have to manage the memory at the hardware level and worry about v-table entries, and so on. You don't have to worry about which register your return value is in, checking the flags for the conditions of all of your operations, the branch predictor, etc. Assembly is architect independent, machine specific and isn't really portable. Yet you can still do all of this in Assembly if you know what you are doing. It's not about this language or that, it's about your understanding of the hardware and how the software operates it. At the end of the day, it's a skill issue based on your level of understanding and knowledge of the system you are interfacing with.

    • @kaelanm-s3919
      @kaelanm-s3919 4 วันที่ผ่านมา

      Bro, making a graphics library by raw dogging assembly???? Please stop, you're giving me new nightmares to wake up to

  • @curious5972
    @curious5972 หลายเดือนก่อน +14

    I made my own engine almost 2 years ago for my grad project. I used ffmpeg and nodejs child process and my own graphics library written in JS. Which gives me a massive success in grad result. Its even 3 times faster than manim ❤

    • @ardnys35
      @ardnys35 หลายเดือนก่อน +4

      hi, i am looking for inspiration for my grad project and this graphic stuff is really interesting.
      how difficult was it and did you do it by yourself or with a group?
      it's hard to find a topic interesting but also not too difficult to scare people away, because we have to do it with a group.

  • @stephanbranczyk8306
    @stephanbranczyk8306 หลายเดือนก่อน +9

    Honestly, AI is not much better. Google's AI would refuse to give information on C/C++ functions to minors because the functions were tagged "unsafe"

  • @ratchet1freak
    @ratchet1freak หลายเดือนก่อน +7

    For programming the animation itself maybe an immediate mode style api would be nice. Instead of having to build an array of keyframes. Which are going to be a pain to change on a hot reload. If you don't mind borrowing from sebastian lague's animation setup.
    That is you have a function that gets called every frame and it then does things like float t = interval(a, 5); which returns a value from 0 to 1 depending on where in the animation you are. Then the next time you call interval(a, 3) the effective interval starts after the previous one finished. And it uses the t to render an animation.
    To facilitate this you would need a float animTime; and a float currentTime; in Animation where animTime gets updated based on the input into interval() and currentTime is the time you are visualizing. So the return value becomes return remapAndClamp(currentTime, animTime, animTime + period, 0, 1)
    You can apply ease-in and out on the returned t if needed.

  • @chillydill4703
    @chillydill4703 หลายเดือนก่อน

    I like where this is going, tsoding!

  • @SaidMetiche-qy9hb
    @SaidMetiche-qy9hb หลายเดือนก่อน +1

    17:20 Skia is a giant Google bloatware for drawing shapes that's like 600megs of source

  • @alexanderkovalev391
    @alexanderkovalev391 หลายเดือนก่อน

    you're actually reinvented erlang's hot code reload approach with your plugin system. take a look at those ideas, it is really cool when the entire system upgrades with no restart

  • @_orangutan
    @_orangutan หลายเดือนก่อน +2

    I think Tsoding programs in a Hyperbolic Time Chamber.

  • @hieudoan4929
    @hieudoan4929 หลายเดือนก่อน +1

    Lol perfect illustration of SO answer

  • @zeusdeux
    @zeusdeux หลายเดือนก่อน +4

    New tsoding vid, let’s goooooo!!

  • @gg-bt4sp
    @gg-bt4sp หลายเดือนก่อน +15

    Hi, Panim playlist link broken
    Have a nice day

    • @TsodingDaily
      @TsodingDaily  หลายเดือนก่อน +9

      Thank you! Fixed!

  • @minirop
    @minirop 18 วันที่ผ่านมา

    the *worst* part of function pointer declaration is that it was done "on purpose". there is a special case in the parser to handle that ugly syntax IIRC.

  • @nashiora
    @nashiora หลายเดือนก่อน

    If I have to use a dynamic language, for any number of reasons, I'd want it to be Lua. I love it for the semantics, definitely not the syntax haha. Otherwise, yes I'd also prefer statically typed compiled languages.

  • @blackhaze3856
    @blackhaze3856 หลายเดือนก่อน +119

    Is 3b1b parent of R2D2?

    • @Shywizz
      @Shywizz หลายเดือนก่อน +6

      Its 3*blue*1*brown* another channel that does explanatory math videos

    • @angelcaru
      @angelcaru หลายเดือนก่อน +81

      @@Shywizz www.wikipedia.org/wiki/Joke

    • @oserodal2702
      @oserodal2702 หลายเดือนก่อน +21

      ​@@angelcarubetter response than wooosh

    • @howdoiexitvim-sg2xl
      @howdoiexitvim-sg2xl หลายเดือนก่อน +19

      ​@@oserodal2702the most amazing thing is youtube not obliterating the comment containing a link

    • @programist2.091
      @programist2.091 หลายเดือนก่อน +12

      And a nephew of 2b2t

  • @anon_y_mousse
    @anon_y_mousse หลายเดือนก่อน

    Maybe RIIC should become the catch phrase. I think I should start that cult.

  • @tianned
    @tianned หลายเดือนก่อน +2

    38:18 expectation
    38:34 reality
    42:25
    42:32
    Mr Zozins explanations are the best imo, probably would become a great teacher if he wished to

    • @MasterHigure
      @MasterHigure หลายเดือนก่อน +2

      Macro source is as unreadable in C as it is in Rust.

  • @apenaswellignton
    @apenaswellignton หลายเดือนก่อน +4

    Pog

  • @mihailazar2487
    @mihailazar2487 หลายเดือนก่อน

    As the prophecy fortold

  • @sudoupdate
    @sudoupdate หลายเดือนก่อน

    Itzzzzz Tshooooding suiiiiiiiiii

  • @hubstrangers3450
    @hubstrangers3450 หลายเดือนก่อน

    Thank you....

  • @shoofle
    @shoofle หลายเดือนก่อน

    the captions seem to be a chat playback for some reason!

  • @user-gi8oc4dr1c
    @user-gi8oc4dr1c หลายเดือนก่อน

    Best animation for loot boxes in game 😂

  • @suvetar
    @suvetar หลายเดือนก่อน

    Skia is a graphics library from Google, it has a lot of handy bindings ... in Csharp for example ... raylib is way cooler though 🙂

  • @hamed9327
    @hamed9327 หลายเดือนก่อน +1

    the pascal case function names are so clear, what is this font?

  • @AlmogD
    @AlmogD หลายเดือนก่อน +2

    LOVE YOUR VIDEOS
    The Panim Playlist link is not working :(

  • @lordeji655
    @lordeji655 หลายเดือนก่อน

    28:53 I don't know why people ignore the gcc "-fanalyzer" option which gives A LOT more warning and would, for example here, clearly give a warning for a segfault.

    • @multicoloredwiz
      @multicoloredwiz หลายเดือนก่อน

      It's annoying n slow. Surprisingly cl /analyze is pretty good!

    • @lordeji655
      @lordeji655 หลายเดือนก่อน

      @@multicoloredwiz annoying ? To have warnings that help you not crash your program ?
      And obviously it's slower. It's a tradeoff as always in programming. The most important thing is that you can choose between safety and speed which is the power of C (while rust fans will brag about the safety and then compile for 10min).

    • @multicoloredwiz
      @multicoloredwiz หลายเดือนก่อน

      @@lordeji655 I agree with you on all points I'm just answering ur question

    • @lordeji655
      @lordeji655 หลายเดือนก่อน

      @@multicoloredwiz AH sorry x)

  • @aniketbisht2823
    @aniketbisht2823 หลายเดือนก่อน

    2:02:53 Why do you use memset/memcpy for struct instead of assignment? Is this a C thing? I think C does support struct assignment. As a C++ programmer, this is absolutely bizarre.

  • @BolasDear
    @BolasDear หลายเดือนก่อน

    what are programming socks , i had not found them in whole market.

  • @kerowagdy9417
    @kerowagdy9417 หลายเดือนก่อน

    How is Twitch Chat caption even possible? 🤔
    I haven't uploaded a single video on yt so it might be easy. Is it that you can export stream chat as transcript ?

    • @yjlom
      @yjlom หลายเดือนก่อน +1

      you can read the chat with the API, so it should just be a matter of storing the comments with their timestamps and then converting that to a transcript track

    • @kerowagdy9417
      @kerowagdy9417 หลายเดือนก่อน

      @@yjlom
      Yeah that makes sense

  • @bufferc6362
    @bufferc6362 หลายเดือนก่อน +8

    I love you.

  • @GajanandamaniAdhikari
    @GajanandamaniAdhikari หลายเดือนก่อน

    Bruh, what font is this. Sweet

  • @KnightOfEvil
    @KnightOfEvil หลายเดือนก่อน

    Why captions are just Twitch Chat. Is that a mistake?

    • @p99chan99
      @p99chan99 หลายเดือนก่อน

      No he implemented it himself

    • @multicoloredwiz
      @multicoloredwiz หลายเดือนก่อน

      No it's tigjt

  • @tiwanndev
    @tiwanndev หลายเดือนก่อน

    what do you mean google shitiness

  • @skilz8098
    @skilz8098 6 วันที่ผ่านมา

    I couldn't stop laughing at about @1:30:40 in the video, I could hear the perfect background song starting to play in the back of my mind... th-cam.com/video/EYb84BDMbi0/w-d-xo.html

  • @mmmmm1438
    @mmmmm1438 หลายเดือนก่อน +1

    you say what welcome to ? what

    • @AnksioXD
      @AnksioXD หลายเดือนก่อน +15

      recreational programming session

  • @RealCatDev
    @RealCatDev หลายเดือนก่อน +4

    when Vulkan?

    • @wildwestrom
      @wildwestrom หลายเดือนก่อน +3

      He did a Rust Vulkan stream awhile ago. Quite useful imo

    • @RealCatDev
      @RealCatDev หลายเดือนก่อน +1

      @@wildwestrom I don't care about some smelly bad language

    • @bhavyakukkar
      @bhavyakukkar หลายเดือนก่อน +2

      ​@@RealCatDev then why are you watching this video

    • @RTZemun
      @RTZemun หลายเดือนก่อน

      ​@@bhavyakukkar he probably wants to say that rust is a bad language and that he wants to see vulkan in C

    • @RealCatDev
      @RealCatDev หลายเดือนก่อน

      @@RTZemun yes

  • @DanelonNicolas
    @DanelonNicolas หลายเดือนก่อน

    Great 🎉

  • @marcsfeh
    @marcsfeh หลายเดือนก่อน

    mm nice

  • @aniketbisht2823
    @aniketbisht2823 หลายเดือนก่อน +1

    Seeing you use macros all over the place gives me aneurysms, as a C++ programmer. I guess this is what "production" C looks like because you need generics and meta-programming in large projects. In C++ using templates (with concepts) and function overloading helps you achieve this (along with little bit of constexpr).
    You said you are not a fan of "dynamic" languages. Here C is no better than those dynamic languages. Whereas in C++ most (generic programming) errors would be caught at compile time and the usage of static_asserts and concepts make those errors easy to reason about.
    44:04 It's embarrassing to see this dude. This function macro, in C++, could have been a simple function template (with appropriate constraints).

    • @monad_tcp
      @monad_tcp หลายเดือนก่อน

      C++ template metaprogramming is the embarassing thing

  • @D-V-O-R-A-K
    @D-V-O-R-A-K หลายเดือนก่อน

    WHERE RED CAR???

  • @dorktales254
    @dorktales254 หลายเดือนก่อน +1

    you mean twitch.tuvalu right? right?