HNHacker News
TopNewBestAskShowJobs

e-dant

408 karma · joined June 19, 2017

Programming is creative
submissionscomments
e-dant··on Libmobi: C library for handling eBook formats
Honest answer: of course it is, and no serious developer is arguing otherwise.

I just finished shipping an industrial lighting unit for “smart farms.” I worked extensively on embedded hardware. The most advanced processor I used was armv6, with the majority of hardware being IC or FPGA.

I used C for one thing only: reading the bitstream from microcontrollers into memory. After which point, I used c++ (17) with exclusively standard libraries (one exception: boost’s ASIO for http) to implement any and all other features.

I would have happily used c++ to read those bitstreams, but the code was so unsafe that it refused to compile. Turns out that reading raw bytes from an irregular file descriptor is so arcane and bizarre that no sane modern compiler felt good enough about itself to allow me to compile it.

All that said, I would only ever allow myself to write in C in that isolated case and for that isolated purpose. Every other nanosecond of my codebase runs on modern c++.

Honest answer, there is no legitimate reason to use C. If in some edge case you must, there is no legitimate reason to use it for anything other than that.

e-dant··on Libmobi: C library for handling eBook formats
The purpose of C was to be an optimizable low-level language. If programmers wanted those things, the sense was always one of “ok, do it yourself and use it as a library.”

There are definite pros and cons to that particular standards methodology. It is, without any question, the most distributable language. The ABI is and will likely always be intact.

Nobody has ever argued that C is anything other than that. It’s about as dead simple as it can be.

There are other languages for other purposes. Rust and C++ are, in all cases I’m aware of, equivalent in performance to their “ideal” C program alternatives.

Nobody has ever argued until just recently that C is or ever has been anything other than what it is or that there is some kind of battle going on between Rust and “c/c++.” Nothing could be more untrue. C and C++ are different things. Though, with a clear lack of understanding you can write a “c” program in c++. The same is true with rust — everything can still be mutable and you can still have undefined behavior very easily (perhaps most easily with IO).

Plenty of other languages exist, too, with other ways of solving these problems. Haskell is a wonderful language which I hope someday to develop with if there was only some way of making it easier to work with file systems without a PHD.

This particular flame war between rust, c, and c++ is so contrived and tired and misleading.

e-dant··on Libmobi: C library for handling eBook formats
I agree with everything you raise here. C is a dinosaur that should be left to museums.

But I’m really, really tired of people comparing c interchangeably with c++ — and, more than anything else, if you have a good idea please just make a pull request on someone’s git repo.

And just in case anyone is unclear about this, if you ship code with unbounded memory leaks you’re going to hell

e-dant··on Matrix Multiplication Inches Closer To Mythic Goal
This thought has been churning around in my mind for some years now — we focus too much on processing speed and reductions in time complexity and not enough on increasing the size and efficiency of our cache and stack.

MM (especially MM on large type numbers like e.g. hashing algorithms) are very reliant on the cache because you can’t always fit that big of a number into a register. Side note, I was reading some Abseil code last night that did some funky bit twiddling on ARM: https://github.com/abseil/abseil-cpp/blob/master/absl/hash/i...

Off the top of my head, isn’t it about 200ns [edit, not ms] to query, bus, and read something from memory? Just a thought, perhaps the cache and memory is where we should focus our efforts.

e-dant··on Libmobi: C library for handling eBook formats
I see some rust, c, c++ arguments in these comments.

It’s getting tired. This is the second time this morning that I’ve stumbled across that particular flame war.

I understand that security and memory safety are important and necessary arguments to have. Unfortunately, it’s a larger problem than which language you use. And, even if it were, it’s not like most (or any?) of the comments in this thread are even remotely correct.

On behalf of (hopefully) plenty of programmers, Let’s take a step back. Stop bugging me.

e-dant··on Ask HN: Who wants to be hired? (January 2021)
Location: Philadelphia, PA

Remote: Yes

Willing to relocate: Yes

Technologies: 8 years of C++, 4 years of Python, bash/fish/sh master, Linux & Mac guru, Plan9 enthusiast, Data Analytics fluency.

Résumé/CV: Upon Request

Email: willhl@protonmail.com

← PreviousPage 5 of 5