Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gsg
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
gsg
9y ago
"Modern Compiler Implementation" isn't too bad, but it is a general purpose introductory compiler text rather than being dedicated to functional languages. It does briefly touch on subjects like closure conversion and type in
32.
▲
by
gsg
9y ago
Itanium did have features for various kinds of speculation, though. You could load from an address even if it were potentially aliased with a subsequent store, with the processor doing a dynamic check to make sure the right value was observ
33.
▲
by
gsg
9y ago
In general you can't drop the contents of the arena on the floor in a GCed language, since you might have been wrong about those objects being short-lived (or because they are short lived, but they were allocated shortly before the y
34.
▲
by
gsg
9y ago
I remember reading it a number of years ago. It's true that it may have been updated since then, although my guess would be that it has not.
35.
▲
by
gsg
9y ago
This is about a decade old, I think. With a substantial optimisation suite added to ocamlopt since, some of it will be out of date. The advice on inlining in particular is obsolete.
36.
▲
by
gsg
9y ago
Very understandable, type classes + inference + monads + do notation is quite a stack of unfamiliar machinery to understand all at once. The return type is inferred, and the type is what the type class machinery is driven by. You can get so
37.
▲
by
gsg
9y ago
return isn't syntax, it's a normal function of type Monad m => a -> m a. The "sniffing" that you are talking about is that overloading is done on the return type. Why does it exist at all? Speaking loosely, monads
38.
▲
by
gsg
9y ago
You might be interested in http://blog.racket-lang.org/2017/04/type-tailoring.html , which argues for customised type checking.
39.
▲
by
gsg
9y ago
Use Int64.t?
40.
▲
by
gsg
10y ago
The Common Lisp answer is 0.3 and not 0.30000000000000004 because those are single float literals: for double float literals, we have (+ 0.1d0 0.2d0) => 0.30000000000000004d0. I would imagine this is the case for several of the other exa
41.
▲
by
gsg
10y ago
There are some tools aimed roughly in this direction, such as https://github.com/TrustInSoft/tis-interpreter . A major difficulty here is that undefined behaviour is a property of a particular execution of a C program,
42.
▲
Essentials of Compilation – compiling Racket [pdf]
(jeapostrophe.github.io)
3 points
by
gsg
10y ago
|
0 comments
43.
▲
by
gsg
10y ago
x86-64 vector compare instructions (mostly) produce masks, which are vector-sized values containing 1 for each bit of the input for which the comparison is true, and 0 where it is false. Since a vector analogue of x == x would be true every
44.
▲
by
gsg
10y ago
What you want is just a few lines up: 1652 If an object that has automatic storage duration is not initialized explicitly, its value is indeterminate. (x is an 'auto' variable in the given program.)
45.
▲
by
gsg
10y ago
In general it's impossible. Consider this C program: void do_something(int *); int f() { int x; do_something(&x); return x; } Is the return of x a use of initialized memory? Maybe. Relink t
46.
▲
by
gsg
10y ago
The idea was that the syntax for declaring a data type mirrors the syntax for using that datatype. See https://www.bell-labs.com/usr/dmr/www/chist.pdf for Ritchie's own comments. It was not a successful
47.
▲
by
gsg
10y ago
That's one possible design, but it's common to use a constant pool. Placing constants in the instruction stream is possible but awkward, since there is no guarantee that they are either aligned or of the right endianness (assumin
48.
▲
Generational Garbage Collection, Write Barriers and Userfaultfd(2)
(medium.com)
3 points
by
gsg
10y ago
|
0 comments
49.
▲
by
gsg
10y ago
From http://v8project.blogspot.com.au/2016/07/v8-at-blinkon-6-con... , at which there are a few more videos.
50.
▲
Ignition – an interpreter for V8 [video]
(youtube.com)
1 points
by
gsg
10y ago
|
1 comments
51.
▲
by
gsg
10y ago
And if you want to go weirder, implicit int means that you can leave out the `int`: typedef x; Even "better", C declarators can be empty in order to allow for struct/enum declarations that do not list any variables.
52.
▲
by
gsg
10y ago
This reminds me of an irritating problem in CPS based compilers where you can have a transformation that is obvious and legal except that after the transformation one of the relevant variables would not be in scope. The solution(s) are to d
53.
▲
by
gsg
10y ago
It's the basis of efficient relocations in position independent code, which is now very common. PIC can be emitted on older x86 machines without RIP-relative addressing, but the code is larger and slower. As an example, consider -m32 g
54.
▲
by
gsg
11y ago
Perhaps MinCaml: http://esumii.github.io/min-caml/index-e.html
55.
▲
by
gsg
11y ago
SML? Pascal? Edit: I was really referring to language families, so including things like OCaml, Modula, etc.
56.
▲
by
gsg
11y ago
Specialising LLVM for dynamic compilation might well come at the expense of LLVM's strengths as an AoT compiler, and it would probably not be easy in any case. In addition to that, dedicated implementations can take various shortcuts t
57.
▲
by
gsg
11y ago
Weird that it doesn't propagate the constant such that both functions are closed - maybe with a higher optimisation level.
58.
▲
by
gsg
11y ago
> Note that for well-known procedures, all variables that are free in the lambda are also free in the caller I don't think this is right, unless given an unnecessarily strict definition of `well-known`. A contrived counterexample:
59.
▲
by
gsg
11y ago
It isn't stable.
60.
▲
by
gsg
11y ago
You could try to split the difference by using a wrapper around malloc that zeroes in production and doesn't under testing. Of course, running significantly different code in production and test has its own issues.
More ›