Profile

Cover photo
Ralph Corderoy
Lived in London, England
2,556 followers|47,616 views
AboutPostsReviews

Stream

Ralph Corderoy

Shared publicly  - 
 
The Tragedy of the Commons is a well-known theory but I only knew what I’d gleaned from en.wikipedia.org/wiki/The_tragedy_of_the_commons, and suspect I’m not alone. +Tim Harford’s excellent Do You Believe in Sharing? added some interesting snippets, e.g. TotC says “freedom to breed is intolerable”, and contrasts its author’s views against those of Lin Ostrom who had studied long-lasting commons that hadn’t unavoidably descended into ruination. It’s a great read over a five-minute break with your favourite beverage.
3
1
Victor Churchill's profile photoRalph Corderoy's profile photoAndrew Bonello's profile photo
7 comments
 
+Victor Churchill, Thanks for letting me know; that's Wordpress for you. ;-) I expect Wolfe will sort it soon. And welcome to G+!
Add a comment...
 
Python library Twisted has been around a long time, “an event-driven networking engine”. +Guido van Rossum recently learnt and explained some more of its internals as research for Tulip, his reboot of asynchronous I/O for Python. I thought it a "fun" read, highlighting how complex some of this stuff can get, not just for the implementer but for the user that has to comprehend the behaviour, especially when debugging.
11
4
Yann Guibet's profile photoIurii Ogiienko's profile photoMaxim Moiseev's profile photoRoberto Peon's profile photo
4 comments
 
Gosh, I hate async programming.
Add a comment...

Ralph Corderoy

Discussion  - 
 
Googler +Josh Haberman, works on BigQuery, has come up with a considered couple of issues with Go's design that's blocking him from using it. I thought there might be learned voices here that can better persuade him, perhaps from long experience, than my comment on his post.
 
I just can't get over my discomfort at Go's take on interfaces. In Go you don't explicitly declare that your type implements an interface, you just pass your type to a function expecting the interface and the Go compiler checks that you have method signatures that match the interface.

This lack of an explicit "implements" statement just bugs me so much. Interfaces can have really subtle semantics; without an explicit "implements" declaration it's unclear what (if any) interface and associated semantics you are promising to implement.

For example, I can easily declare two interfaces (I haven't written any real Go, so sorry if I get the details of this wrong):

type Writable1 interface {
  // Returns the number of bytes successfully written,
  // or "0" or on error or EOF.
  Write(data []byte) int
}

type Writable2 interface {
  // Returns the number of bytes successfully written,
  // or "-1" on error or EOF.
  Write(data []byte) int
}

Now there is no type that can implement both interfaces correctly, but any type that attempts to implement one will also (inadvertently) implement the other, and the Go compiler will be happy to let this happen.

Also, if the interface changes the compiler won't warn you about subclasses that need changing unless you compile the code that tries to use that type by its interface.

I really think explicit is better than implicit when it comes to "implements" declarations. This is a big stumbling block for me ever wanting to use Go.
6
1
Elazar Leibovich's profile photoKevin Gillette's profile photoRalph Corderoy's profile photogeorge oloo's profile photo
31 comments
 
I think that +Josh Haberman have a very valid point. Everyone answer the concern: "accidentally implementing an interface will cause a bug". A bigger concern is "not declaring implemented interfaces explicitly hamper readability".

If you look at the go/ast package for example, you'll find a "standard" type hierarchy for where "If is a statement" is implemented by having If struct implementing an annotation-only interface.

This indeed makes it harder to read, and harder to understand.

What really bothers me about +Josh Haberman's approach for evaluating programming languages, is the methodology of deciding against a language because it has a single bad feature.

People worked successfully with far worse languages, with tools and methodology to mitigate their shortcoming. IMHO the mere features of the language does not correlate to a productivity boost.

Go features a first class standard library, with a clean API. Go put emphasize on top notch developer tools (which other language implemented a profiler so early, and added standard to the GDB). I personally couldn't care less if some detail is wrong in the language design.
Add a comment...

Ralph Corderoy

Shared publicly  - 
 
Cycle-counted bit-banging of video and audio

Heartened by the comments on Jeff Dean’s post, plus.google.com/118227548810368513262/posts/EMzp9NVV6QJ, showing that the skill of low-level optimisation is still valued, I thought I’d dig out Linus Åkesson’s 2011 blog post about his “Bit banger”.

It’s not uncommon to bit-bang audio these days, or even a video signal. Linus does both, and in a very constrained environment. He’s using a 1.6MHz Atmel ATtiny15 microcontroller that has room for a maximum of 512 instructions. RAM’s a bit tight too; 32 bytes. Though “RAM” is a bit of a stretch, those bytes are more accurately described as the register file.

Linus doesn’t shirk from giving detail so I’ll stop re-telling it here, but do look out for his assembly extract. It’s in two columns, video bit-banging instructions are on the left, audio on the right. They have to be interleaved because of the timing constraints. :-)
1
Add a comment...

Ralph Corderoy

Discussion  - 
 
If Go matches my understanding of its ancestors, a select where more than one case can proceed will pick one pseudo-randomly. Is this true, and is it still true in the Playground? I'm suspecting it's effectively nobbled there, perhaps as a side effect of the PRNG always having the same seed.
1
David Cheney's profile photoReed O'Brien's profile photoRalph Corderoy's profile photoGlenn Lewis's profile photo
6 comments
 
Cheers +David Cheney. Caching accepted, I can get a select to pick randomly by tweaking the magic value. Seeing about 50/50 between the two channels. http://play.golang.org/p/7Qylg4RF1w
Add a comment...
Have him in circles
2,556 people
Larry Kollar's profile photo

