HNHacker News
TopNewBestAskShowJobs

stephenjudkins

1,606 karma · joined February 20, 2009

submissionscomments
stephenjudkins··on Scala on LLVM
No, one of the constructors for String takes only char[] as a parameter. You can pass in an arbitrary array of chars, even invalid UTF-16.

You're correct that well-written code should never do this. However, there is no guarantee that some library you're using doesn't. You can never assume that 'new String(oldString.getBytes("UTF-8"), "UTF-8").equals(oldString)', which has some unfortunate side-effects if you're doing anything involving serialization and equality.

I agree that Java's String API is generally quite well-designed, but the ability to access the raw UTF-16 is a very big leak in the abstraction.

stephenjudkins··on Scala on LLVM
java.lang.String uses UTF-16 internally. It's a wrapper around an array of 16-bit chars. Thus, it's possible for one to create a String which is NOT valid unicode by abusing surrogate pairs.

Thus, the JVM has no native datatype that represents a "valid unicode string". This is unfortunate, because if java.lang.String did enforce this it would let us make some helpful assumptions.

stephenjudkins··on After approving NBC buyout, FCC Commissioner becomes Comcast lobbyist

  The US government is beyond corrupt and beyond any possible reform and nobody cares.

  my team versus yours bullshit

  It won't happen in my lifetime. I know that much.
Have you ever volunteered for a local politician? Paid close attention to an particular issue? Gone to your state capitol to lobby for a particular bill? Took notice of any substantive differences between politicians of both major parties running against each other? Have you ever spent a substantial amount of your own time and effort to attempt to fix any of these issues?

Or do you just bitterly complain about the irredeemably corrupt nature of US government on online message boards?

Your cynicism, and those of people like you, is also a large contributor to our nation's innumerable problems. There exist honest, well-meaning, hard-working people working in government and politics to attempt to fix these issues. Unfortunately they're outnumbered by people like you, who tar all of them with same brush you use for the most corrupt business lobbyist. That's probably because it's much easier to complain than fix the problem.

stephenjudkins··on Scala and Android Development
There are a few obstacles to easily using Scala on Android. Namely, the Scala standard library is too large to be easily "dexed" by the Android toolchain. Using Proguard or a similar treeshaker removes unused classes, but it's a bit of a hassle to set up manually.

However, I've found that using the SBT Android plugin (https://github.com/jberkel/android-plugin) makes the entire process relatively painless. I recommend starting with that approach.

stephenjudkins··on Intel Reinvents Transistors Using New 3-D Structure
From what I've heard, using 50% as much power for the same performance as the previous generation still will not be sufficient to bring Intel's Atom performance/energy consumption ratio to that offered by ARM chips. However, it's a huge leap in the right direction. Add better-designed power-saving features on the next generation of Atom chips, and future process shrinkages, and it's easy to see ARM's lead getting chipped away until it's gone.
stephenjudkins··on Dr. Stallman responded to my open letter
A friend of mine (a relatively well-known person who has contributed a good deal to free software) once introduced himself to Richard Stallman. Richard Stallman immediately told him he was evil because he had once worked for Microsoft.

Behavior like that, where Stallman immediately alienated a potential ally, does little but harm the free software cause. The only thing it enhances is Richard Stallman's reputation among a small (and probably dwindling) group of radical free software advocates.

stephenjudkins··on Steam Lisp
From reading the author's other posts, the clear implication is that Lisp (and only the author's preferred flavors of Lisp, not pale imitations like Clojure) offers the only possibility of breaking out of the hopelessly broken paradigms accepted by the unwashed masses.

Personally, for all the problems and terrible design decisions that we're all living with, I find a whole lot of what fellow programmers do amazing and inspirational. A lot of the stuff they produce with so-called broken and unproductive tools are amazing products that provide a lot of productivity and enjoyment for a wide range of people. I've also found that almost any sufficiently popular language or environment has its share of brilliant, original thinkers trying to build new tools to make things easier and better for others. These are people who should be thanked and celebrated for their contributions.

I looked further into the author's blog posts. The dominant themes are bilious and scornful attacks on other's work, or lamentations about the sad state of software today. He claims to be producing a Lisp-based operating system. Curious to see his progress, I checked the source repository, to find that it only contains a README indignantly protesting the the treatment he's received from others.

