HNHacker News
TopNewBestAskShowJobs

SubjectToChange

709 karma · joined February 9, 2020

submissionscomments
SubjectToChange··on Maybe Rust isn’t a good tool for massively concurrent, userspace software
it makes me laugh to hear claims about Java GC superiority. Please go back in time and fix all the crashes and OOMs caused by enterprise JVM,

I don’t see how running into an OOM problem is necessarily a problem with the GC. That said, Java is a memory intensive language, it’s a trade off that Java is pretty up front about.

I don’t have a horse in this race but I would be quite surprised if Go’s GC implementation could even hold a candle to the ones found in C# and Java. They have spent literally decades of research and development, and god knows how much money (likely north of $1b), optimizing and refining their GC implementations. Go just simply lacks any of the sort of maturity and investment those languages have.

SubjectToChange··on Web scraping for me, but not for thee
that's the expected cost of publishing something to the public internet. People are going to access it. No one has a right to complain when people access something that was put there for the public to see.

What is your opinion on spam email?

SubjectToChange··on SQLite 3.43
I mean I was never crazy, RDBMS are useful, but SQL languages feel awkward not just to me.

Calling RDBMSs “useful” is quite the understatement. They are among the most commercially successful software products of all time, and the theory backing them has endured with us for over 50 years now.

BTW the question I asked was about querying data without ever using a SQL language, like tapping directly into the data. Of course a DB system is not designed to be used like this, but to me, it should, or at least there should be better alternative to SQL.

This approach has been tried over and over again with little success to show for it. Considering that a good number of working programmers would be hard pressed to recall what ACID even stands for, much less with any rigor, you have to ask yourself if you really want to entrust valuable data to them. Furthermore, mucking around with low level storage and access patterns adds tremendous amount of work to development, it is very unpleasant.

SubjectToChange··on C and C++ prioritize performance over correctness
Let me be clear about my claim: tailor made solutions to each problem will almost always be faster than generic solutions. Do you really disagree with that?

I disagree with it in the sense that I disagree with the statement "A human will always be able to write the same or better assembly than a C compiler, because humans can learn the compiler's tricks and make optimizations which the compiler is not allowed to make." It's a true statement, but it's so detached and irrelevant that it hardly matters.

Generic code has proven itself time and time again, even Go caved in and supported it.

SubjectToChange··on C and C++ prioritize performance over correctness
To get that, sometimes you need -ffmast-math, sometimes said undefined behavior, or code patterns which translate to better code for the processor you target.

There isn't really any fundamental limitation of Rust for those situations. A better reason why C++ is better than Rust for compute is the support for OpenACC, OpenCL, OpenMP, CUDA, ROCm/HIP, etc.

Also, if you give half an effort, C++ is pretty secure and robust to begin with, esp. on the pointers department.

The problem is that even if a "Safe" C++ could be defined, it would need to interoperate with the rest of the "Unsafe" C++ world. Perhaps a programmer can write absolutely safe C++ themselves but all bets are off once you're working with other programmers.

Just be mindful, and run a couple of valgrind tests on your code, and you're set. Been there, done that.

Seriously? A "couple of valgrind tests" would be insufficient for catching all but the most trivial and/or blatant memory safety issues in C++, especially when dealing with malicious users. Although I agree that dynamic analysis like valgrind and sanitizers should be the default for C++ development, industrial grade static analysis tools are at least as important. And needless to say, if you find Rust complains about code too much then just wait for what static analysis tooling will complain about.

SubjectToChange··on C and C++ prioritize performance over correctness
Metalness is a gradient

It would be better to say that "Metalness" is a sort of "Feature Set". IMO, most programmers would tend to agree that C++ is far closer to Java than C is, yet C++ is every bit as low level as C is. Indeed, even a managed language like C# supports raw pointers and even inline assembly if one is willing to get their hands dirty.

SubjectToChange··on C and C++ prioritize performance over correctness
No, it almost always is.

A library author can spend ridiculous amounts of time refining and optimizing their implementations, far more than any application programmer could afford or justify.

The designers of a generic library can't anticipate the use case, so can't make appropriate tradeoffs.

This is definitely not true. Take C++ for instance, not only is it possible to specialize generic code for particular types, but it's absolutely routine to do so. Furthermore, with all sorts of C++ template features (type traits, SFINAE, CRTP, Concepts, etc) even user-defined types can be specialized, in fact it's possible to provide users with all sorts of dials and knobs to customize the behavior of generic code for their own use case. This functionality is not just a quality-of-life improvement for library users, it has profound implications for performance portability.

For example, compare `std::unordered_map` to any well written C hash table.

std::unordered_map is a strawman. There are a plethora of generic C++ hash tables which would match, if not soundly outperform, their C counterpart. Also, even if we blindly accepted your claim, then how do you explain qsort often being beaten by std::sort or printf and its variants being crushed by libfmt? What about the fact that Eigen is a better linear algebra library than any alternative written in C?

SubjectToChange··on C and C++ prioritize performance over correctness
The market share of C in desktop, server, and other "enterprise" applications has drastically dropped since the 90s. Nowadays it's quite rare to see C chosen for new projects where it isn't required. In fact, despite of how pervasive it is, a huge amount of C code cannot be built on a pure C toolchain, i.e. C is essentially like Fortran.
SubjectToChange··on C and C++ prioritize performance over correctness
Perhaps, but C and C++ assume flat address spaces and modern hardware includes many programmable devices with their own device memory, e.g. GPUs. Naturally this discontinuity causes a great deal of pain and many schemes have been developed to bridge this gap such as USM (Unified Shared Memory).

