4 ms·
It's interesting to look at the source code. However, I have yet to find a clear unique selling point that justifies the development of a new language and infra
by Rochus 3y ago
It's interesting to look at the source code. However, I have yet to find a clear unique selling point that justifies the development of a new language and infrastructure, or clearly shows me why I shouldn't just use D, for example. Any hints?
- flohofwoe 3y agoPersonal preferences should be enough to choose a different language or create a new language (e.g. it can be as simple as "I don't like D"), in the end that's how progress happens, individuals not being happy with the status quo, and building something they like. If others like that thing too, it might even become popular (and if this happens without a big company behind it then that thing might even be objectively good). (I'm not a fan of Jai's closed development model though, but to each their own)
- Rochus 3y agoMaybe when it comes to learning compiler construction. But otherwise, what's the point of all this effort if the result is hardly different from anything existing? Some innovation or other special feature justifying all the effort to implement the language and toolchain and for the interested parties to adopt it should at least be present. I would still be interested to know where this can be found on Jay. Any hints?
- flohofwoe 3y agoIn the end it comes down to healthy competition, it doesn't matter much why one thing is better than another, it just has to be preferred by enough people. And all those people may have different opinions on why they would choose one language over another. Traditionally, there has been a real lack of "better C" languages. Now since a few years we suddenly have a number of promising options but still not enough: Odin, Zig, Jai, and a few lesser known like C2 and C3, that's about it - I count Rust and D as attempts to a "better C++", not a "better C" (I'm aware of D's "das better C" subset though). 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.
- Rochus 3y ago> Now since a few years we suddenly have a number of promising options but still not enough Well, but how do you recognize that there are still not enough options? I assume it should be a bit more specific than just a feeling or "personal preference", isn't it? > Rust and D as attempts to a "better C++" Rust has at least one big unique selling point which was not present so far in any other language (at least I'm not aware of any one): compile time automatic memory management. The unique selling point of D in contrast is not that obvious, at least not to me. > whether that is actually true I can't tell though since I haven't used Jai yet. Well then maybe someone else knows.
- flohofwoe 3y ago> how do you recognize that there are still not enough options One language that's still missing is a simple C-like language that offers Rust-style memory safety but without Rust's design philosophy of repeating every C++ mistake (that's not about memory safety) and high level type system wankery (or generally too much influence from functional languages). There are also many more areas still to explore when it comes to memory safety that are less extreme than Rust's approach (I completely forgot about Vale which tries out some really interesting things in that direction: https://vale.dev/ https://vale.dev/)
- Rochus 3y ago> is a simple C-like language that offers Rust-style memory safety Ok, I see; but why then not just add this feature to C, or maybe Zig? > many more areas still to explore when it comes to memory safety that are less extreme than Rust's approach Such as memory arenas/pools (like Ada), or runtime automatic garbage collection?
- flohofwoe 3y ago> but why then not just add this feature to C It would most likely need to 'break' C in a way that it wouldn't be recognisable as C anymore or at least break compatibility with existing C code (e.g. removing pointers, or at least pointer arithmetics, and the way pointers and arrays interact).
- paddim8 3y agoNo language is perfect. There is nothing wrong with making your own that works the way you want a language to work. I don't get people who complain about new languages. Variety is good. Let people have fun.
- Rochus 3y agoInnovation is good. There is a tradeoff between the benefit of choice and waste. Duplication is a good candidate for waste.
- mariusor 3y agoI think it's not up to us, the peanut gallery, to judge what any particular developer spends their time on. It's worthwhile to Blow, and he is very vocal that he is developing the language for his own use, not for anyone else. If you keep that in mind, maybe some of the choices around how it's being developed will make more sense.
- Rochus 3y agoI'm a language implementor myself and just asked for a clear unique selling point of Jai, and guess what, there was indeed one fellow here who didn't question the question, but has personal experience and was able to give me the information I was interested in (see https://news.ycombinator.com/item?id=37369342 https://news.ycombinator.com/item?id=37369342), without me having to read or listen through dozens of outdated blog posts and presentations. I still think a language specification would be worthwhile, even during early development.
- mariusor 3y agoFrom what I understood from Blow, a specification at this point would only serve to have other people bike shed about syntax, features, etc. Looking at the explanation you linked, I would say that the author uses the language in a very unidiomatic way (if idiomatic Jai would be a thing :D). It takes a very template focused mindset and uses the features of the language to bastardize and complicate things needlessly (IMHO, as a not game developer). I think my main take away from the language is that it focuses on the way memory is mapped (similarly to how C does it) and less on behaviour associated with that memory. So for that example, instead of trying to overthink a container that uses a generic behaviour through templated types, it would implement different overloaded functions for each type as needed.
- vblanco 3y agoJai has a few unique features that are quite interesting. You can think of it as C with extremelly powerful metaprogramming, compile-time codegen and reflection, and strong template systems, plus a few extra niceties like native bump allocator support or things like easily creating custom iterators. There is nothing quite like it.
- Rochus 3y agoThanks. I guess the "extremelly powerful metaprogramming", "compile-time codegen" and "strong template systems" are essentially the same thing. So the unique selling point of Jai from your perspective would be "C with generic metaprogramming, iterators and reflection"? Besides reflection, which is quite limited in C++, this would essentially be a subset of C++, isn't it?
- vblanco 3y agoCpp goes nowhere to this level. Jai templates execute normal code (any code) at compile time, so there is no need for sfinae tricks or others, you just write code that directly deals with types. 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.
- mariusor 3y agoTo answer specifically about D, I think Blow considered it and couldn't get past the garbage collection (this is mostly inferred). As a matter of fact I heard of Jai through a presentation of Walter Bright's, so I'm pretty sure was definitely some back and forth between the two.
- wudangmonk 3y agoI think there is a very clear open spot where Jai fits in otherwise why would google be doing the same thing with their carbon language. People want a better c++. It should compile fast, have all the low level stuff of C. Have Metaprogramming and introspection and including a decent library for basic stuff would be nice too. 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.