It’s interesting to revisit the earlier Jon’s streams and see how the game looked like back then.
@kalelsoffspring7 жыл бұрын
Wow, seeing that compile time for 37000 lines of code was amazing. The metaprogramming support is awesome
@64jcl6 жыл бұрын
Yes we need JAI now! :)
@snoophoggfan68737 жыл бұрын
You are honestly my new favorite KZbinr. I could watch this all day. Keep up the good coding!
@deftlyhacked34947 жыл бұрын
Creating a compiled programming language that executes your interpreted command language. #TrueSkill
@GiammarcoAgazzotti5 жыл бұрын
Catching up really late on these videos. Really enjoying them. You are inspiring me to do such things for the game me and my team are developing, such a good inspiration! Keep up the good work man, nice job.
@ivanbraidi7 жыл бұрын
"English, DO YOU SPEAK IT??" -> Best commit message ever! XD
@dimarichmain3 жыл бұрын
"Added add"
@markusiak17 жыл бұрын
I simply love it! :) Jai is so cool. And these explanations. Oh my ;)
@UncoveredTruths7 жыл бұрын
thankyou for streaming so much, im in the middle of nowhere with just my phone so this has been great
@crybirb7 жыл бұрын
I'm a very bad programmer and I couldn't follow this project fully because I'm getting my CS degree, but it's so amazing to see a little snippets over the years since this project started and I'm very pumped to use it when it comes out.
@casvanmarcel7 жыл бұрын
this is so inspiring and makes me so happy
@DerMannInDerWand5 жыл бұрын
leaves: float Seems right
@Lagiacrus427 жыл бұрын
Hey, Jon! For code generation, would it be possible to include data structures and procedures in the standard library specifically for generating code at compile time, as opposed to dealing with raw strings? One issue with the C preprocessor is that splicing strings together results in inconvenient errors; it would be a lot nicer to substitute 'expressions' for example. If you think this is a bad idea, thoughts on why, and any alternatives you might have, if any?
@jblow8887 жыл бұрын
Yes, I plan to have that kind of stuff; part of the reason I am doing these exercises is to figure out what would be good to put into the library. However, I will say that several people have suggested a more data-structure-oriented way of generating code by default (instead of strings) and I am not sure I buy it. The good thing about strings is you can see obviously when they are malformed. Arbitrary ASTs, not so much.
@AlejandroMartinez47 жыл бұрын
This has been really amazing.
@clankill3r7 жыл бұрын
This stream was f*cking awesome! This gave me so many ideas of how to tackle a certain problem I have without using tons of code. The only thing I would really like now is named return values (for metaprogramming). And multiple return values (now it only supports 2 return values I believe). @Jonathan Will it eventually be possible to return more then 2 values?
@jblow8887 жыл бұрын
Actually you can already use an arbitrary number of return values. There's no limit.
@clankill3r7 жыл бұрын
damn, I love you so much :D
@skullfirec7 жыл бұрын
Thanks for this Jon. Love this concept! Would you consider moving things you need on the metaprogramming phase elsewhere? eg. getInteger, getFloat, etc. feels wrong to be both on the commands.jai (which depends on first.jai in some way) and first.jai will now depend on implementation of getInteger, getFloat on commands.jai. Or perhaps add a third file JUST for userbase commands, instead of mixing it up on the same commands.jai?
@jblow8887 жыл бұрын
Well, first.jai does not really "depend" on those things in the regular sense used in programming languages, but it's true that if you change those routines then first.jai will be wrong. But you could pretty straightforwardly just put the procedure that generates the metaprogram into commands.jai itself, and just call into it from first.jai.
@videouploader16777217 жыл бұрын
At 00:31:42, what if files/modules/libraries had an init function that gets called automatically by the entry point function/main (not sure in what order though) instead of having to manually remember to call these type of functions?
@jblow8887 жыл бұрын
The problem with that is you run into problems, where you need to initialize things in a clear order in order for them to work, but automatic calls like that are hard to order. You see this problem with global constructors in C++.
@Raattis7 жыл бұрын
Well, because that Start/Awake granularity is not always enough Unity also has option for explicit execution ordering. This whole thing is on a bit different level here when comparing programming languages to game engines.
@Pyromuffin7 жыл бұрын
Very cool. I am not too much a fan of building up compile time functions by adding strings together. Maybe you could have #directive that stringifies a regular function body and maybe some language keywords that work like % in format strings. maybe compile time function generation wont be so common that you'd want a facility for this, but it would be nice.
@zacpier7 жыл бұрын
Well, I think the beauty of a system of this is that it doesn't require any special APIs or learning. I can look at the definitions of the structs that the compiler gives the code, and use the data to build a function just like I would write any other code. With any other system, you'd have to learn a special method of generating code, and since you don't have to metaprogram that often, you'd constantly be relearning the special syntax for this. I think string-based code generation is a nice compromise between power and sane programming practice.
@Pyromuffin7 жыл бұрын
i agree. i haven been thinking about this for a while since i made that comment and there's not really anything that will ever be as flexible as emitting strings. it definitely has to be an option to do it using strings. watching jon program, it's actually very different from how i program. i can't survive without intellisense (always work with huge code bases that i didn't write). if you don't need code completion to work then writing program strings isn't that much different than your regular workflow. it does sting to give up completion for compile time function generation however.
@TetraluxOnPC7 жыл бұрын
+Kelly MacNeill Jai also has "here strings" where you provide an arbitrary sequence of characters which serve as the sequence that terminates the string. e.g: X :: #string END f :: (i: $T) { return i * 2; } END
@mars31426 жыл бұрын
What would the best way to do that in C++? I mean, how can I generate the "front_" functions at compile time? Is that even possible without a custom preprocessor?
@64jcl6 жыл бұрын
Most languages has some kind of attribute tag you can put on functions which is essentially a preprocessor thing. If it doesnt have it you can make your own using a comment above your function with a unique tag. Your preprocessor then "just" looks for these comment tags and parse the function definition, creating the front functions as well as the register stuff. If custom preprocessor functions is not supported by the compiler a simple shell/batch file can be called instead before calling your compiler to generate your code.
@dimarichmain3 жыл бұрын
The best way is to abandon C++.
@GeorgeWulfers_887 жыл бұрын
Awesome!
@needlessoptions7 жыл бұрын
Hey Jon it's me the mememaster
@bigmofo11227 жыл бұрын
You can inspect your global config value and do function call at any time from within the debugger. In-game console are for the users who want to tweak his experience. Why do a in-game console, and even take the time to make it good, if it's not 'user level' and will be compiled out when shipping? I understand that your home-brew language don't have good debugger. But from earlier stream you have shown that the Witness had a console only in the dev build. Why is that?
@Borgilian3 жыл бұрын
Because sometimes you want to print out data to a console (or modify debug data), and you don't want your project to spawn a child cmd.exe. Also windows terminals are slow.
@Awpteamoose7 жыл бұрын
Have you considered hooking up an existing scripting language and exposing functions/variables to it instead of making a console like that?
@TheMaginor7 жыл бұрын
He said in an earlier video that that is overkill and the scripting language may do allocations that fragments the heap unnecessarily, which is bad on some platforms. When I think about it, that may have been in regard to loading variables from a file though.
@64jcl6 жыл бұрын
I believe Jon's goal has always been to use the same language for everything, so the programmer only have to learn one language in order to do anything, including meta-programming. A lot of languages are just riddled with silly macro nonsense that looks totally unlike the actual programming language, or use some kind of magic tags everywhere that generate a lot of boilerplate behind the scenes. I believe Jon's idea is for the programmer to be more in control of whats actually happening and be able to read their own code at a later time as well as its written in the same language as the whole thing.
@Fan64Mario7 жыл бұрын
I always wonder: Is he going to implement the jai compiler in jai?
@martinmidtgaard7 жыл бұрын
He has talked about it earlier, and he is not that interested in it currently. While the language is still in flux, he would have to change the compiler while changing the language. There is also not much to gain from writing the compiler in jai other than some sort of "achievement".