Jblow Talks About Rust, Jai, And More | Prime Reacts

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

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

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

    7:45 This is what Common Lisp macros are, just Lisp code running at compile time that returns Lisp code. The next benefit they have over other comp time and macro systems is that all Lisp code is already written as Lisp objects, so there's no special operations or types needed to represent code.

  • @DaveGomes
    @DaveGomes ปีที่แล้ว +351

    Prime's love for JBlow runs deep. He not drinking the koolaid, he snortin the blowcaine

    • @jenav
      @jenav ปีที่แล้ว +16

      I guess you didn't watch the full video

    • @shinjite06
      @shinjite06 ปีที่แล้ว +9

      I would blow Blow

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

      ​@@shinjite06🫡

  • @TankorSmash
    @TankorSmash ปีที่แล้ว +192

    Jonathan Blow does a lot of good interviews, I'm sure he'd love to be on here actually. He did some great interviews with No Boilerplate, and No Frauds Club.

    • @gameofpj3286
      @gameofpj3286 ปีที่แล้ว +9

      Where can I watch/listen to these? :o This sounds really interesting!

    • @TankorSmash
      @TankorSmash ปีที่แล้ว

      @@gameofpj3286 here on TH-cam, I can't link directly

    • @Muskar2
      @Muskar2 ปีที่แล้ว +8

      The invisible reply is probably someone linking them

    • @pythonxz
      @pythonxz ปีที่แล้ว +1

      Get Kasey and Jonathan on here at the same time!

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

      I can't find the interview with No Boilerplate. Can you point me in the right direction?

  • @icemojo
    @icemojo ปีที่แล้ว +109

    For clarity, when Jon Blow talks about "entities", he's not referencing to any sort of ECS mechanism like 98% of the time. The term "entity" is as generic of a term as the "variable" in his working style. They are just a bunch of collection of data that represent things that can exist in a game world. That's all. Don't think too hard.

    • @jonaskoelker
      @jonaskoelker ปีที่แล้ว +4

      Another way of saying the same thing: when a Java developer talks about an object, they're not talking about a thing whose (narrowest) type is `java.lang.Object`, but rather... any instance of any class. Entity is similarly general, although along a slightly different axis: it's any obj... uh... _thing_ which exists in the game world. A player, a monster, a tree, a wall, a vehicle, whatever.

    • @Zipperheaddttl
      @Zipperheaddttl ปีที่แล้ว +3

      Entities is another word for an object, but like an object in the real world like a cup or something. Its a thing that can Normally be interacted with someway in the game world.
      Its really really annoying that programmers steal random words for random shit. Wish we could just use the word object, but that means a bunch of very different things now.

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

      the scope of the generality is misunderstood by people - the monster is an entity, the tile the monster is in is also an entity, one is in a queue, the other in an array .. an entity is much more general that "object"@@jonaskoelker

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

      I think it's the difference between
      ```
      -- init Object with data
      object = {position=V3(1,2,3), health=42, maxHealth=50, active=true}
      allObjects[#allObjects+1] = object
      -- later
      for _, o in allObjects do
      if o.active then
      o.Health = o.maxHealth
      end
      end
      ```
      and
      ```
      -- init entity data
      n = entityCount
      positions[n] = V3(1,2,3)
      healths[n] = 42
      maxHealths[n] = 50
      activeEntities[#activeEntities+1] = n
      entityCount += 1
      -- later
      for _, eid in activeEntities do
      healths[eid] = maxHealths[eid]
      end
      ```
      this allows a direct index to get or set specific-property data by id (number) rather than (object.property)
      consider the difference:
      given N objects with M properties each, there will be N * M + N different data-containing-structures.
      whereas
      given N entities with M properties, there will be M different data-containing structures.
      In my experience (significant amount) this is meaningful to bottom-line (what can happen in a frame) when doing simple operations on ~million things 60 times a second. It becomes more important when there are interactions between entities that can be compressed down to operations on data.

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

      tldr;
      object and entity are different concepts:
      objects have more wrapping paper,
      entities have large wrapping papers that each cover a lot at once

  • @jhuyt-
    @jhuyt- ปีที่แล้ว +74

    Regarding the "difficulty of trying stuff out", I remember watching a video where a C++ developer said he used Python for prototyping because it's easier that way. Once he found an solution he liked, he then implemented it in C++.

    • @yash1152
      @yash1152 ปีที่แล้ว +2

      the blender is made that way nowadays. ig even freecad too.

    • @jonaskoelker
      @jonaskoelker ปีที่แล้ว +5

      Can confirm. There was a thing I wanted to write in C, let's pretend it's a Sudoku generator (it's not too far from being concretely true). I had various strategies that partially worked, some of the time, but frequently enough I would generate a puzzle my solver couldn't solve.
      I used python to prototype various ideas. Failure-and-retry probabilities served as a good enough predictor of performance. Once I got an algorithm I was okay with, I implemented it in C and it worked as expected.
      Note that the output as a function of input is probably the same in C vs. python, but the performance is not. So be careful about extrapolating; Think about when the prototype is and isn't a good predictor of the characteristics of the production implementation.
      When is a python prototype the right approach? Intuition says: the longer the exploratory process is, and the more faster you can try ideas out in the prototype language compared to production, and the less time it takes to rewrite.
      Let's math it out. Say the time cost of implementing x features in language 1 is a_1*x + b_1 and in language 2 it's a_2*x + b_2, the cost of rewriting the final version is r and you need to implement at least t features before your prototype is done and you can begin rewriting.
      Then the cost of writing in language 1 is a_1*t + b_1; the cost of prototyping first is a_2*t + (b_2 + r). For prototyping to win, you want a_2*t + b_2 + r < a_1*t + b_1, which is equivalent to b_2 + r - b_1 < (a_1 - a_2)*t.
      This agrees with intuition: the numbers which favor prototyping are greater t (more exploratory process), greater a_1 - a_2 (development time: python beats Scala beats C++), lower rewriting and differential fixed costs.
      Of course, you can never observe the numbers and so you never know. You can do both, interleaved, and "only" spend twice as much time as the fastest approach. Or you can make a judgement call based on experience.

    • @alexvitkov
      @alexvitkov ปีที่แล้ว +8

      If you're doing something small or just starting out a project, sure, but if you want to prototype/explore something inside a 1 million line C++ codebase you can't really whip out the python.

    • @jonaskoelker
      @jonaskoelker ปีที่แล้ว +2

      @@alexvitkov I generally agree-although one should consider defining some interface around the place where you want to introduce new behavior, which only takes plain data in and gives plain data out.
      Then you can prototype a python thing which does the right input/output mapping of the data, then rewrite it in your production language once you have the right implementation strategy.
      This becomes harder if you want to prototype something which reads and/or updates the system state. It's doable: send over all the data you could ever want to read; return a list of descriptions of things to update. Probably requires a lot of elbow grease and the amount of transferred data may be too large to be practical. But sometimes this can work, and hey this technique might be one that works.

    • @ifstatementifstatement2704
      @ifstatementifstatement2704 ปีที่แล้ว +1

      Python allowed me to understand and learn more complex concepts a lot faster and easier. I then find out what the equivalent of those are in c++ and understand them a lot better.

  • @careymcmanus
    @careymcmanus ปีที่แล้ว +132

    In that talk I get the impression that he actually respects rust but that it is not the right tool for for him or game design in general. I also get the impression that while he is an opinionated man willing to express those opinions that he is not mean and he is happy to hear out/encourage other opinions without belittling them.

    • @BboyKeny
      @BboyKeny ปีที่แล้ว +19

      Your impression resonates with me
      I think anyone serious about making a language has to understand and respect what other language designers did. But on the other hand being opinionated helps since basically everything you decide for a language is an opinion you force onto other. So forming opinions and being informed of opinions are required skills for the job.

    • @simivb
      @simivb ปีที่แล้ว +43

      I'm a regular on his streams for years now and somewhat disagree. If he wants to, he can be nuanced and say his opinion in a way that is very hard to fault, but most of the time, he doesn't want to. And the outcomes of that make me sad sometimes. If someone comes to the stream, asks a random question, and gets absolutely trashed for it, that's not good. He can be mean.

    • @Muskar2
      @Muskar2 ปีที่แล้ว +5

      @@simivb Certainly, he's no Carl Sagan. But in the Witness, he featured James Burke and other decent science communicators (like astronauts) and I think it illustrates that he may want to be approachable, but just have limited capacity/patience to practice it. I'm giving him the benefit of doubt, but it's certainly a shame, given Jai has a lot a potential - at this point I expect it to be in closed beta until some entity creates a superior publicly available one.

    • @auxiliaryboxes
      @auxiliaryboxes ปีที่แล้ว +7

      I've listened to a lot of JBlow's stuff, and yes, he does respect Rust. In some of his earliest lectures on what he wants from a programming language (now Jai) he mentions it several times. He likes that it is trying to have a strong and unique opinion about how programming could, or should, work. A lot of modern languages are just syntactical sugar or supersets of pre-existing languages, with very few, if any, truly innovative ideas. He respects that Rust is doing something different.
      As for opinions, well he can definitely be mean/abrasive when he's in a bad mood lol. He often parrots a gate-keeping mentality and in my opinion, it doesn't do him any favors. I think its a bit of a shame because he is an absolutely brilliant mind, and I can highly recommend watching any of his talks if you're into game design/development.

  • @user-hk3ej4hk7m
    @user-hk3ej4hk7m ปีที่แล้ว +15

    This argument for ease of experimentation is why I love to do first drafts in Python, if it turns out that you need more performance, rewrite it in cpp, rust, or whatever systems language. Reciently I had to build an SPI to webrtc bridge to display stats from a DSP in real time, guess what python is slow and there were some bugs I had to solve in aiortc, but in the end it helped me to understand how the whole webrtc signaling process works. Now I'll be rewriting the bridge in rust with a more solid understanding of the process.
    Most of the time the python implementation is more than sufficient through, which saves me a lot of dev time.

    • @voskresenie-
      @voskresenie- 2 หลายเดือนก่อน

      that's the problem though - most of the time you won't rewrite it, so now you have a program in python, with all the problems that go along with that, when you originally wanted a program in cpp, rust, or whatever systems language, and planned to just write a prototype in python. I can virtually guarantee that, while the prototype might be slower to get out if you write it in cpp or whatever, it will take less time overall to write a prototype in cpp and then convert that to a final version in cpp, compared to writing a prototype in python and a final version in cpp.

  • @zynot91210
    @zynot91210 ปีที่แล้ว +90

    I'm a simple man, I see a Joblow vid, i watch.

    • @dolorsitametblue
      @dolorsitametblue ปีที่แล้ว +7

      Ama simpler man, I see BlowJo - I watch.

    • @farqueueman
      @farqueueman ปีที่แล้ว +4

      gaaaaaeeeee

    • @JohnDoe-jk3vv
      @JohnDoe-jk3vv ปีที่แล้ว

      Joe Blow blowing Joe's bros

    • @homelessrobot
      @homelessrobot ปีที่แล้ว +1

      simplest man; i just watch.

  • @gabrielerbano2786
    @gabrielerbano2786 ปีที่แล้ว +15

    I miss the On The Metal podcast. Every guest had some amazing anedoctes and insights. Even though JBlow's interview was 3 hours long, I didn't want it to end. Every single episode was like that.

  • @user-ge2vc3rl1n
    @user-ge2vc3rl1n ปีที่แล้ว +39

    Rewrite it in Rust unironically the best approach to writing Rust ?

  • @rallokkcaz
    @rallokkcaz ปีที่แล้ว +8

    I love Jon and I always appreciate his opinions. He's not always right and he's not always making the best case. But he's always concise about how he feels and always brings great ideas into the conversation.

  • @GiovanniCKC
    @GiovanniCKC ปีที่แล้ว +3

    7:10 I was just actually watching a video on comptime, etc, in Zig, and, coming from C++, Zig has started to feel kind of like that smaller, beautiful language that is supposed to be struggling to get out of C++. I know it's supposed to be like a modern C, but it feels more like what C++ was supposed to be. Like for example, constexpr & consteval gets us in the realm of comptime-- that idea of a first class function -- *not a macro* -- that does compile time calculations to generate some code or some compile time variable. And then we also have the ultra easy interop with C, literally no effort apparently. And defer! Oh gosh, defer looks so nice. It just feels like the same sort of area of why Bjarne made "c with classes". The niceties just shifted from being actual literal builtin classes and polymorphism to all the zig niceties. Ya know? idk. just some thoughts..

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

    While Rust provides correctness checking by building it into the compiler (as part of the language itself), Jai let's programmer's extend the compiler through it's metaprogramming capabilities and achieve, for example, similar correctness checking to what Rust offers, if one happens to want this. I wonder if I am understanding this correctly. And if so, isn't this kind of genius?

  • @akademiacybersowa
    @akademiacybersowa ปีที่แล้ว +2

    6:00 in C# you can use Roslyn Analyzers to do this kind of stuff (custom static code analysis). Of course it won't fulfill the exactly same role as in Jai because you're still dealing with all other stuff of C#.

  • @MrAbrazildo
    @MrAbrazildo ปีที่แล้ว +2

    Smart pointers were made for allocating memory on the heap. But if this happens for "character logic"/engine, if the compiler can't transpose that memory to CPU caches, then a giant performance loss will happen.
    What I use to do is to use a std::vector, which has a mostly identical syntax to an std::array or a "static_vector" (a kind of std::vector for caches). Then, if performance goes wrong, I simply change the container type - this is just 1 line of code, if aliases were created.

  • @simivb
    @simivb ปีที่แล้ว +24

    Oh god, thats the second reaction to jon blows stuff that contains basically the entire buildup to a point he is making, and then just stops before he makes the point. Im dying out here, what is this

  • @trapexit
    @trapexit ปีที่แล้ว +3

    @9:00 So... like C++ templates, constexpr, etc.

  • @kasper_573
    @kasper_573 ปีที่แล้ว +5

    I think a cool case for zig comptime would be parsers. You can get a type safe interface for some file format (think schemas) at compile time without codegen or code first type inference (like zod in typescript)

  • @yash1152
    @yash1152 ปีที่แล้ว +2

    11:25 11:30 11:50 ECS entity-component-system

  • @yannick5099
    @yannick5099 ปีที่แล้ว +18

    "Building an ECS" from Sander Mertens is a nice series that explains some concepts and implementation details. I'm currently building my own variant with Zig Comptime that automatically creates all the necessary data structures as SOA just from the struct types. Systems are simple functions that are automatically called for each entity that contains the requested components. At runtime it is just a bunch of loops over SOAs and function calls, no runtime reflection. It's not fully featured but a very good exercise.

    • @RomanFrolow
      @RomanFrolow ปีที่แล้ว +3

      oh nice, do you have it open sourced? also maybe some blog post?

    • @yannick5099
      @yannick5099 ปีที่แล้ว +1

      I'll probably open source it when I have the basic features completed. No blog post yet, but take a look at the series that I mentioned above. Main difference is that I want a more static approach, instead of archetypes that are defined at runtime they are fixed. This prevents implicit copying things around if components are added/removed (you would have to do that manually by defining all variants or choosing another representation), which I think fits better with Zigs explicit nature. Especially many short-lived components for e.g. for debuffs can otherwise quickly lead to performance problems. Other than that you could take a look at Flecs (C, there is a binding for Zig called zflecs) or the ECS from Bevy (Rust).

  • @culturedgator
    @culturedgator ปีที่แล้ว +2

    19:15 ish noob q here: Aren't Rust lifetimes a solution to that problem? by using matching lifetimes on matching entities that are supposed to live and die at the same time?

    • @fluffyteddybear6645
      @fluffyteddybear6645 ปีที่แล้ว +2

      Precisely. In fact, you can do exactly what John Blow describes with an arena allocator crate (and I have seen it down in compilers for pass-local structures). All data allocated into the arena would get references with the lifetime bound to the arena, and if "the noob intern" ended up shoving one of them into a long-lived data structure, you'd get an instant type error.
      There are, however, a few more complexities that make this a bit tricky in practice (and why entity indices may be the superior approach). One is, for example, it may require some tricky management of the mutability access on these pointers: say allocating in the Arena gives you back a &mut T, then there is no easy way to go down into a &T and then back up to a &mut T safely. With an index, the problem is "punted" down to the access on the container, not on the pointer itself (as pointer = container[index])
      Finally, the obvious way for doing this requires the "game" to be written in a way that controls the main loop. If you are making your game in something like "standard bevy", you don't have control over that loop, hence no control over the per-frame scoping.
      So, I think, ultimately, entity indices are the way to go. Insisting on entity pointers makes sense once you are in something like C++ (though I disagree on this as well...). This is fine, but it leads to the non-surprising conclusion that "I wouldn't use Rust for this C++-style solution"

  • @MenkoDany
    @MenkoDany ปีที่แล้ว +25

    I was *just* on a primeagen JBlow binge! Yes! More! Love Jai

    • @MenkoDany
      @MenkoDany ปีที่แล้ว

      Oh, it's that 2020 interview. Meh :/

  • @SimGunther
    @SimGunther ปีที่แล้ว +6

    7:00 comptime generics are great for Zig, but not for most languages as discussed on the blog post "Zig-style generics are not well-suited for most languages"
    Whether or not you like a more limited use case version of generics fit for your program and how much you love other kinds of generics is gonna determine whether you love zig generics.

  • @HobokerDev
    @HobokerDev ปีที่แล้ว +5

    JBlow doesn't use ECS. He talked many times about how your game doesn't need ECS. Just write the code for entities you have. That's what he does.

  • @musdevfrog
    @musdevfrog ปีที่แล้ว +9

    Can't wait for John to be on the stream!

  • @yash1152
    @yash1152 ปีที่แล้ว +1

    6:39 how times change wrt zig & comptime & rust & macros in prime's opinion :D

  • @an_imminence
    @an_imminence ปีที่แล้ว +1

    I listen to that interview just for fun sometimes, it's so good. Recommended in its entirety!

  • @FaZekiller-qe3uf
    @FaZekiller-qe3uf ปีที่แล้ว +4

    Paused it right before he explained how Jai's meta programming helps. It's literally written in the transcript you didn't read.

  • @jesse2667
    @jesse2667 ปีที่แล้ว +1

    13:50 "Limited amount of memory" I don't know when we got to the point where to open up just a single browser window requires 400-500mb of RAM. I tried with several different browsers. It feels like **something has gone terribly wrong**. We just build 💩 on top of a foundation of more 💩.

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

      I just had a discussion at work, that we need to increase request size limit, we were like why? 60MB was not enough for one of our POST endpoints. Turns out we had a product, that had a company, and the company had products.... And nobody noticed we post this shit back and forth for the las couple years, but lately we handle enough products for this to become a problem :D

  • @homelessrobot
    @homelessrobot ปีที่แล้ว +11

    This actually connects back to the thing about whether or not you should comment your code; very few comments should survive the exploratory phase of programming, but comments are pretty important FOR the exploratory phase. Its something you fortify shakey code with, and either the code changes, or the comments go away. Sometimes a little of a and b both.
    The ultimate end-all-be all impossible to prototype in language would be one of those 'true by construction' type languages that even have a special structured editor (as opposed to text editors) where theres no such things as compile errors because you cannot even express an invalid program. Sounds great because a large class of bugs are no longer even representable in the language; its inherently more safe. But you basically already have to have written the program in another language and debugged it there before you can bring it into this stricter system.
    Debugging isn't just a processes for fixing your programs. I would say it isn't even PRIMARILY a process for fixing your programs. Its primarily a process for fixing your conception/understand of them. You need an environment to explore bad programs before you can get to the good ones. Its not enough for some tool to tell you one time 'yeah this is good'. You need to build up confidence iteratively.

  • @francis_the_cat9549
    @francis_the_cat9549 ปีที่แล้ว +20

    odin has comp time too btw, you just prefix a parameter/struct field with a $ and there you go. You can constrain them with where clauses too, its really nice
    Edit: this makes it also really nice to create an ecs in odin

  • @karanmungra5630
    @karanmungra5630 ปีที่แล้ว +2

    I like the idea of using Ada and Spark. Where you can enforce many checks statically and its is a procedural language so it is also easy to use.

  • @0xCAFEF00D
    @0xCAFEF00D ปีที่แล้ว +1

    I remember one cool thing about jai metaprogramming which was a metaprogramming system for integrating functions into the game console. I don't recall the details exactly but from memory it inspected the functions that were passed to it and automatically generated help text and input value correctness checking for the associated console command based on the function arguments and generated code to be run to register the console command later during that same compilation.
    So the method for adding a console command is just to declare that the function should work in the console with a description of what it does and the metaprogram does the rest of the work.
    Of course I'm so hazy on this maybe it was just a dream.

    • @notuxnobux
      @notuxnobux ปีที่แล้ว +1

      That part is actually similar to Java properties, except in jai it's done at compile time instead of runtime

    • @TheMrKeksLp
      @TheMrKeksLp ปีที่แล้ว

      @@notuxnobux "It's done at compile time instead of runtime" Which makes it quite a bit less interesting. I mean you could do the same thing even with C macros

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

    4:45 is he basically describing clojure's spec and check?

  • @filipmajetic1174
    @filipmajetic1174 ปีที่แล้ว +4

    "now that Jai is out there" what the hell did I miss??

  • @kirashufflerful
    @kirashufflerful ปีที่แล้ว +1

    So, basically zig's comptime is like templates and constexpr from c++?

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

      Kinda. Comptime allows for manipulating types as values (you can pass a type as a function parameter, you can return it from a function, you can create new types during compile time) and executing code during compile time. It is basically a replacement for templates, constexpr and (some) macros, all in one and more "elegant".

  • @_jmgomez_
    @_jmgomez_ ปีที่แล้ว

    6:19 what he is referring to is static introspection. You can do that in Nim today

  • @Imaltont
    @Imaltont ปีที่แล้ว +5

    Having the borrow checker as a compiler flag would be pretty cool. All the exploratory programming and then turn it on when you locked things down/keep it was warnings. Similar to how lisp does it with type-checking when you turn on optimizations (for SBCL at least).

    • @dynfoxx
      @dynfoxx ปีที่แล้ว +1

      Technically I belive it is. I may be wrong but you can compile without doing borrow checking.

    • @bytefu
      @bytefu ปีที่แล้ว

      Bad idea. You'll likely end up with a pile of garbage rather than a beautifully refactored chunk of code. It's definitely not fun to suddenly get a hundred errors from a compiler and spend an hour or two fixing those. Even if you end up with something decent, the tedious and non-creative process of this kind of refactoring would eventually wear you out, you'll ditch the borrow checker and just stop caring about correctness that much. Not to mention the disappointment when your beautiful experimental code simply cannot be refactored to satisfy the borrow checker, because of some subtle but fundamental flaw in the algorithm.
      Optional correctness never works. Just look at C and C++. You can absolutely write perfectly safe code in these, just gotta follow all the million rules in the standards. They've got valgrind, various sanitizers, static analyzers and whatnot... it all doesn't matter much, 95% of that code is still crap, because all these tools are optional.

  • @NdxtremePro
    @NdxtremePro ปีที่แล้ว +1

    I think that is kinda what Zig is doing when you switch between release, release fast, debug and debug fast. A lot of the magic in Zig is this type of comptime loops, at least that is my understanding.

  • @user-ov5nd1fb7s
    @user-ov5nd1fb7s ปีที่แล้ว +5

    Jon has never programmed in Rust. So it is hard for take his opinion seriously.
    From listening to the "prime", it seems he doesn't know Rust very well either.
    His example with the "strings" is weird. If you want to experiment with strings, use String, clone and
    then when you know exactly what you want change it to &str, Cow or whatever.

    • @user-ov5nd1fb7s
      @user-ov5nd1fb7s ปีที่แล้ว +5

      @@rytif 1. I don't care how long it takes to compile. I've shipped projects with a thousand dependencies and it compiled in about 40-50 seconds.The compile times are slow but not so slow that you can't work. I care about the runtime. 2. Iteration is terrible, if you don't know the language well or you are a bad programmer.

  • @verified_tinker1818
    @verified_tinker1818 ปีที่แล้ว +3

    Memory is incredibly limiting when making an intermediate-to-large game (and some niche kinds of small games).

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

    @ThePrimeTime Now that JAI is a little more open, you can probably ask for access.
    Randy (yes that Randy) is using it currently for his game so maybe he could take the time to show you some stuff.

  • @captainfordo1
    @captainfordo1 ปีที่แล้ว +16

    We need more J Blow's in tech.

    • @lmnts556
      @lmnts556 ปีที่แล้ว

      We need more BlowJobs indeed.

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

      You know what I need more?
      Blow J

  • @friendlyfella123
    @friendlyfella123 ปีที่แล้ว +2

    Whats the point of seeing Prime's reaction to JBlow clips since they practically agree on most of the covered topics?

  • @smarimc
    @smarimc ปีที่แล้ว +6

    Jai's megaprogramming is the Lego Technic to Zig comptime's Duplo. Both are great, but the maturity delta is significant.

    • @homelessrobot
      @homelessrobot ปีที่แล้ว +4

      I will believe it when i can actually use it

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

    I've always just thought of comptime being a pre-pass on the code. Need to calculate a value based on the target OS? comptime

  • @herzogatomsprengkopfensen4696
    @herzogatomsprengkopfensen4696 ปีที่แล้ว

    3:40 Valorant invite sound in the background?

  • @milangruner5538
    @milangruner5538 ปีที่แล้ว +5

    If you want to get a proper grasp of ECS, try the Bevy game engine (in Rust). It's entities and components all the way down.

    • @kulkalkul
      @kulkalkul ปีที่แล้ว +2

      @@rytif Or... maybe let people choose if they need it or not. What's the issue with people wanting to use ECS getting suggestions that bothers you so much?

  • @peterklemenc6194
    @peterklemenc6194 ปีที่แล้ว

    Limited amount of memory @14:00 is about VRAM / GPUs

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

    3:03 "And boom! You are good to Go!"

  • @artifishul
    @artifishul ปีที่แล้ว

    Writing compiler time rules after the fact sounds like what we're all using unit tests (in untyped languages) for now. That sounds neat, especially if it can be integrated with an LSP for realtime notification that I'm breaking rules.

  • @bonsairobo
    @bonsairobo ปีที่แล้ว +7

    Prime: "I'd rather just write Rust code executed at compile time that generates code"
    Yea. That's what procedural macros are.

  • @EvanBoldt
    @EvanBoldt ปีที่แล้ว

    5:41 like noImplicitAny in TS, but better. Or like having a GC mode and a borrow checker mode on a module level.

  • @fishfpv9916
    @fishfpv9916 ปีที่แล้ว

    The rest of the episodes on this podcast are fantastic and would love to see prime react to more of them

  • @flyingsquirrel3271
    @flyingsquirrel3271 ปีที่แล้ว +6

    I get your excitement for comptime, but I don't think it's a good replacement for rusts generics. The amazing thing about rusts generics is that they are type-checked using traits. I can look at a generic function and know exactly what I am able to do with the generic argument in its body without introducing a breaking change.

  • @culturedgator
    @culturedgator ปีที่แล้ว +1

    7:10 ish isn't that TDD? write assertions about your edge cases, write "fluid" code around them. Repeat.
    Also I feel I've discovered the graal recently for the TDD way, Pharo. Please give it a try, it's mind blowing. Not blanzingly fast runtime (it's a Smalltalk and pure OOP), but blazingly fast devtime and its coherence and simplicity make me think its VM can be optimized to death.

  • @cybresquid
    @cybresquid ปีที่แล้ว +3

    You mentioned utilizing smart pointers in Rust for app development. Could you expand a little on the use case there? I feel like I don't take enough advantage of smart pointers. I'm primarily an app/web developer

    • @anlumo1
      @anlumo1 ปีที่แล้ว +3

      Smartpointers are for languages without a garbage collector. If you're a web dev, you most likely always use GC.
      The most used ones allow the code to hold multiple references to the same piece of data while not leaking memory (or doing the memory management manually). Others make sure that there's only a single reference. Some might do other stuff like closing a network connection when a piece of data isn't used any more.

    • @SimonBuchanNz
      @SimonBuchanNz ปีที่แล้ว +1

      If you use Box or Arc, you're already using smart pointers. They're not that fancy.

  • @ulrich-tonmoy
    @ulrich-tonmoy ปีที่แล้ว +1

    The battle of C family C/C++ vs Zig vs Jai vs Odin vs Carbon vs V vs Beef

  • @Talk378
    @Talk378 ปีที่แล้ว +10

    JBlow makes all the right people salty asf, plus he made Braid.

  • @t3dotgg
    @t3dotgg ปีที่แล้ว +2

    Cover his takes on women in STEM and Covid next

  • @ducksies
    @ducksies ปีที่แล้ว

    CL-style defmacro statements are still probably the most powerful way to metaprogram

  • @sharp7j
    @sharp7j ปีที่แล้ว +1

    I think this only sometimes true.
    I made a multithreaded game engine as my first Rust project, as an experiment.
    Making anything multithreaded in Rust is way way way way easier and faster because you aren't spending a shitton of time solving race conditions.
    For projects that don't really have "bug filled traps" like multithreading and other stuff then ya better to use C# or something.
    The other thing is if your experiment is gated by performance. If you're trying to build a crazy simulation, you might not get to experiment with the stuff you want to because its too slow. Same with games. "Ah I can't experiment with a like 10000 unit RTS game unless performance is awesome out of the box".

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

    I'd like to see Jon on the show. I've been watching his videos from over the past 9 years. He is good at thinking about ideas down to the CPU/RAM/cache and deciding why it would or wouldn't work.

  • @ReedoTV
    @ReedoTV ปีที่แล้ว +2

    Is comptime like const fn in Rust?

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  ปีที่แล้ว +1

      no... because comptime produces types and types can be used.

    • @reo101
      @reo101 ปีที่แล้ว +1

      Calling functions at comptime is the same as const fn, yes. The cool thing is that all* function are `const fn`s! (*: with some exceptions like doing networking/file IO and such)

    • @xplinux22
      @xplinux22 ปีที่แล้ว +3

      Sort of... My understanding of Zig's *comptime* is that it's largely akin to both *const fn* and *const { }* blocks (not available on stable Rust yet). The scope of *comptime* is a bit broader, though, as it also includes type-level expressions, which would probably fall under const-generic expressions inside *where* clauses in Rust (also not available on stable yet).
      I'd say that *comptime* is probably closer to C++'s *constexpr* and templates, in most respects, as its compile-time "well-formedness" and correctness guarantees are much looser than Rust's equivalent (so *comptime* errors can be pretty gross, compared to Rust errors, when things go wrong), but the feature is somewhat more flexible as a result.
      Disclaimer: I'm primarily a Rust developer with a passing interest in Zig on the side, so feel free to correct me if I'm wrong, folks.

  • @rafaelbordoni516
    @rafaelbordoni516 ปีที่แล้ว +1

    The compilation logic he is talking about is probably for porting to different platforms, GPUs and different versions OpenGL/DX3D/Vulkan have a lot of small differences between each that are a pain to work with. For example, big commercial game engines each have their own different set of conventions they adhere to and they each have to translate these to different versions of OpenGL, it's a mess.

  • @egor.okhterov
    @egor.okhterov ปีที่แล้ว

    Netflix app is not opening. Are you oncall btw?

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

    JB is the real OG. He knows his stuff.

  • @shreyasjejurkar1233
    @shreyasjejurkar1233 ปีที่แล้ว

    Comptime looks similar to what C# source generator is? Am i correct?

  • @cherubin7th
    @cherubin7th ปีที่แล้ว +2

    With Python I always lose so much time on stupid runtime errors caused by some small nonsense that I cannot find the cause for hours. So I stopped prototyping in it. I never have this problems with statically typed languages.

  • @nERVEcenter117
    @nERVEcenter117 ปีที่แล้ว +4

    Almost all of Nim can run at compile time. Arbitrary (and incredibly clear) compile logic is easy. And const compile-time definitions make some really wild stuff possible (i.e. reading a file into a string and including it as a const in your compiled binary). I definitely avoid macros, though.

  • @danieloberhoff1
    @danieloberhoff1 ปีที่แล้ว

    with ts i love the comination of super easy concurrency and type safety so much...that plus being able to roll it out to the web and have access to all those tools, for frontend, my goto

  • @colin_actually
    @colin_actually ปีที่แล้ว +23

    He makes enough people mad that he's gotta be right.

    • @ade5324
      @ade5324 ปีที่แล้ว +3

      If anyone agrees to you, why even speak, right?

    • @farqueueman
      @farqueueman ปีที่แล้ว +11

      if i punch everyone i see... i too must be right.

    • @homelessrobot
      @homelessrobot ปีที่แล้ว +1

      he's certainly right about some stuff. but i doubt thats why anyone has issue with the things he says.

  • @ManThermos
    @ManThermos ปีที่แล้ว +8

    I recommend watching the video where john blow made a sad edit of himself saying how noone understands the meaning of braid while playing clips of soulja boy playing braid saying the game is about jumping

    • @drygordspellweaver8761
      @drygordspellweaver8761 ปีที่แล้ว +2

      He didn’t make that clip. It was clear mockery.

    • @ManThermos
      @ManThermos ปีที่แล้ว +2

      Was the part where he's against a window in a dark room like a CIA informant saying how they misunderstood his art filmed without his knowledge lol?

    • @hwstar9416
      @hwstar9416 ปีที่แล้ว +3

      That wasn't made by him. It was an indie games documentary

  • @xbmarx
    @xbmarx ปีที่แล้ว +3

    If you like zig comptime, you will love OCaml functors.

  • @a097f7g
    @a097f7g ปีที่แล้ว +2

    Blow actively advocates *against* ECS. The reality is that ECS is just the new OOP: Overcomplicated premature over-generalization that usually doesn't solve your actual problems, generates new ones and makes everything 10x more complicated than it needs to be. And I say this after having used an ECS on a 3-year commercial game project. I do not regret using ECS, it's fine. But it's way more complicated than it needs to be. Keep stuff simple.

    • @SimonBuchanNz
      @SimonBuchanNz ปีที่แล้ว +2

      You can make ECS as simple as you want: a World struct with a bunch of Vecs for each entity type and you're *nearly* there.

  • @rakaboy1619
    @rakaboy1619 ปีที่แล้ว +1

    Hey, Prime. Why'd you stopped Zigging? Are you in your Ocamling stage now? Will you ever Zig again?

  • @vikramkrishnan6414
    @vikramkrishnan6414 ปีที่แล้ว +4

    JBlow slags off Lisp, but clojure has generative testing and spec which kind of do what he wants to do

    • @freesoftwareextremist8119
      @freesoftwareextremist8119 ปีที่แล้ว

      OK man hear me out, Clojure is fine... But have you tried CL?

    • @vikramkrishnan6414
      @vikramkrishnan6414 ปีที่แล้ว

      @@freesoftwareextremist8119 Yes. Great Language, but JVM has a great ecosystem for modern applications, so the ability to leverage that while maintaining some measure of lispiness is quite nice.

  • @NeoShameMan
    @NeoShameMan ปีที่แล้ว +1

    My programming pipeline is mock up in javascript then straight to assembly for implementation 😂

  • @justintonation29
    @justintonation29 ปีที่แล้ว

    Pretty funny that all the comments in his stream are "What about Lisp?", Prime proceeds to ignore Lisp's existence 🙂

  • @adama7752
    @adama7752 ปีที่แล้ว +1

    ThePrimeTime doesn't even know how good it is.

  • @tim-harding
    @tim-harding ปีที่แล้ว

    Would be super cool if you were able to get him for an interview.

  • @stangeorge6893
    @stangeorge6893 ปีที่แล้ว

    Can't wait to watch the stream where you build an ECS. :)

  • @krux02
    @krux02 ปีที่แล้ว

    Compile time code execution and macros are not the same. You need compile time code execution for macros, but it really just a strict subset of what you can do with macros.

    • @homelessrobot
      @homelessrobot ปีที่แล้ว +1

      Subset? Seems like a strict superset. Especially if you read 'macro' as 'syntax macro'. Its really just compile time code that operates over a syntax tree.

    • @krux02
      @krux02 ปีที่แล้ว +1

      @@homelessrobot yea, compile time code execution is like a macro, but you can't operate on the syntax tree, or do anything with the syntax tree, all you get are comp-time-values

  • @Spencer-r6r2l
    @Spencer-r6r2l 11 หลายเดือนก่อน +1

    Ha! Say "entity" instead of "object"?! Because OOP is so evil, right? Let's just call it something else. Ha!

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

    14:12, see that's the thing, you don't care about memory. Keep in mind I have at least 50 tabs open, it adds up.

  • @xdman2956
    @xdman2956 ปีที่แล้ว

    CSV parser is an S-program: solving a well specified problem

  • @DBGabriele
    @DBGabriele ปีที่แล้ว +2

    ECS is literary destroyed during the optimization step of the video game development cycle.
    Moreover, it's quite common to use fix allocation, even for objects with different sizes, which allow to achieve better performance.
    In rust this is hard or even impossible (just in unsafe mode?).
    In this context, Zig could be a good alternative, but it leaks of operator overloading, and for linear math is very bad.

    • @empireempire3545
      @empireempire3545 ปีที่แล้ว

      "ECS is literary destroyed during the optimization step of the video game development cycle. " why would you say that? Have any concrete examples, sources?

    • @DBGabriele
      @DBGabriele ปีที่แล้ว +1

      @@empireempire3545
      In short: to avoid memory fragmentation.
      Indeed, game optimization often involves "component fusion," merging components with entities to enhance memory and cache performance.
      An example is the Unity "transformation-component", it is a fake component (indeed it is mandatory), or an other example is the Actor class in UE (which has a lot components/behaviors build in).

    • @kulkalkul
      @kulkalkul ปีที่แล้ว +1

      ​@@DBGabriele I suggest you to check it out thoroughly, most of the assumptions you have seems wrong.

  • @rosehogenson1398
    @rosehogenson1398 ปีที่แล้ว +3

    comptime is a replacement for generics, and also macros.

  • @JJ-hb9in
    @JJ-hb9in 6 หลายเดือนก่อน

    I’ve been thinking it’d be nice to have a easy rust. You could write any module in easy rust, which is just rust, but everything that would be on the heap is simply Rc so you never think about that or boxing etc. All strings are String.
    You could write your module in this, and then when it needs to be fast, change the file from ers to rs and add in all the big boy code.
    It would interact with rust no problem you just have a non optimal but python like experience but it’s still rust just without a bunch of choices
    Someone please steam my idea

  • @empireempire3545
    @empireempire3545 ปีที่แล้ว

    ECS is the best architecture we have atm imo. Not just for games, for many, many things.

  • @adicide9070
    @adicide9070 ปีที่แล้ว

    I'm so scrolling what the host says just to hear snippets of what Jon says before listening to the whole podcast.

  • @pif5023
    @pif5023 ปีที่แล้ว +7

    Yes! Cost of experimentation is my worry with Rust, especially coming from TS. You can make up for it with better pen and paper structured problem analysis but it has its costs.

  • @Godalming123
    @Godalming123 ปีที่แล้ว

    The 10th time I've heard prime say how great it would be to write a CSV parser in rust...

  • @mycollegeshirt
    @mycollegeshirt 13 วันที่ผ่านมา

    not to be a zig fanboy. But I never even knew any of this was a problem. Thank goodness, In zig I would just have made the entity nullable. Use an arena and allocate and deallocate for space, never for functionality. As in how many things am I possibly going to need for some amount of time. So I would have just done if(destroy)self = null; or something and on the follower. if(followingEntity)|entity| self.follow(entity); It gives me a lot of flexibility on my allocation strategy and it seems wasteful to bring in a reference counter in there. on every entity? Maybe it's combat memory fragmentation? but the extra u64 id is giving pointless fragmentation out the gate.

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

    "This guy made one successful video-game and now acts like he's the next Linus Torvalds."
    Best most accurate comment about JB I've ever read on youtube.

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

      It’s not accurate at all.. he made 2 successful games. And tbf, his first game Braid was really ground breaking and helped kicked off indie game development

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

      @@ZombieLincoln666and has no documented control scheme on Netflix, but "Hey!" it's a puzzle game, right?

  • @NotMarkKnopfler
    @NotMarkKnopfler ปีที่แล้ว +5

    I work on memory constrained machines. The one I use a lot has 4K of flash, and 256 bytes of RAM 🙂But I work in embedded stuff. I'm just here for the lolz.

    • @musamahmood635
      @musamahmood635 ปีที่แล้ว

      What chip has those specs? The weakest mcu I've used is the cortex m0

  • @constantinefedotov8394
    @constantinefedotov8394 ปีที่แล้ว

    Prime might like vim keybindings for Firefox and Chrome

  • @trendingtopicresearch9440
    @trendingtopicresearch9440 ปีที่แล้ว +5

    What would happen if we'd wrote programs by just defining tests. And let ChatGPT iterate till the tests are passed. What would the world look like in such scenario?

    • @davideastman5806
      @davideastman5806 ปีที่แล้ว +1

      I actually asked ChatGPT about this idea awhile back. It suggested that it'd require very thorough and precise unit tests and would be very resource intensive. But I think someday we'll get there, with humans doing higher-level architect work and AI doing the construction work.

    • @TurtleKwitty
      @TurtleKwitty ปีที่แล้ว +2

      An extremely high suicide rate, or no software being made cause no one wants to be just writing tests

    • @homelessrobot
      @homelessrobot ปีที่แล้ว +1

      @@TurtleKwitty so people would kill themselves because they have to write less code and do less debugging? I doubt it.

    • @homelessrobot
      @homelessrobot ปีที่แล้ว

      the general concept is akin to 'theorems for free' style type-derived programs, where you specify the type so narrowly that there is exactly one program that the type could satisfy. The world wouldn't look any different really. At least in this version of reality where the type entirely describes the runtime behavior of the program. You just have big disgusting types/tests that obscure the meaning of the program

  • @freesoftwareextremist8119
    @freesoftwareextremist8119 ปีที่แล้ว +2

    I honestly find comptime way too confusing. Macros don't have to be hard. Lisp macros (especially in Common Lisp) are more powerful than Rusts proc macros, and nonetheless super easy to write.

    • @homelessrobot
      @homelessrobot ปีที่แล้ว +2

      ease of authoring is almost never the problem with macros. its ease of making sense of the shit later. or ease of making sense of other people shit.

    • @freesoftwareextremist8119
      @freesoftwareextremist8119 ปีที่แล้ว

      @@homelessrobot Ease of making sense is easily solved by a good editor that allows you to incrementally expand the macros inline to see what they do.

    • @homelessrobot
      @homelessrobot ปีที่แล้ว

      @@freesoftwareextremist8119 this is about as true as if an editor that shows the assembly for some code you are working would make the language completely transparent and everything written in it obvious. I don't think it would.
      The connections between various elements to their concrete and abstracted representations need to be spelled out for those relationships to be obvious upon initial encounter. And even this isn't always very helpful because there are many many layers of abstraction, and without really seeing 1) what these layers are and 2) how they are related, we aren't getting a full picture.
      You often run into a similar problem with optimizations. It often isn't enough to know what some code optimize to to have faith in your ability to use the optimization correctly. And optimizations are a thing that are supposed to work almost entirely without specific knowledge of specific optimizations.
      You are effectively adding a new feature to the language everytime you introduce a new macro. This means every program written this way is effectively a fork of the language itself that needs to be understood in combination with this new business logic.

    • @freesoftwareextremist8119
      @freesoftwareextremist8119 ปีที่แล้ว

      @@homelessrobot I add a language feature every time I add a new function. I don't see how adding new grammar makes code more difficult to understand, but adding new vocabulary doesn't?
      The same rules that apply for functions apply for macros as well. Name them well, follow sensible conventions and patterns.
      If even then, if what a function does is unknown to me, I can simply jump to it and read the code. If what a macro does is unknown to me, I can expand it and see what code it results in.

    • @homelessrobot
      @homelessrobot ปีที่แล้ว

      ​@@freesoftwareextremist8119 Well its strange to me that you don't see it, but I guess its in-line with a constructive view of language required to deal with the consequences of ubiquitous syntax extension.
      Function application/call violates many fewer assumptions about the meaning of some code that someone generally makes in the absence of macros. Even though you don't get a full picture of the semantics of some code if you don't know the meaning of some function, you don't have to question EVERYTHING about it.

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

    JB always says "right?" in such peculiar spots