Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sparkie
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
181.
▲
by
sparkie
2y ago
A function like `closeFile` will consume the linear value but not produce a new linear value - it returns `Unit`. It does this via a destructuring assignment (For example, File would be a record type with a field named handle). functi
182.
▲
by
sparkie
2y ago
Every _BitInt(N) is a subtype of _BitInt(N+1). For practical purposes though, you'd usually make each intN a subtype of intN*2, up to some top integer type which supports arbitrary precision. int8 <= int16 <= int32 <= in
183.
▲
by
sparkie
2y ago
One possible trick for unions is to use bloom filters, providing you have some way of hashing types. If you create a bloom filter `Bloom(t1, t2)`, it's the same as doing `Bloom(t1) | Bloom(t2)`, where `|` is just bitwise-OR. Obviously
184.
▲
by
sparkie
2y ago
I'd recommend using goblint ( https://github.com/goblint ) as a starting point, rather than Clang.
185.
▲
by
sparkie
2y ago
The Apache or MIT license would permit you to continue using it for all versions up to the last commit which used that license. Any later commits under a different license would not be Apache licensed and you would need to follow the new
186.
▲
by
sparkie
2y ago
The problem with existing attempts to fix C, like Cyclone, are they're creating a new language, but what we really want is C, with improvements. The approach should not be to make a new language, but to augment C with optional new fe
187.
▲
by
sparkie
2y ago
GCC and Clang both provide `_readfsbase_u64()`, which presumably is just a wrapper around `__asm__("rdfsbase %0" : "=r"(result))`. Also gcc lets you define variables like `int__seg_fs *foo;`if the `__SEG_FS` preprocessor
188.
▲
by
sparkie
2y ago
What's wrong with a generated parser?
189.
▲
by
sparkie
2y ago
A capability is basically a reference which both designates some resource to be accessed and provides the authority to access it. The authority is not held somewhere else like an Access Control List - the reference is the authority. Cap
190.
▲
by
sparkie
2y ago
> But you use capabilities all the time... operating system users work that way. Most operating systems don't have proper capabilities - they use things like ACLS, RBAC, MAC, etc for permissions. The golden rule of capabilities is t
191.
▲
by
sparkie
2y ago
Don't forget about the `prog*` family. --- (prog1 foo bar*) Evaluates foo, then bar(s), and returns the result of evaluating foo and discards the results of bar(s). Useful if `foo` is the condition and you need to perform some
192.
▲
by
sparkie
2y ago
nd nglsh spkrs cn ndrstnd nglsh wtht wrttn vwls. Easy to understand for a fluent speaker, but a learner might struggle. We saw back when we had keypad phones, the youth would write "txt" speak because it was faster to type with 10
193.
▲
by
sparkie
2y ago
> I'm sure people have tried to come up with something, somewhere. Perhaps related is the abjad used in Arabic and Farsi. Vowels are written with diacritics above or below the main part of the character, which represents a consonant
194.
▲
by
sparkie
2y ago
The keyword there is responsibility . It's a reasonable approach - taking some workload off government immigration bodies to speed up the process, and it saves the taxpayer money because the costs of background checks would fall on th
195.
▲
by
sparkie
2y ago
It's possible if the proposal is accepted into legislation. Any sovereign nation can decide its own immigration rules. Other countries have similar programmes to attract top talent. Most likely this kind of work permit will be limited
196.
▲
by
sparkie
2y ago
More time spent filing patents than implementation.
197.
▲
by
sparkie
2y ago
Inflation is not due to the war in Ukraine, but is due to bad management of COVID and excessive money creation. It may be exacerbated by the war, but that is certainly not the cause. The same is of course true for the 1970s because we know
198.
▲
by
sparkie
2y ago
RISC-V is an ISA. There are many processors for it - some open and some proprietary. An ISA alone doesn't make a fully open processor. You still need buses, which are often proprietary. Even many of the open source RV processors are us
199.
▲
by
sparkie
2y ago
Inflation was caused by lockdowns and the excessive money creation that happened during that time and nothing else. In Britain, they're still trying to blame Brexit for inflation, despite every other nation that wasn't involved in
200.
▲
by
sparkie
2y ago
So you want to blame a Prime Minister who came to power in 1979 for something that very clearly started during the previous Labour government throughout the 1970s, and just continued afterwards? Seems to be missing a few details about the s
201.
▲
by
sparkie
2y ago
> If I write a parser combinator based parser for a grammar that is not ambiguous How do you even know it is not ambiguous to begin with? I already said it doesn't matter what tool you use to parse a language designed by someone els
202.
▲
by
sparkie
2y ago
Yes, but I've never actually seen this done in practice. For starters, it kind of requires a multi-stage compilation process - because you must verify and prove non-ambiguity before or during compilation of the application using the
203.
▲
by
sparkie
2y ago
The advice to "use CFGs" is incomplete. What you really want is to use one of the deterministic subsets of CFGs, like LR( k ), and importantly, with a parser-generator which will reject any non-LR productions in the grammar before
204.
▲
by
sparkie
2y ago
It's difficult to conclude meaningfully that any one is more expressive than the other. They parse different languages, though there is a large subset of PEGs which are also CFGs, they're not a proper superset - there are things y
205.
▲
by
sparkie
2y ago
The problem is if you pass an offset which the user has not yet input to, you're either going to have to abort or return an error of some kind. If the user inputs to this location later, and you read from it, you've broke referent
206.
▲
by
sparkie
2y ago
I think it's semi-novel as I have not seen a queue exactly like this, but the structure of the queue itself is not novel - it closely resembles Brodnik et al's RAOTS[1], which also uses an array of pointers to other arrays which i
207.
▲
by
sparkie
2y ago
Yeah, we can consider `string`, `int` to both be subtypes of `string | int`, and `string & int` to be a subtype of both `string`, `int`. There are some problems with doing so though, such as inferring the types, but this can be mostly m
208.
▲
by
sparkie
2y ago
I personally think these effect systems are trying to solve the wrong problem. What we really want is capabilities [1], and the means of enforcing them, which I suspect is best done with linear types and uniqueness types. Granule[2] is cer
209.
▲
by
sparkie
2y ago
Perfectly reasonable question. Basically, you can consider it a NOP if there's no observable side-effect. Obviously, stdout has a particular purpose and you wouldn't just disable the side-effect for one use case, but you could i
210.
▲
by
sparkie
2y ago
One example is to cause a fairly predictable delay in embedded microcontrollers for bit-banging[1] digital signals. If we know the clock frequency and the cycle cost of a certain instruction (say, add or nop), we can specify how many times
More ›