2006-07-12

Keep your bits.

BitKeeper Author Prohibits Paying Customer From Creating Competing Product.

As I understand it, according to the BitKeeper license, you're not even allowed to think about writing a Source Control system while you're a paying customer of BitKeeper. This was the primary reason that the use of BitKeeper for the Linux Kernel was a pain - folks working on subversion and friends weren't allowed to use it.

Shit like this is why I advocate Free Software and Free Culture.

In a related story, I was there when at LinuxConfAu2005, Tridge took an opportunity during a keynote to 500ish hackers to say, "I'm not a genius reverse engineer, I didn't use magic powers to write SourcePuller." And told the audience the host and port of a BK repo, and asked how he'd go about reverse engineering it. It was very well staged. The responses, 'telnet hostname portnum', 'help' and 'clone' (clone was in the help text provided by the BK serevr) were all that was required to make a very impressive quantitiy of code start streaming from the BK server over the telnet session.

It evoked quite the, "well now isn't Larry a silly boy" response from the crowd.

'rati tags:

2006-07-07

I Own My Music

American Students Reject Free Music Downloads

As a student at Cornell University, Angelo Petrigh had access to free online music via a legal music-downloading service his school provided. Yet the 21-year-old still turned to illegal file-sharing programs.


The reason: While Cornell's online music program, through Napster, gave him and other students free, legal downloads, the email introducing the service explained that students could keep their songs only until they graduated. "After I read that, I decided I didn't want to even try it," says Mr. Petrigh, who will be a senior in the fall at the Ithaca, N.Y., school.

WSJ

It is exactly the sentiment of not wanting to Rent music, that is behind the I Own My Music website run by Linux Australia as part of an awareness campaign about the DMCA legislation that will be brought into Australia in Janurary '07.

Thanks to an excellent talk given by Rusty Russel at Humbug I now know a bit more about the issues in Australia, but have yet to write a letter and send it via Snail Mail to my politicians. I should do that. I think everyone who cares about the matter should too.

The legislation that is coming into Australia will provide Music companies with the power to say where and when we're allowed to play their content. To DRM it to heck, and make it illegal to own or distribute the tools required to ignore the DRM protections.

If the current laws go through, any '''protected''' works may not have their '''protection''' circumvented. Even if that '''circumvention''' is just playing a DVD under linux, cutting up a commercial DVD to use in a presentation in a school or duplicating some music so that it can be played on your MP3 player.

I don't want music they can only play in a archaic CD player, I don't want music I can only play for a restricted time period. I don't want to pay good money to 'rent' something I feel I should be allowed to own and do with As I Please.

2006-07-06

PyPy Musings

I've been fiddling with PyPy this week. I thought I would share a few things I know, and relate my experience with getting the Twisted unit tests running under PyPy. I've only gotten the twisted.trial the unit testing framework to run its own tests so far.

Many people seem to misunderstand the PyPy project. So I'm going to explain it in very simple terms for those who have not heard of it, or have only heard a brief blurb.

PyPy is a project that aims to completely implement Python, using Python. Much like GCC is written in the C programming language and FreePascal is written in the Pascal programming language.

The structure of PyPy is interesting once you delve into it. It has that ability to run 'untranslated'. That is, PyPy's interpreter running under CPython[1]. This is *slow*. I used this technique to run 250 tests on twisted.trial and it took nearly 11 hours of CPU time. This is for a battery of tests that runs in CPython in 25 seconds.

PyPy can also be translated to a number of backends. Backends for C, llvm, Common Lisp and JavaScript all exist. This is exciting because it means that instead of running at a speed that a snail would be embarressed to be compared to, it runs python at approximately 3-10x slower than CPython. Benchmarks of various builds here.

Translating to a backend requires that platform calls be implemented correctly. This can be implemented by saying (for instance) os.stat should proxy the call through to the CPython implementation in untranslated PyPy, should call this C code when translated to C, should call llvm code when translated to llvm, and should simply not exist when translated to JavaScript.

This is a bit nasty, because you've got to implement things a few times over, so there's a new way based on ctypes that's completely awesome.

When using ctypes, you can implement a python version of the call to the system library, and when translating to C, the calls to ctypes will be translated to C as well. Meaning that it's possible to have a single implementation of a function that works in untranslated and translated PyPy, without writing a line of actual C code.

An example of some actual code I had to write in order to get the twisted tests to run.
dllname = util.find_library('c')
libc = cdll.LoadLibrary(util.find_library('c'))
def access(space, path, mode=R_OK):
  if libc.access(path, mode):
    return space.wrap(0)
  else:
    return space.wrap(1)
access.unwrap_spec = [ObjSpace, str, int]

There's some funky stuff there for wrapping/unwrapping return calls to the Application Level as this is Interpreter Level code - you're not allowed to give the application level any of the underlying interpreter level objects, but the really interesting bit is libc.access(path, mode) which will result in a call to access(2).

And the best thing is, this code will run untranslated or translated. I hope to iron out a few of the bugs I have in modules like fcntl (thanks Lawrence Oluyede for implementing this in ctypes!) that stop them from being translated, then I'll be able to run a translation and run the tests at a reasonable speed. :)

[1] CPython is the name used to unambiguously refer to Python implemented in C, and to distinguish it from Jython, PyPy, IronPython or Stackless Python. /usr/bin/python is CPython.


'rati tags: ,