HNHacker News
TopNewBestAskShowJobs

swdunlop

515 karma · joined December 6, 2009

Lead wookiee at https://www.cmdzero.io
submissionscomments
swdunlop··on Go: a nice language with an annoying personality
The OP offers up Python as an example of "weightlessness", which I take as meaning "it will execute any code it can parse." Languages with this kind of tolerance require exhausting levels of diligence to verify assumptions and ensure consistency in a development team.

Go's pedantic compiler and style enforcement fade pretty quickly into the background with practice and a reasonable text editor. The pain of trying to fix mixed metaphors between modules in Python never will.

As an aside, here is the solution to your fmt.Println problem:

    func traceln(v ... interface{}) {
        fmt.Println(v...)
    }
Just bind the function, and you can comment or uncomment traceln to your heart's desire.
swdunlop··on My Top Sublime Text 2 Plugins
Seconded; GoSublime gives you a nice REPL for Go's build and test commands, package completion and linting. It is the second Sublime Package I install, after Package Control and before my own Antiki.
swdunlop··on The Atlantic suspends the Scientology advertorial
That's probably because they are still trying to figure out if Scientology can sue them for breach of contract. Org lawyers are less stable than old dynamite.
swdunlop··on Go, the language for emulators
I wanted something relative to ANSI C, which has no closures, no concurrency, no garbage collection, and a standard library consisting of stone tools, without invoking the horrible term "Very High Level Language", which implies Visual Basic and copypasta. ;)

Perhaps I should have gone for the Monty Pythonesque "higher level than C but lower level than ASP.Net" term?

swdunlop··on Go, the language for emulators
Interesting. It appears that cgocall has improved from the last time I went down this rabbit hole. Previously, it used a pthread_create to construct a C stack and context on each runtime.cgocall and then waited on a mutex for it to return. The overhead was enough to make me favor image/png Encode over libpng for smaller images.

Time to go profiling again! :)

swdunlop··on Go, the language for emulators
You can, but Go doesn't really have a good way to link in the product at runtime. Maybe something like a Go version of GNU Lightning would be a fun project -- http://www.gnu.org/software/lightning/

You can't wrap Lightning itself, otherwise any possible gains you could expect are lost at the CGO transition.

swdunlop··on Go, the language for emulators
Off the top of my head, I can think of a few why Go is better than Python or other high level languages for writing an emulator:

- Go makes it easy to write a process for your emulator, instead of a state machine.

- Go's slice types makes passing blocks of memory around a zero copy operation.

- Pass by value lets you reduce the number of objects GC must trace.

- Go is explicit about integer size and sign, makes conversion errors more visible.

It's not better than C, but it's certainly easier to work with. I'm routinely surprised at how C-friendly Go's produced code is -- take a spin through profiling some of the image library primitives and compare them against your favorite C library.

swdunlop··on Go at Google: Language Design in the Service of Software Engineering
Slide 14 is particularly important for new Go programmers. Go's garbage collector does not have access to certain optimizations because of the requirement to support pointers to internal members of structures and arrays.

The loss of these optimizations are compensated by nesting structures instead of just always using pointers to imitiate pass by reference semantics found in other GC'd languages, such as Java or Python. Using them correctly can reduce the number of objects to be collected and analyzed.

swdunlop··on Go is PHP for the Backend
Actually, the following is valid syntax in Go 1.0 and later:

    var i = 0
The use of "var" without a type is a common idiom when binding global variables, such as:

    var ErrTooLarge = errors.New("bytes.Buffer: too large")
Oddly, the := shortcut is not legal in the global context. Also fun:

    var (
        i = 0
        j = 0
    )