Ralph Corderoy

Tips and tricks  - 
 
Using an int to track indentation and print itself as the indent when its String() method is called. play.golang.org/p/uY6SW71jjS is a longer example showing a bit more behaviour.
 
Stumbled on this Go code I wrote ages ago. It's an interesting use of the String method. (To see it in action, visit http://play.golang.org/p/MX7eFmtHh_)


// tab indents itself when printed.
type tab int

func (t tab) String() string {
  n := int(t)
  if n > len(tabs) {
    n = len(tabs)
  }
  return tabs[0:n]
}
8
Add a comment...

Ralph Corderoy

Discussion  - 
 
Written in Go, etcd is a distributed locking manager for small amounts of data, e.g. configuration, with handling of node failures. Similar to Google's Chubby, research.google.com/archive/chubby.html, or Apache's Zookeeper. It's just released version 0.1.0. Brandon explains more in the comments of his post.
 
etcd is a distributed key value store we have been working on for CoreOS. It is like Zookeeper but uses REST APIs and is written in Go. Excited to get this first release shipped!

A distributed configuration service is a primitive we are building into CoreOS. Every application stack builds something like this eventually we want there to be an easy default.
29
4
Claudio Omar Biale's profile photoAndrea Pavoni's profile photoKrzysztof Wilczynski's profile photoKonstantin Cherkasoff's profile photo
3 comments
 
+Konstantin Cherkasoff, Yes, Brandon answered what some of the differences were between Doozer and etcd on his post.
Add a comment...

Ralph Corderoy

Show and tell  - 
 
groupcache is implemented in Go and, I thought, sufficiently interesting to warrant its own post.
 
groupcache: Memcached alternative/replacement from its original author

+Brad Fitzpatrick has just given a talk at OSCON 2013 on downloads from Google’s dl.google.com: talks.golang.org/2013/oscon-dl.slide. Its old C++ code was replaced with an all-round better Go implementation.

groupcache is part of that and is now available. It has coordinated cache filling, so on a cache-miss the herd doesn’t thunder. Unlike Memcached, a key’s value is immutable, so no increment, etc. This allows groupcache to replicate sought-after items to processes other than the authoritative source, avoiding a bottleneck of CPU or NIC for very popular items.

#memcached #golang
11
5
Andrea Pavoni's profile photoSidnei da Silva's profile photo
Add a comment...
 
groupcache: Memcached alternative/replacement from its original author

+Brad Fitzpatrick has just given a talk at OSCON 2013 on downloads from Google’s dl.google.com: talks.golang.org/2013/oscon-dl.slide. Its old C++ code was replaced with an all-round better Go implementation.

groupcache is part of that and is now available. It has coordinated cache filling, so on a cache-miss the herd doesn’t thunder. Unlike Memcached, a key’s value is immutable, so no increment, etc. This allows groupcache to replicate sought-after items to processes other than the authoritative source, avoiding a bottleneck of CPU or NIC for very popular items.

#memcached #golang
4
7
Julien Etienne's profile photoAndrea Pavoni's profile photoSidnei da Silva's profile photoFrederick ROS's profile photo
 
I'm hoping this improvement spreads further so googlecode.com stops returning 404 for HEAD until a little while after a GET for the same URL has primed its cache. It then works, returning 200, at least for a while. Been like this for a few years now. :-) code.google.com/p/support/issues/detail?id=660
Add a comment...

Ralph Corderoy

Shared publicly  - 
 
For us plebs that haven’t got a vanity Google+ URL, unlike https://plus.google.com/+AdeOshineye/, the http URL scheme can be abused to add in your desired text: https://plus.google.com/115649437518703495227;Ralph-Corderoy

That’s a ‘path parameter’, defined in http://tools.ietf.org/html/rfc2396#section-3.3 but the superseding RFC 3986 doesn’t make them a formal part of a path. Even so, some web servers strip them out when traversing the path allowing us to add our own commentary to a URL.

That URL above goes to my posts. My boundless vanity would probably prefer the About page but if you open https://plus.google.com/115649437518703495227;Ralph-Corderoy/about you’ll see About is underlined in the navigation but the browser’s location is showing /posts and that’s what’s being displayed. Poor G+ has got a bit confused.

(In case it’s not obvious from the tongue-in-cheek nature of this post, I don’t serious intend anyone to do this. I just thought it an amusing little corner of URLs and shone a little light on it. If I were Google I’d stop ignoring path parameters on G+ quite quickly so your pride will take a fall when they become ‘404 Not found’.)
1
Add a comment...
People
Have him in circles
2,556 people
Larry Kollar's profile photo
Work
Occupation
Consulting programmer
Basic Information
Gender
Male
Story
Tagline
Programmer of the Unix school
Introduction
Unix/C programmer for over twenty years, lots of programming/assembly languages over that time, nowadays C, Python, and ARM.  Performance, problem-solving, and bit-twiddling are particular interests.
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Previously
London, England - West Sussex, England - Hampshire, England - Dorset, England - Versailles, France
Packed to the rafters with one of just about everything, this is an excellent hardware and ironmongers. Always lots of staff on hand wearing brown overall coats to help. All the nuts and bolts are tucked away in a plethora of little cardboard boxes behind the counter. You go in with an unknown type of widget that needs replacing, they recognise it, get the right box, sift through the different sizes for one to match, wrap it in a little bag, then ask for 37p or some other inconsequential amount. Go in asking for oil for a lock and they'll politely question you and perhaps explain graphite powder would be better. Great place to wander in and browse too. Has its own little bit of parking at the back accessed by the driveway down its side.
• • •
Public - 5 months ago
reviewed 5 months ago
1 review
Map
Map
Map