HNHacker News
TopNewBestAskShowJobs

e-dant

408 karma · joined June 19, 2017

Programming is creative
submissionscomments
e-dant··on Initialization in C++ is bonkers (2017)
Let the language die, hope it goes quicker than cobol.
e-dant··on Can Style Be Timeless?
These were three pants from Lululemon, figured they’d be good.

None of them lasted more than 6 months.

Admittedly, I bike and walk a lot, so probably I put more strain on them than I should have.

But, come on, that’s why I got them, and surely if I can bike 20 miles in $30 pants from target, those fancy lululemon pants should also have worked.

e-dant··on Can Style Be Timeless?
Few years back, I thought it was wise to invest in some semi-pricey clothes which were intended to suite me for a while. The only formal stuff I had at the time was my Dad’s, or something I thrifted, which didn’t quite fit.

Some pants, shirts, which I could put a jacket over for something more formal. Some shorts and shirts for the gym.

Every single one of those pants ripped, to my surprise, because some of them were $150-$250. Some ripped in the belt loops, others between the legs. The dress shirt is barely holding up, there are little plumes of ripped material on the side.

Each time they ripped, I replaced them with something I found for $15-35 at Target. Not a single rip.

I still keep the dress shirt, because it’s the only one I have, and I’m not at all sure what to replace it with.

I dislike the shirts that Target sells because the frame they use is of a long, skinny man, with small arms, and an extremely wide neck. Not sure how the fuck that happened. But the material is perfectly fine.

If anyone knows where I can find a nice shirt (both collared and others for the gym), that’d be great. I’m set on target pants, though. They are indestructible.

e-dant··on Functors, Applicatives, and Monads
Part of why monads are not interesting to talk about is that they’re generic enough that most explanations are incomplete, and sufficient explanations are boring and unhelpful.

But the biggest reason is that they’re sort of intuitive, plenty examples exist. And then at some point someone tells you that those things are monads, but it’s in the kind of way that social psychologists make up some fancy word for crap we all know about in our gut.

Nobody gives a shit that a list is a monad, people give a shit that it’s a list. Anyone who’s written lisp or node or any nontrivial C program or anything with coroutines or anything with concurrency can and will tell you that, yeah, duh, control flow can be represented by a data structure. A couple more fancy “monad laws” and you have something that looks like other monads, and lists and if expressions and IO meld together. Ok, how unhelpful.

e-dant··on Where Do the Bytes Go?
Linux has pledge? Huh?

`pledged = (p->p_p->ps_flags & PS_PLEDGE);`

e-dant··on Tree Calculus
Feels like clojure from afar
e-dant··on Show HN: A portable hash map in C
I want to thank everyone here who pointed out deficiencies in this little library.

Good catches :)

e-dant··on Show HN: A portable hash map in C
Nevermind — there are ways for deleting colliding items to cause other colliding items to be “forgotten”, and one solution would be to implement slot cycling on deletion
e-dant··on Show HN: A portable hash map in C
Good catch! Yes, that looks like a bug :)
e-dant··on Show HN: A portable hash map in C
There’s no slot cycling logic. When a k,v pair at some index is deleted, and a different k,v pair has a matching hash, there’s a (small?) penalty in the hm_get logic that will eventually the right k,v pair.

I need a bit more clarification on your first question. There should be no mutation of the underlying map when it grows — we’re just allocating more room for entries and adjusting the old map’s item “ownership” — moving pointers->items around.

e-dant··on Show HN: A portable hash map in C
I like the exercise of trying to find the simplest reasonable solution to some problem.

Many of my toy and hobby projects are exactly that. Some make allowances for the sake of performance and generality.

The hash map, though, is up there with sorting algorithms in the breadth of wild implementations. Salmagundi is unlikely to be the fastest, or the smartest. But it’s cute and portable.

e-dant··on Show HN: A portable hash map in C
Huh — I must have written djb1 in error
e-dant··on Show HN: Uniquely identify any process you run (with o pidfiles)
This was originally meant to solve the problem of zombie processes in Docker containers (hence the name and issue nr.; moby/9098).

I’ve found this more succinct in other contexts than backgrounding tasks, writing pid files, and maintaining them through the process’s lifetime.

Also less prone to error.

e-dant··on Frots: The only file rotation tool I'm aware of that *handles stdout
logrotate (which you really ought to use if you can) happens to use rename() under the hood to move the primary logfile into rotation, which confuses programs already writing to it (they will now be writing to the rotated file, which is weird). frots was primarily made to solve that problem.
e-dant··on __init__.py files are optional. Here's why you should still use them
I hate init py files the same way I hate Java’s verbosity.

If it looks like a package, it’s a package.

If I want to be explicit, I’ll write something in C.

e-dant··on Tracy: A real time, nanosecond resolution frame profiler
I always squint a little bit when folks mention nanoseconds.

The overheard of observing the time is around 60 nanoseconds.

