HN user

cyber1

1,214 karma
Posts54
Comments68
View on HN
arxiv.org 9mo ago

Implementing OpenMP for Zig to enable its use in HPC context

cyber1
7pts0
github.com 11mo ago

Go SIMD dev branch

cyber1
2pts0
www.c-language.org 1y ago

C-Language.org

cyber1
6pts0
azeemba.com 1y ago

C++, Complexity, and Compiler Bugs

cyber1
3pts0
alexgaynor.net 1y ago

Safer C++

cyber1
7pts0
www.mdpi.com 1y ago

Performance Evaluation of C/C++, MicroPython, Rust and TinyGo on ESP32

cyber1
3pts2
starfighter.acornarcade.com 2y ago

C versus C++: Fight

cyber1
3pts1
consteval.ca 2y ago

I have no constructor, and I must initialize

cyber1
325pts226
medium.com 2y ago

Persistent Data Structures in VictoriaMetrics (Part 1): Vmagent

cyber1
1pts0
www.talos.com 2y ago

Talos Goes Sonic

cyber1
1pts0
peps.python.org 2y ago

PEP 744 – JIT Compilation

cyber1
14pts0
hsutter.github.io 2y ago

Overview: What are Cpp2 and cppfront? How do I get and build cppfront?

cyber1
190pts168
testing.googleblog.com 2y ago

Write Clean Code to Reduce Cognitive Load

cyber1
4pts0
zyedidia.github.io 3y ago

Writing a bare-metal RISC-V application in D (Better C)

cyber1
2pts0
gustedt.gitlabpages.inria.fr 5y ago

Defer Reference Implementation for C

cyber1
77pts59
robertseacord.com 5y ago

Adding a Defer Mechanism to C

cyber1
3pts0
groups.google.com 5y ago

Go: Moving forward with the generics design draft

cyber1
2pts0
thenewstack.io 6y ago

Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe Systems Programming

cyber1
4pts0
stackoverflow.blog 6y ago

Why the developers who use Rust love it so much

cyber1
135pts165
www.open-std.org 6y ago

Goals and Priorities for C++

cyber1
140pts197
nelari.us 7y ago

Writing a small ray tracer in Rust and Zig

cyber1
260pts96
www.youtube.com 7y ago

50 shades of C++ - Nicolai Josuttis - Meeting C++ 2018 Closing Keynote

cyber1
7pts1
www.youtube.com 7y ago

Modulator crate and Play app (Rust coding series)

cyber1
5pts0
groups.google.com 8y ago

Go modules have landed

cyber1
3pts0
andygrove.io 8y ago

First Benchmark for DataFusion (Rust) vs. Apache Spark for a Trivial Workload

cyber1
5pts1
www.youtube.com 8y ago

DotGo 2017 – Pascal Costanza – Go, C++ or Java for DNA Sequencing?

cyber1
1pts0
stanford-cs242.github.io 8y ago

Rust is now an official part of Stanford's Programming Languages course

cyber1
7pts0
avadacatavra.github.io 8y ago

Attacking Rust for Fun and Profit

cyber1
2pts0
github.com 8y ago

Rust – Non-Lexical Lifetimes RFC Was Merged

cyber1
7pts0
chromium.googlesource.com 8y ago

Chrome OS KVM - A component written in Rust

cyber1
239pts107

The concept of lifetimes was invented long before Rust borrow checker was even "scratched on paper." Of course, people who understand what they are they doing have known about these concepts for decades and have built their architectures around them. However, Rust borrow checker is much stricter than that. You have to build your architecture around the fact that you can't have more than one mutable reference at a time, and your data structures have to be represented as directed, acyclic graphs, etc. If you have to break all these rules by using a lot of unsafe because it's too difficult to represent your system within Rust safe subset using only value semantics and borrow-checked references, etc, then why use Rust instead of C++, C, or Zig?

What I mentioned is only a tiny part of the entire software, which has been successfully written in C, C++, and now in Zig as well, and is used daily by people around the world.

For 99.99% of cases, you're reading and writing this under an operating system whose kernel is written in a language without send/sync, and inside a browser that also largely written in languages without send/sync, because those systems are fundamentally well designed. So instead of fixing the bugs and rethinking the architecture, the author of Bun decided to transpile almost the entire codebase from Zig to Rust without a deep architectural review. Okay...

If you use Rust the way it was designed to be used, rather than relying on countless "unsafe" blocks, you need to redesign the entire codebase architecture to make it compatible with the borrow checker rules.

To me, this whole effort of rewriting Bun from Zig to Rust looks like a big marketing move. The question is: if Anthropic AI is really that powerful, why not just fix the bugs and give it the more ambitious task of redesigning the existing Bun Zig codebase in a way that eliminates not only the current bugs but also prevents similar ones from happening in the future?

Why is Zig so cool? 9 months ago

I also hope that WG14 eventually adopts successful features from Zig, such as comptime, and reduces the use of ugly macros and _Generic.

Why is Zig so cool? 9 months ago

The biggest advantages of Zig for me are that everything is explicit (no hidden features like overloads or implicit conversions) and that its metaprogramming is powerful, easy to use, and easy to understand.

In Defense of C++ 10 months ago

Just look at this: https://pvs-studio.com/en/blog/posts/cpp/1129/ - 11 parts about C++ undefined behavior from people who specialize in finding this stuff. And that’s only the tip of the iceberg.

