Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gsg
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
gsg
5y ago
This works until the analogue of monotremes shows up to ruin your supposedly flawless categorisation.
2.
▲
by
gsg
5y ago
System F doesn't have general recursion. Extensions with a letrec-like construct are common, and are sometimes inaccurately called 'System F', but those languages do not have the properties of System F.
3.
▲
by
gsg
5y ago
There are some examples, for example Crowbar is an OCaml tool that uses AFL to drive property based tests.
4.
▲
by
gsg
6y ago
chrisseaton is talking about the bump-pointer allocator in a modern GC, not an implementation of malloc/free. The performance characteristics are quite different. In a generational copying system an object that is bump allocated and th
5.
▲
by
gsg
6y ago
Yes, this has been done a few times. CDR-coding was a hardware-assisted method of unrolling a Lisp list (complicated somewhat by the need to support mutation of car and cdr) that appeared on Lisp machines, and there's a Appel/Repp
6.
▲
by
gsg
6y ago
You can easily see by searching for 'kmalloc' (or 'malloc') at https://github.com/torvalds/linux/blob/master/include/linux/... that it does no such thing. Here's the lo
7.
▲
by
gsg
6y ago
BOUND is pretty slow, and requires an odd start/end pair to be placed in memory. I don't see any reason that it would be better than the usual unsigned comparison + branch that languages with bounds checking tend to use. Besides,
8.
▲
by
gsg
6y ago
Sure, but that didn't change much between x86 and x86-64. Perhaps it got a little worse because the SIMD instructions aren't overflow check friendly.
9.
▲
by
gsg
6y ago
That still exists though? add rax, rbx/jo overflow_error is how you do overflow checking on x86-64.
10.
▲
by
gsg
6y ago
> As far as I understand it, this limitation is also the only thing preventing tail-call elimination in C/C++. That is not the case. Guaranteed TCE requires deallocating the stack frame before jumping to the target, but that is not
11.
▲
by
gsg
6y ago
Interesting if somewhat opaque. I'm familiar with defunctionalisation as an alternative to closure conversion in whole program compilers and as a description of how data types are derived from the lambda calculus - never seen a categor
12.
▲
by
gsg
8y ago
Lambda lifting is an alternative to closure conversion, so it doesn't get rid of closures so much as obviate introducing them at all. The two transformations are fairly closely related, actually. You can view lambda lifting as closur
13.
▲
by
gsg
8y ago
My guess would be that they were thinking h <= SIZE_MAX / w, and added the most obvious logic to avoid a division by zero.
14.
▲
by
gsg
8y ago
Monomorphising doesn't work for rank-n polymorphism, either. (This is mentioned on the page.)
15.
▲
by
gsg
8y ago
A bunch of languages have something much like .let/.apply already, since it's pretty much just function application in reverse order: "foo" |> String.length |-> printf "%d\n" |> fun x -> x + 1
16.
▲
by
gsg
9y ago
This is nonsense. Modern compilers don't work by generating the results you see with -O0 and then optimising; the poor quality of -O0 code is the result of skipping register allocation. > Dataflow-directed, "work backwards"
17.
▲
by
gsg
9y ago
First, deriving is just pointer arithmetic and doesn't copy anything. Second, standard flat closure representations already involve copying parts of environments, with any sharing problems addressed by assignment conversion (turning va
18.
▲
by
gsg
9y ago
Mutually recursive functions can be closure converted without cycles by deriving closure values from each other rather than storing them in each other.
19.
▲
by
gsg
9y ago
I see. It seems like that would still make calling supporting routines annoyingly expensive, but perhaps that (and the extra tag memory) doesn't matter as much as I think it does. Good luck with the project.
20.
▲
by
gsg
9y ago
How do you pass arguments? In two registers? On the stack?
21.
▲
by
gsg
9y ago
There's a decent textbook written in the incremental style argued for by the author: Essentials of Compilation. It features compilers for seven languages, written in Racket, each with successively more advanced features. https:/&
22.
▲
by
gsg
9y ago
My complaint with |> is that it makes code with nesting look quite different based on argument position. Argument position is not a very interesting property, so it doesn't seem right for it to be influencing the shape of code in th
23.
▲
by
gsg
9y ago
> some random OO language on Amiga that I've never really been able to track down Maybe Amiga E? http://strlen.com/amiga-e/
24.
▲
by
gsg
9y ago
So... the only way to stop a bad guy with a GAN is a good guy with a GAN?
25.
▲
by
gsg
9y ago
Because S <: S in most (all?) type systems with subtyping.
26.
▲
by
gsg
9y ago
You're right: it should be pushq $1/pop %rax (which is also three bytes, although there will be a prefix byte for registers r8 through r15).
27.
▲
by
gsg
9y ago
Those compilers use CPS as an intermediate language - a bit like SSA form for functional languages - which is (mostly) independent of supporting first class continuations. Support for first class continuations is a matter of tradeoffs. It&#
28.
▲
by
gsg
9y ago
push $1/pop %eax (6a 01 58) is shorter, but perhaps not the best idea.
29.
▲
by
gsg
9y ago
Immediates are a bit of a mix. mov doesn't have very nice encodings, but many instructions do: push $1 is 2 bytes, addl $2, %eax is only 3 bytes. There's no question that x86-64 could be improved on in terms of code density.
30.
▲
by
gsg
9y ago
You might find http://esumii.github.io/min-caml/index-e.html interesting. While not as well-presented as munificent's current effort, it does present a working functional language compiler as a tutorial.
More ›