Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm currently trying to decide if Nim is my C replacement.

On the one hand, it isn't C++, and it has real type safety, and it interfaces with existing C libraries very easily.

On the other hand, it is rapidly getting very complicated, and seems almost eager to become another C++ in terms of sheer volume of language features.



>On the other hand, it is rapidly getting very complicated

This seems to be the case for almost any "C replacement", and it will be (my prediction, at least) the reason they all fail.

I feel I might be a bit of an outlier in this respect, but I have only ever enjoyed using languages which are small and simple - C, Go, Scheme. The times I've tried Rust, it's been nice to have code that cannot segfault, but I find it such a chore to deal with. Whenever I've read open-source projects in Rust it's always a readability disaster. Also the compiler emitted warnings because functions were not snake case, which I found obnoxious.


you would probably like zig, if you haven't given it a look yet.


I feel zig is now experiencing feature creep now too sadly. Async and await and coroutines are being added to it, because it's the new-ish hotness I guess? Stopped paying attention to the language after that. I was hoping for a more streamlined language.


FWIW, adding async/await feels excusable to me.

I was strongly resistant to it when it first came out in C# something like 10 years ago. I thought it was language cruft that was better handled with a library solution, and nothing more.

I was convinced to give it a real try about 4 years ago, and had a serious change of heart after only a week or so. It was just syntactic sugar, but it was syntactic sugar that made concurrent code much easier to write. Not just in terms of making the code more verbose, but in terms of making it easier to do correctly. Because, at least in the way the C# team designed it, it subtly steers you towards doing things in smarter and safer ways, and away from the usual hot mess that is multithreading.

I've heard similarly positive things about goroutines, which seem at first blush to be about the same thing.

Given that Zig is ostensibly about helping people to write performant code more safely, that leaves me thinking that there's an argument to be made that async/await are a good fit for Zig's mission, and not just kitchen sink features.



Zig is promising as a "better C" but is nowhere near a 1.0 release as far as I know.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: