⚡zap⚡ - Blazingly Fast Backends in Zig - Rene Schallner - Software You Can Love Vancouver 2023

Поділитися
Вставка
  • Опубліковано 18 сер 2023
  • Official website: softwareyoucan.love
    Vancouver Conference Website: softwareyoucanlove.ca
    Abstract:
    In this talk, I am going to showcase my zig project "zap" as the result of my quest to find a performant approach to using zig for developing robust and super fast REST API backends.
    Instead of writing the HTTP server part in GO and the logic in zig and, by doing so, turning everything into a GO project build-wise, I opted for zig-wrapping an existing, battle-tested C microframework for web applications (facil.io). Now, I can happily remain in zig land. 😊
    So far, zap has beaten everything I tested it against, performance-wise, in simple, basic HTTP server tests, e.g., a simple zap HTTP server yields 30% higher requests/sec on my PC than a simple GO HTTP server.
    The talk will lead to a live (SYCL 😊) survey demo with a questionnaire app written in zig zap plus a small pure JavaScript frontend that communicates with the REST API.
    With this talk, I also want to encourage everybody to start an open-source zig project to be able to use zig at work.
  • Наука та технологія

КОМЕНТАРІ • 51

  • @yaanno
    @yaanno 10 місяців тому +37

    i think its an ongoing pun between zig and rust folks so try not to be offended. there is much to learn from each projects :) great talk!

  • @HaMMeR33661
    @HaMMeR33661 10 місяців тому +54

    Are these comment sections *always* so terrible? Let's do a better job of congratulating to outweigh the unreasonable naysayers!
    Great jokes, great solution, impressive performance! Thank you
    I love slim web-related things
    The lack of acceptance for different solutions is astounding.

  • @r4gus
    @r4gus 10 місяців тому +10

    Great talk Rene! I really enjoy your Zig talks.

  • @lilzin69
    @lilzin69 10 місяців тому +5

    Great talk! Congrats!

  • @michaelkastner3611
    @michaelkastner3611 9 місяців тому +4

    This presentation has blown my mind. A really smart and witty presentation. Now I am really curious about his zig source code. Humbling, I've been programming at least ten years longer than Rene and I haven't acquired a fraction of the skills he has. Zig seems to gain traction quickly and having at least a workable example of a micro framework will definitely be an incentive for many more productive uses.
    Kudos and thank you!!!

  • @zanez7953
    @zanez7953 8 місяців тому

    Nice talk, you're actually very funny hahaha. I also watched your previous presentation about slides, it was awesome.

  • @MaRi0-64
    @MaRi0-64 10 місяців тому +3

    Great presentation! I like the concept of it, using the framework for even something useful for the event itself, good idea. Details are in the code anyways, and there is quite some functionality added since I checked the github repo last time. For sthg that started out of a need, as private project, impressive what it has become!
    Btw I find it would it be a good ieda to link to the project page in the video description, makes it easier for people who want to jump from the video to the code, when they are interested, probably helps spreading the zig virus - aeh love 😊haha
    Cool conference, too! 👾👾👾

  • @alexpyattaev
    @alexpyattaev 10 місяців тому +8

    Where can I get the source for the rust benchmark that performed so poorly? It would likely make for a treasure trove of bug reports against the rust book.

  • @KresnaPermana
    @KresnaPermana 10 місяців тому +12

    Imagine if the project was named with "ZAG"

    • @natescode
      @natescode 6 місяців тому +3

      That should be a framework like Ruby on Rails should be Zig Zag 😂

    • @danvilela
      @danvilela 28 днів тому

      yeah.. that P is annoying me ..

  • @yash1152
    @yash1152 9 місяців тому

    10:28 fums
    just expand, extrapolate, estimate

  • @jackmordaunt5410
    @jackmordaunt5410 6 місяців тому +1

    BLAZINGLY f a s t

  • @danvilela
    @danvilela 28 днів тому

    IT SHOULD'VE BEEN NAMED ZAG!!!

  • @DAB009
    @DAB009 10 місяців тому +7

    I see what happened with the name here.

  • @saultube44
    @saultube44 6 місяців тому

    It's not OK that a circular reference is allowed, as it's an infinite loop; it has to break out at some point, so it's not a circular reference, which will be confusing to detect bugs an debugging

  • @enzocalzone5298
    @enzocalzone5298 8 місяців тому +1

    What number was he talking about at 12:19?

    • @aurianamaraine378
      @aurianamaraine378 6 місяців тому

      I'm assuming it was the much, much smaller number. You can't imply Rust is that much slower without inviting some zealotry.

  • @29238734943
    @29238734943 10 місяців тому +13

    Weird, someone deleted my comment about the underlying c framework facil being abandoned with no commits for several years. Also should have said not looking at supporting http2/3 is short sighted. Will move along.

    • @renerocksai
      @renerocksai 10 місяців тому +1

      weird, and my reply got deleted that pointed to the cstl repo

    • @ZigSHOWTIME
      @ZigSHOWTIME  10 місяців тому +21

      UA-cam sometimes loses comments. If I delete a comment, I always also ban the person, so if it had been me you wouldn't have been able to post this other comment.

    • @simonfarre4907
      @simonfarre4907 10 місяців тому

      ​​@@ZigSHOWTIMEit seems to happen when one posts links *or* references well know companies like M$ explicitly or products (particularly if you spell and capitalize them correctly) or write comments that suggests "use product X". It's bizarre.

    • @_kurohana
      @_kurohana 10 місяців тому +2

      Apparently UA-cam some time ago started to silently delete most comments containing links, which is frustrating beyond words.

    • @CheeseOfMasters
      @CheeseOfMasters 10 місяців тому +4

      @@_kurohana Not only links also certain inflammatory topics.

  • @the.real.ipatch
    @the.real.ipatch 10 місяців тому +10

    but i just learned rust 🙃

    • @DAB009
      @DAB009 10 місяців тому +16

      Make money in rust and then propose changes in your org with Zig if you like it.
      Nothing wrong with using rust for a while. Because people still use C.
      All the best.

    • @saymehname
      @saymehname 5 місяців тому +2

      @@DAB009there are few openings for rust

  • @StinkyCatFarts
    @StinkyCatFarts 2 місяці тому +1

    Why is it that Rust developers are the ones always crying. Never met such a highly strung community in all of my life.

    • @Leonhart_93
      @Leonhart_93 2 місяці тому +1

      I have seen them several time being associated with wokeness. The more I see, the more true it seems, that unique blend of narcissism.

  • @haliszekeriyaozkok4851
    @haliszekeriyaozkok4851 10 місяців тому +5

    I don't like that framework and also that arrogant guy. As being an actix-web developer this is one of the worst frameworks it can ever possible, it could be able to took the worst feature of golang, middleware chaining. It's bad as oop. I definitely never write with it.

    • @renerocksai
      @renerocksai 10 місяців тому +21

      I also don't do middleware. But there's also: other people. They asked for it, it was easy enough to do, they got it. You can just use the endpoint structs or build your own framework on top of just the listener (plus callbacks). Which you don't need to since you seem happy with actix-web which is fine. I might come across as arrogant in the video and will have to live with that - but you know me about as little as I know you :-), so I wouldn't judge you even if I wanted to (which I don't).

    • @MaRi0-64
      @MaRi0-64 10 місяців тому +8

      Your comment imho is very "you" specific, and stubborn. Web developer, ok, I used to see it not even as serious programming for example when you would have asked a younger me. I use assembly and C most (systems developer). There is differences. "Bad as oop". When you grow a bit older you will see a perfect need for all kinds of languags, even Javascript.
      Having said that, I have no other chance than seeing people coding in rust as arrogant and stubborn. You do them no favor imho.

    • @haliszekeriyaozkok4851
      @haliszekeriyaozkok4851 10 місяців тому

      @@renerocksai just i'm curious, why wouldn't you consider to add dependency injection except middleware chaining? Also synthax of your framework is very complex, even rust frameworks is way easier than yours with their very detailed types. In the conclusion you seem to me like you wanted to create hardest to code framework you can and eventually made it. Isn't zig should be the simpler than rust, because it's purpose is to replace c except c++? But it seems you achieve to made it more harder.

    • @MaRi0-64
      @MaRi0-64 10 місяців тому +8

      @@haliszekeriyaozkok4851 all you say has been said in the presentation. middleware was never planned, it was people they asked for it. And you see a kind of zig vs rust competition here, noone asked for, too. please think about it.

    • @haliszekeriyaozkok4851
      @haliszekeriyaozkok4851 10 місяців тому

      @@MaRi0-64 and no one asked to you advocate him. His complete work is a very typical example of overengineering and my reaction is for that, i made back-end development with express.js, vanilla go, actix web and i have a hard time to reading that frameworks code.

  • @khanra17
    @khanra17 10 місяців тому +2

    never make backends in non memory safe languages 🤒

    • @lilzin69
      @lilzin69 10 місяців тому +9

      joke

    • @jakubgiesler6150
      @jakubgiesler6150 9 місяців тому +19

      Oh no, that rust sickness is spreading all over the place.

    • @cancername
      @cancername 9 місяців тому +4

      git gud

    • @jakubgiesler6150
      @jakubgiesler6150 9 місяців тому

      @@cancername lol yeah

    • @cancername
      @cancername 9 місяців тому +3

      @@jakubgiesler6150 This was not a serious answer. Obviously, you can't fix the risks of memory unsafety simply by "getting good". Zig provides tooling for tests and reduces footguns, making viable and much easier to write safe programs in it, much unlike
      C. I was mostly trying to criticize the standpoint of "memory unsafe languages are not worth using" while poking fun at the "actually, you should write everything in C, just get good lol" crowd, because no matter how good you are, the complexity of a language and footguns will eventually cause bugs. Sorry about the misunderstanding.