Reputation
2,045
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
7 15
Newest
 Yearling
Impact
~66k people reached

1d
comment What happens if dependency repository is deleted on GitHub?
Forks are free. If it helps you sleep at night, do it.
Jul
26
comment What should JITed bytecode do exactly?
Another geezer data point: the DEC PDP-11 Fortran compiler from the 1970s also used a threaded interpreter. They might have done it for ease of implementation, but I strongly suspect that they wouldn't have done it if the performance was bad (and that was pre-cache, with a machine architecture that was flexible enough to run the processor backwards).
Jul
26
comment What should JITed bytecode do exactly?
@delnan - Forth is extremely cache friendly, so I would not be surprised at that claim. Whether you could write (and maintain) a Forth program that's equivalent to an arbitrary C program is another matter (caveat: it's been 30 years since I used Forth professionally, so take that comment with a grain of salt).
Jul
11
comment long (or bizarre) file paths
And as a general comment: why not just store on the heap. Perhaps as a linked-list structure where each node holds an arbitrary-length path component? Yeah, it's overkill for tiny pathnames, but I suspect that it won't be called so often that the overhead is noticeable.
Jul
11
comment long (or bizarre) file paths
One example that I've seen of excessively long paths are Scala (generated) classfile names. There are many Scala projects (including the compiler itself) that you can't build on eCryptfs (the default home-directory encryption on Linux), which has a 240 character pathname limit.
Jul
11
comment Why is heap size fixed on JVMs?
@Ben - yep, you're right. And my second sentence points out that there are alternatives. I don't, however, agree that a fixed-size heap is the wrong way to manage GC in the general case. A properly tuned JVM uses the "right" heap size; in my experience long GC pauses happen when the JVM hasn't been properly tuned. And often the "right" heap size is far smaller than you might think.
Jul
5
comment Why don't open source projects pay more attention to backward compatibility
You would probably be better served by posting your actual problem over at SO. It surprises me that Maven, at least, would have backwards-compatibility issues -- I'm still running Maven 2 build scripts that I wrote 6-7 years ago.
Jun
26
comment Is Logger.getLogger(MyClass.class) the best way to initialise log4j loggers?
That said, I prefer loggers as instance variables rather than class variables, so eliminate the static keyword and replace Foo.class with getClass().
Jun
26
comment Is Logger.getLogger(MyClass.class) the best way to initialise log4j loggers?
What do you find verbose about this (setting aside Java's syntax)?. You have to create a variable to hold the logger, and you have to tell getLogger() the name of the logger to get.
Jun
10
comment Explicit DAG instead of Vector Clocks for synchronisation
Yeah, my understanding of vector clocks is that they're intended simply for an accept/reject decision: "node C is trying to update this piece of data, but it isn't aware of node B's update".
Jun
10
comment Explicit DAG instead of Vector Clocks for synchronisation
I may be misunderstanding what you're saying, but it's unclear how a graph of all events leading to a state could be smaller than a vector of counters. Unless you're in a system that has an extremely large number of nodes and an extremely small number of changes.
May
22
comment What is the functional programming answer to type-based invariants?
In your example, a 2-tuple is a Fraction only if it was produced by one of the "fraction" functions (or, as a more relaxed definition, can be used by them). Otherwise it's just a 2-tuple, with no special meaning.
May
22
comment What is the functional programming answer to type-based invariants?
@BenAaronson: types are just conventions describing the use of data. In a language that provides classes and encapsulation, that convention is embedded in the class implementation. In a language that provides functions and simple collections, that convention is embedded in the function implementation. There's really no difference.
May
7
comment Legitimate cases of having .equals() behaving inconsistently with .compareTo()?
Thank you very much, @MichaelT. It's nice to see that an experienced programmer can answer that question. I wrote the comment, however, in the hope of getting the OP to think about the differences.
May
6
comment Legitimate cases of having .equals() behaving inconsistently with .compareTo()?
Why does it make sense for BigDecimal?
May
6
comment How does modulus work?
That said, I'd expect that a modern processor would implement in some form of logic array.
May
6
comment How does modulus work?
Long-division works the same way with binary numbers as it does with decimal. Try it, then think how you might code it (hint: you'll use a lot of shifts).
May
2
comment Is it possible to speed up a hash table by using binary search trees for separate chaining?
@Aviral - why are collisions happening? Do objects have the same hashcode, or are they going into the same bucket? If the latter, then pre-sizing your table to be much larger than needed may be appropriate. If the former, I suggest replacing your HashMap by a TreeMap and measuring the difference in performance. I think you might be surprised.
Apr
11
comment When there's no TCO, when to worry about blowing the stack?
@supercat - I'm not sure what your question is. The first point of this post is that the compiler can't know what the stack frame of all potential callees might look like (remember that the stack frame holds not just the function arguments but also its local variables). I suppose you could add an opcode that does a runtime check for compatible frames, but that brings me to the second part of the post: what's the real value?
Feb
24
comment When to use a SortedMap interface?
You're expecting way too much from the type system. No matter how much you want to believe that types rigourously define behavior, it comes down to implementation by an ordinary human. In the case of Java interfaces, there's no pretense; the interface describes a contract, with luck that contract doesn't have too many corner cases, hopefully the people who implement classes based on that interface follow the contract without bugs, and the consumers of that interface use it in its intended manner.