85 points · by doesntmeananyth · 3y ago · 101 comments
I also recognize that I am participating in said dynamic.
Regarding Jai: the idea about a "language for good programmers" is just about the worst thing ever to say about a language and it's community in my opinion (and I'm being paid as a C and C++ programmer for 20 years now, so I guess I'm at least not totally bad at it).
I mean sure, people are in general hesitant when someone calls himself good, and for a decent reason.
But pushing it to extreme and defaulting to reverse JUST BECAUSE someone dared to call himself good is also a pretty childish reaction. At the end of the day it is a fact that there are differences in skill between programmers and different languages expect from you different levels of understanding. Pretending it's only valid to acknowledge these differences in others but not in oneself is irrational.
> Pretending it's only valid to acknowledge these differences in others but not in oneself is irrational.
I do hope that we can agree that people are way better at assessing others than themselves - in both ways, under- and overestimation of their own capabilities.
TL;DR Inexperienced != Bad
"The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt."
What Pike meant is that a company (e.g. google) cannot hire only people who have deep understanding in subtleties of advanced programming language theory and had the time to go through a long learning curve to actually reap the benefits of these advanced programming languages.
These young engineers are not bad, quite the opposite they are usually bright and brilliant young engineers
The problem with that kind of people is that they will use their cleverness to build complicated and beautiful stuff, but when combined with a lack of true and deep experience due to them being still young, this can become counterproductive.
Oh, and the compile times are just a joy, almost no other language even comes close to the speed of iteration that's possible with Jai, which is another great reason to use it for games and prototyping in general.
How do nested for-loops work, if `it` names the current iterator?
for particles {
// Inside for loops the "it" object is the iterator for the current object.
particle_left := view_left \* it.particle_size;
}- It's the innermost iterator that takes priority
- You are encouraged to name your iterators if you do so (for particles { part -> part.velocity } )
- Compiler throws warnings if you shadowed names.
Oh, i didn't know that there are any.
It would be a good idea to add the naming explicitly to the Wiki entry of loops: https://jai.community/t/loops/147, I've just found it buried in the `remove` section.
Btw. in for-loops the colon `:` is used inconsistently again, this time for naming the iterator (`foo` in this example:) `for foo: VALUES { ... }`.
The source code to the program is available, but the compiler with which to compile that code isn't.
To the OP I would say this is opensource.
If you received an open source recipe, despite not having a kitchen you could still modify the recipe, pass it on etc.
You still have the right to modify this code and pass it on, which is what the opensource licenses generally guarantee, opensource software for the latest supercomputer doesn't guarantee you access to that supercomputer.
You can do things like having structs remove or add members by just putting the member behind an if branch. You can also fully inspect any type and iterate members through reflection. There is a macro system that lets you manipulate and insert "code" objects, the iterator system works this way. you create a for loop operator overload where the for loop code is sent to the function as a parameter.
It also lets you convert a string (calculated compile time) into code. Either by adding it into the macro system, or just inserting it somewhere.
Some of the experiments ive done were implementing a full marc-sweep GC by generating reflection code that would implement the GC sweep logic, having a database system where it directly converts structs into table rows and codegens all the code relating to queries, automatic inspection of game objects by having a templated "inspect<T>" type thing where it exposes the object into imgui or debug log output, fully automatic json serialization for everything, and an ECS engine where it directly codegens the optimal gather code and prepares the object model storage from whatever loops you use in the code.
All of those werent real projects, just experiments to play around with it, but they were done in just a few dozens/hundreds lines of code each. While in theory you could do those in Cpp, it would need serious levels of template abominations to write it. In jai you write your compile time templates as normal jai. And it all compiles quickly with optimal codegen (its not bloating your PDB like a million type definitions would do in cpp template metaprogramming).
The big downside of the language is that its still a closed private beta, so tooling leaves much to be desired. There is a syntax color system, but things like correct IDE autocomplete or a native debugger arent there. I use remedybg to debug things and vscode as text editor for it. Its also on relatively early stages even if its been a thing for years, so some of the features are still in flux between updates.
The one issue with Nim I had while trying it out is that there is an incredibly rich amount of features but many of them seem half-baked and it’s constantly being changed, so you’re always a bit unsure what’s a feature stable and safe to use or is “experimental”. But at least it’s been public for quite some time and you can actually use it right away…
(I'm not a fan of Jai's closed development model though, but to each their own)
Apparently Jai is specifically tailored to game development problems and frustration with C++ for game dev (or at least it tries to fix rough edges that a typical game developer encounters in existing languages used for game dev) - whether that is actually true I can't tell though since I haven't used Jai yet.
What this really reads to me is why not just use Rust. Rust is useful for the things Rust was designed for. Some people love it and think its the greatest language out there and that's fine but a lot of people have used it and they either do not like it or they like it but they wouldn't want to use it for the type of work they like to do.
Having more languages and each influencing another is the only way we can get better and better languages.
jai -quiet first.jai
So... where can I find the Jai compiler?
Yes, there is a whole Jai community wiki made from half cobbled together knowledge (https://github.com/Jai-Community/Jai-Community-Library/wiki), and a super secret discord made for the super elite, non-compiler-having plebs are banned.
Anyone have any GUI (non-CLI) recommendations for editing larger files, specifically text files 10 MB+?
If these GUI editors can't offer better than VIM + tmux, then something is wrong