“Biasing” towards one component of a sum type is a bit like the “biasing” towards choosing an order of a tuple. Should it be (Name, Age) or (Age, Name)? Instead of
data Locality = Local | Remote
or
data Remoteness = Local | Remote
I think I prefer using either
data IsLocal = IsLocal { local :: Bool }
or
data IsRemote = IsRemote { remote :: Bool }
And if you end up using both then it still reads nicely, like:
foo IsLocal { local } =
... (bar IsRemote { remote = not local })
This style is even nicer in languages with proper keyword arguments (the examples above are in Haskell).
Nor are you popping up strange things when text is highlighted, nor are you fiddling with the contents of the clipboard when something is copied.
The more well-intended of these things originate from {mobile vendors, browser vendors, and mobile browser vendors} dropping the ball. How am I supposed to scroll to the top of a long web-page on a phone? Add #top to the URL? Oh yeah editing the URL to add a fragment’s gonna be real obvious to all the grandmas out there, but unfortunately [bz]oomers that don’t know HTML are an important market segment so we all get to enjoy discovering everyone’s ad-hoc re-implementation of basic functionality. Adding navigational cruft isn’t the responsibility of your web-page, it belongs to lower down in the stack.
How am I supposed to scroll to the top of a long web-page on a phone?
Replace your Android with an iPhone then touch the top of the screen. Dunno why Google have not copied this feature, sigh. Like you, I get irritated by the workarounds perpetrated by web devs.
This list has the depressing dual properties of (i) going on and on, and (ii) every item being familiar.
Some more potential entries:
No full screen images put there to wow you that you have to scroll past.
No huge (probably AI generated) prelude before the page’s content. E.g. this post didn’t start with a short essay on what a website is. (Yes: I’m mad at what search results are like these days.)
I was guilty of the image thing. It was always a frame from a movie I was reviewing.
Funny enough when I shrunk the images to fit the content properly, it removed a lot of awkward design challenges and generally looks better, if a little less flashy perhaps.
it’s difficult to diagnose generated code that fails to compile
Procedural macros are easy to debug. If an environment variable is set, write the generated code to a file, run rust-fmt on it, and output an include!(). rust-fmt will need some coercion if the macro produces something that isn’t an item.
Quite smart. Tar files are usually compressed, and supporting some equivalent would require filesystem-specific kernel interfaces to then be able to support only one of them.
I wonder if you could double-JIT x64 instructions. Produce your C object code as usual. Then carefully execute an instruction at a time, recompiling to encrypted instructions, and then ‘unsheathing’ if the instructions can be proven sound.
FRP does not protect subojects, which under the threat model used means that attackers can take a pointer to, say, a user object, and alter it to point to another user object stored in the same array. If you allow for recompilation like CHERI, you could make & produce a fresh object mapping like CHERI C produces a narrower capability, but that would be far more expensive. And potentially not feasible, since you’d have no good way of tracking when a subobject mapping should be deallocated the way you can simply deallocate the object mapping during free().
For large objects, FRP results in much more metadata than CHERI. As an example, say you want to mmap a 2 GB file. For that you need 128 mappings with contiguous IDs, or 2 KiB. While CHERI only adds 65 bits. In a program with many many pointers but few objects, FRP wins, but with few pointers per object or big objects, CHERI wins.
FRP still requires recompilation. Many programs won’t need to be recompiled, but a non-trivial number would still need to be. Especially noteworthy is that FRP really only protects C/C++ using the system libc. Most anything else will either need larger interventions to work with FRP, or simply violate its assumptions completely. This makes it quite sucky for the use case of embedding unsafe C code in safe(er) high level code.
CHERI does a lot more than just make legacy C and C++ safe. It adds new features to the ISA that can be leveraged for good. For example, something I am quite excited for is the ability to fully sandbox code I don’t trust. You can give pointers to library functions that are read only, or that cannot be stored anywhere but the stack (and thus can’t be stashed away by the library for later use). This does require new CHERI specific code to be written, but crucially, it only needs to be added to the code that wants to do the sandboxing. The code being sandboxed would not need to be changed. So new stuff could take advantage of it, while old stuff could be wrapped up in safety sandboxes.
I’ve got an APT use case that is tangential. I’m posting here because i think this will attract apt users and hopefully some of them will chime in. I think this solver piece is very interesting and will send to a co-worker.
I’m needing an apt-get experience that plays nice with containers and rebasing (ability to apply layers on top of one another without a rebuild). Currently apt-get has some shared state (like a file with a list of all dependencies installed) and individual packages can do whatever they want and some of them have hardcoded paths so they are not portable to a different directory. I also want dynamic linking (so NIX is not the answer).
I’m curious if there are any efforts out there to provide such a tool or ecosystem. If not, maybe you would be interested in such functionality? Or maybe I didn’t explain my desires well enough and you have some questions.
I also want dynamic linking (so NIX is not the answer).
Nixos/nixpkgs uses dynamic linking by default (unless you force the static build for each package). Maybe there’s some more context, but maybe it’s a misunderstanding and it would work?
Quite possibly. I’ve been known to misunderstand a thing or two.
I need to be able to upgrade/replace packages in place. I want to patch packages with ABI compatible versions without requiring any rebuild or compilation steps for any native dependencies (like a Ruby library with a C extension that is linked to libxml).
I was under the impression that Nix wants very explicit versions and won’t take kindly to pretending a patched version of a package is the same as the original package. I’m not sure why I thought static linking was a part of that contract, so perhaps I’m wrong about more.
No, that’s right. Nix uses dynamic linking, but it’s strict about the dependency changes, so you can’t replace an existing item. But guix has grafts of you really need them https://guix.gnu.org/en/blog/2020/grafts-continued/
Yes! Like nixery.dev but Debian packages! I’ve wanted this so much! With each layer defined by the path in the registry and representing a single package (but the solver adds the dependency layers only once, even if required by multiple elements of the path).
Edit: I thought it actually had a layer per slash package, but it’s actually possible that a similar caching algorithm could be used for apt with multiple things installed in each layer. https://tazj.in/blog/nixery-layers
Unsafe Rust is more difficult than just using C, and doesn’t automatically force the language to do what you want. For example, translating a C program 1:1 will likely result in UB (aliased mutable pointers are allowed in C, and a big no no for even unsafe Rust).
If you translate C pointers to Rust raw pointers (not references), you’re fine. Rust allows aliasing mutable raw pointers. Just don’t add references into the mix and you get more or less C rules.
The issue is that many idiomatic language constructs in Rust can create implicit references, for example method calls. You need to contort yourself quite a bit to avoid them fully.
The major problem with this is, that you’re handing out knifes by proposing this as a default.
Every kitchen needs them and usually no one will question why you use them. But if you would hand out knifes on the street to everyone, you will surely give it to the wrong people in the wrong place.
And we’re on the internet, so no one knows whether you’re a cook, a human > 16 years old, a dog or a toddler.
Every time a toddler uses that knife, you will have to life with the news and questions, why you did hand them out in the first place.. The worst part is: the knife may end up in the dish (crate). And then everyone starts shouting.
For firefox you can toggle network.IDN_show_punycode in about:config. Here’s some example links posted to lobste.rs as punycode and Hiragana; I had to reload the page for the settings change to take effect.
What a dumb quiz. This is obviously fishing for a certain kind of result, while pretending it has universal applicability.
On question #1:
the rectangle class is immutable, so you can only change a rectangle by constructing a new one… there is no mention of how you do this, so the design is extremely incomplete and it’s impossible to judge the ergonomics… it also makes the answer about caching confusing
the requirement that points must be passed in as (X,Y) and size as (width,height) means you have to construct a new tuple. Given the explicitly specified use case (GUIs) it is actually extremely likely you will calculate each of these values independently in an unvectorized form, so the packing is unnecessary overhead
I stopped there.
Have these people ever built their own UI toolkit?
I don’t have broad experience with different UI frameworks but I’ve worked plenty with PDFs and websites. x and y are passed in as two integers. I haven’t seen a point class outside a college textbook or one case of Ruby code written by a Java “expert” who was clearly “programmatically challenged”.
It would be better to have the other slides in the svg as regular svg rather than in a string in javascript. Your slides could still be viewer with noscript, like in SVG editors.
Well I’m not an svg expert but I think the XML’d look like <svg><g id=slide1>...</g><g id=slide2></g></svg>, with each group having a transform to lay them out sensibly w/o JS, but corrected to an interactive slideshow if JS is actually present.
How about sending SQL’s grammar back to the fiery chasm from whence it came? One of you must do this.
the fiery chasm of 1973
“Biasing” towards one component of a sum type is a bit like the “biasing” towards choosing an order of a tuple. Should it be
(Name, Age)or(Age, Name)? Instead ofor
I think I prefer using either
or
And if you end up using both then it still reads nicely, like:
This style is even nicer in languages with proper keyword arguments (the examples above are in Haskell).
Sort by universality & constancy.
Nor are you popping up strange things when text is highlighted, nor are you fiddling with the contents of the clipboard when something is copied.
The more well-intended of these things originate from {mobile vendors, browser vendors, and mobile browser vendors} dropping the ball. How am I supposed to scroll to the top of a long web-page on a phone? Add
#topto the URL? Oh yeah editing the URL to add a fragment’s gonna be real obvious to all the grandmas out there, but unfortunately [bz]oomers that don’t know HTML are an important market segment so we all get to enjoy discovering everyone’s ad-hoc re-implementation of basic functionality. Adding navigational cruft isn’t the responsibility of your web-page, it belongs to lower down in the stack.Replace your Android with an iPhone then touch the top of the screen. Dunno why Google have not copied this feature, sigh. Like you, I get irritated by the workarounds perpetrated by web devs.
This list has the depressing dual properties of (i) going on and on, and (ii) every item being familiar.
Some more potential entries:
I was guilty of the image thing. It was always a frame from a movie I was reviewing.
Funny enough when I shrunk the images to fit the content properly, it removed a lot of awkward design challenges and generally looks better, if a little less flashy perhaps.
Vanity isn’t a deadly sin, but subscription pop-ups definitely are.
Why batch in that way?
(Vec<Egg>, Vec<Ham>)is simpler thanVec<Either<Vec<Egg; Max=4096>, Vec<Ham; Max=4096>>>.Procedural macros are easy to debug. If an environment variable is set, write the generated code to a file, run
rust-fmton it, and output aninclude!().rust-fmtwill need some coercion if the macro produces something that isn’t an item.Amazing and terrifying.
I’m scared by how much I like this.
Magnificent
Do the
imgtags havewidthandheightset?Originally no, they just set
width/heightin CSS and then usedobject-fit: contain. Now it’s a CSSbackground-imageso moot point.Quite smart. Tar files are usually compressed, and supporting some equivalent would require filesystem-specific kernel interfaces to then be able to support only one of them.
Sounds like a more practical CHERI.
I wonder if you could double-JIT x64 instructions. Produce your C object code as usual. Then carefully execute an instruction at a time, recompiling to encrypted instructions, and then ‘unsheathing’ if the instructions can be proven sound.
I came away with the opposite impression.
FRP does not protect subojects, which under the threat model used means that attackers can take a pointer to, say, a user object, and alter it to point to another user object stored in the same array. If you allow for recompilation like CHERI, you could make
&produce a fresh object mapping like CHERI C produces a narrower capability, but that would be far more expensive. And potentially not feasible, since you’d have no good way of tracking when a subobject mapping should be deallocated the way you can simply deallocate the object mapping duringfree().For large objects, FRP results in much more metadata than CHERI. As an example, say you want to mmap a 2 GB file. For that you need 128 mappings with contiguous IDs, or 2 KiB. While CHERI only adds 65 bits. In a program with many many pointers but few objects, FRP wins, but with few pointers per object or big objects, CHERI wins.
FRP still requires recompilation. Many programs won’t need to be recompiled, but a non-trivial number would still need to be. Especially noteworthy is that FRP really only protects C/C++ using the system libc. Most anything else will either need larger interventions to work with FRP, or simply violate its assumptions completely. This makes it quite sucky for the use case of embedding unsafe C code in safe(er) high level code.
CHERI does a lot more than just make legacy C and C++ safe. It adds new features to the ISA that can be leveraged for good. For example, something I am quite excited for is the ability to fully sandbox code I don’t trust. You can give pointers to library functions that are read only, or that cannot be stored anywhere but the stack (and thus can’t be stashed away by the library for later use). This does require new CHERI specific code to be written, but crucially, it only needs to be added to the code that wants to do the sandboxing. The code being sandboxed would not need to be changed. So new stuff could take advantage of it, while old stuff could be wrapped up in safety sandboxes.
Maybe @david_chisnall has some thoughts on this.
The
curl | bashis on-brand for installing Chrome & Spotify, but under the hood it’sgit clone | bash.Feels similar to Reservoir Sampling. Are there any algorithms like this?
I’ve got an APT use case that is tangential. I’m posting here because i think this will attract apt users and hopefully some of them will chime in. I think this solver piece is very interesting and will send to a co-worker.
I’m needing an apt-get experience that plays nice with containers and rebasing (ability to apply layers on top of one another without a rebuild). Currently apt-get has some shared state (like a file with a list of all dependencies installed) and individual packages can do whatever they want and some of them have hardcoded paths so they are not portable to a different directory. I also want dynamic linking (so NIX is not the answer).
I’m curious if there are any efforts out there to provide such a tool or ecosystem. If not, maybe you would be interested in such functionality? Or maybe I didn’t explain my desires well enough and you have some questions.
Nixos/nixpkgs uses dynamic linking by default (unless you force the static build for each package). Maybe there’s some more context, but maybe it’s a misunderstanding and it would work?
Quite possibly. I’ve been known to misunderstand a thing or two.
I need to be able to upgrade/replace packages in place. I want to patch packages with ABI compatible versions without requiring any rebuild or compilation steps for any native dependencies (like a Ruby library with a C extension that is linked to libxml).
I was under the impression that Nix wants very explicit versions and won’t take kindly to pretending a patched version of a package is the same as the original package. I’m not sure why I thought static linking was a part of that contract, so perhaps I’m wrong about more.
No, that’s right. Nix uses dynamic linking, but it’s strict about the dependency changes, so you can’t replace an existing item. But guix has grafts of you really need them https://guix.gnu.org/en/blog/2020/grafts-continued/
Yes! Like nixery.dev but Debian packages! I’ve wanted this so much! With each layer defined by the path in the registry and representing a single package (but the solver adds the dependency layers only once, even if required by multiple elements of the path).
Edit: I thought it actually had a layer per slash package, but it’s actually possible that a similar caching algorithm could be used for apt with multiple things installed in each layer. https://tazj.in/blog/nixery-layers
I might not understand you right, but perhaps you could make a package repository full of nothing but metapackages, like how ubuntu-desktop works.
It sounds like Rust’s game developer experience could be improved by adding this at the top of each file:
Whenever the compiler’s doing unproductive bullying you can safely borrow one without feeling guilty for introducing an
unsafeblock.Unsafe Rust is more difficult than just using C, and doesn’t automatically force the language to do what you want. For example, translating a C program 1:1 will likely result in UB (aliased mutable pointers are allowed in C, and a big no no for even unsafe Rust).
If you translate C pointers to Rust raw pointers (not references), you’re fine. Rust allows aliasing mutable raw pointers. Just don’t add references into the mix and you get more or less C rules.
The issue is that many idiomatic language constructs in Rust can create implicit references, for example method calls. You need to contort yourself quite a bit to avoid them fully.
The major problem with this is, that you’re handing out knifes by proposing this as a default.
Every kitchen needs them and usually no one will question why you use them. But if you would hand out knifes on the street to everyone, you will surely give it to the wrong people in the wrong place.
And we’re on the internet, so no one knows whether you’re a cook, a human > 16 years old, a dog or a toddler.
Every time a toddler uses that knife, you will have to life with the news and questions, why you did hand them out in the first place.. The worst part is: the knife may end up in the dish (crate). And then everyone starts shouting.
There must be some good fun to be had with a Lua repl in the kernel, but I don’t know what it would be.
So it’s KIO for Python. Are there any compatibility wrappers, I wonder?
Kind of like Tower of Hanoi.
For firefox you can toggle
network.IDN_show_punycodeinabout:config. Here’s some example links posted to lobste.rs as punycode and Hiragana; I had to reload the page for the settings change to take effect.What a dumb quiz. This is obviously fishing for a certain kind of result, while pretending it has universal applicability.
On question #1:
the rectangle class is immutable, so you can only change a rectangle by constructing a new one… there is no mention of how you do this, so the design is extremely incomplete and it’s impossible to judge the ergonomics… it also makes the answer about caching confusing
the requirement that points must be passed in as (X,Y) and size as (width,height) means you have to construct a new tuple. Given the explicitly specified use case (GUIs) it is actually extremely likely you will calculate each of these values independently in an unvectorized form, so the packing is unnecessary overhead
I stopped there.
Have these people ever built their own UI toolkit?
I don’t have broad experience with different UI frameworks but I’ve worked plenty with PDFs and websites. x and y are passed in as two integers. I haven’t seen a point class outside a college textbook or one case of Ruby code written by a Java “expert” who was clearly “programmatically challenged”.
OpenStep (including Cocoa) always passes points as NSPoint structures and passes rectangles as NSRect structures.
A few years of hard labor fixing copy-paste errors in the Siberian 3D graphics work-camps will show you the value of a good
Pointclass.It would be better to have the other slides in the svg as regular svg rather than in a string in javascript. Your slides could still be viewer with noscript, like in SVG editors.
I’m not sure I follow, you mean like
<svg><svg id=slide1>...</svg>...<svg id=slideN>...</svg></svg>?Well I’m not an svg expert but I think the XML’d look like
<svg><g id=slide1>...</g><g id=slide2></g></svg>, with each group having a transform to lay them out sensibly w/o JS, but corrected to an interactive slideshow if JS is actually present.