So, going back to the original comment -- yes, Go has some odd little shortcuts and inconsistencies.
swdunlop··on (Pidgin's) SSL support appears to have been written by a lobotomy victim
Looking at the code referenced in the bug? I agree, this is a horrible slight to lobotomy victims.
swdunlop··on Apple v Samsung Foreman Gets More Things Wrong
Agreed. The guilty party, here, is either Samsung's lawyers for failing to convince the foreman of the law and its applicability to their case, the judge for refusing to permit prior art to be presented, or the laws themselves which were incomprehensible to a layperson.
swdunlop··on How I hacked Gogo inflight wireless Internet with Chrome
Not sure what's less impressive. A pricing model based on browser headers, or a 10,000 word article on "hacking gogo inflight" based on changing a browser header.
swdunlop··on Man kicked off flight by pilot for wearing anti-TSA shirt
Or fly naked.

http://articles.cnn.com/2012-04-18/travel/travel_oregon-airp...

swdunlop··on Man kicked off flight by pilot for wearing anti-TSA shirt
Wearing a sarcastic t-shirt is equivalent to the Westboro Baptist Church protestors trying to shout down a funeral?
swdunlop··on Stop Applying to Startups
As a frequent interviewer, I regarded it as a sign that the interviewee had read a few articles somewhere and paid it almost no attention.
swdunlop··on X11 and the disturbing trend of Apple removing functionality from OS X
That is a lot of excitement for something that was available at http://xquartz.macosforge.org/ on release day. I didn't even notice or care until I realized that libpng's headers were considered part of X11.

When Apple introduced X11.app, I regarded it a tactic to get UNIX developers onto the platform. At the time, MacOS developers were sticking to Carbon like glue, and I think that by improving the POSIX compatibility and adding X11, Apple was trying to get other communities excited about OSX.

X11.app did not integrate well with OSX, let alone Apple's shrinkwrap vision of the Desktop. I'm not surprised to see they treat it like an optional add on package, and I am somewhat relieved to see it continue as an open source project with support and recognition by Apple. It's the right way to handle a legacy framework in my opinion.

As for the loss of RSS from Mail.app and Safari.app. Srsly? People use that who don't have a six paragraph definition for "semantic web"?

swdunlop··on Apple Support Allowed Hacker Access to Reporter's iCloud Account
It was the first thing I thought. "Hah! Good luck getting Google to answer a phone.." Then I thought, "wait, was that a joke?"
swdunlop··on What I Hate About Git
While I agree with the article in many of its finer points, the hyperbole ruins its effectiveness. For example, I don't find it frequently necessary to "log on to github and issue a pull request" to commit changes. Additionally, github != git, blaming one for the sins of the other just muddles things further.
swdunlop··on Google crackdown catches innocent devs in the crossfire
False positive with impending loss of market placement, reviews and app presence with their customers. No recourse for flagging Google's attention except for appealing to the court of public opinion?

Perhaps it is a "repeating scenario" because these app stores are rolling over in bed and squishing the poor bastards who get into bed with them and stake their business on cooperation?

swdunlop··on NBC Retracts Complaint, Guy Adams Is Back On Twitter
It's not an apology, it's a rationalization and a disclosure that Twitter has erected a classic legal fiction -- a Chinese Wall. In this case, Twitter has revealed two distinct groups that are not permitted to interact directly for reasons of decorum and liability. One polices the Twitter zeitgeist for memes that are distasteful to their partners (@nbcuni in this case), and the other reacts to breaches of Twitter's AUP.

Like with most abuses of corporate Chinese Walls, and why they are really just fictional constructs, there is a trampoline available for coordination -- in this case it's the partner itself. "We have encountered something you would find disparaging. Would you like to hellban? If so, please forward the following infringement to our unsuspecting moderation team.."

I find particularly nice that Twitter's own general counsel decided to spell it out in long form for the audience. It's a little like the ring leader explaining the physics supporting the acrobats after a performance.

* http://en.wikipedia.org/wiki/Chinese_wall

* http://blog.twitter.com/2012/07/our-approach-to-trust-safety...

swdunlop··on ~/.osx updated — sensible hacker defaults for OS X Mountain Lion
While it may be wrong in theory, changing it meant that all muscle memory developed by users thus far was thrown out of whack.

What was the gain for disorienting the users by introducing a new default? An improvement in acceptance by users who had only used tablets and phones but never PC's? Is that a large set?

swdunlop··on ~/.osx updated — sensible hacker defaults for OS X Mountain Lion
So was unilaterally setting it to the 10.7 standard. I think we should have the script flip a coin so people are annoyed evenly.
swdunlop··on Go is boring
Go has a smaller, narrower standard library that is more tightly maintained and governed than Python. Python's original slogan, "batteries included" could be amended after 20 years of use to "bitrot included." Some libraries have partially broken semantics that have been maintained because legacy applications rely on those broken semantics. Python modules don't even agree on tab width or casing.

Part of that is youth, Go went 1.0 just this Spring, and had a serious housecleaning applied in the process. "Being boring" is a big part of Go's identity -- most changes have been pragmatic and thoroughly thought out, and when they come, "gofix" often knows how to apply them to legacy code. (Static linking doesn't hurt, either.)

In theory, Go has more to gain in performance with the GC leaving a lot of room for improvement -- CPython has been subject to a lot of tuning over the years and has found a nice local maximum to settle on. In practice, this does not matter nearly as much as picking the right algorithm, profiling, and avoiding dumb mistakes. (A favorite gaffe: "string concatenation is faster than using a format string in Python".)

swdunlop··on Go is boring
It is hard to get excited about concurrency in vanilla Python while the Global Interpreter Lock still chokes everything down internally. (Vanilla, here, should be read "not Stackless.")

For more effective use of lightweight processes, I'd probably reach for Erlang or Occam.

swdunlop··on John Siracusa's OS X 10.8 Mountain Lion Review
Finally sorted itself out this evening. I just went back to Lion for the day and waiting for the #xcode rage to die down on twitter. :)
swdunlop··on John Siracusa's OS X 10.8 Mountain Lion Review
Looking at my inbox? Because they are too busy declaring that they can't reproduce it.
swdunlop··on Xcode 4.4 is available (for Lion and Mountain Lion)
Same here; the late July update is only installable on 10.7. Looks like we're still stuck waiting for Apple to sort out the 403 error for XCode 4.4 on Mountain Lion.
swdunlop··on John Siracusa's OS X 10.8 Mountain Lion Review
Just don't put it on your development workstation yet; XCode 4.4 is blocking the install of Command Line Tools for some developers. This means Homebrew doesn't work, VIM doesn't work (no /usr/include for pyconfig.h), and things are generally horked unless you want to play end-user in the app store.

Welcome to release day, Apple style. :)

swdunlop··on Just pay me.
I whole-heartedly agree with the terms, if not quite the tone. I've had to chase companies that had the cash to waste visibly for late payment. I've had to chase companies that wanted to change terms after there was acquisition interest. In both cases, I had to waste time chasing them down and I feel that the usual "net 30" scheme was to blame. The companies see the 30 days as a way to procrastinate after the purchase and the opportunity for a situation change to make things weird creeps in.
swdunlop··on Go at SoundCloud
Right. Early in learning golang, many people will get tired of typing:

    ..., err := doStuff()
    if err != nil {
        return err
    }
The usual text editor features, like templates, reduce the typing, but the point is that the programmer must think, each time, about what they want to do when a function fails. This can become either a really good habit, or a distraction, depending on your perspective and problem domain.

When people say Go poor or no error handling, this is probably what they are complaining about. The fundamental properties offered by try/catch/throw are unpacked by Go into defer, recover and multiple value returns and type switches. Go's designers make the argument that when used thoughtlessly, exceptions encourages error handling antipatterns.

← PreviousPage 4 of 7Next →