Light travels about a foot in a nanosecond.

Below ~500 nanoseconds, things get fuzzy.

e-dant··on Nyxpsi – A Next-Gen Network Protocol for Extreme Packet Loss
What’s the protocol actually?

All I can see are hardcoded ping/pong “meow” messages going over a hardcoded client and server.

But maybe the ping/pong is part of the protocol?

It’s not clear.

Anyway, this redundancy-based protocol doesn’t seem to take into account that too many packets over the network can be a cause of bad, “overloaded” network conditions.

Raptorq is a nice addition, though.

e-dant··on Rust in Linux Revisited
Oh, I started searching for some hot topics in the rust lkml, ouch, there’s some bad stuff in there.

Linus seems reasonable in comparison…

e-dant··on Rust in Linux Revisited
I must be missing something obvious. I’m not aware of any too-frequent toxicity in the rust lkml.

Just seems like a lot of groundwork is still being laid, without much even having been started.

The article makes it seem like things are actually being rewritten in rust.

Are they?

e-dant··on Knowing how slow the kernel thinks your program is, and plottable
Flaregun safely monitors performance metrics on a program, or your whole system.

Like top, it doesn’t require much to Just Work and produce meaningful output.

Like other dedicated tracing tools, Flaregun can peek deeply into your application, extracting metrics like TCP packet and file system latency.

e-dant··on Delivering WordPress in 6KB (2018)
Seems like a good pitch for ai
e-dant··on Three Laws of Software Complexity
I once wrote a small piece of software which did everything for everybody in constant time with no dependencies. It was very simple.
e-dant··on The server chose violence
I’m wondering if this really is too aggressive.

On Linux, sure it’s not possible to directly crash another program you’re talking to via a socket alone (ignoring bad data on the socket).

But you can absolutely kill them. Anything running as root can kill anything else. Can even reboot and bring down the whole system.

Maybe a bit harder and a bit more unusual, but at least for containers, root privileges are common. And yeah, sure, there’s a cgroup there are you’re more limited. But you get the idea.

It’s also a bit different from the (conventional?) wisdom about being “liberal in what you accept, conservative in what you emit” though that’s a bit more tied to networked systems.

Though, maybe it’s inevitable that a system has to be liberal in what they accept.

How else can you change the api slightly without breaking existing programs?

e-dant··on Show HN: Hancho – A simple and pleasant build system in ~500 lines of Python
It’s the integration with those platform-specific requirements which I find so tough. Apple wants a particular format, signed and whatnot via xcodebuild. Windows, I don’t even know. Something about universal apps on the Windows store. Android is a bit simpler if you can target the right directory with the right toolchain.

It’s these particular systems that I find the most difficult. If there were a collection of nice utilities for working with them uniformly, oh, that would be amazing.

e-dant··on Ask HN: What do I do with my side projects?
- People will happily spend $5 for coffee but have an existential crisis when asked for a $1 app. If you’re looking to make money on these things, it’s an uphill battle.

- All software is derivative. Yours included. Putting it out there is like planting a seed for more to grow, even if it’s just an AI ingesting your work.

- The last two points aren’t mutually exclusive.

Put your work out there in the clear for free, as in freedom, but paid, as in you can get paid. Just don’t expect much.

e-dant··on War of the workstations: How the lowest bidders shaped today's tech landscape
I wonder if there’s room for a theory of convergent evolution, in software and languages, towards something that is generally appreciated.

Maybe there will always be camps arguing for one thing or another, but together and over the longest term, do they all pull in one general direction?

I’m not so sure I agree with most of the article. The perspective is valuable.

e-dant··on Show HN: An Automated AI Translator
How well does this handle formatted text, like, say, json? yaml? legal agreements?
e-dant··on Elixir is still safe
The ABS system your car’s brakes could crash — literally — and that would be safe?
e-dant··on Elixir is still safe
Without stepping on anyone’s toes, I think we can agree that “safety” could be broken down a bit. Memory safety, thread safety, fine… but there’s a whole forest past those trees.

Is it a safety feature to type-check regular expressions using dependent types? Is Python a security vulnerability because the performance can be unpredictable?

I don’t know.

Rust, for that matter, doesn’t protect you from running out of memory from leaking data on the heap — or from running out of stack space because your infinitely recursive function doesn’t halt. Maybe that’s not part of memory safety — but that’s my point.

There’s a whole safety forest out there. Whenever I read an article about safety in software, it seems like a comfy blanket statement. “This is a nice definition which I will live in.”

I just don’t see how it’s so flat.

e-dant··on Breaking java.lang.String
Right, that’s my understanding. But OP and a sibling thread here seem pretty sure about the mutex thing.

I think there’s some nuance, but not in the general case.

Shared memory, lazy statics in async blocks, and asynchronous constructors might have different initialization order mechanics that would require synchronization — but even then, the borrow checker would at least point it out

← PreviousPage 2 of 5Next →