Better HN
topnewbestaskshowjobs
Log inSign up

kortex

8,487 karma · joined Feb 1, 2017 (9y ago) · 2,549 submissions

Submissions

comment 4y ago · link · parent

I mentioned that. The problem with feather at the moment is readily writing metadata. I currently have to use a hacky workaround to write the metadata.

comment 4y ago · link · parent

I've considered it. If I went that route, I'd probably use zstandard instead of PKWARE .zip (even though python stdlib has the zipfile interface built in). Zst is waaay faster, the API is more modern and actually architected from the ground up, supports parallel block processing, it's got rfc8878. It's quite nice. I'd have to still implement the object model on top of the block storage.

With low compression levels, you can actually tune things to get faster write times than raw bytes, depending on CPU speed vs IO speed. So that's cool.

http://facebook.github.io/zstd/

comment 4y ago · link · parent

Okay, I've been playing around with ASDF a bit and I kinda really like it! It's quite performant - about 40% slower than reading/writing TIFFs, but supporting arbitrary metadata and array sizes. Supports in-band compression with zlib (ok), bzip2 (slow AF), and lz4 (quite fast, only about 50% slower than no compression, so in line with lz4 compressing the raw data).

There's a couple of squicky things, for one, it looks like the extension model may allow RCE behaviors by deserializing arbitrary classes. It looks like it uses a URI/registration based system so by default, it is limited in what types it can try to load, but it's plugin-based, so a library you import could theoretically expose you. But that seems relatively low risk.

But overall this format is really cool. Supports linking across multiple ASDF files, which I can see getting messy, but this is an incredibly powerful technique and they do it in a sane way.

comment 4y ago · link · parent

Anyone else feel let down by all the existing container formats out there, and feel this itch to like, write their own? I know, I know, that's like the worst possible idea, xkcd #927 "now there are 15 standards", but like, what if?

What I'm looking for is basically something that ticks all the boxes of LOC's 7 Sustainability Factors. Is able to store arbitrary binary data, along with metadata, in a single file. Easy to pack/unpack, particularly in Python. I'm pretty well covered for image/audio/video formats, but none of those lend themselves to n-dim arrays.

Ogg, matroska, and HDF5 are all container formats which can ostensibly do this, possibly even well. Ogg and matroska are supposed to be able to support arbitrary data steams and metadata, but actually finding tooling to do the operations I want to do has yet to bear fruit. HDF5 is insanely complex, and I have some concerns about performance and data corruption risk.

Tar is tempting but it does some really goofy things, like ending an archive with 1kB of zeros.

What actually looks most promising as an existing "format" is the RIFF family of chunked encoding. Dead simple, python stdlib even has a reader. Only real downside is 2*32 ~= 4 gigabyte size limit, though this can be overcome by using a "stream of chunks" model.

Alternatively, a stream based on Msgpack, with some slight constraints, is very appealing.

Sqlite3, also very tempting.

If I did write such a "format", it would definitely be built on the primitives of either RIFF, Msgpack, or Sqlite-as-application-file, so it'd be less of a "file format" and more of "existing format with some opinions about schema".

Protip for anyone also thinking about making their own file format: make sure the API/format supports some sort of arbitrary metadata model! Apache Feather and Parquet are pretty recent, but don't really support writing metadata, you kind of have to hack around it. IMHO, this is a huge oversight, especially considering the internal metadata is literally just JSON-encoded fields.

Edit: actually just reread the follow-up to "moving away from hdf5" and it mentions ASDF format. This looks really promising. YAML metadata header with binary blocks. Normally it's not a good idea to start with UTF8 and later go binary, but if you know when to stop reading text, it's not the worst. Also, it's a name collision with the asdf version manager (and also anything else named after rolling the left hand home keys)

https://cyrille.rossant.net/should-you-use-hdf5/

https://towardsdatascience.com/saving-metadata-with-datafram...

https://en.m.wikipedia.org/wiki/Resource_Interchange_File_Fo...

https://msgpack.org/index.html

https://www.sqlite.org/appfileformat.html

https://asdf-standard.readthedocs.io/en/latest/

comment 4y ago · link · parent

You should reach out to them and let them know. I don't know what the alternative would be - are there better CC licenses out there? Dual licensing CC+MIT/BSD?

Pragmatically (but not legally speaking, INAL) you could probably get by with summarizing and linking (especially to web archive).

comment 4y ago · link · parent

Not GP but it's a cascade failure mode with theoretically no upper bound in how much chaos it could cause. A toilet paper shortage caused millions to lose their goddamn minds, what do you think having no refrigeration on a world scale for even a week would do? A CME could potentially fry enough equipment that we would be left in in the dark and unable to repair for months, just due to availability of parts. I believe those estimates are at current production rates, too. If the supply chain and global comms are compromised, it's even harder.