This guy's combination of arrogance, scorn, and complete lack of demonstrated competence makes him oddly fascinating. I wonder what kind of social factors in our industry produce people like this, and how we can work to counteract them.

stephenjudkins··on Scala 2.9.0 RC1 released
There isn't as much new features in this release compared to the 2.7.7 -> 2.8.0 upgrade, but this is still a notable release.

Not mentioned in the post but apparently included with this release it the new "Dynamic" trait, which enables runtime method dispatching. See http://squirrelsewer.blogspot.com/2011/02/scalas-upcoming-dy... for a better explanation and examples.

stephenjudkins··on PyPy Status Blog: A thank you to the PSF
How are the the PyPy developers supporting themselves? Are they being paid salaries from the project, which (if I understand correctly) is currently being funded as an EU research project?

Obviously the PyPy code will deliver vastly more than $10k of value to the world. Keep up the good work.

stephenjudkins··on Why the Nitro JavaScript Engine Isn’t Available to Other iOS Apps
If I'm looking for the most reasonably explanation for Apple's behavior that still manages to cast them in a good light, I'll read Gruber. If I'm looking for the most reasonable possible explanation, full stop, I'll read elsewhere.
stephenjudkins··on Why the Nitro JavaScript Engine Isn’t Available to Other iOS Apps
I'm not sure why I read John Gruber anymore. I get my hopes up that perhaps I'll see some of the smart, incisive that I remember from years ago, but instead I see another pretty baseless apology for Apple's behavior. He may actually be correct in this case, but it's hard to take him seriously given that he seems to bend over backwards to interpret Apple's actions as charitably as possible. This post is certainly more defensible than his recent defense of Apple's 30% application revenue power-grab, but I am skeptical that it was written in any better faith.

With every thing he writes like this, he's behaving more like a fanboy and less like a reliable source of information. It's a bit sad.

stephenjudkins··on Compile and boot linux kernel in 15seconds
Fabrice Bellard is one the most impressive hackers around. His other accomplishments include QEMU, launching FFMPEG, and discovering the fastest (at the time) method for calculating digits of pi.

See http://en.wikipedia.org/wiki/Fabrice_Bellard and http://bellard.org/ for more info on the guy. I wonder what he's doing these days?

stephenjudkins··on JRuby 1.6.0 Released: Now with Ruby 1.9.2 Support
No. The JVM spins up several threads, even when running a single-threaded Java program. Threads and fork() do not mix well together, and using threads is heavily entrenched in the Java world. I doubt Oracle intends to do the work to make fork() work.

As far as rewriting your code, would it be that difficult to change it to use threads? They don't FORCE you to share state, and there are powerful primitives for message-passing in java.util.concurrent. As long as you're not abusing global variables in Ruby it should translate over just fine.

stephenjudkins··on JRuby 1.6.0 Released: Now with Ruby 1.9.2 Support
JRuby is pretty unique among non-reference language implementations in that it's often more performant, powerful, and stable than the standard Ruby implementations. It's been rock-solid for us recently, and integrates with Java surprisingly well.

I often think that the Ruby world would be a more productive place if the original implementation had leveraged the JVM.

stephenjudkins··on Logging Without Side-effects
From the perspective of a reader not steeped in functional programming, your proposed solution to logging is probably unpersuasive, for the reasons the above commenter articulated better than I can.

* When using loaded terms such as "dysfunctional" to describe programming paradigms that the reader may be very comfortable with--and may have produced useful software using--make sure to thoroughly defend this characterization.

* Do you believe that there exist extremely intelligent, productive programmers who remain unconvinced of the merits of functional programming? If so, force yourself to adopt a charitable view of their skepticism. If not, what's the point of this presentation? Those committed to functional programming don't need to hear why their approach is superior, since that's just preaching to the choir; you can skip to the implementation section.

