Demo: Code Modification

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ส.ค. 2024
  • Another demo! The corresponding Q&A is here:
    • Q&A: Code Modification

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

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

    That compiler demo is badass!

  • @5Gazto
    @5Gazto 8 ปีที่แล้ว +3

    Thanks for continuing the series.

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

    Hell yeah man, been looking forward to more Jai!

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

    This is amazing. I used to hand-instrument C code to visualize what it was doing - I could do so much better with your system.
    If only I could use this idea directly on legacy C/C++ code...

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

    Can't wait to try this.

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

    I also cannot wait to one day try out your language. That profiling tool looks really helpful. Currently I'm spawning another thread with a GTK Window for my game.

  • @dumitru-alinsimoiu7652
    @dumitru-alinsimoiu7652 8 ปีที่แล้ว +2

    great work! we need to make this happen, thank you Jonathan Blow!

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

    I believe in the Java world it's called aspect programming. Aspects are coded in java and injection is done at bytecode level via DI. Can't wait to use your language. Great work.

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

    It would be great fun to see this working on data structures.

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

    how can i try jai?

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

    Awesome, the post-typechecking AST modification looks really useful and it's something I haven't seen many other languages attempt. Since you were discussing plans for a possible pre-typechecking version of this, I am interested in hearing how much support there will be for "arbitrary syntax" (i.e. not just current syntactic structures, but also slightly more lenient expressions that could be used specifically to trigger a "macro"-like AST rewriter... if you can even allow for unparsed lists of expressions in some special syntax (let's say #extend(list of tokens(go "here")) then you would gain most of Lisp's power for expressing domain specific languages, which could be fucking awesome).

  • @clankill3r
    @clankill3r 8 ปีที่แล้ว

    When i first saw the thumbnail on twitch i got so happy cause i thought Jon worked on programming with nodes :)

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

    I'm curious what cmder did to your computer. I was thinking about using it.

    • @Maraus92
      @Maraus92 3 ปีที่แล้ว

      I'm using it now and I too wonder what it does to his system.

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

    The low bitrate is because of the excessive colour switching on screen. In the future I recommend turning the enemies into single colours or grayscale, or even just panning the screen so that half of it is cropped out to the left.

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

      +Jeru Sanders yeah, and the original stream was much worse than the youtube upload, to the point where none of the text on the screen was even close to readable.

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

    Will you use LLVM to generate the actual machine code? If not, could you explain why?

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

      We will have a comprehensive update on this topic in the next demo!

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

    Very interesting video! It's nice to see how much progress you are making.
    BTW, is more accurate to say that defer is the same scope (exit) in D
    dlang.org/spec/statement.html#ScopeGuardStatement
    because there are other types of scope guards.

  • @icylace
    @icylace 3 ปีที่แล้ว

    45:10 If I'm not mistaken the background music of the demo game is the title theme of the Commodore 64 game "Commando" written by Rob Hubbard: th-cam.com/video/qrQuR1LHAVI/w-d-xo.html

  • @Simon8162
    @Simon8162 8 ปีที่แล้ว

    So this is like ASM or Javassist in the java world. Neat.

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

    Is the compiler already public?

  • @Narblo
    @Narblo 2 ปีที่แล้ว

    Where do you do type checking? is that part of the infer phase?

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

    We need a "sophisticated" counter each demo :P

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

      And a “robust” recount!

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

    is this language somewhere in public yet to try?

  • @Xavier-cd6fx
    @Xavier-cd6fx 6 ปีที่แล้ว

    Can we add some procedure at compile time? I have a use case with lot of procedures definitions coming from the extraction of a dll exported functions (or a .h file), and I may want to start to generate procedures with a basic implementation of those functions, something like a print of the procedure name and arguments. The goal is to replace the original dll, Is something like this feasible?

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

    seems a little hacky having to define a procedure in order to be able to pull the statements out of it, instead of just defining the statements. i understand it might be difficult, because you'd have to deal with having the statements living in the global scope -- such as the for loop, which would be invalid i guess.

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

      +Seltsamster Typ It is actually the cleanest way to do it. You don't want to drop a bunch of statements at top-level (or in any other code you are otherwise using) because there could be name conflicts or whatever else. Also, the statements are not just an array of isolated things: they contain pointers to each other and to stuff that has been imported. If they contain names that resolve to things in the global scope or that have been imported from some module via 'using', then those resolutions will vary depending on the outer environment. So the best thing is to encourage people to be precise about what that outer environment is, rather than setting up some situation that is messy and hard-to-think-about by default.

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

    I would really like to know, what you think about the programming language "Nim", it also has the option to modify the AST, both a type checked AST or a non type checked AST. Additionally to that that language has now 10 years of development behind it, so a lot of thingst hat just need time to be developed are already there.

    • @renozyx4634
      @renozyx4634 8 ปีที่แล้ว

      +krux02 I think that from a game programming POV, the GC 'by default' present in Nim would be an issue: as it's there it means that most of the libraries will use it, so if you want to have a 60FPS game, you will have to avoid most of Nim's libraries..

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

      +Reno Zyx
      I've worked with the language a bit, and I would say, not really. The language is not designed like c#, you can avoid garbage collection pretty well, because the language has value semantic most of the time. Libraries that are intended to be used during rendering are garbage collection free, and libraries that have nothing to do with rendering and utilize the garbage collection can be executed on another thread, and will not harm the rendering thread at all, because memory is allocated thread local by default.

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

      ​@@krux02Doesn't matter. In a game everything has to be fast, not just Rendering. His point stands.

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

    What is that song playing with the compiler?

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

      +sumsar Requiem for a Dream

    • @nintendude794
      @nintendude794 2 ปีที่แล้ว

      Lux Æterna by Clint Mansell from Requiem For A Dream

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

    You better not make it public, because then I will implement a metaprogram that introduces garbage-collection

  • @needlessoptions
    @needlessoptions 7 ปีที่แล้ว

    How does Compiler.jai interface with the actual C++ code for the compiler O_o

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

      It varies depending on what is being interfaced with. Sometimes, there are redundant declarations in the C code that say what the memory offsets are of various members, and/or just are C structs whose layout matches the structs in Compiler.jai, and then any time something changes in one place, I have to be sure to change it in the other place. Sometimes, the compiler actually introspects on the declaration of the struct from the .jai file (though I think this only happens with Preload.jai, not Compiler.jai).

  • @janboerman720
    @janboerman720 4 ปีที่แล้ว

    2:17 song name?

    • @nintendude794
      @nintendude794 2 ปีที่แล้ว

      Lux Æterna by Clint Mansell from Requiem For A Dream

  • @Beefster09
    @Beefster09 8 ปีที่แล้ว

    Is the compiler bootstrapped or is it still implemented in C++?

    • @TreesPlease42
      @TreesPlease42 8 ปีที่แล้ว

      +Beefster09 Good question. I'm curious as well.

    • @TheMaginor
      @TheMaginor 8 ปีที่แล้ว

      Wouldnt it be a little pointless to bootsrap it while it still compiles via c anyway?

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

      +Beefster09 It is in C++. Bootstrapping is one of those things where people get really excited about the idea of it, but it's actually not very interesting compared to designing a good language.

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

      The platform on which the code is being executed seems irrelevant for bootstrapping but I'm not sure.

  • @benjaminpedersen9548
    @benjaminpedersen9548 8 ปีที่แล้ว

    Does anyone know the link to the source code of this demo?