It's definitely at the sweet spot of "terrifying" and "completely plausible."

comment 4y ago · link · parent

My favorite feature of Láadan is grammatical evidentiality, which I believe is based on real features of certain Native American languages. This is where you state how you know something, did you see it with your own eyes, hear it from a close friend, or just through the grapevine. There's even a particle for having dreamed it.

How is this different than English? For one, English relies heavily on the copula (is/to be) for statements of fact ("it is raining" vs "I see rain"), and secondly it's baked into the grammar. Stating something without evidence would sound just as wrong as "Me fail English? That's unpossible!"

The one exception might be the "uncertainty suffix" -ish.

https://en.m.wikipedia.org/wiki/Evidentiality

comment 4y ago · link · parent

I suppose it's better than strychnine in that there is a chance for antidote. But that presumes there is the time/knowledge to apply the antidote for the pet. And of course that won't help with wild animals or "utility pets" like barn cats.

I'm not sure why the metal phosphide class isn't more popular in America. They hydrolyze in the stomach to produce toxic phosphine gas, which doesn't persist. Seems to be used in conjunction with SGARs but not as a first-line.

comment 4y ago · link · parent

Hence "if it they can manage it". The tradeoffs you mention is exactly what I mean. GATs/HKTs are really pushing the envelope for the Rust type system, GATs being slightly more tractable and much closer to reality (soon!) than HKTs. But I don't think HKTs are a bridge too far for Rust. Maybe I'm wrong about that. Or GATs will appease the FP crowd enough (and it'll be hard enough) that there won't be enough drive for HKTs.

But I agree you shouldn't be "writing Haskell in Rust".

https://blog.rust-lang.org/2021/08/03/GATs-stabilization-pus...

comment 4y ago · link · parent

In optics, there's a thing called the circle of confusion (1). It's the locus of points that maps to a single point source of photons. A "perfect" focus maps a point source to a point on the image: perfect contrast. Ability to focus is basically how tight you can get this circle, for a focal distance. (this is all super simplified, perfect lenses, no aberration, etc).

The smaller the aperture, the more constrained the light field, thus the smaller the circle of confusion (at the expense of light collection). That's how pinhole cameras work in fact.

Shrinking the aperture also increases the depth of focus. Pinhole cameras have ~∞ depth of field because there is ~1 path every photon can take (ignoring hole width, diffraction, etc).

1 - https://en.m.wikipedia.org/wiki/Circle_of_confusion

comment 4y ago · link · parent

This feels unnecessarily snarky. If you wanna write in Haskell, use Haskell. Rust is a different beastie with different use cases. There's no reason why any language shouldn't benefit from a powerful type system if they can manage it.

comment 4y ago · link · parent

Hard/confusing for user programmers, or for language designers? I don't think the concept being tricky for users is what is preventing adoption of HKTs. The &|x| hints at some of the reasons why implementing HKTs in Rust is tricky (not impossible). They are naturally very abstract, and if a structure is to be compiled in Rust, it (and its lifetime) needs to be reified. That is no small feat. See also: the difficulty with callbacks/anonymous closures in Rust.

comment 4y ago · link · parent

Folding in half is still better than crazy origami robot yoga (that's my new band name). Also I could readily envision a supersize fairing built on the Starship/heavy booster platform.

More lift capacity also means less weight optimization and more emphasis on robustness, reliability, redundancy, and power.

comment 4y ago · link · parent

Thank you for the deep response!

That is kind of what I figured, basically it always boils down to divide and conquer.

It just feels like with software, it's simultaneously easier than mech eng in so many ways (everything is in silico, near infinite abstraction power, ability to automate so many parts), yet it feels like we are constantly struggling with complexity. It starts simple but then quickly becomes a ball of yarn.

Maybe that perception is wrong, but if there is some truth to that intuition, I think it is due in part to this: software is all degrees of freedom and very few invariants to start, but then the system space quickly fills with rigid rules than can intersect in unpredictable ways. Physical engineering, you start with lots of invariants (the laws of physics, materials, chemistry, electronics, and geometry) but they are all thoroughly documented at this point. Things intersect, systems interact, but it feels much more bounded. You're only ever gonna have 3 dimensions, 6 simple machines, 92-ish usable elements, the standard model and universal constants.

This is why I value Rich Hickey's "Simple made easy" as the the exemplar of software philosophy. It's easy to say "oh yeah modular code good" but it's another to actually write code that is naturally decoupled.

As an aside, both disciplines tend to benefit from "throw more hardware at it!"

comment 4y ago · link · parent

We're not yeeting $11B USD into a Lagrange halo orbit. It's funding STEM jobs.

Yes we should have UBI but like, that doesn't meant we can't do science at the same time. Maybe look to the MIC to cut first.

comment 4y ago · link · parent

As dang would say,

> "Eschew flamebait. Avoid unrelated controversies and generic tangents."

comment 4y ago · link · parent

How does one even begin to engineer tests for such a sequence of events? Yeah you can test each step individually, but then you have all the integration effects. How do you know you have enough coverage?

$10B buys a lot of QA and I'm sure they try to engineer everything with the right margins, but it's still an unfathomable amount of state space.

Are there techniques to stay sane and manage risk without just throwing money at it? I feel like that kind of knowledge could be useful for software test development.

comment 4y ago · link · parent

Yes, exactly. Culture of trust is the root. Many beneficial patterns emerge when you can have that: more critical PRs, blameless post-mortems, etc.

comment 4y ago · link · parent

The Gervais/Peter Principle is alive and well in many orgs. That doesn't mean that when you have the prerogative to change the culture, you just give up.

I realize that isn't an easy thing to do. Often the best bet is to just jump around till you find a company that isn't a cultural superfund site.

comment 4y ago · link · parent

Current co is small. We are putting in the safeguards from Day 1. Well, okay technically like day 120, the first few months were a mad dash to MVP. But now that we have some breathing room, yeah, we put a lot of emphasis on preventing outages, detecting and diagnosing outages promptly, documenting them, doing the whole 5-why's thing, and preventing them in the future. We didn't have to, we could have kept mad dashing and growth hacking. But very fortunately, we have a great culture here (founders have lots of hindsight from past startups).

It's like a seed for crystal growth. Small company is exactly the best time to implement these things, because other employees will try to match the cultural norms and habits.

comment 4y ago · link · parent

Ok, and? I don't doubt it fails in places. That doesn't mean that it doesn't work in practice. Our company does it just fine. We have a high trust, high transparency system and it's wonderful.

It's like saying unit tests don't work in practice because bugs got through.

comment 4y ago · link · parent

It's like trying to get the truth out of a kid that caused some trouble.

Mom: Alexa, did you break something?

Alexa: No.

M: Really? What's this? 500 Internal server error

A: ok maybe management console is down

M: Anything else?

A: ...

A: ... ok maybe cloudwatch logs

M: Ah hah. What else?

A: That's it, I swear!

M: 503 ClientError

A: ...well okay secretsmanager might be busted too...

comment 4y ago · link · parent

That sounds like the exact opposite of human-factors engineering. No one likes taking blame. But when things go sideways, people are extra spicy and defensive, which makes them clam up and often withhold useful information, which can extend the outage.

No-blame analysis is a much better pattern. Everyone wins. It's about building the system that builds the system. Stuff broke; fix the stuff that broke, then fix the things that let stuff break.

comment 4y ago · link · parent

I have the same fear. It's very daunting. It's not that I don't know how to set up an email server, it's that I know just enough to be dangerous, but not enough to be reliable.

There's so much nuance and it's easy to let things lapse, or make a small mistake and silently get all your mail rejected, lose/corrupt a bunch of data, etc.

comment 4y ago · link · parent

That's a good idea but I can also see it backfiring. "Oops your account got locked by our algo, better cough up some dough so we can take a look at it..."

comment 5y ago · link · parent

Ahhh yup, that makes perfect sense given how zone files are formatted.

But that moves the question. Why do zone files use ; as comment? Some old assembly dialect? I've not worked much with assembly but it's always been # or //

comment 5y ago · link · parent

Great idea, I'll take a stab at it!

comment 5y ago · link · parent

Dig is great and DNS is hella underrated. It seems like not nearly enough folks know how to wield it. At both $lastco and $thisco people just used a mess of configuration to point to service IPs/URIs. I showed them how to set private zones and records for both A and SRV and suddenly everything is just using sane defaults.

Side note: does anyone know why dig's output is so...eye-bleeding? Why does it show so much info by default? +short should be the default. Why the ;; "comment" prefix?

comment 5y ago · link · parent

Sounds like something someone motivated to sell cars would say.

Even with subsidies, that first leg of depreciation is the steepest slope. Like I don't see how that beats just buying and owning it.

comment 5y ago · link · parent

Been a while since I was in the chemistry game, but my guess is lattice structure and packing. Pure Si has relatively long bonds compared to carbon, so the intermolecular forces are a bit weaker. Apparently SiC has over 250 polymorphs, but the most common is the alpha.

... ok I'm reading about the material properties of SiC and it's insanely complex so I'm just going handwave and say that α-SiC has tighter packing with stronger bonds because of the alternating Si and C atoms.

1
414243
85