Jai w/ Judah 001:

Sdílet
Vložit
  • čas přidán 8. 09. 2024
  • In this episode I talk about the #insert and #run directives, how they're used together, and what you can do with them.

Komentáře • 19

  • @XeZrunner
    @XeZrunner Před rokem +11

    Awesome! Can't wait for this language to become publicly available.

  • @user-tt4dy1ti5v
    @user-tt4dy1ti5v Před 3 měsíci +2

    00:00 Intro
    00:28 #run directive (runs scope of code)
    02:03 #run directive (calls function)
    04:12 #run directive (calls lambda)
    05:06 #run lambda shorthand
    05:38 Summary of #run directive
    06:04 #run,stallable overview
    07:15 #run,stallable is currently not documented.
    07:42 #insert ""
    07:53 #insert #code
    08:37 Use of #insert within #expand macros
    10:01 Use of #insert within #expand for_expansion
    10:24 For loops are a special-case macro.
    10:42 #run #insert example
    14:49 .build directory
    15:04 .added_strings_w2.jai file
    15:44 #run #insert example continuation: integers
    16:43 #run #insert example continuation: enums
    19:44 #run #insert use case: DEBUG, RELEASE, OPTIMIZATION build booleans
    19:58 #run #insert use case: SECRET key
    20:17 #run #insert example continuation: structs
    22:04 Each #insert directive creates a new section in the .added_strings_w2.jai file.
    23:09 #run #insert use case: pulling data from an external API
    23:16 #run #insert use case: serialization / deserialization
    24:11 Wrap up

  • @ali-4096
    @ali-4096 Před 4 měsíci +1

    Jai looks so elegant. I love it

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

    This is sick, I hope you make more videos like this!

  • @IndellableHatesHandles
    @IndellableHatesHandles Před 2 měsíci +1

    The biggest thing for me is the compile time. Rebuilding my piddly 2D game takes 40 seconds, and if I modify something deep in the include hierarchy it can take 20 seconds or more, so the compile time advantage is going to be huge for game dev.

    • @nothappyz
      @nothappyz Před měsícem

      If it's taking 40 seconds you're using a game engine. Apples and oranges

    • @IndellableHatesHandles
      @IndellableHatesHandles Před měsícem

      @@nothappyz Nope, no engine here. 40 seconds for a full rebuild of a 2D RPG in C++ is normal, which is quite concerning

    • @nothappyz
      @nothappyz Před měsícem

      @@IndellableHatesHandles oh that must suck, sorry for the assumption

  • @simonl1938
    @simonl1938 Před 9 měsíci

    Great video, I love how straight forward the library stuff is, I always hate fucking around with headers in c/c++. Also the 'read_entire_file' function in the 'File' import is something I always use myself in c lol. I was a bit intimidated by the #insert stuff at first but it's actually really simple and useful.

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

    amazing language, when we get a release of jai compiler

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

    love jai

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

    will this make compile times moon when you have too much metaprogramming? Or is it cached or something

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

      All compile-time code is ran with Jai's byte code interpreter uncached (still statically checked/typed of course, so Jai's compile-time interpreter is different from something like Python or Ruby). The compiler itself is very fast, so I rarely see an increase in compile times when metaprogramming; only when parsing large files or waiting for external programs to finish executing.
      You can think of Jai's metaprogramming as running a separate program at compile-time, so your compile times would be linked to how long that program takes to finish executing within the bytecode interpreter. There's a bit more nuance to this, but that's the gist of things.
      Here's a fun demo that might explain things further: czcams.com/video/UTqZNujQOlA/video.htmlsi=FDnwkfYABt7WMjyu&t=2684
      Hope that answers your question!

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

      @@JudahCaruso thanks! So jai is the new python?

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

      @@Lircking no problem!
      And not exactly. This playlist has videos that describe Jai's goals more succinctly than I could! czcams.com/play/PLmV5I2fxaiCKfxMBrNsU1kgKJXD3PkyxO.html&si=1OHQsml5I6Iz5U2d

  • @ThomasMinitsios
    @ThomasMinitsios Před rokem

    What happens if there are circular dependencies with stallable?

    • @JudahCaruso
      @JudahCaruso  Před rokem

      Circular dependencies between #run directives are caught at compile-time; regardless of if they’re stallable or not

  • @adicide9070
    @adicide9070 Před 10 měsíci +5

    3 spaces??? :D How dare you!

  • @mzakyr342
    @mzakyr342 Před 8 měsíci

    What is this?