Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Peaker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
36 ms
·
331.
▲
by
Peaker
12y ago
So basically the #include granularity is extremely coarse, because otherwise it is unmanageable. I think it is nicer to have quite specific #include's: #include <stdbool.h> #include <stdarg.h> #include "hash_ta
332.
▲
by
Peaker
12y ago
Yes, at least a few of the Ten Commandments from God are ridiculous. What's your point?
333.
▲
by
Peaker
12y ago
> Simple rule: include files should never include include files. If instead they state (in comments or implicitly) what files they need to have included first, the problem of deciding which files to include is pushed to the user (progr
334.
▲
by
Peaker
12y ago
A homogenous list is guaranteed to only have one instance unless you enable incoherent instances (a known bad extension) or confuse the compiler with orphan instances (though I've never encountered this and think it should be detectabl
335.
▲
by
Peaker
12y ago
That's great! Don't expect to "pick up the language" in an evening :) Haskell takes a few evenings at the very least!
336.
▲
by
Peaker
12y ago
You can define a mutable std::sort like function in Haskell: mutableSort :: (MArray arr elem m, Ord elem, Ix ix) => arr ix elem -> m () This can work on mutable arrays in the IO, ST, or other mutable-array supporting monads. It
337.
▲
by
Peaker
12y ago
The advantage you mention is one of many (over OOP interfaces), I'll repeat it as (A). (A) Ability to instantiate old types with new classes (B) Conditional instantiation: "Maybe a" is an instance of "Show" iff &quo
338.
▲
by
Peaker
12y ago
A GCed language requires good stack escape analysis. Unless you expose it to the programmer for at least semi-manual MM, it is bound to have false negatives, where you pay for the allocation on the heap unnecessarily. I totally agree about
339.
▲
by
Peaker
12y ago
malloc/free suck. They are strawmen for manual memory management though, because the vast majority of manual memory management (when done carefully) avoid malloc/free. Instead, you embed allocations within each other when possible
340.
▲
by
Peaker
12y ago
There are two independent problems here. Problem A: foo.c: #include "bar_auto.h" when you have a rule "%_auto.h: %_auto.xml". gcc -M on foo.c will not tell you about the dependence on "bar_auto.h", but will rat
341.
▲
by
Peaker
12y ago
If you avoid stop-the-world, you solve one of the major GC problems, but not all of them. The need to repeatedly traverse all reachable pointers (even if relatively rarely) is still noticeably more expensive than never having to.
342.
▲
by
Peaker
12y ago
Lots of GC vs Manual MM do a disservice to manual MM, by comparing GC to a strawman with lots of malloc/free. IME, manual MM often embeds allocations within each other and/or places allocation on the stack. Both of these options m
343.
▲
by
Peaker
12y ago
I was a bit surprised by the reverse: let x = 5 let mut y = &x If I understood correctly, x is immutable, but can still be mutated via (*y)?
344.
▲
by
Peaker
12y ago
I'm not talking about autotools :) I've always avoided autoconf/et-al. I'm talking about make-based builds not being able to use gcc -M properly, because it doesn't work when header files need to be generated due to
345.
▲
by
Peaker
12y ago
Template Haskell does support looking up the namespace in the same file.
346.
▲
by
Peaker
12y ago
A) Usually, there's a rule like: auto_%.h from %.xml Then you want #include "auto_foo.h" to be found, and cause auto_foo.h to be auto-generated from foo.xml, without explicitly mentioning "foo.xml" anywhere in th
347.
▲
by
Peaker
12y ago
One thing almost nobody knows about gcc -M is that it is wrong :( And for 2 different reasons: A) If the headers are supposed to be auto-generated, it will uninformatively fail B) If everything is successful, it will not tell you about all
348.
▲
by
Peaker
12y ago
That case is the easy case (though caching of included files is problematic in most build systems due to inability to express dependency on the inexistence of the included name in a previous include directory). The hard case is changing def
349.
▲
by
Peaker
12y ago
This is a rebuild, though. You can distinguish the preprocessing phase into its own build step and then you'd just preprocess everything. You could even try to cache which macros are relevant to which headers/files.
350.
▲
by
Peaker
12y ago
If nothing needs to be built, my statement still stands. The build system needs to cache its dependency computations. Empty build would be same time as git status.
351.
▲
by
Peaker
12y ago
If "git status" is empty, and takes milliseconds to know that -- "make" should take roughly the same amount of time to know the same. There are some better build systems which will fulfill this requirement, but fail othe
352.
▲
by
Peaker
12y ago
How is a common change (updating a function signature) easily causing cryptic bugs rather than a visible compile-time or run-time error an issue? Bugs are bad?
353.
▲
by
Peaker
12y ago
Call a function "foo" that expects 3 arguments with 5 or 2 arguments, instead. Javascript will gladly accept that and not yield any error, not just at compile-time, but even at run-time! Unless the function explicitly checks that
354.
▲
by
Peaker
12y ago
IMO the biggest problem, even worse than type coercions, is the error silencing regarding wrong argument counts. This can easily hide so many bugs, it's amazing it is acceptable to anyone.
355.
▲
by
Peaker
12y ago
I use file system hooks to autodetect dependencies, so it should always work as long as the file system is the input of the build and not other channels. Explicit input specifications are virtually never correct. #include scanners for examp
356.
▲
by
Peaker
12y ago
The male connector wears out, I think. But maybe it's the wire side of the male connector, I've never thoroughly tested, just played with the angles till it charged.
357.
▲
by
Peaker
12y ago
The cables die because of the connector. You can toy with the connector and it does work in some angles after it breaks, most of the time.
358.
▲
by
Peaker
12y ago
Or you bump an API version. And the fixes are gradual everywhere.
359.
▲
by
Peaker
12y ago
Micro-USB has been terrible, reliability wise. The ports survive pretty well, but cables wear out at an unacceptable pace. I buy stocks upon stocks of micro USB cables, and I've switched to wireless charging, because I simply keep runn
360.
▲
by
Peaker
12y ago
It could use git-annex[1]? [1] https://git-annex.branchable.com/
More ›