Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gsg
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
27 ms
·
211.
▲
by
gsg
13y ago
If you accept the modern notion of types as proofs, dynamic languages are correctly described as untyped since they prove nothing about the code they run. Unfortunately the term "type" is also used to refer to the tags dynamic languages put
212.
▲
by
gsg
13y ago
He's thinking of C, which allows all kinds of dumb crap in declarations. const typedef; is my favourite.
213.
▲
by
gsg
13y ago
Is this really type safe? Does anything prevent the address of a member being taken, followed by an assignment to a member of different type (destroying the validity of the pointer)? You can make tagged unions type safe if you eliminate sto
214.
▲
by
gsg
13y ago
A++ is a grade, not a number. Clearly what you need is #S(grade :letter A :decorations (+ +) :rapidly-escalating-pedantry t) or some other meaningful representation.
215.
▲
by
gsg
13y ago
Trees don't have to have terrible locality. There are a number of tricks to encode parts of the tree structure into nice flat blocks. (This can involve some memory overhead, which may or may not be offset by the space saved on pointers depe
216.
▲
by
gsg
13y ago
The space taken by an adjacency matrix doesn't depend on edge count. That's why it is usually the favoured representation for dense graphs.
217.
▲
by
gsg
13y ago
Hmm, ok. Intel recommend avoiding it pretty strongly: I guess they overstate their case. One cycle in (and one out?) isn't exactly crushing.
218.
▲
by
gsg
13y ago
On modern x86 hardware, integer instructions that act on float values in xmm registers (and vice versa) require a somewhat expensive change of execution domain. That the register names are the same is irrelevant: everything will be renamed
219.
▲
by
gsg
13y ago
The difference between abstraction bindings and let bindings is that let variables are only ever bound to the value of a single expression, whereas the argument of a function may be bound to the value of any number of expressions. This caus
220.
▲
by
gsg
14y ago
Most of the STL data structures guarantee stable element addresses, completely precluding any kind of cache-friendly rearrangement. They also require fast stable iterators that are cheap to pass by value, constraining the implementation fur
221.
▲
by
gsg
14y ago
x86 has encodings for shifts by 1 that are two bytes, so there's no code size advantage.
222.
▲
by
gsg
14y ago
Just for fun I took a crack at the maze problem and ended up with a (quasi-)linear time union-find solution. Maybe I over-engineered, but I'm very impressed if schoolkids are really learning about algorithms like that.
223.
▲
by
gsg
14y ago
Stalin compiles a subset of Scheme.
224.
▲
by
gsg
14y ago
So it does. I didn't know gcc attributes included that kind of thing. I've really gotta dig though the manual some time.
225.
▲
by
gsg
14y ago
It won't execute though: [23] .got.plt PROGBITS 0804954c 00054c 000014 04 WA 0 0 4 [24] .data PROGBITS 08049560 000560 000010 00 WA 0 0 4 <--- [25] .bss NOBITS
226.
▲
by
gsg
14y ago
He's clearly a dualist and objects to Kurzweil's reductionist views. As I see it this isn't a book review in good faith so much as an excuse to air McGill's opinions on the matter. Consider this phrase: > The belief that London is rainy
227.
▲
by
gsg
14y ago
I ran into a similar bug fiddling with home and end. Repro: Delete the intro text, type 'wat'. Hit 'home'. Hit 'delete' three times. Observe breakage.
228.
▲
by
gsg
14y ago
Yes, but it is still a dependency. By which I mean the software won't run if you don't supply the necessary thing at resolution time (which is possibly quite late: well into runtime, if you are on a system with lazy linking). Go (and some o
229.
▲
by
gsg
14y ago
Compilation units can rely on each other through forward declarations, so the dependency graph is not acyclic. Header exclusion does form a DAG within a compilation unit, I guess.
230.
▲
by
gsg
14y ago
You mean address space. The OS can and will reclaim all the memory it likes, when it likes. Pages that are mapped but are left untouched for a long time aren't problematic in modern systems. There is a small cost for the PTE but nothting li
231.
▲
by
gsg
14y ago
Iterator stability means iterators that point into a container are not invalidated by operations (such as insertions or deletions) on that container. Address stability means that addresses of elements are not changed by container operations
232.
▲
by
gsg
14y ago
Control over the program counter allows return-into-libc or other ROP attacks.
233.
▲
by
gsg
14y ago
Of the three solutions, minBy is the only one likely to handle the empty sequence/database case at all gracefully. Returning a fake "zero" is particularly awful. It probably doesn't matter much since it's a throwaway problem and the databas
234.
▲
by
gsg
14y ago
The STL guarantees both iterator and address stability for the elements of a set, map, or the unordered variants. Those guarantees can't be provided by many more compact representations. Note that this rules out more than just B-trees: open
235.
▲
by
gsg
14y ago
There's more at http://gcc.gnu.org/wiki/GENERIC : my purpose was more to point out that an interface exists than to pinpoint the exact documents for you.
236.
▲
by
gsg
14y ago
Hmm? Front ends emit GENERIC, which is detailed at http://gcc.gnu.org/wiki/GenericAPI . I don't see what this has to do with RMS or plugins.
237.
▲
by
gsg
14y ago
Are you suggesting that C++11 support would be implemented as a plugin , rather than by modifying the existing C++ front end? I'm not sure how seriously to take that.
238.
▲
by
gsg
14y ago
Hmm, I read it at least partly as a riff on the idea of composition: the day is won by designing components with desirable properties out of lesser components which lack them. The parallel to programming seems obvious. Your reading works to
239.
▲
by
gsg
14y ago
Yes, and I think that's why I like this parable so much. The contrast between the elegance of the solution and the futility of the enterprise as a whole is striking.
240.
▲
A Parable
(cs.virginia.edu)
171 points
by
gsg
14y ago
|
77 comments
More ›