News for hackers. Stuff that matters.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by stephc_int13 on Wednesday November 23, 2022 @12:04PM (#33721715)
I'd love to see more about Jai.

I don't understand why they are not working in the open, this is a tool, not a game, input for a large community is extremely valuable.

But as brilliant as Jon Blow is, he is at least equally as stubborn.

Fast compilation and nice, easy to read syntax with good default is exactly what I am looking for.

I can understand the hype about metaprogramming, and its potential usefulness, but I also think this is a pandora box.

Pretty much like C macros and C++ templates, overuse can lead to a very messy codebase, hard to read, hard to debug, with a lot of unexpected side effects.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by hbn on Wednesday November 23, 2022 @12:17PM (#33721893)
I don't see why a language can't be one guy's passion project. Even if he releases it and it turns out he's the only person that likes it, so what? It's not like he's had millions in VC or government investment dumped into it or something. He's got some ideas and he's implementing them. I'm interested to see how it turns out.

Golang has had success and was primarily made in private by 3 guys and hasn't strayed too far from the original founding principles they came up with.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by stephc_int13 on Wednesday November 23, 2022 @12:53PM (#33722353)
Yeah, of course he can do whatever he wants.

The think is that quite a few people have been convinced by his talks and want to use Jai for real projects.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by googlryas on Wednesday November 23, 2022 @01:51PM (#33723093)
If there's enough actual interest, some group of people will just clone the language in an open manner since enough is known about it. But that doesn't seem to be happening at the moment.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by cyber_kinetist on Wednesday November 23, 2022 @03:03PM (#33723848)
I thought Odin was one of the clone languages at the start (although later it diverged from Jai in many aspects, and is far ahead Jai in the aspect that it's open-source and is actually being used in production).

But really I would like Jai to take some time to mature over the years, instead of rushing out for an immediate public release. It has some very ambitious ideas that would absolutely be killer features, but I think it needs ample time to get polished. (Off to writing C++ code during the time then...)

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by suby on Wednesday November 23, 2022 @05:34PM (#33725380)
Odin has similar syntax, but one of the main reasons I am interested in Jai is because it has strong meta-programming support[0], where as Odin doesn't and will likely never due to the author of the language not wanting to go in that direction.

[0] - https://github.com/Jai-Community/Jai-Community-Library/wiki/...

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by stephc_int13 on Wednesday November 23, 2022 @05:59PM (#33725613)
What do you think about Zig?

I am not a fan of metaprogramming, but this is a relatively important feature of Zig.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by cyber_kinetist on Wednesday November 23, 2022 @08:01PM (#33726617)
Yeah, I have about the same opinions. Odin made a conscious decision to not invest much in compile-time metaprogramming, and as a result was able to actually ship things without spending too much time on language design. But it’s a bit less ambitious than what Jai was trying to do.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by germandiago on Thursday November 24, 2022 @05:57AM (#33729893)
which killer features?
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by ok123456 on Wednesday November 23, 2022 @02:17PM (#33723389)
Unless it's being designed from committee from the start, most languages start off as a 'passion project.' But, there is a point where they have to bring in more people to handle the work and mitigate the single point of failure.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by curtainsforus on Thursday December 01, 2022 @06:12PM (#33824373)
I think he bought in more people at one point, then sent them away again when he realized he wasn't able to keep the project on track with that many chefs making the soup. The problem with more people is that the project can very easily degenerate into design by committee.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by 3a2d29 on Wednesday November 23, 2022 @12:37PM (#33722165)
It’s hard to find any material on Jai.

It seems to be a “better C”.

Isn’t that what D / Zig try to do? What’s the advantage?

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by stephc_int13 on Wednesday November 23, 2022 @12:51PM (#33722325)
I think that Jai / Zig / Odin all started around the same time.

D is closer to C++ than C, in my opinion.

I suspect that Jai was an inspiration for Zig and Odin.

Many developers in gamedev circles are still using C or orthodox C++ (C++ without most of the bullshit) but are frustrated by many features and gaps.

Short compilation time is one of the big goals, as it is crucial for fast iteration.

The goal is simply to have a powerful low-level/system language that is enjoyable to use. Or at least more enjoyable than C++. (the de-facto standard)

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by 3a2d29 on Wednesday November 23, 2022 @01:24PM (#33722750)
Right that makes sense.

I’m curious if the gaming industry will switch languages, it feels like with the current game engines that it’s heavily entrenched in C and C++. Feels like something like Carbon has the best chance to break in.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by stephc_int13 on Wednesday November 23, 2022 @02:56PM (#33723773)
Only time will tell.

But I think there is an opportunity at this point in time.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by oxryly1 on Wednesday November 23, 2022 @03:26PM (#33724099)
A chunk has already switched to C# with Unity. Most other engines (proprietary, Unreal, etc) have decades of C++ that would require too much effort to migrate to anything new.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by cmovq on Wednesday November 23, 2022 @04:02PM (#33724476)
Unity is still written in C++. It's fairly common to write the core engine in C++ and use a language like Lua, or as is more common in AAA, some proprietary scripting language for gameplay code.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by 3a2d29 on Wednesday November 23, 2022 @06:23PM (#33725828)
Interesting. I heard the Civilization games were Lua, didn’t know that was more common.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by TheCycoONE on Wednesday November 23, 2022 @07:07PM (#33726189)
Quite common: https://en.m.wikipedia.org/wiki/Category:Lua_(programming_la...

I work on CorsixTH as a hobby which is also c++ and lua.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by int_19h on Wednesday November 23, 2022 @08:51PM (#33727014)
This kind of thing in general is very common and goes back decades, it's just that the languages used to be custom (QuakeC, UnrealScript etc) before the industry largely standardized around Lua. Some older games also experimented with Python for this, and I recall even seeing Tcl once.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by pjmlp on Thursday November 24, 2022 @04:39AM (#33729395)
Unity core, written by Unity employees, customers use C#, that is a big difference.

Also since Burst got mature, many C++ modules are slowly being rewritten in C#/Burst subset.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by bartwe on Thursday November 24, 2022 @05:24AM (#33729674)
There are a number of Rust projects happening, but not overtaking c++ any time soon.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by bachmeier on Wednesday November 23, 2022 @02:46PM (#33723662)
> D is closer to C++ than C, in my opinion.

In terms of what the language allows you to do, yes. However, if you're a C programmer, you can pretty much just keep writing the same code you've always written (minus the preprocessor, thankfully). You can even compile C code with the D compiler and call those functions from your D code without doing anything further. That's definitely not the case with C++.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by moonchild on Wednesday November 23, 2022 @04:05PM (#33724524)
Oh, come on now. I'm no C++ apologist, but you can do both of those things in C++ as well as in D.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by bachmeier on Wednesday November 23, 2022 @10:45PM (#33727594)
I meant you can't do things like compile C++ code directly into your D project.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by SilentLambda on Wednesday November 23, 2022 @11:29PM (#33727806)
D is not at all like C++.

D is D.

You only need to compare how C++ and D treat a class type, and you know straight away they are miles apart (I prefer C++ in this regard).

D has a subset, and that subset is more like C - pretty much cause that subset is C. That can be interesting to use, since it's like C with modules.

But don't be fooled. D is not like C++.

I wish people would stop saying as such, cause it's not at all true.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by pjmlp on Thursday November 24, 2022 @04:40AM (#33729408)
You're right, in many areas it is more powerfull than C++23 is.

As for classes, just pretend you are using structs in C++, and use structs in D.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by hsn915 on Wednesday November 23, 2022 @03:01PM (#33723827)
If you can find very old Jai videos on YouTube, you can find the creator of Odin was one of the early people excited about the project.

I suppose if the development of Jai was made more in the open/public, Odin would probably not have existed.

That said, I'm glad Odin exists.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by BaculumMeumEst on Wednesday November 23, 2022 @05:31PM (#33725354)
You can find the creator of Zig in those videos as well
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by mariusor on Wednesday November 23, 2022 @09:22PM (#33727180)
I think that even if Jai didn't directly inspire Odin and Zig, seeing Jon's enthusiasm for his new language influenced GingerBill and Andrew Kelley in their work. This is only the conjecture of someone on the side, but the timeline fits pretty well in my opinion.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by WalterBright on Wednesday November 23, 2022 @08:24PM (#33726784)
> D is closer to C++ than C

I'd put C++ as being between C and D, as D leaves a lot of things behind like the preprocessor.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by SilentLambda on Wednesday November 23, 2022 @11:17PM (#33727743)
.. you forgot to mention also, that (in the context of a D module) D stops treating a user-defined class-type as real type. Additionally, a D class is a reference type. Whereas in C++, a class type is a real type (treated as any built-in type), and is a value type (by default).

Nor does D have a concept of C++ friend.

So even when it comes to classes, C++ and D are miles apart.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by WalterBright on Wednesday November 23, 2022 @11:37PM (#33727849)
D structs are value types, D classes are reference types. This was done to avoid mistakes like having a type that is sometimes used as a value type and sometimes as a reference type.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by SilentLambda on Thursday November 24, 2022 @04:47AM (#33729451)
Would have been much better in my opinion, if D had maintained a C like struct (not a C++ like struct), and a C++ like class. That would have solved the problem you identified, while still allowing for the class to be what it was designed to be. The mistake C++ made was the mistake you identified. But the solution you provided in D is its own mistake.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by WalterBright on Friday November 25, 2022 @03:04AM (#33740283)
The C++ class would require the user to constantly remember it has to be passed by reference, not by value. D making the class a reference type means the user cannot mix them up.

It has worked well from the beginning, it is not a mistake.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by SilentLambda on Saturday November 26, 2022 @06:29PM (#33758081)
..and in the context of a module.. not even used as a type at all.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by ibgeek on Wednesday November 23, 2022 @11:28PM (#33727796)
Honest question: as a GC’d language, D seems to occupy the same niches as Go, JVM-based, and CLR-based languages rather than that of C++. Wouldn’t it be more accurate to compare to them than C/C++? Am I misunderstanding something?
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by WalterBright on Wednesday November 23, 2022 @11:34PM (#33727839)
D isn't a GC based language. The GC can be used, or not used, as the user chooses. D supports many different programming paradigms.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by ibgeek on Thursday November 24, 2022 @12:04AM (#33727962)
Ah! Okay, that’s what I was missing. I found the blog posts on using malloc and free from D. I knew the GC could be disabled, but I wasn’t aware of how practical it was to manually manage memory. Thanks!
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by WalterBright on Thursday November 24, 2022 @01:04AM (#33728209)
It's not necessary to disable it, just don't use it.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by kjksf on Wednesday November 23, 2022 @03:09PM (#33723926)
There's quite a lot of information, just not very accessible.

https://www.twitch.tv/j_blow/videos?filter=archives&sort=tim... : this is jai's author livestreaming language development, most up-to-date

https://www.youtube.com/playlist?list=PLmV5I2fxaiCKfxMBrNsU1... : a cureated subset of twitch videos, possibly outdated info

https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md : a summary of jai based on the above curated videos, possibly outdated

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by vinyl7 on Wednesday November 23, 2022 @07:36PM (#33726419)
Here's a community run wiki that's been kept up-to-date https://github.com/Jai-Community/Jai-Community-Library/wiki
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by _trackno5 on Wednesday November 23, 2022 @02:14PM (#33723352)
> input for a large community is extremely valuable

it’s also an extreme time suck. Having everyone opine on their pet feature would just take away from the focused work the people at Thekla are doing.

Honestly, I don’t even see why Jon should make things open source (apart from it being a major incentive for people to adopt it). The performance improvements they are offering compared to other languages 100% warrant charging for it.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by henry_viii on Wednesday November 23, 2022 @02:27PM (#33723464)
I'm surprised the author didn't mention the Lobster programming language when evaluating a successor language:

https://github.com/aardappel/lobster

The language seems to be exactly what he was looking for - a high-performance high-level language specifically designed for video games.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by cyber_kinetist on Wednesday November 23, 2022 @03:00PM (#33723810)
From a glance at the language description, this is very different from what he is looking from Jai. I don't see any description of it having metaprogramming facilities as good as D or Jai (or even C++!).
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by seabass on Wednesday November 23, 2022 @02:29PM (#33723495)
> input for a large community is extremely valuable

In the early stages, everyone has a thousand opinions and it’s not clear even to those working in jai daily what exactly the language wants to become and which patterns should be supported. From what I understand, Blow intends to gradually open things up as the project matures, which I think is 100% the right approach for something fairly experimental and with a lot of new ideas.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by dymk on Wednesday November 23, 2022 @03:43PM (#33724287)
It's 8 years old
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by mumblemumble on Wednesday November 23, 2022 @03:57PM (#33724425)
For a volunteer developed programming language, that's almost certainly early stages.

Calendar years is not a good measure of how much work has gone into a language. Think in terms of person-hours instead.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by bsder on Wednesday November 23, 2022 @04:53PM (#33725008)
> I don't understand why they are not working in the open, this is a tool, not a game, input for a large community is extremely valuable.

Ayup. Talking about JAI is simply a waste of time until they put it in the open under a genuine open-source license.

Otherwise, you wind up with situations like "Our Machinery".

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by throwaway17_17 on Wednesday November 23, 2022 @07:44PM (#33726487)
Just curious, but when you genuine open-source license what do you include? Going back to the earliest talks on a potential language Blow cites a non-GPL, permissive license as his probable license. I know some folks tend to not count BSD, Public Domain, etc as open source.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by bsder on Wednesday November 23, 2022 @08:15PM (#33726723)
Certainly anything OSI is acceptable. GPL isn't my cup of tea, but it's fine, too. Owner/authors are doing the work and if you don't like what license they choose, you can go elsewhere.

As long as no entity can retroactively revoke your ability to use the source code, it's probably sufficient.

As things currently stand, that is NOT true for JAI.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by umanwizard on Thursday November 24, 2022 @12:59AM (#33728187)
> I know some folks tend to not count BSD, Public Domain, etc as open source.

This isn’t true, unless you’re talking about some niche opinion held by a few eccentric people.

Even Richard Stillman, probably the most ardent and uncompromising copyleft activist in the world (elevating the GPL to nearly religious status) accepts that non-copyleft licenses like BSD are open-source (and free software, a term he prefers).

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by uvtc on Wednesday November 23, 2022 @05:10PM (#33725158)
> I don't understand why they are not working in the open,

> Fast compilation and nice, easy to read syntax with good default is exactly what I am looking for.

> [re metaprogramming] ... but I also think this is a pandora box.

Sounds like you might also like [Hare](https://harelang.org/). (has some work-in-progress [SDL2 bindings](https://git.sr.ht/~sircmpwn/hare-sdl2))