Live data from Hacker News

Porting 58k lines of D and C++ to Jai

yet-another-blog.com

141–150 of 264 posts

Re: Porting 58k lines of D and C++ to Jai

#141
post #108

> a big chunk of these vulnerabilities would not exist if C and C++ [...] simply didn’t have zero-terminated string, initialized values by default, had a proper pointer+length type thus replacing 90% of pointer arithmetic with easily bounds-checkable code, and had established a culture that discouraged the prevalent ad-hoc style of memory management. This is Rust's calling-card, so I find this plea for a better lang…

If I'm reading OP right, their issue with Rust is the borrow checker - none of those features require one. They're asking for a language that's safer than C, not as safe as Rust, but simpler and easier to ram things through. I don't necessarily agree, but I think that's what they're saying.

Re: Porting 58k lines of D and C++ to Jai

#142
> In my eyes, the most important ones are faster compilation and allowing metaprogramming via unrestricted compile time execution.

I'm fascinated by languages that are adding more compile-time programming features, in the context of a low-level performance-oriented use case. Would love to know more about the history and state of the art of this area.

Re: Porting 58k lines of D and C++ to Jai

#143
post #21

Earlier quoted context omitted.

Over the past decade, I watched HN's and Reddit's hype waves cycle through server-side JavaScript, Golang, Haskell, and now Rust. With plenty of secondary favorites in the mix like Julia, Nim, Zig, etc. A lot of these things do find some modest niche to survive in. But none really take over the world as originally forecast by the hype wave. Ultimately, you either enjoy tinkering with programming languages for persona…

I'm starting to actually believe that Rust will eat C's lunch for systems programming.

Rust will not accomplish this without significant language changes as well as changing cargo into something a lot more cooperative with external ecosystems.

Zig is getting an absolutely enormous boost from the fact that it is a self-contained C ecosystem that can cooperate with others. Zig has tripped into a very powerful niche--a lot of people LOATHE the build systems of the C/C++ world. If Zig gains very much more traction there, it's going to be extremely hard to dislodge.

I suspect that there are FAR more users of "Zig as C build system" than there are of "Zig as a language".

Re: Porting 58k lines of D and C++ to Jai

#144

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…

> 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 58k lines of D and C++ to Jai

#145

I’m in the private beta and things are changing constantly. I’m not sure why anyone would pick a language that won’t ever have a real ecosystem of libraries. Coming from C++ and need to remain low-level? Pick Rust, done.

>I’m not sure why anyone would pick a language that won’t ever have a real ecosystem of libraries

Could you elaborate?

Re: Porting 58k lines of D and C++ to Jai

#146
Putting together the available document "JayPrimer" (which may be obsolete) with the blog post, Jay it seems a language designed by somebody who's was fed up with C++, and deciced to write their own, tailored language; this looks great when seen through the lens of C++, but there isn't anything particularly innovative in the context of modern languages.

In particular, I'm personally neutral to Zig, but there seems to be little reason to prefer Jay over it.

From the primer:

> Arbitrary Compile-Time Code Execution

This is the big selling point, but, brought to the extreme, it's not necessarily a good thing. The examples in the primer are intended to look great:

- Insert build time data

- Download the OpenGL spec and build the most recent gl.h header file

- Contact a build server and retrieve/send build data

but they're the type of things that turn a build into a monster.

I guess comptime execution is big in the gamedev area (I can't say, I have little experience), but I suppose Zig fits the typical gamedev use cases (curious to hear devs with hands-on experience).

> Code Refactoring

The example presented seems to be "extract to function", which sufficiently advanced IDEs should support. It's also unclear if it's currently implemented.

> Integrated Build Process

I don't see this as a good thing. It's good from the perspective of old programming languages, whose build tools are a mess. But having a separate tool is actually an advantage, as long as it's standardized and well integrated (I suppose modern languages have this support).

> SOA AND AOS

This seems to be a very niche feature.

> Reflection and Run-Time Type Information

This is very convenient, but again, nothing unique.

> FUNCTION POLYMORPHISM

It seems to be an odd (flexible/inferred) generics implementation. One of the language objectives is to never perform automated type casting, but in this example, it is performed.

> THE ANY TYPE

I guess this is a polarizing feature.

> STRUCT POINTER OWNERSHIP

Is this syntactic sugar for a C++ destructor?

> Other Cool Stuff

> Specific data types for 8, 16, and 32 bit integers

No 64/128? :^)

Regarding the post, the non-trivial selling points are described as:

> Reducing compile times from about 60s right now to under 5s, hopefully around 1s

This is certainly very appealing.

> having debuggers work

Uh? That's based on the bad D experience.

> Replacing build-scripts with jai code

> Catching more errors by introducing custom compilation checks using metaprogramming

> Replacing complex metaprogramming code with simpler, imperative code

See Zig.

The rest are trivialities.

Re: Porting 58k lines of D and C++ to Jai

#147

Earlier quoted context omitted.

Complexity often arises from restrictions on "anything", rather than people actually doing anything.

I'm curious - what you think of as a good example? I think of C++ templates & macros, which I would not describe as arising from restrictions?

Template metaprogramming in the absence of constexpr/concepts would be my guess.

Re: Porting 58k lines of D and C++ to Jai

#149

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…

> 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))

Re: Porting 58k lines of D and C++ to Jai

#150

Earlier quoted context omitted.

> No native macOS then? Or Pi, or iOS, or practically all Android hardware… Kind of a non-starter IMO. Maybe this was marginally acceptable when the language started in '14 but it becomes less so every year.

well, given that any random person can't just adopt the language today, the platform support available today doesn't really matter, does it? Jon is writing it for his needs, and this thread is full of people saying "it doesn't meet my needs!" So what? it's not for you !

Yeah, I guess that’s true as far as Blow goes. But there are other people interested in this thing (hence why the OP exists and why we’re commenting on it). And I presume not all of them want to lock themselves in to the apparent dead end that is the x86 platform in the current year when both cross-platform languages and cross-platform game engines are all over the place.
Post reply on HN