Personally I would like to see a native language which attempts to acknowledge and work with disjoint and/or "far away" address spaces. However the daunting complexity of such a feature would likely exclude it from any portable programming language.

SubjectToChange··on C and C++ prioritize performance over correctness
Of course the problem is that the vast corpus of legacy C code was not written with such aggressive compilers in mind.
SubjectToChange··on MLIR For Beginners: A series of articles on the MLIR framework
MLIR (Multi-Level Intermediate Representation) is an LLVM project made to address some of the shortcomings of LLVM IR. Many languages using LLVM as a backend (e.g. Swift, Rust) have have resorted to defining their own IRs because dropping all the way down to LLVM IR loses almost all of a language’s semantics.
SubjectToChange··on Can you use a class in C?
Standardizing name mangling would only be a baby step towards C++ ABI compatibility, sadly.
SubjectToChange··on Can you use a class in C?
It’s amusing to me that whenever C has a feature that C++ doesn’t, C programmers hammer on the usefulness and power of said feature, but on the converse those same C programmers hammer on the divine simplicity of C.

C++ has constructors, it doesn’t really need designated initializers in the first place. They were added primarily for C compatibility.

SubjectToChange··on Ode to the M1
Are you sure you couldn’t wrap that up in another library and just do everything in a single call?
SubjectToChange··on Ode to the M1
What goalpost did I supposedly move?
SubjectToChange··on Ode to the M1
write a hello world application in gtk or qt and see how much assembly you get.
SubjectToChange··on Exploring the Internals of Linux v0.01
I don’t know about this. A lot of the success of a project has to do with how they react to changing conditions and the needs of their users. Moreover I would say that most projects owe a great deal of their success to the nontechnical factors, e.g. licensing or other social factors.

Reading the initial working versions of a successful project will inform you on how that project used to work. In a sense it’s akin to reading a working draft of a great piece of literature without reading the final product.

SubjectToChange··on Exploring the Internals of Linux v0.01
GCC supports a plethora of ISO standards, language extensions, pragmas, etc. It simply isn’t tractable to guarantee support for every behavior or language construct which GCC has tacitly supported. Compilers like GCC may go above and beyond the ISO C standards, but they aren’t in the business of supporting every C dialect possible.
SubjectToChange··on Exploring the Internals of Linux v0.01
Par for the course honestly. Obviously major C compilers are only becoming more strict about acceptable code. For instance when -fno-common was made the default in GCC 10 it ended up breaking an rather incredible number of packages.
SubjectToChange··on Mixing Swift and C++
the situation will change in such a way that more control about the specific of the solution becomes a requirement, and the language shortcuts will fit less and less, to the point where they become a liability.

This is exactly what Go does. Languages like C++ or Rust make it possible to expose and interact with those complex requirements, whereas Go takes it away in the name of “simplification”. Just look at all of the insane hacking tailscale does on Go to make it work for them.

SubjectToChange··on Mixing Swift and C++
Lots of open source projects and foundations, or businesses where you can actually pay for guarantees.

Apple just doesn’t like making solid commitments to outsiders, especially for something as mundane as legacy support. They want to mold swift into anything they want/need.

SubjectToChange··on Mixing Swift and C++
Go seems to have been developped by true masters that really understand that less is more.

"The key point here is our programmers are Googlers, they're not researchers. They're typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They're not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt." - Rob Pike

Ignoring complexity on the language level simply passes the buck to application code, and developers end up paying that price across the ecosystem in perpetuity.

They've also kept a laser sharp focus on working on things that really matters and took the time to do things right.

Go's async model is underspecified, its implementation of generics incurs runtime overhead, much of the "wonderful tooling" only exists because of severe shortcomings in the language design and/or compiler implementation, its FFI is... difficult, etc.

To be blunt, the values that Go embraces are none of the values I seek in a programming language or community. And I feel sorry for anyone too heavily invested in Go to turn back.

SubjectToChange··on Mixing Swift and C++
I don't trust Apple to care about platforms or developers that aren't directly benefiting them.
SubjectToChange··on Why SQLite does not use Git (2018)
Either way “Rust is helping” is true. And given that Go is a managed language it never really factored into the shared library debate to begin with, whereas Rust forces the issue.
SubjectToChange··on Why SQLite does not use Git (2018)
Microsoft is a better example with git vfs and now Scalar.
SubjectToChange··on Why SQLite does not use Git (2018)
AOSP is a distributed as a bunch of git repos, but Google uses an in-house VCS called piper.
SubjectToChange··on Musl: List of alternative libs that are lightweight, not bloated and efficient
I used Siemens NX daily and Mathematica at home. While such programs are certainly “bloated” they work well and provide an incredible amount of value. The communities around musl/suckless/cat-v have absolutely no answer to how they could possibly replicate such programs in their paradigm.
SubjectToChange··on Musl: List of alternative libs that are lightweight, not bloated and efficient
Again, you can write a C89 (even more with C++20) dialect in C++. There’s practically nothing C can do that C++ can’t. Also, the fact that the linked page recommends tinycc and pcc pretty much proves they don’t care about performance or memory usage.
SubjectToChange··on Musl: List of alternative libs that are lightweight, not bloated and efficient
I'll assume dwm is great and all, but I feel like that just proves my point.
SubjectToChange··on Musl: List of alternative libs that are lightweight, not bloated and efficient
What is the best piece of software the musl/suckless/cat-v crowd have to offer? They smugly moan about the state of modern software but only manage to write alternatives to relatively trivial programs. For instance, it's ridiculous to recommend tinycc or pcc as an alternative to GCC or Clang.
← PreviousPage 6 of 12Next →