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
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.
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.
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 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
Awesome! Can't wait for this language to become publicly available.
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
Jai looks so elegant. I love it
This is sick, I hope you make more videos like this!
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.
If it's taking 40 seconds you're using a game engine. Apples and oranges
@@nothappyz Nope, no engine here. 40 seconds for a full rebuild of a 2D RPG in C++ is normal, which is quite concerning
@@IndellableHatesHandles oh that must suck, sorry for the assumption
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.
amazing language, when we get a release of jai compiler
love jai
will this make compile times moon when you have too much metaprogramming? Or is it cached or something
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!
@@JudahCaruso thanks! So jai is the new python?
@@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
What happens if there are circular dependencies with stallable?
Circular dependencies between #run directives are caught at compile-time; regardless of if they’re stallable or not
3 spaces??? :D How dare you!
What is this?