Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gsg
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
91.
▲
by
gsg
11y ago
Yes. Various parts of the stdlib are intended to be used by catching Not_found or End_of_file or whichever exception happens to be relevant. It's not what I would have done. (Mark text as code by putting it on a fresh line with two or
92.
▲
by
gsg
11y ago
Oops, breaks on empty files. I should have matched on the input_line chan in sum_channel to catch End_of_file - damn exceptions. print_string should also be print_endline to match the original.
93.
▲
by
gsg
11y ago
Hmm, the OCaml could be a lot shorter: let rec fold_channel f acc chan = match input_line chan with | line -> fold_channel f (f line acc) chan | exception End_of_file -> acc let comma = Str.regexp ",&
94.
▲
by
gsg
11y ago
"Race to sleep" is a well known power saving strategy. > This of course ignores leakage You can't ignore leakage. The ability of a chip to turn off currently unused silicon is crucial to power management on modern devices.
95.
▲
by
gsg
11y ago
The large volume of -O0 code is just a result of skipping register allocation to save compilation time. There's no problem here.
96.
▲
by
gsg
11y ago
That's nothing compared to the -O0 crud that the GP was complaining about. It's also not a problem with the field of compiler design, but a (probably temporary) weakness in gcc. (It is an interesting anecdote though.)
97.
▲
by
gsg
11y ago
SBCL will emit (rather verbose) annotations if you ask it to optimize.
98.
▲
by
gsg
11y ago
It's quite funny to hear somebody call for the reinvention of a field based on the quality of -O0 code. Just get over yourself and pass -Os.
99.
▲
by
gsg
12y ago
Except in leaf functions, where the win materializes. Leaf functions are a healthy fraction of calls, counting dynamically, so passing args in registers is a good idea. It's true that the benefit isn't enormous.
100.
▲
by
gsg
12y ago
Wow, that's quite the misrepresentation. I can imagine it left a bad taste in the mouth. Did you get the impression this was a deliberate strategy, or just an oversight?
101.
▲
by
gsg
12y ago
Yeah, that gives something of the flavour. (I was thinking of the record encoding at http://www.lexifi.com/blog/dynamic-types , myself.)
102.
▲
by
gsg
12y ago
I've come to think that these toy interpreter examples are a bit questionable unless they contain a variadic structure like an arbitrary tuple - they give the impression that programming with GADTs is simpler than it really is.
103.
▲
by
gsg
12y ago
For mutable data - text or rodata pages sharing the same addresses should be fine (if I understand the scheme correctly).
104.
▲
by
gsg
12y ago
Interesting that it doesn't mention CDR-coding - I guess that's considered competitive only with hardware support. There's been some work by Appel on trying to improve performance by unrolling (in his case, immutable) cons li
105.
▲
Machine Learning for Programming – Peter Norvig
(infoq.com)
187 points
by
gsg
12y ago
|
22 comments
106.
▲
by
gsg
12y ago
Register machines have no particular problems with cache due to random access. The typical arrangement is that there are instructions that allocate and deallocate a block of N contiguous slots from a stack, and "registers" refer t
107.
▲
by
gsg
12y ago
> instruction stream density can be puffed up if we don't have a getvar instruction that takes an immediate operand, but only a register pair It's hard to imagine this being a concern. If you are in a position to choose whether
108.
▲
by
gsg
12y ago
Fast, restrictive and secure have been done before - see ATS, Cyclone, etc. Almost everybody ignored those trailblazing efforts, probably because those languages are very intimidating.
109.
▲
by
gsg
12y ago
I would be surprised if block versioning didn't eliminate more type tests (counting dynamically) than a conservative analysis that takes the program graph as-is. Code duplication inherently provides more opportunities to specialise, wh
110.
▲
by
gsg
12y ago
Good article, nice and meaty. mov 0xc(%r12,%r11,8),%eax Interesting choice, won't this be a so-called "slow lea" on recent Intel hardware?
111.
▲
by
gsg
12y ago
There are schemes to "unroll" conses, too. CDR-coding, Appel's paper (although IIRC that requires immutable conses), etc.
112.
▲
by
gsg
12y ago
In C, == simply produces a numeric value (0 or 1). There's nothing "weird" about the subsequent operation of & on those values. There's no effects to make short-circuiting a problem, either - on the contrary, it is l
113.
▲
by
gsg
12y ago
Caching length doesn't really make sense for persistent lists, as you would have to have one field for each cons. That's a considerable overhead.
114.
▲
by
gsg
12y ago
Hah! That big one has SIMPLE written on it, but is ten times the size of the others! Thanks for the history bomb.
115.
▲
by
gsg
12y ago
Considering Walker is described as a heavy patent holder, I'm not sure his enthusiasm for the wonders of patents are entirely objective. Is he concerned here with informing his audience or the value of his holdings? > it will be aim
116.
▲
by
gsg
12y ago
The hardware implementations often have problems: http://randomascii.wordpress.com/2014/10/09/intel-underestim...
117.
▲
by
gsg
12y ago
More info at http://www.chrisseaton.com/rubytruffle/deoptimizing/
118.
▲
Deoptimizing Ruby
(confreaks.com)
4 points
by
gsg
12y ago
|
1 comments
119.
▲
by
gsg
12y ago
At load time. gcc's approach is to substitute an entry in the PLT, the CPU dispatch logic being run at that time to select the contents of the entry.
120.
▲
by
gsg
12y ago
How exactly can the same object (not a copy) be an element of two non-intrusive lists?
More ›