2,676 karma · joined Nov 28, 2019 (7y ago) · 1,131 submissions
comment 2y ago · link · parent
Careful. The default installation prefix is /usr/bin, and the install will happily clobber your mount command with one that requires a library that doesn't exist. Then next time you boot, the kernel will mount the file system read-only.
comment 2y ago · link · parent
The problem is that unless your use case is very limited and is guaranteed to stay that way, supporting more and more language constructs will quickly turn your code into a mess.
Compiler design as we learn it (lex/parse, syntax tree, semantic checks, transforms, lowering to codegen) is _the_ solution to the problem of dealing with computer programs as inputs and outputs. Trying to do something less is like solving a dynamic programming problem without knowing dynamic programming: it will only work for a restricted set of inputs.
comment 2y ago · link · parent
{"name" (includes? "k"), "age" (< 20)}
into {"name" #(includes? % "k"), "age" #(< % 20)}
which is the same as {"name" (fn [name] (includes? name "k")), "age" (fn [age] (< age 20))}
Then have another macro that converts that into the pattern matching code, or maybe there's already something in the standard library.You could serialize the patterns using EDN as a substitute for JSON.
Fun stuff.
I wrote something [similar][1] in javascript. With that it would be:
const is_k_kid = tisch.compileFunction((etc) => ({
'name': name => name.includes('k'),
'age': age => age < 20,
...etc
}));
const result = input.filter(is_k_kid);
Yes, "...etc" is part of the DSL.comment 2y ago · link · parent
The security issue with io_uring, as I understand it, is that it bypasses a lot of Linux's security auditing mechanisms. The problem is that, like with ioctl, if the kernel called out to a security subsystem with "here's something that the user wants to do with this file," the security subsystem would have to know what "something" means for every driver. Impossible; so do you allow most things? Deny them? If you choose the former, now there are gaping security holes. If you choose the latter, then enabling security will break too many things.
comment 2y ago · link · parent
How could we go the other way? A set can be "defined" by the predicate that tests membership, but then how do we model the predicates? Some formalism like the lambda calculus?
comment 2y ago · link · parent
The language specification, or standard, guarantees certain things about the behavior of programs written to the specification. "Undefined behavior" means "you did something such that the guarantees of this specification no longer apply to your program." It's pretty much a worst case scenario in terms of writing programs. The program might do... anything. Fortunately, in reality it happens all the time and programs often keep behaving close enough to what we expect.
Turing completeness is unrelated to that sense of "undefined behavior".
comment 2y ago · link · parent
The fact that MOND fits a lot of the data troubled cosmologists, because they know that a General Relativistic theory is needed to explain pretty much the rest of gravity.
TeVeS is an extension to General Relativity that reduces to MOND in the non-relativistic limit. For comparison, General Relativity reduces to Newtonian gravity in the non-relativistic limit. The non-relativistic limit is when speeds and spacetime curvature are small.
comment 2y ago · link · parent
Pragmatically, restart the service periodically and spend your time on more pressing matters.
On the other hand, we fully understand the reason for the fault, but we don't know exactly where the fault is. And it is, our fault. It takes a certain kind of discipline to say "there are many things I understand but don't have the time to master now, let's leave it."
It's, mostly, embarrassing.
comment 2y ago · link · parent
Bots looking for exploits is rude, spamming an endpoint with more traffic than normal is rude.. but a human trying to figure out the API that you exposed to the internet? That's just fair play.
Also, better to ask for forgiveness than to ask for permission. The author is adding value to the world while hurting nobody, and the answer would likely be an automatic "no" anyway.
comment 2y ago · link · parent
Now that I think about it more, you're right. Best case scenario for reading a bit would be to wait for the pin to go high/low, then push the corresponding bit into the input shift register, and have that automatically flush to DMA every 32 bits, say. Can't do better than some fraction of the clock speed because of the multiple instructions needed.
comment 2y ago · link · parent
That's a microcontroller. I wonder if more powerful chips can do more.
comment 2y ago · link · parent
comment 2y ago · link · parent
You have a ring around which charged particles can travel. The voltage at the start is V, and the voltage just behind the start (the end) is defined to be zero. A charged particle "falls" down the potential until it gets to right before where it started. But then it will momentarily feel a large force in the opposite direction as it "climbs" back up to V from zero.
I don't know how particle accelerators avoid this, but the wiki on cyclotrons refers to a "rapidly varying electric field."
comment 2y ago · link · parent
Again, I'm no expert.