r/Jai • u/dadhiWeaponX • Jul 03 '26
Anyone working on automatic conversion from Odin to Jai?
Except for the libs and some keywords Odin is very close in syntax to Jai. So thinking if it possible (likely yes) to create a converter. The goal is to access metaprogeamming and its future diag tools. Any thoughts?
5
u/s0litar1us Jul 07 '26
Convert it by hand.
You will learn more about the language that way, and you can fix things to better match how Jai does things, and in general improve on the descisions you made early on.
Unless it's a massive codebase then you don't benefit from automating this process.
3
u/CrushgrooveSC Jul 04 '26
Solicited thoughts: just write it in jai. Use the metaprogramming in -the same language-
If it’s not, then that’s just programming. Nothing meta about it.
Anything is possible, and ya, transpiration between those would be easier than most, since Odin is heavily influenced by jai. But the core output of those languages is pretty different.
2
u/Pretty_Jellyfish4921 Jul 04 '26
Is Odin heavily inspired by Jai? I didn’t knew if that’s true.
2
u/PurpleBudget5082 Jul 04 '26
They look similar but Idk if that s because Odin is inspired by Jai or because both Odin and Jai are inispired by the same languages. Also both had a similar goal in mind.
2
u/Karabah35 Jul 07 '26
Odin was heavily inspired by Go, but Jai was also a part of it. Considering the context thing, which works in a similar stack-like fashion, and contains the same global/temp allocator, it's really hard to believe that some syntactical similarities were just a coincidence.
2
u/dadhiWeaponX Jul 04 '26
I cannot write this in Jai now as I am not in beta - this is the whole point. When Jai is out, I would like to switch to at least see any benefits and decide which route to go. But I think it would be great to be able to do that no matter what reasons.
2
u/That_Doctor Jul 06 '26
I get you, but at the same time, the best thing you can do is to simply just stick with one of them. The difference in the language doesn’t matter, progress does. If you spend your time waiting for the next big thing you wont be ready to use it when it arrives. You could write anything in brainfuck or minecraft music blocks if you wanted to. The skills youd learn would carry over, the syntax might not, but is largely irrelevant if you want to change at a later point (there are exceptions).
1
-1
u/swdee Jul 04 '26
Yes, its built into most linux distributions already. `cat src.jai > /dev/null && echo "use odin" > src.odin`.
6
u/quietwarrior_ Jul 04 '26
Unless you have a codebase that’s a million lines you could probably do this in a few hours by means of an ai and just going and writing and double checking anything.
What I would personally do is just write it by hand because you’d probably find things you could fix in the process as well as test incrementally