News for hackers. Stuff that matters.
Re:No Abstractions: our API design principle by lmz on Thursday April 25, 2024 @07:44PM (#40164402)
Isn't there the issue of modifying the state enough through the low-level API such that it breaks the assumptions of the high-level one?
Re:No Abstractions: our API design principle by eru on Friday April 26, 2024 @01:16AM (#40166159)
Just say that you don't support mixing both APIs.
Re:No Abstractions: our API design principle by lazyasciiart on Friday April 26, 2024 @03:49AM (#40166827)
Now you’re telling users to check the source code of any tools they use with your stuff? “We recommend using ToolOne only on content you do not also manage with ToolTwo”
Re:No Abstractions: our API design principle by eru on Saturday April 27, 2024 @04:21AM (#40178290)
See how libfuse handles it with their low level and high level APIs.
Re:No Abstractions: our API design principle by actionfromafar on Friday April 26, 2024 @01:54AM (#40166301)
That’ll fix it. ;-)
Re:No Abstractions: our API design principle by withinboredom on Friday April 26, 2024 @02:46AM (#40166554)
The high level API shouldn’t care about state. In other words, your “readers” should merely aggregate state and your “writers” should only care about subsets of state.

Think about file permissions in Linux. Running ls just shows you gross file perms (current user, group, and global) but you can also grant access to other individual users, or even make a file immutable that still shows up as writable to ls. The high level api doesn’t know or care about the low level state except where it is relevant.

Re:No Abstractions: our API design principle by Pxtl on Friday April 26, 2024 @09:36AM (#40169202)
Yes. But that's the high-level API's problem. That's a problem with any abstraction really. "What if there's something in the thing we're abstracting that doesn't fit the abstraction" isn't really a problem with the "two API" approach, it's a problem with abstraction.

The high-level API needs to handle that case, if nothing better than having internal assertions that throw if it hits a case it's not designed to accommodate.

(also I'm annoyed with myself that I wrote buffer underrun in my first post instead of buffer overflow and now it's too late to edit).

Re:No Abstractions: our API design principle by cylemons on Friday April 26, 2024 @11:16PM (#40176829)
You did make me search what a buffer underrun was and I think it was a good read