I use C++ daily, and it’s an overcomplicated language. The really good thing about Rust or Zig is that (mostly) everything is explicit, and that’s a big win in my opinion.

In defense of C++, I can only say that lots of interesting projects in the world are written in it.

Zig's Lovely Syntax 12 months ago

At first glance, when I looked through the Zig reference, I didn’t like a lot about its syntax (though syntax isn’t the most important thing for me). But when I tried writing in it, I changed my mind - it’s a concise and convenient language with a very low entry barrier. It feels like Go, and with some C experience, you can quickly start writing functional stuff.

This is true. I agree with this statement. It's the holy cow of C. However, the problem with generic programming and metaprogramming isn't going away, and many people continue to struggle with it. Introducing something like compile-time reflection might be a solution...

I'm currently at a crossroads: C++ or Zig. One is very popular with a large community, amazing projects, but has lots of ugly design decisions and myriad rules you must know (this is a big pain, it seems like even Stroustrup can't handle all of them). The other is very close to what I want from C, but it's not stable and not popular.

Hey, I understand you and know this stuff well, having worked with it for many years as a C dev. To be honest, this isn't how things should generally be done. Macros were invented for very simple problems. Yes, we can abuse them as much as possible (for example, in C++, we discovered SFINAE, which is an ugly, unreadable technique that wasn't part of the programming language designer's intent but rather like a joke that people started abusing), but is it worth it?

Many C programmers need proper generic programming mechanisms (perhaps something like Zig's comptime) in C, but macros are the worst possible approach, and they don't want to switch to a different language like C++. As a result, they struggle with these issues. This is what I think the standardization committee should focus on, but instead, they introduced _Generic.

"Safe" Rust is generally a simple language compared to C++. The borrow checker rules are clean and consistent. However, writing in it isn't as simple or intuitive as what we've seen in decades of popular systems languages. If your data structures have clear dependencies—like an acyclic graph then there's no problem. But writing performant self-referential data structures, for example, is far from easy compared to C++, C, Zig, etc.

On the opposite, "Unsafe" Rust is not simple at all, but without it, we can't write many programs. It's comparable to C, maybe even worse in some ways. It's easy to break rules (aliasing for exmaple). Raw pointer manipulation is less ergonomic than in C, C++, Zig, or Go. But raw pointers are one of the most important concepts in CS. This part is very important for learning; we can't just close our eyes to it.

And I'm not even talking about Rust's open problems, such as: thread_local (still questionable), custom allocators (still nightly), Polonius (nightly, hope it succeeds), panic handling (not acceptable in kernel-level code), and "pin", which seems like a workaround (hack) for async and self-referential issues caused by a lack of proper language design early on — many learners struggle with it.

Rust is a good language, no doubt. But it feels like a temporary step. The learning curve heavily depends on the kind of task you're trying to solve. Some things are super easy and straightforward, while others are very hard, and the eventual solutions are not as simple, intuitive or understandable compared to, for example, C++, C, Zig, etc.

Languages like Mojo, Carbon (I hope it succeeds), and maybe Zig (not sure yet) are learning from Rust and other languages. One of them might become the next major general-purpose systems language for the coming decades with a much more pleasant learning curve.

Unfortunately, the standardization committee plays around with macros and _Generic instead of investing their time in modern metaprogramming ideas

This is intriguing. Interesting, how does this new Influx engine compete in terms of performance with VictoriaMetrics (which is written in Go and really fast)?

They moved their entire stack from Go to Rust, rewrote the system from the ground, and spent a lot of time on it, I guess this is a big cost.

Is it worth it?

But C can be improved by adding features that allow this and there is a lot of CS experience accumulated around metaprogramming to design this without lots of pitfalls, and no one says that this is easy, this is really hard, but possible. Unfortunately, the committee plays with old and ugly macros system and a little bit with lambda which for sure is better than nothing, but not enough to make C better.

Absolutely true. C might have its own way of evolution to Modern C with quite a good standard library and mature features, but people who stay behind C++ don't want this, and even though some of them behave really aggressively if some languages like Rust or Zig or Modern C (unfortunately this is will never ever happened) try to replace C++ or take even a little piece of the pie.

C++ is not a bad language at least because lots of amazing soft already written on it, but some people accept it with all of the myriads of complex rules with their own subset and some people totally disagree with this and just want Better(Modern) C with plain and simple rules without hidden complex things which happened behind the scene, and counterintuitive features.

About Rust is everything cool except sometimes it doesn't allow you to write correct code and push you to do things in ways that you don't like. But we are programmers and some part of us is a painter :)

Yet another "X faster than Y" where inside X all hot jobs are done by really good-tuned C or C++. Facepalm.

Without real problem-solving (business logic) written in Python, this is only lightweight wrapper on C/C++. When the number of Python code start growing in the hot path, then these blazing-amazing thruput numbers tremendously will be going down.

Why Rust? 4 years ago

Most benefits of Rust are true, except in some cases it does not allow you to compile an absolutely valid and safe program like here https://github.com/rust-lang/rust/issues/47680 - unfortunately you don't have freedom of code design decisions! I see some possible problems with refactoring, extending logic and functionality, and lots of issues with async code design and readability.

For me, Rust looks like a temporary step before the next language.