stephenjudkins··on Scala Considered Harmful For Large Projects?
The author is correct that, as a language "in the small", Scala offers many more ways for a programmer to create hard-to-understand complexity. Though many things have been conceptually simplified (the distinction between primitives and objects has been abstracted away so that most developers don't have to worry about, for example) there is a whole lot more stuff that make it easy to hang yourself with. (See implicit conversions and parameters, destructuring and pattern matching, and the power of the type system). Most of these things can be used to make code more readable, concise, and flexible, but can also be used to great ill effect.

When it comes to programming "in the large", like the author seems to be describing, I couldn't disagree more. Here it's Java--the culture and ecosystem--that tends towards over-abstraction, huge frameworks that obscure rather than illuminate intent, ridiculous class names that include "FactoryFactory", and so on.

I would argue that the second phenomenon--the hugely complex frameworks that have arisen in the Java world--is a direct consequence of the lack of power offered by Java, the language. Complex frameworks that do dependency injection through bytecode generation and XML configuration files really aren't necessary in the Scala world, where 90% of what you're actually trying to do can be done using compile-time mixins. The factory pattern can be replaced with anonymous first-class functions, with a net increase in clarity and conciseness. Most things that makes Scala more complicated in the small can be also be used to replace even more complicated, ad-hoc patterns and frameworks that make big Java projects such a pain to work on.

That said, it could be true that introducing Scala into existing codebases that already have thousands of lines of Spring XML config might simply introduce additional complexity, without offering a realistic path to removing all of the nonsense that supports the legacy Java code.

stephenjudkins··on PHP 5.3.3 hangs on numeric value 2.2250738585072011e-308
Though the author doesn't seem to be malicious in any way, he really should have reported it to the PHP core team as a security vulnerability before writing a blog post. This could easily lead to denial-of-service attacks.
stephenjudkins··on Cassandra vs MongoDB vs CouchDB vs Redis vs Riak comparison
Here's an informative presentation about how HBase has (massively) sped up random access, as of version 0.20: http://www.docstoc.com/docs/7493304/HBase-Goes-Realtime

I did benchmarks on a previous version, and the results were pretty miserable (600ms/lookup on a table with several million columns). It certainly sounds like they've improved.

stephenjudkins··on Wyden (Oregon) threatens block on censorship/copyright bill
His health care plan had the unfortunate property of pissing off both organized labor and the healthcare industry, and neither Republicans or Democrats really got behind it. Which was too bad, because it certainly would have been better than what we actually got. Then again, if it had to wind its way through the legislative sausage-making it would probably end up as bad as the current bill. It's a reminder that to be an effective senator, one can't just be smart, well-intentioned, and hard-working. One also has to be good at convincing the preening sociopaths that occupy most of the Senate to go along with it.

I've met Wyden several times at volunteer events, and he seems like an incredibly friendly and down-to-earth guy. Not that the personal qualities of a legislator are all that relevant, but it doesn't hurt my impression of someone.

stephenjudkins··on Why doesn’t Google have a hedge fund?
The difference is that they're only managing their own money. The implication of "running a hedge fund" is that you're managing outside investors' money. I imagine that with that comes an onerous set of regulations.
stephenjudkins··on Refactoring to clean code.
These are excellent examples of refactoring.

It's strange, however, that the author brings up the absolute necessity of unit tests when refactoring like this, yet says he omitted them for brevity. I've found, however that one of the most difficult and important parts of refactoring is making sure code has proper test coverage, especially when starting with crufty code. It's unlikely that the (not very clean) code he presents came with a thorough set of unit tests.

The first thing I try to do when working with insufficiently tested code is to begin refactoring it into a more testable form. This involves many small steps, and in some cases manual testing to make sure that the automated tests I'm writing are testing the correct thing. I think this article would be better if he moved the parts conducive to that (#6 and #9) to the top and included examples of writing tests (with appropriate mocks).

Further, canvas is a rich and complicated API that is relatively difficult to test against; for this article something simpler might have been more appropriate.

stephenjudkins··on Mysql "Swap Insanity"
This is all very interesting, and the author has clearly done a lot of research. But where are the benchmarks? I'd love to see some sort of replicable evidence that using this command helps things that much.

Linux's NUMA policy does seem broken for this use case. If all the memory on node 0 is used up (but plenty is free in node 1) and a thread in node 0 attempts to allocate memory, why not, instead of swapping out pages from node 0, simply move them to node 1? Alternatively just allocate memory in node 1, as the author suggests. I'm not a kernel programmer. Anyone who's more familiar with this care to answer?

stephenjudkins··on Address Validation Using the Google Maps API: A better way to enter addresses?
This makes a lot of sense.

However, I'm growing wary of "dependency sprawl", where the functionality of a web application is tied to an increasing number of other services. That said, as far as uptime goes Google is hard to beat.

stephenjudkins··on Castro has his doubts on Communism
It would have been great if he'd realized it earlier.

However, I imagine that growing up during the great depression (especially under a series of kleptocrat dictators) changes one's perspectives on the relative merits of different economic systems. I'm currently reading a book on J. Robert Oppenheimer, and I've been struck by the seeming ubiquity of very left-wing views among brilliant young theoretical physicists in the 1930s. Combine the dire economic circumstances in the US at the time with the rise of the Nazis and little accurate knowledge of life under Stalin, and some very smart people came to conclusions that seem very misguided in retrospect.

stephenjudkins··on Project Cybersyn
See http://www.marginalrevolution.com/marginalrevolution/2009/12... for a skeptical take on this.
stephenjudkins··on Oracle sues Google over use of Java in Android
It seems like defending against software patent claims are a cost of doing anything interesting now days. Create a novel, popular platform or tool, and someone somewhere will probably sue you over infringing on their patents. Google can probably dig into its mountain of cash and come out OK, but the precedent is chilling to smaller companies.

It's also ironic that it's Dalvik that got hit, given the amount of anti-Microsoft hysteria that has surrounded the Mono project.

stephenjudkins··on Why isn't Haskell popular in industry?
I think there are a couple reason.

Haskell is a significant departure from most other languages commonly used by industrial programmers. It's a relatively shallow learning curve from Java to Python to JavaScript, but making the leap to a pure functional language is very difficult. Path-dependence plays a huge part here. This isn't just a matter of "people being afraid of what's different" as the article suggests; there are very rational reasons for a profit-seeking firm to exploit the fact that their developers (and those available to hire) are already relatively proficient at writing procedural code.

Another, more important reason, is that Haskell is too intellectually demanding for most industrial programmers. I consider myself an enthusiast of functional programming, but achieving anything practical using purely functional code remains extremely difficult for me, even though I regularly dabble in it during my free time. The Haskell IRC channel can be helpful, but it's very difficult to square "Haskell is easy enough for anyone to learn" with the inevitable "you are too stupid/impatient/incompetent to use Haskell effectively" taunts you're likely to hear, when you're asking for help to perform a simple task. Many Haskell evangelists don't understand that most developers aren't nearly as smart or dedicated as they are.

I'd be curious to know where most Haskell users believe they lie on the distribution of programming ability. I'd estimate most of them lie at the 99% percentile, and that any of them arguing otherwise are doing so out of modesty. (Note that I'd include dedication and curiosity in with intelligence in this metric.) I believe the most likely explanation for this is that Haskell is a particularly difficult language to use effectively.

stephenjudkins··on Node and Scaling in the Small vs Scaling in the Large
I completely agree. Further, as he points out, code using events is fundamentally different than code that uses threads, in ways that aren't immediately clear to someone writing a "hello world" app. Complexities arise in ways that don't in threaded code. I think many of the more naive "event-driven" boosters haven't gotten far enough to see the real potential for pain.

That's not saying threaded code doesn't have its own set of issues; but having written a tool that saw very high traffic, was written an event-driven style, and suffered performance reliability issues, I can say that the event-driven approach is no panacea.

That said, for certain applications, one or the other approach is clearly appropriate. But to make that decision requires an understand of the strengths and drawbacks of each.

stephenjudkins··on Desperate Perl Hacker
Tim's current position is something any professional developer should reflect upon. Even if the tools or language one currently uses are popular (and growing more so) at the moment, there's a good chance that they will eventually enter into long-term decline, like Perl has. Ruby users may now feel on top of the world, since despite its flaws the Ruby community is vibrant, exciting, and lucrative, but one day we too may be protesting that "Ruby isn't dying", despite all evidence to the contrary.

Being honestly aware of the strengths and weaknesses of the tools one uses, and being willing and able to move to other tools if necessary, are attributes that will probably help one have a much happier career.

stephenjudkins··on Extending Cassandra with Asynchronous Triggers
This could make Cassandra a great deal more useful for many applications. Having the database itself handle keeping secondary indexes (eventually) consistent is far more palatable than doing it externally through some sort of queue. Though clearly far more cumbersome than adding a simple index through DDL in a SQL database, the asynchronous nature of these triggers brings some benefits as well.
← PreviousPage 2 of 5Next →