Random: Jai + Go (compile-time binding generator)

Sdílet
Vložit
  • čas přidán 1. 07. 2024
  • Slightly different format for this video, wanted to try something new. Let me know what you think!
  • Věda a technologie

Komentáře • 12

  • @JudahCaruso
    @JudahCaruso  Před měsícem +5

    Apologies for the audio cut-outs. My microphone's gain was much lower than it usually is and I forgot to adjust it.

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

      excellent video, shame it has audio problem. maybe it is time for a new microphone 🎤

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

      Thanks! And it was mostly related to incompetence haha. I forgot to turn up my mic/adjust my noise gate in OBS…

  • @maxrinehart4177
    @maxrinehart4177 Před měsícem +1

    man, I love your videos, I learned a lot from them.
    Please make more Jai videos. ❤

  • @AE4i1
    @AE4i1 Před měsícem +5

    damn man, I really want that jai

    • @ArkDEngal
      @ArkDEngal Před měsícem +2

      same, since 2016 TT_TT

  • @DavidFregoli
    @DavidFregoli Před měsícem +1

    mic keeps cutting out 😢

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

    Hi Judah. Love your videos covering Jai.
    I have a question. Does variable tagging support holding values and can that tag be read during runtime?
    E.g. for displaying a property UI panel based on the selected context. How would you tag a specific float with a Clamp tag that would have a min and max, so the panel knows how to render the UI for that specific property

    • @JudahCaruso
      @JudahCaruso  Před měsícem +2

      Thanks! I appreciate the support!
      And it depends on what you mean by holding a value. For instance, the value can't be something known at runtime because it's just a constant string put on the declaration. However, you can read them at runtime if you have runtime type information enabled (which it is by default).
      Your example could definitely work like this:
      UI_Panel :: struct {
      parent: *UI_Panel;
      min: float32; @Clamp(0, parent.min)
      max: float32; @Clamp(parent.max)
      }
      ui_panel_update :: (panel: *UI_Panel) {
      info := cast(*Type_Info_Struct)type_info(UI_Panel);
      // if you don't like this style, you could also auto-generate this code with #insert #run
      for info.members if it.notes.count > 0 {
      for note: it.notes if starts_with(note, "@Clamp") {
      // now we know we're looking at the Clamp note of a struct member,
      // so we can parse the string and do whatever with it.
      // for example, seeing 'parent.min' in the string, then using its value at runtime

      // ...
      if use_parent_min {
      panel.min = clamp(0, parent.min);
      }
      }
      }
      }

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

      @@JudahCaruso Thank you for the detailed reply. It answered my questions :)

  • @chopsueysensei
    @chopsueysensei Před 23 dny

    great stuff! do you have a jai LSP for Sublime or something like that here?

    • @JudahCaruso
      @JudahCaruso  Před 23 dny

      it's not exactly an LSP, but there's a sublime plugin called JaiTools which has syntax highlighting and goto definition; then I just have a sublime project that points to the install directory!