Hacker News new | past | comments | ask | show | jobs | submit | vineek's comments login

Very nice. In similar fashion, a few years back I set out to create Wuhoo.

Wuhoo loosely stands for W indows U sing H eaders O nly. It is an attempt to create a single-header library (in the spirit of STB) for graphics related window management, compatible with both C and C++.

It works on Windows, Linux and Mac.

https://github.com/ViNeek/wuhoo


Very nice article. Literate programming might have some interesting features in this direction. The not so obvious thing is how it can scale.

A very good example of literate programming can be found in the fantastic book Physically Based Rendering [1]. It also has a preface discussing it [2].

The authors write a full physically-based rendering system in a declarative fashion. This approach has also led to a nicely adapted web-based version of the book [3].

Although we have successful examples like TeX and HTML, it would be very interesting to see this approach explored further by a more modern language or programming methodology.

[1] https://pbrt.org/

[2] https://www.pbr-book.org/3ed-2018/Introduction/Literate_Prog...

[3] https://www.pbr-book.org/3ed-2018/contents


I completely agree with the points from this article. It is fundamentally infeasible to make all C and C++ code safe. The main reason, PAST code. There are countless lines of unsafe code already written. However, there is nothing magical about Rust's facilities (e.g. borrow checker) that make them inapplicable to FUTURE C and C++ code. I believe this is the only way forward for C and C++. They need to offer mechanisms that guarantee that any code written today can be provably memory and thread safe. That of course requires yet another tool in the myriad of tools that exist for C and C++.


Language semantics matter. If a language doesn't place very strong meaning on certain things from the get-go, no amount of static checking will ever be able to guarantee certain traits of the code written in it, because it doesn't have enough information to work off of. And I'm not just talking about undefined behavior.

People have been writing safety checkers/linters/etc for C and C++ for decades. Many of them are very impressive and useful. None of them can ever be totally sound, as a fact of the languages themselves.


by the same token you could say it's also fundamentally infeasible for Rust to be code safe, otherwise they would not have unsafe code... so in the end it's an article that says nothing interesting at all


The ability to occasionally opt-out is both a feature and a necessity because certain systems are inherently unstable and offer varying guarantees. I’m arguing for an opt-in feature in C++. Of course there is no panacea.


To get a quick feel for ray tracing, I would also suggest https://rayground.com/. It has a lot of ray tracing projects, ranging from basic samples to complicated scenes. They can all be run in your browser.


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

Search: