Zig Compiler Internals - Andrew Kelley

Sdílet
Vložit
  • čas přidán 28. 05. 2024
  • From Zig SHOWTIME #5
    zig.show
    0:00 Title
    0:52 Talk
    33:56 Interview
  • Věda a technologie

Komentáře • 36

  • @familyshare3724
    @familyshare3724 Před 4 měsíci +14

    Would love a compiler summary update "state of the art" in 2024

  • @KomariSpaghetti
    @KomariSpaghetti Před 3 lety +42

    Recursion considered harmful. Great talk!

    • @tux1968
      @tux1968 Před 3 lety +13

      Relationship breakups considered helpful.

  • @Verrisin
    @Verrisin Před 2 lety +15

    My question would have been, why is the IR flat. That intuitively seems harder to optimize and work with, to me. - I know Kotlin uses tree IR, and that just makes sense to me.
    (tree IR is quite different from AST, of course)

  • @prateeknischal5170
    @prateeknischal5170 Před rokem +10

    There was a talk from the Go team where they mentioned about supporting exotic architectures. Any one who wanted to implemented a new target GOOS, GOARCH, they could implement that translation layer GOASM -> machine code and bam! support for a new target. And according to them, the translation layer is simple.

  • @hank-uh1zq
    @hank-uh1zq Před 3 lety +33

    The problem with Zig is documentation. I can see that goes for the code as well...this needs to get way better. Maybe the Foundation can hire someone to write documentation?

    • @inkryption3386
      @inkryption3386 Před 2 lety +10

      Honestly, it hasn't been much trouble for me. Once you understand the syntax and are aware of the conventions (which there aren't too many anyways), the code becomes its own documentation. Which I imagine is part of the objective of Zig.

    • @jackmordaunt5410
      @jackmordaunt5410 Před 2 lety +21

      AFAIK, Documentation will be a focus post 1.0. Doesn’t make so much sense to document while things rapidly churn.

    • @darkfllame
      @darkfllame Před 28 dny +1

      the only doc i need is with the build system, that's all, everything else is pretty straight forward

  • @yvvkiRika
    @yvvkiRika Před 8 měsíci +1

    Whatever on the bottom left is, it's keeping my focus on like subway surfers. Amazing talk!

  • @astphaire
    @astphaire Před 2 lety +10

    I heard that Zig can call functions at compile time. How is this done? Is the IR stepped through like a bytecode?

    • @DF-ss5ep
      @DF-ss5ep Před rokem

      There is no need for that. If your compiler has AST nodes that it understands, it can implement their behavior as C++ functions and then modify the AST with the results

    • @numeritos1799
      @numeritos1799 Před 13 dny

      @@DF-ss5ep essentially interpreted at compile time right?

  • @leffivanov3127
    @leffivanov3127 Před 3 lety +1

    What software are you using for this kind of streams?

    • @kristoff-it
      @kristoff-it Před 3 lety +6

      OBS, Discord, laplace.madeby.monster/

  • @GK-rl5du
    @GK-rl5du Před měsícem

    What is the difference between un-typed and typed Zig IR?

    • @darkfllame
      @darkfllame Před 28 dny

      duh, typing 💀the untyped zig IR does not generate errors with types

    • @GK-rl5du
      @GK-rl5du Před 28 dny

      @@darkfllame If I recall correctly, Andrew mentioned that first compiler converts the source code to untyped IR. Then at some later stage untyped IR is converted to typed IR. I was wondering why not directly start with typed IR as the code author already declares the variable types.
      As you can tell I'm a compiler noob. If this is something obvious please let me know I'll do more research

    • @numeritos1799
      @numeritos1799 Před 13 dny

      I think Andrew was just referring to the comptime approach that they implemented. I'm not certain that what he described here still holds true today though. The video here is almost 4 years old, back when Zig was at 0.6.0.

  • @nathanruben3372
    @nathanruben3372 Před rokem

    What is the licence of this language?

  • @KalleJillheden
    @KalleJillheden Před 7 měsíci +1

    Held my curiosity for a while, but the technical issues made it unbearable to watch.
    All the flickering, and Andrew talking about code that's not loaded on the screen yet... quite a mess.
    From Andrew's other talks, I can tell that he's a great speaker, but for this video in particular, it's getting a thumbs down from me. Would love to see a re-take though.

  • @Stopinvadingmyhardware
    @Stopinvadingmyhardware Před rokem +1

    why would I use this? I don’t see the point.

    • @megamaser
      @megamaser Před 10 měsíci +3

      Systems and embedded programming.

    • @josephlunderville3195
      @josephlunderville3195 Před 8 měsíci +3

      You're probably not missing anything, it's still not all that mature. It's an interesting language and I'm playing with it, and I think it has a brighter future -- but if you want to solve an actual problem right now today, there are other languages that are good enough and which have much better library support.
      For systems and embedded you're probably making smaller programs and so the lack of libraries is less of a problem, but you'll still get up and running faster with existing frameworks in C/C++ or even Rust, so if you're being paid to do the work you might choose one of those.

  • @ranam
    @ranam Před 3 lety

    Can you compile zig compiler to compile darknet with cuda

  • @lepidoptera9337
    @lepidoptera9337 Před 10 měsíci +1

    You know that something is dead when it has 18 comments on CZcams in three years. ;-)

    • @megamaser
      @megamaser Před 10 měsíci

      Zig is new and just beginning to pick up steam.

    • @lepidoptera9337
      @lepidoptera9337 Před 10 měsíci

      @@megamaser Dude, the video is from three years ago. I will give you attention, anyway. :-)

    • @megamaser
      @megamaser Před 10 měsíci +2

      Yeah and? 3 years is nothing in the lifecycle of a programming language.

    • @lepidoptera9337
      @lepidoptera9337 Před 10 měsíci

      @@megamaser True. Cobol is still around. I didn't care about it, either. :-)

    • @josephlunderville3195
      @josephlunderville3195 Před 8 měsíci +6

      Trolls be trollin