22 ms·
Four Years of Jai (2024)
- WhereIsTheTruth 1y agoodin has replaced the need for jai, and even then, i'm not sure there is a need for "yet another sugar for LLVM" they show an adoration for C, and they both hate C++, yet they chose C++ for their compiler, go figure
- IshKebab 2y agoHard to see how this will compete with Zig.
- ramon156 2y agoHard to see this compare at all without examples, but I'll stay patient
- troupo 2y agoWell, they promise to release a full commercial game engine alongside it, so that might help :)
- rc00 2y agoI can see the appeal if there is a need for stronger metaprogramming. Not that Zig is terrible in this area, it is just that Jon's language is much more powerful in that area at this stage. That being said, I do see an issue with globally scoped imports. It would be nice to know if imports can be locally scoped into a namespace or struct. In all, whether it's compete or coexist (I don't believe the compiler for Jon's language can handle other languages so you might use Zig to compile any C or C++ or Zig), it will be nice to see another programming language garner some attention and hopefully quell the hype of others.
- deagle50 2y agoZig comes with a mountain of friction and ceremony, imo. It does a lot of things well, but for game dev I'd take Jai or Odin every time.
- sph 2y agoSurprising deep and level headed analysis. Jai intrigues me a lot, but my cantankerous opinion is that I will not waste my energy learning a closed source language; this ain’t the 90s any more. I am perfectly fine for it to remain a closed alpha while Jonathan irons out the design and enacts his vision, but I hope its source gets released or forked as free software eventually. What I am curious about, which is how I evaluate any systems programming language, is how easy it is to write a kernel with Jai. Do I have access to an asm keyword, or can I easily link assembly files? Do I have access to the linker phase to customize the layout of the ELF file? Does it need a runtime to work? Can I disable the standard library?
- mjburgess 2y agoIirc, pretty sure jblow has said he's open sourcing it. I think the rough timeline is: release game within the year, then the language (closed-source), then open source it. Tbh, I think a lot of open source projects should consider following a similar strategy --- as soon as something's open sourced, you're now dealing with a lot of community management work which is onerous.
- baranul 1y agoAn argument can easily be make that Jai could have been released as closed-source, some time ago. Many fans and the curious, just want to be able to get their hands on it. Jon is not going to stop public reaction nor will Jai be perfect, regardless of when he releases. At least releasing sooner, allows it to keep momentum. Not just generated by him, but by third parties, such as books and videos on it. Maybe that's where Jon is making a mistake. Not allowing others to help generate momentum.
- xigoi 2y ago> as soon as something's open sourced, you're now dealing with a lot of community management work which is onerous. This is a common misconception. You can release the source code of your software without accepting contributions.
- 2y ago
- pcwalton 2y ago> I’d be much more excited about that promise [memory safety in Rust] if the compiler provided that safety, rather than asking the programmer to do an extraordinary amount of extra work to conform to syntactically enforced safety rules. Put the complexity in the compiler, dudes. That exists; it's called garbage collection. If you don't want the performance characteristics of garbage collection, something has to give. Either you sacrifice memory safety or you accept a more restrictive paradigm than GC'd languages give you. For some reason, programming language enthusiasts think that if you think really hard, every issue has some solution out there without any drawbacks at all just waiting to be found. But in fact, creating a system that has zero runtime overhead and unlimited aliasing with a mutable heap is as impossible as finding two even numbers whose sum is odd.
- sph 2y agoThe faster computers get, the more the GC problem is way overblown apart from super-low-latency niches. Even AAA games these days happily run on GC languages. There is a prominent contributor to HN whose profile says they dream of a world where all languages offer automatic memory management and I think about that a lot, as a low-level backend engineer. Unless I find myself writing an HFT bot or a kernel, I have zero need to care about memory allocation, cycles, and who owns what. Productivity >> worrying about memory.
- lifthrasiir 2y agoGC doesn't exactly solve your memory problem; it typically means that your memory problem gets deferred quite far until you can't ignore that. Of course it is also quite likely that your program will never grow to that point, which is why GC works in general, but also why there exists a desire to avoid it when makes sense.
- sph 2y agoThat’s fair, no resource is unlimited. My point is that memory is usually the least of one’s problem, even on average machines. Productivity and CPU usage tend to be the bottleneck as a developer and a user. GC is mostly a performance problem rather than a memory one, and well-designed language can minimize the impact of it. (I am working on a message-passing language, and only allowing GC after a reply greatly simplifies the design and performance characteristics)
- msmshazan 2y agoWonder when will Jai open beta happen
- troupo 2y agoIf all goes according to plan, late this year. https://youtu.be/jamU6SQBtxk?si=hDbwZQX2MtFiwun8 https://youtu.be/jamU6SQBtxk?si=hDbwZQX2MtFiwun8
- sushidev 2y agoI would have liked to see more code examples in the article.
- lawn 2y agoYeah, I see a bunch of praise and references to unfamiliar features/syntax and it makes it hard to follow and to form an opinion about.
- perching_aix 2y ago> rather than asking the programmer to do an extraordinary amount of extra work to conform to syntactically enforced safety rules. Put the complexity in the compiler, dudes. And how would that compiler work? Magic? Maybe clairvoyance?
- selfselfgo 2y ago[dead]
- lifthrasiir 2y agoThe biggest "crime" of Jai is that it (soft-)launched like an open source programming language and didn't actually become open source shortly. There are so many programming languages that did go through the "beta" period and still remain open sourced all the time. Open source doesn't imply open governance, and most such languages are still evolved almost solely with original authors' judgements. It is fine for Jai to remain closed of course, but there is no practical reason for Jai to remain closed to this day. The resulting confusion is large enough to dismiss Jai at this stage.
- jimbob45 2y agoYep. Same dilemma as Star Citizen. If both just threw their hands up and said, "Done!", today then everyone would agree that a great product had been released and everyone would be mostly pleased. Instead, development has dragged on so long as to cast doubts over the goodwill of the founders. Now, Jai is unusable because it's difficult to trust Blow if he's willing to lie about that and Star Citizen is unplayable because the game was clearly released under false pretenses.
- chriscbr 2y agoSame story with the Mojo language, unfortunately. To me this raises the question of whether this is a growing trend, or whether it's simply that languages staying closed source tends to be a death sentence for them in the long term.
- Pet_Ant 2y agoHonestly the tone of the article was so smug and condescending that I couldn’t finish it.
- cynical_german 2y agowow... I did not get that _at all_ ; opinionated maybe, do I have to share all these opinions to the degree to which they've been expressed? No, but condescending? To whom? To duck typed languages?
- tialaramex 2y agoIt's condescending to the people who've noticed they make mistakes and so value a language which is designed accordingly: "So, put simply, yes, you can shoot yourself in the foot, and the caliber is enormous. But you’re being treated like an adult the whole time" That is, those of us who've noticed we make mistakes aren't adults we're children and this is a proper grown-up language -- pretty much the definition of condescending.
- unclad5968 2y agoI can't tell if you're joking or not, but if you aren't, no one is calling you a child. The article is obviously saying that the compiler doesn't stop you from doing dumb things, which is a privilege generally only extended to adults. Nobody is saying anyone who makes mistakes is a child.
- phtrivier 2y agoIf you feel this article is smug and condescending, don't start watching the language designer's stream too soon. The least you can say is that he is _opinionated_. Even his friend Casey Muratori is "friendly" in comparison, at least trying to publish courses to elevate us masses of unworthy typescript coders to the higher planes of programming. Jblow just want you to feel dumb for not programming right. He's unforgiving, Socrate's style. The worst thing is : he might be right, most of the time. We would not know, cause we find him infuriating, and, to be honest, we're just too dumb.
- triilman 2y agoI am not interested. I am just trying to code with C3 and make some binding with another language like C and Zig, it is quiet easy and fun. I think it's enough for me to learn kinds of language than using jai that never released the compiler to the public till now.
- TinkersW 2y agoI have my doubts with Jai, the fact that Blow & co seems to have major misunderstandings with regards to RAII doesn't lend much confidence. Also a 19,000 line C++ program(this is tiny) does not take 45 minutes unless something is seriously broken, it should be a few seconds at most for full rebuild even with a decent amount of template usage. This makes me suspect this author doesn't have much C++ experience, as this should have been obvious to them. I do like the build script being in the same language, CMake can just die. The metaprogramming looks more confusing than C++, why is "sin"/"cos" a string? Based on this article I'm not sure what Jai's strength is, I would have assumed metaprogramming and SIMD prior, but these are hardly discussed, and the bit on metaprogramming didn't make much sense to me.
- VyseofArcadia 2y ago> Also a 19,000 line C++ program(this is tiny) does not take 45 minutes unless something is seriously broken Agreed, 45 minutes is insane. In my experience, and this does depend on a lot of variables, 1 million lines of C++ ends up taking about 20 minutes. If we assume this scales linearly (I don't think it does, but let's imagine), 19k lines should take about 20 seconds. Maybe a little more with overhead, or a little less because of less burden on the linker. There's a lot of assumptions in that back-of-the-envelope math, but if they're in the right ballpark it does mean that Jai has an order of magnitude faster builds. I'm sure the big win is having a legit module system instead of plaintext header #include
- MyOutfitIsVague 2y agoIt depends heavily on features used, too. C++ without templates compiles nearly as quickly as C.
- Jyaif 2y agoFor 1 million lines of C++ to take 20 minutes you must be building using a single core.
- unclad5968 2y agoI seriously doubt that any of them have trouble understanding a concept as simple as RAII.
- VyseofArcadia 2y ago> The net effect of this is that the software you’re running on your computer is effectively wiping out the last 10-20 years of hardware evolution; in some extreme cases, more like 30 years. As an industry we need to worry about this more. I get that in business, if you can be less efficient in order to put out more features faster, your dps[0] is higher. But as both a programmer and an end user, I care deeply about efficiency. Bad enough when just one application is sucking up resources unnecessarily, but now it's nearly every application, up to and including the OS itself if you are lucky enough to be a Microsoft customer. The hardware I have sitting on my desk is vastly more powerful that what I was rocking 10-20 years ago, but the user experience seems about the same. No new features have really revolutionized how I use the computer, so from my perspective all we have done is make everything slower in lockstep with hardware advances. [0] dollars per second
- danpalmer 1y agoI understand the attitude but I think it misses a few aspects. We have far more isolation between software, we have cryptography that would have been impractical to compute decades ago, and it’s used at rest and on the wire. All that comes at significant cost. It might only be a few percent of performance on modern systems, and therefore easy to justify, but it would have been a higher percentage a few decades ago. Another thing that’s not considered is the scale of data. Yes software is slower, but it’s processing more data. A video file now might be 4K, where decades ago it may have been 240p. It’s probably also far more compressed today to ensure that the file size growth wasn’t entirely linear. The simple act of replaying a video takes far more processing than it did before. Lastly, the focus on dynamic languages is often either misinformed or purposefully misleading. LLM training is often done in Python and it’s some of the most performance sensitive work being done at the moment. Of course that’s because the actual training isn’t executing in a Python VM. The same is true for so much of “dynamic languages” though, the heavy lifting is done elsewhere and the actual performance benefits of rewriting the Python bit to C++ or something would often be minimal. This does vary of course, but it’s not something I see acknowledged in these overly simplified arguments. Requirements have changed, software has to do far more, and we’re kidding ourselves if we think it’s comparable. That’s not to say we shouldn’t reduce wastage, we should! But to dismiss modern software engineering because of dynamic languages etc is naive.
- spacechild1 2y ago> because most Javascript programmers are entirely unaware of the memory allocation cost associated with each call to anonymous functions How does calling an anonymous function in JS cause memory allocations?
- steveklabnik 2y agoI also found this comment a bit strange. I'm not aware of a situation where this occurs, though he might be conflating creating an anonymous function with calling it.
- spacechild1 2y ago> he might be conflating creating an anonymous function with calling it. Yeah, that's what I figured. I don't know JS internals all too well, so I thought he might be hinting at some unexpected JS runtime quirk.
- nmilo 2y agoProbably misspoke, returning or passing anonymous functions cause allocations for the closures, then calling them causes probably 4 or 5 levels of pointer chasing to get the data that got (invisibly) closed over
- spacechild1 2y agoI don't think there is much pointer chasing at runtime. With lexically scoped closures it's only the compiler who walks the stack frames to find the referenced variable; the compiled function can point directly to the object in the stack frame. In my understanding, closed over variables have (almost) no runtime cost over "normal" local variables. Please correct me if I'm wrong.
- nmilo 1y agoI meant more like storing closures to be used later after any locals are out of the stack frame, but tbh that's an abstraction that also causes allocations in C++ and Rust. On the other hand, no idea how JS internals work but I know in python getting the length of an array takes five layers of pointer indirection so it very well could be pointer to closure object -> pointer to list of closed variables -> pointer to boxed variable -> pointer to number or some ridiculous thing like that.
- malkia 2y agoI didn't know much about Jai, and started reading it, and it really has (according to the article) some exciting features, but this caught my eye: "... Much like how object oriented programs carry around a this pointer all over the place when working with objects, in Jai, each thread carries around a context stack, which keeps track of some cross-functional stuff, like which is the default memory allocator to ..." It reminds me of GoLang's context, and it should've existed in any language dealing with multi-threading, as a way of carrying info about parent thread/process (and tokens) for trace propagation, etc.
- leecommamichael 2y agoThe Odin programming language uses an implicit context pointer like Jai, and is freely available and open source.
- malkia 1y agoThanks! I should check it out!
- sesm 2y ago> async/await, a pattern increasingly polluting Javascript and Python codebases in the name of performance In JS world async/await was never about performance, it was always about having more readable code than Promise chain spagetti.
- deleted 2y ago[deleted]
- mustache_kimono 2y ago> Software has been getting slower at a rate roughly equivalent to the rate at which computers are getting faster. Cite? This problem statement is also such a weird introduction to specifically this new programming language. Yes, compiled languages with no GC are faster than the alternatives. But the problem is and was not the alternatives. Those alternatives fill the vast majority of computing uses and work well enough. The problem is compiled languages with no GC, before Rust, were bug prone, and difficult to use safely. So -- why are we talking about this? Because jblow won't stop catastrophizing. He has led a generation of impressionable programmers to believe that we in some dark age of software, when that statement couldn't be further from the truth.
- topspin 2y agoI carefully watched a number of the early jai language YouTube videos. Some of his opinions on non-programming topics are just goofy: I recall him ranting (and I wish I could find it again,) about the supposed pointlessness of logarithmic scales (decibels, etc.,) vs scientific notation and experiencing a pretty bad cringe spasm. jblow's words are not the Gospel on high.
- troupo 2y ago> He has led a generation of impressionable programmers to believe that we in some dark age of software, when that statement couldn't be further from the truth. Have you actually used modern software? There's a great rant about Visual Studio debugger which in recent versions cannot even update debugged values as you step through the program unlike its predecessors: https://youtu.be/GC-0tCy4P1U?si=t6BsHkHhoRF46mYM https://youtu.be/GC-0tCy4P1U?si=t6BsHkHhoRF46mYM And this is professional software. There's state of personal software is worse. Most programs cannot show a page of text with a few images without consuming gigabytes of RAM and not-insignificant percentages of CPU.
- mustache_kimono 2y ago> Have you actually used modern software? Uh, yes. When was software better (like when was America great)? Do you remember what Windows and Linux and MacOS were like in 90s? What exactly is the software we are comparing? > There's a great rant about Visual Studio debugger Yeah, I'm not sure these are "great rants" as you say. Most are about how software with different constraints than video games aren't made with same constraints as video games. Can you believe it?
- phtrivier 2y agoI sincerely dread that by the time jblow releases jai, people will just have moved on to zig or rust, and that it will just become irrelevant. I'm sure jblow is having the same fears, and I hope to be wrong. Still, it's fun to be remembering the first few videos about "hey, I have those ideas for a language". Great that he could afford to work on it. Sometimes, mandalas are what we need.
- lerno 1y agoI think the Zig community should worry more about when Jai is released. Esp given that Zig isn’t anywhere near 1.0 yet, and feature wise it’s a rather sparse language that has first mover advantage over alternatives, but as a language it actually doesn’t bring many new tools AND is bad with IDEs. Jai similarly is hard for IDEs, but has much more depth and power. While Zig has momentum, it will need to solidify it to become mainstream, or Jai has a good chance of disrupting Zig’s popularity. Basically Zig is Jai but minus A LOT of features, while being more verbose and annoyingly strict about things. Odin on the other hand has no compile time and in general has different solutions compared to Zig & Jai with its rich set of builtin types and IDE friendliness. And finally C3 which is for people who want the familiarity of C with improvement but still IDE friendliness with limited metaprogramming. This language is also less of an overlap with Jai than Zig is.
- baranul 1y agoAmazingly, in agreement with most of this. The sooner that Jai is released, the more likely it will be a Zig popularity disruptor. And Zig is definitely vulnerable. It has a large amount of issues, is dealing with trying to maintain being a limited/simple language, and still far from 1.0. Regardless of comptime, Odin and C3's public accessibility, and being close enough to Jai for folks to contemplate switching over, will eat at its public mind share. In both cases (be it Zig or Odin/C3), the longer that Jai keeps making the mistake of avoiding a full public release, the more it appears to be hurting itself. In fact, many would argue, that a bit of Jai's "shine" has already worn off. There are now many alternative languages out here, that have already been heavily influenced by it.
- 2y ago
- mppm 2y agoJai's perpetual closed beta is such a weird thing... On the one hand, I sort of get that the developers don't want to waste their time and attention on too many random people trying to butt in with their ideas and suggestions. On the other hand, they are thereby wasting the time and attention of all the people who watched the development videos and read the blog posts, and now can do basically nothing with that knowledge other than slowly forget it. (Except for the few who take the ideas and incorporate them into their own languages).
- ModernMech 2y agoIt's a common thing in programming language design and circles where some people like to form little cults of personality around their project. Curtis Yarvin did that with his Urbit project. V-Lang is another good example. I consider Elm an example as well. They get a few "true believer" followers, give them special privileges like beta access (this case), special arcane knowledge (see Urbit), or even special standing within the community (also Urbit, although many other languages where the true believers are given authority over community spaces like discord/mailing list/irc etc.). I don't associate in these spaces because I find the people especially toxic. Usually they are high drama because the focus isn't around technical matters but instead around the cult leader and the drama that surrounds him, defending/attacking his decisions, rationalizing his whims, and toeing the line. Like this thread, where a large proportion is discussion about Blow as a personality rather than the technical merit of his work. He wants it that way, not so say that his work doesn't have technical merit, but that he'd rather we be talking about him.
- rglover 2y agoThe reality of a project like this is that to get it right (which is by the creator's standards, no one else's) takes time. Add on top of that Blow and Thekla are building games with this to dogfood it which takes time, too. Sadly, there exists a breed of developer that is manipulative, obnoxious, and loves to waste time/denigrate someone building something. Relatively few people are genuinely interested (like the OP) in helping to develop the thing, test builds, etc. Most just want to make contributions for their Github profile (assuming OSS) or exercise their internal demons by projecting their insecurities onto someone else. From all of the JB content I've seen/read, this is a rough approximation of his position. It's far less stressful to just work on the idea in relative isolation until it's ready (by whatever standard) than to deal with the random chaos of letting anyone and everyone in. This [1] is worth listening to (suspending cynicism) to get at the "why" (my editorialization, not JB). Personally, I wish more people working on stuff were like this. It makes me far more likely to adopt it when it is ready because I can trust that the appropriate time was put in to building it. [1] https://www.youtube.com/watch?v=ZY0ZmeYmyjU https://www.youtube.com/watch?v=ZY0ZmeYmyjU
- kbr- 2y ago> It’s a simple keyword, but it singlehandedly eliminates the need for any kind of RAII. What if you want to put a resource object (which needs a cleanup on destruction) into a vector then give up ownership of the vector to someone? I write code in go now after moving from C++ and God do I miss destructors. Saying that defer eliminates need for RAII triggers me so much
- estebank 2y agoThere's a school of thought that correctly states that in that case it is very easy to cause expensive drop behavior to be ran for each element in the vector where a faster batch approach could instead be done, which is doable if not encouraged with defer, so it should be prioritized to push people towards that. I do not subscribe to that idea because with RAII you can still have batched drops, the only difference between the two defaults is that with defer the failure mode is leaks, while with RAII the failure mode is more code than you'd otherwise would have.