Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sparkie
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
24 ms
·
241.
▲
by
sparkie
3y ago
F# can also be interpreted
242.
▲
by
sparkie
3y ago
You don't need to keep the lists, just keep a Bloom filter of sufficient size to keep false positives low.
243.
▲
by
sparkie
3y ago
So they're unboxed in certain situations, but otherwise boxed. With NaN-boxing you would do this for Int64s. They would need boxing when you need a single value, but you can have one or more tags for vectors of them, in which case the
244.
▲
by
sparkie
3y ago
According to https://v2.ocaml.org/manual/intfc.html#s%3Ac-value , a 64-bit word is either an integer or pointer. Doubles are heap allocated with pointers represented by a Double_tag or Double_array_tag. It should be obv
245.
▲
by
sparkie
3y ago
What is also lost: Efficient 64-bit FP arithmetic, because your boxing format can't support 64-bit floats as values. You either stick with 32-bit floats or have additional dereferencing for 64-bit floats. This is why I prefer the NaN-b
246.
▲
by
sparkie
3y ago
Create your own haiku, never publish it. What are the odds of someone creating exactly the same haiku?
247.
▲
by
sparkie
3y ago
Required ordering encourages you to organize your code to form an almost directed acyclic graph by minimizing cyclic dependencies between types/functions. The only way you can have the cyclic dependencies is to include them in the same
248.
▲
by
sparkie
3y ago
48-bit virtual addresses are the most common in use today. All AMD, ARM64 processors, and most of Intel's. Only recent Intel chips support PML5 (5-level paging), giving them 57-bits of virtual address space. There are no 64-bit process
249.
▲
by
sparkie
3y ago
seL4 is more interesting than Hurd's Mach kernel. Genode can use seL4 and several different microkernels and has more activity than Hurd.
250.
▲
by
sparkie
3y ago
The problem with monads is that they're a poor abstraction. Need to output: WriterMonad. Need input: ReaderMonad. Need to store something: StateMonad. Local mutation: MonadST. IO/global mutation: MonadIO. Transactions: MonadSTM. A
251.
▲
by
sparkie
3y ago
.NET is big for mobile app development, particularly when you include Unity. It's really one of the best solutions for writing Android + iOS apps, where you can share a significant amount of code and still have native-looking apps. You
252.
▲
by
sparkie
3y ago
You also want the subclasses to be `sealed`. Ideally you would want to write `abstract sealed` for `Discount` too, but C# does not allow it. CIL does support it however, and it is how F# implements sum types. There's no reason I see fo
253.
▲
by
sparkie
3y ago
It does, but I see it as a feature, not a bug. Please dontfix.
254.
▲
by
sparkie
3y ago
Also check out Avalonia.FuncUI: https://github.com/fsprojects/Avalonia.FuncUI
255.
▲
by
sparkie
3y ago
While some of the complaints in the article are reasonable, the author seems to miss that F# began as essentially "OCaml for .NET". It's syntax is ML derived and the .NETisms came later, which is why there's sometimes tw
256.
▲
by
sparkie
3y ago
Only takes a redditor to figure it out: https://www.reddit.com/r/space/comments/1515q3w/comment/js6w...
257.
▲
by
sparkie
3y ago
Prices drop.
258.
▲
by
sparkie
3y ago
Nobody actually uses M-expressions. Mathematica and Wolfram use something quite close, but Lisps are almost universally written in S-expressions. There are some alternative syntaxes like Sweet expression[1] (t-expression), but they've
259.
▲
by
sparkie
3y ago
In-place mutation in a functional language dates back as far as 1994, when it was introduced for Clean in the paper 'Guaranteeing safe destructive updates through a type system with uniqueness information for graphs'[1]. The FP2 p
260.
▲
by
sparkie
3y ago
See SHAPES[1] for a method of selecting data layout without sacrificing the abstraction programmers are typically used to having in OOP. The idea is that a "layout" is decoupled from the object that stores the data. Layouts are at
261.
▲
by
sparkie
3y ago
I seem to recall reading (though quite some time ago so I may be mistaken), that `yield` was developed for use in robotics as part of the CCR (Concurrency and Coordination Runtime), and it's inclusion in C# 2.0 was to support this.
262.
▲
by
sparkie
3y ago
I like the Model-View-Adapter[1] architecture, which is basically what you get by reversing the arrows between the View and ViewModel in MVVM. The view and model are oblivious to each other and to the adaptor directly (but interact with it
263.
▲
by
sparkie
3y ago
A big benefit comes from having branchless code. For example, if you have an if/else statement where the consequent acts on some elements of the vector and the antecedent acts on the others, you can perform them all with no branch, by
264.
▲
by
sparkie
3y ago
I doubt it would be much use as cryptographic operations tend to mainly use xor on two inputs. VPTERNLOGD basically works by constructing a truth table for 3 inputs. | A | B | C | R | 0 | 0 | 0 | x | 0 | 0 | 1 | x | 0 |
265.
▲
by
sparkie
3y ago
The thing this appears to be missing is the ability to capture the part of the stack between the try and hurl as a first-class value and reify it later, although the toss/return is not too dissimilar as toss does capture the stack and
266.
▲
by
sparkie
3y ago
Content-addressability means you don't need any infrastructure. You should be able to distribute code over IPFS for example. There is no need for a central repository of any kind. Anyone can ship their own version of a library or progr
267.
▲
by
sparkie
3y ago
It's more compact than UTF-8 because fewer bits are used for the encoding itself. There are 24 bits, and only 3 bits are used as part of the encoding, with the other 21 bits representing the code-point. (Precisely the number we need to
268.
▲
by
sparkie
3y ago
Codepoints themselves could technically all fit into 3 bytes (or 21 bits to be precise), but there is no standard 3-byte encoding. The highest Unicode codepoint is 0x10FFFF. An idea for a variable width encoding of 1 to 3 bytes: Read the MS
269.
▲
by
sparkie
3y ago
Once you get used to it, the overwhelming majority of cases you don't actually need to manually write recursive style functions - you start thinking in terms of `map`, `zip`, `unzip` `fold`, `unfold`, `scan`, `init`, `filter`, `take` a
270.
▲
by
sparkie
3y ago
These exist and are part of the fonts the article is talking about, though I've not seen it done for `==` because there's already a gap there. The ligatures for `==` in these fonts usually combine them to remove the space, but kee
More ›