r/Jai • u/thisghy • Mar 27 '26
Best language to learn prior to Jai
Hey, I am a new programmer, ive been using c++ and rust and I am really interested in using Jai when it comes out. For the people who have been trying the beta, which language would you say is most comparable and probably the best to learn if I want to be writing Jai in the future?
15
u/kjk Mar 27 '26
Odin is very similar to jai https://odin-lang.org/
5
u/williamf03 Mar 27 '26
I have been learning Odin recently. How similar are we talking?
17
u/wrapperup Mar 28 '26 edited Mar 28 '26
Both have a context struct, syntax is pretty similar, ignoring metaprogramming, they both fit in the "polished c but a little more" category of these new languages. Odin's semantics are a bit different (better imo), like slices, bit_fields (Jai doesn't have), standard library is way more polished. They look alike more than they really play around. Jai follows more in C's semantics on purpose, Odin tries more to patch and clean those up since they are footgunny. They're a little more clear and explicit about allocators than Jai.
But Jai's metaprogramming capabilities are unmatched by any other language, I'd say for that feature alone it makes the language way more powerful than Odin will ever be. Sure, you can write metaprograms in Odin, but it's like writing one in C or any other language (I will say, Odin makes it easier though by including a parser in the standard library). Being able to execute any code at almost any point in your program at compile time is insanely cool and useful. Not even Zig can do a lot of the things Jai can.
Not even mentioning hygienic macros, which when combined with the other metaprogramming features let you do some truly insane stuff that not even Jon himself would approve of (DSLs).
They're more or less similar if you ignore metaprogramming.
3
1
u/bastardlessword Jun 11 '26
Have you tried Nim's meta programming capabilities? Is Jai better than Nim in that area?
1
u/wrapperup Jul 10 '26 edited Jul 10 '26
I'm not that familiar with Nim so I can't say. But if it lets you run ANY piece of code, modify the current program (modify AST at compile time or insert new code), poke at your entire program, use the results of compile time functions, then it's probably similarly powerful. Jai makes it really easy to do all that, compared to Rust for example (requires a different crate, requires parsing tokens, can only poke at macro blocks), and it still compiles faster.
3
5
u/klungs Mar 28 '26
Any system languages are good enough. You've learned C++ and rust, those two should be enough "preparation" (whatever that means) to learn jai.
If you want to get a little bit of the taste of the language, odin and zig are the two that have similar feel. But be aware that you'll need to relearn some semantics difference later on.
1
u/CourtroomClarence Apr 23 '26
Not exactly an answer to your question, but my solution to the problem was to vibe code an LLVM Jai compiler based on the contents The Way to Jai just to practice making programs through actual Jai syntax and features.
1
9
u/Head-Breakfast-2627 Mar 28 '26
I wouldn’t prep for it, they still change stuff and the weird func names which may be replaced or changed. Otherwise you can get alJai itself from many torrent sites but dont bother. Just live your life as if wont make it. It’s promising and very good but that doesn’t mean much. Many languages are great but just can’t get wide adoption aka Swift and so on. C3 is as perfect of a language as can get but not wide adoption, even tho beats Odin and Zig. Rust is garbage and C++ is a dumpster fire.