Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sparkie
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
18 ms
·
151.
▲
by
sparkie
1y ago
The point was more that, you shouldn't always try to remove the branch from a loop yourself, because often the compiler will do a better job. For a contrived example, we could attempt to be clever and remove the branching from the loop
152.
▲
by
sparkie
1y ago
GCC can do better than the example I gave. https://godbolt.org/z/fo74G7d3W
153.
▲
by
sparkie
1y ago
In some cases you want to do the opposite - to utilize SIMD. With AVX-512 for example, trivial branching can be replaced with branchless code using the vector mask registers k0-k7, so an if inside a for is better than the for inside the if,
154.
▲
by
sparkie
1y ago
There's a non comprehensive list of hobbyist kernels at https://wiki.osdev.org/Projects
155.
▲
by
sparkie
1y ago
There was barrelfish, but it's no longer under development. https://barrelfish.org/
156.
▲
by
sparkie
1y ago
I'm assuming something more like Qubes, with proper isolation between groups of processes.
157.
▲
by
sparkie
1y ago
Having been in the other shoes - the employer or recruiter is worried that you'll be offended if they pronounce your name wrong - they're not discriminating - it's just that they're not wizards and they won't know h
158.
▲
by
sparkie
1y ago
That may work, but there are potential issues with that regarding timing attacks. If an attacker could make many attempts to access a resource, they may be able to figure out who (probably) has access with a brute-force timing test, and nar
159.
▲
by
sparkie
1y ago
Using them for whitelists is probably not a great idea because they can give false positives. An attacker could potentially flood the filter with fake accounts and increase the rate of false positives, increasing the chance they're gra
160.
▲
by
sparkie
1y ago
Also quite recent are Ribbon filters: https://arxiv.org/abs/2103.02515 But these, and xor/binary-fuse-filters are only direct replacements for Bloom filters in some problems. There are still problems for which Blo
161.
▲
by
sparkie
1y ago
I don't like it either, because it promotes method `b` to the global namespace. There may be many such `b` methods on different, unrelated types. I think that the latter should be prefixed with the typename or module name. a.b(c)
162.
▲
by
sparkie
1y ago
You could make use of `flip` from Haskell. flip :: (x -> y -> z) -> (y -> x -> x) flip f = \y -> \x -> f x y x |> (flip f)(y) -- f(x, y)
163.
▲
by
sparkie
2y ago
https://www.deceptive.design/types (formerly "Dark Patterns").
164.
▲
by
sparkie
2y ago
`auto` is still using static typing, and is a tool for type inference. A dynamically typed version might look equivalent but would behave differently, failing at runtime rather than compile time.
165.
▲
by
sparkie
2y ago
Dynamic typing can forbid the latter (at runtime), but it's implementation dependent. There's a further distinction, Latent typing , which is where types are associated with values rather than variables . But a dynamic languag
166.
▲
by
sparkie
2y ago
They're not so different in that regard. C# `await` can be adapted by making an awaitable and awaiter type[1], which isn't to dissimilar to how a computation expression in F# needs to implement methods `Bind`, `Return`, `Yield
167.
▲
by
sparkie
2y ago
`await` can only be used in an `async` function. How is that so different from `let!` only being available in a computation expression?
168.
▲
by
sparkie
2y ago
Japanese is consistent about the verb (or adjective, adverb) coming last in the clause/sentence (besides certain sentence-ending particles). There are no "particles" necessary on verbs because they're always in the right
169.
▲
by
sparkie
2y ago
Not strict, but there is underlying structure. It's not really practical, but it is interesting to compare it structurally to programming languages. A verb (or verbal adjective) basically forms the "root" of a clause, and typ
170.
▲
by
sparkie
2y ago
No. Japanese is very context sensitive, and like any natural language, has ambiguities. Japanese is loaded with dajare (puns). Grammar checking basically needs AI - you need to train some model to understand common phrases and sentence st
171.
▲
by
sparkie
2y ago
Gradual typing is static typing augmented with a known static type `dynamic`, and some rules by which conversions to/from `dynamic` are statically checked, called consistency. A program in a gradually typed language which does not use
172.
▲
by
sparkie
2y ago
> I don’t understand why… Because dynamic typing has its own advantages, which are worthy of experimentation even if you perceive absence of static typing as a weakness. Gradual typing can offer us the benefits of both worlds. > infer
173.
▲
by
sparkie
2y ago
The use case would be where the arguments are expected to be filled in by the function - ie, as additional return types. Consider if we have `A <= B <= C`, and a function: int Copy([out] Array<B> dest, [in] Array<B>
174.
▲
by
sparkie
2y ago
`String => Cat` and `String => Animal` are the types of the functions themselves - not the arg and return types. If we consider inside the function: foo : arg:String => result:Animal foo = ;; arg <: String
175.
▲
by
sparkie
2y ago
> How did you resolve all this? When I implemented Kernel, this was one of my big sticking points as to whether environments were only copy-on-write or genuinely mutable. I must have read the Kernel report several dozen times, implemente
176.
▲
by
sparkie
2y ago
> One interesting bit that remains unappreciated about Kernel is that environments are reified and are "copy-on-write". So, if you make an environment change, it propagates forward but previous calls only see the previous envir
177.
▲
by
sparkie
2y ago
To the best of my knowledge, seL4 is not AVX-512 aware. The AVX-512 state is not saved or restored on a context switch, which is clearly going to impact efficiency. At present there's 16x64-bits of register state saved (128B), but if w
178.
▲
by
sparkie
2y ago
You would need first-class functions (closures). This might work for the example you've given where we pass in a string - a non-linear value. However, consider the case where we might partially apply a linear value - the value will be
179.
▲
by
sparkie
2y ago
The same technique is also done with uniqueness types , which Clean[1] implements. They look very similar on the surface and are sometimes confused. The paper Linearity and Uniqueness: An Entente Cordiale[2] goes into depth on the differen
180.
▲
by
sparkie
2y ago
Linear types can only really be used in a single-threaded manner. If multiple threads could access the same linear value, you would lose all compile time linearity guarantees, since it's out of your control in which order the threads w
More ›