inicio mail me! sindicaci;ón

Stuck in the compiler

I’m making progresses to feed the rctime module to the extension compiler. He doesn’t like that much tuples so fixing a couple of tupled line to lists decreased the number of translation errors. Now the translation goes fine but I’m stuck in the compiler process. ctypes doesn’t have a mechanism to explicitly tell that one function returns void (nothing) and/or and by default all functions in ctypes return an integer.

The C generated source code from the translation process assigns the “hypothetic” return value of the function I’m calling (in this case tzset()) to a variable and GCC (he’s right ovbiously) does not allow that.

One step forward anyway!

UPDATE: I should think about the importance of None between one debugger session and the other. Thanks to Albert Strasheim. Better go to bed now.

I think I’ve found a bug in the rpython translation layer but more on this later.

PyPy Sprint Day 3

My last sprint day was good but I lost a lot of time around some limitations and a bug that’s actually there (anyway unit tests pass) but I’m fighting to win, so I’ll win :-)

I had the chance to pair with Armin Rigo itself and I think that I learned a lot from him (and also from Anders of course). Pair programming with the guys like them it’s important to my knowledge of PyPy and Python.

We have been invited by Richard Jones, a pygame guru, to see a nice and funny presentation about pygame and its capabilities. He was using Bruce as the presentation tool and I’ll definitely try it because it seems awesome!

Other guys have started porting md5, random and zlib also so maybe we’ll managed to port all the Python standard library someday :-)

In the evening Fabrizio and I played to Carcassonne with Armin, Richard and a really nice swedish summer student named Pauline. We italians didn’t know that game but Richard was very kind to teach us how to play. Obviously we lost but Richard, a master board game player, was defeated by Pauline :-)

So that’s all from my first PyPy sprint.

If you want to follow my SoC/PyPy work you’ll find it in pypy.module.rctime (which probably will be renamed as time when completed).

Michael Hudson wrote a PyPy sprint report today to summarize all the work has been done in Geneva: PyPy Post-EuroPython 2006 Sprint Report

PyPy Sprint Day 2

Today I continued working on the rctime module with the supervision of Anders. I’m improving my knowledge of rpython and how the interpreter level and application level works and how to make them communicate. This is not really documented in deep so you’ve to check out examples also.

Sad, a swiss boy, joined us and started learning how rctypes work. I think he’s porting zlib module by himself. Now he has a codespeak account so he can work on the live project.

We checked in the fix in format_somobject_error because it was needed by other people that encountered the same problem.

I now know the basics of the machinery of making tests pass and the translation process too.

You can’t use space.unwrap() directly in the interpreter level stuff that goes translated because it’s not supported at all (thanks Armin and Anders!) so you have to use XXX_w functions in the object space.

In the morning I also tried to make my stuff work on Windows but I gave up after installing the .NET SDK 1.1, .NET runtime 1.1, mingw compiler and do some hacking to work around the actual problem that python 2.4 is compiled against msvcrt71.dll but it’s part of the MS VC++ 2003 toolkit that is not available anymore. Visual Studio 2005 provides msvcrt80.dll so I didn’t manage to make it work. Windows is very unfriendly to developers not using all MS tools.

I completed time.sleep(), time.clock(), time.ctime(), time.struct_time, time.gmtime(), time.localtime(), time.mktime()

I have a problem using the translated module on CPython because I have a problem in checking the presence of an optional argument. So basically, if you don’t pass anything to, for example, time.localtime() it fails but if you explicitly pass None as the actual argument it works well. On py.py it works very well. Tonight I’ll try to translate all pypy.

After the sprint we had dinner and after Fabrizio, Alexander, Antonio and I joined summer students at a very funny Dutch party. :-) Summer students here at CERN know how to have fun! They’re obviously physicists or computer scientists from all over the world. From Japan to New York City.

PyPy Sprint Day 1

This is the report of the first day of the PyPy sprint session here at CERN.

The sprint began in the early afternoon (1.30pm) because this morning there was the CERN’s visit.

They started doing a crash-course-tutorial-so-my-head-did-boom presentation. PyPy is really complicated but it’s an interesting challenge. If you want to know more about its architecture and its present capabilities google for PyPy…

After the intro we (about 20 people) decided the topics of the sprint and divided ourselves in pairs (almost). There are the actual topics: planning.txt

So we began working!

I paired with Anders and Brian (a smart south african guy who lives in Barcelona) and we got into deep of the extension compiler machinery and rctypes limitations to port my previous work. We started kinda slow because… because that’s how you learn things. We managed to write some tests and a little functionality (basically time.accept2dyear and time.time()). We also discovered a couple of bugs in the PyPy translation toolchain. One has been fixed: the problem was there because C macros (geterrno specifically) are not supported by rctypes so… we’ve simply wrapped it in a function.

At the time of writing this post I’ve just finished the whole PyPy -> C translation and it worked so we didn’t made it explode (we tested it, but you can’t be sure anyway.) It took 53 minutes eventually. Nice, but I have a dual core 2Ghz CPU and 2Gb of ram…

The other problem is format_someobject_error in pypy.tool.error module. We had an empty block masking our actual block and a strange IndexError bug. So after some digging Anders came out with an hack (it’s not in the repository, only on my machine) to make it work in the translation process. We’ve to find the real reason behind this.

So, that’s it. It’s not very much but believe me… it’s brain-exploding stuff if you are a pypy newbie like me :-)

Anders was very kind to let us ask any kind of questions and provide hints and answers. I’m making progresses and that’s what counts. Hope to finish the all stuff before the summer of code deadline.

UPDATE: I also found myself in a toga party organized by the summer student at CERN so I met a lot of people and some nice girls :-P. Tomorrow night will be dutch-party time… so let’s roll!