<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1938537367225443542</id><updated>2012-01-15T19:14:04.132+09:00</updated><title type='text'>FePy Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-8799340693527989617</id><published>2009-09-25T04:49:00.003+09:00</published><updated>2009-10-20T16:19:50.845+09:00</updated><title type='text'>Selectively disabling Gold linker</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Gold_%28linker%29"&gt;Gold&lt;/a&gt; is a new, fast linker written by &lt;a href="http://www.airs.com/blog/"&gt;Ian Lance Taylor&lt;/a&gt; and his colleagues at Google. It has been a year since its first public release, and it is now packaged as &lt;a href="http://packages.debian.org/binutils-gold"&gt;binutils-gold&lt;/a&gt; in Debian, so you can easilly try it. Google claims Gold is five times faster than classic GNU linker for linking large C++ applications (of which Google has plenty), and my experience confirms. Overall, this is a welcome development.&lt;br /&gt;&lt;br /&gt;Alas, not everything is as rosy as it seems. GNU linker, in its multi-decades history, has accumulated a lot of features, and Gold, being a from-the-scratch re-implementation, is yet to catch up. There are bugs, incompatibilities, and missing functionalities. Above Debian package installs Gold as /usr/bin/ld, and after installation, some softwares may fail to compile from source. Often it is clear this is Gold's fault; but sometimes it is not. And you probably want to know a way to selectively disable Gold linker so you can check whether it's Gold's fault.&lt;br /&gt;&lt;br /&gt;Above Debian package leaves classic GNU linker as /usr/bin/ld.single, and it is likely that other systems will also retain classic GNU linker under different names. So one way to disable Gold linker is to let environment variable LD to point to classic GNU linker before configuring softwares.&lt;br /&gt;&lt;br /&gt;That is, if the build system of the software in question honors LD. But quite often, linker is implicitly called by compiler driver gcc, so you want to tell &lt;b&gt;gcc&lt;/b&gt; to use another linker, and telling build system to use another linker is useless.&lt;br /&gt;&lt;br /&gt;This is where gcc's -B option comes to rescue. You can pass "-B prefix" option to gcc, and gcc will first search under prefix to find the linker it uses, before falling back to default paths. So I arrived at the following solution:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ mkdir /opt/no_gold&lt;br /&gt;$ ln -s /usr/bin/ld.single /opt/no_gold/ld&lt;br /&gt;$ export CC='gcc -B /opt/no_gold'&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;By the way, Gold problem happened to me while I compiled &lt;a href="http://www.twotoasts.de/index.php?/pages/midori_summary.html"&gt;Midori&lt;/a&gt; from source. Midori is a lightweight web browser based on WebKit, with Adblock, user scripts, user styles, and other interesting features. I can do a little advertisement on my blog, can't I? Also, thanks to people on #midori IRC channel at Freenode for all the help and patience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-8799340693527989617?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/8799340693527989617/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=8799340693527989617' title='6개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/8799340693527989617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/8799340693527989617'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2009/09/selectively-disabling-gold-linker.html' title='Selectively disabling Gold linker'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-6003212301265756721</id><published>2009-05-04T10:54:00.003+09:00</published><updated>2009-05-04T11:11:03.558+09:00</updated><title type='text'>Building libFIRM from the public repository</title><content type='html'>&lt;a href="http://libfirm.org/"&gt;libFIRM&lt;/a&gt; is yet another IR(intermediate representation) from University of Karlsruhe. It has been public for the last year, but the repository was not. Recently, the &lt;a href="http://github.com/MatzeB/libfirm"&gt;repository&lt;/a&gt; has been &lt;a href="http://sourceforge.net/forum/forum.php?forum_id=945411"&gt;published&lt;/a&gt; at github, which is a good news.&lt;br /&gt;&lt;br /&gt;On the other hand, there doesn't seem to be any documentation for building from the repository. Since the build process is not exactly straightforward, here is a little recipe.&lt;br /&gt;&lt;br /&gt;First you want to clone the repository:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ git clone git://github.com/MatzeB/libfirm&lt;br /&gt;$ cd libfirm&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then you need to generate some source files from scripts.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ python scripts/gen_ir.py spec ir/ir&lt;br /&gt;$ python scripts/gen_ir_io.py spec ir/ir&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The rest is standard autotools build, except there is no autogen.sh.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ libtoolize&lt;br /&gt;$ aclocal&lt;br /&gt;$ autoheader&lt;br /&gt;$ autoconf&lt;br /&gt;$ automake --add-missing&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now configure and make.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-6003212301265756721?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/6003212301265756721/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=6003212301265756721' title='1개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/6003212301265756721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/6003212301265756721'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2009/05/building-libfirm-from-public-repository.html' title='Building libFIRM from the public repository'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-6335136792468203171</id><published>2008-12-19T19:35:00.004+09:00</published><updated>2008-12-19T23:01:29.413+09:00</updated><title type='text'>Encoding name normalization in Python</title><content type='html'>Python provides &lt;a href="http://docs.python.org/library/codecs.html"&gt;codecs&lt;/a&gt; module, which provides the codec registry. You can query the registry with codecs.lookup function. codecs.lookup function receives an encoding name as an argument.&lt;br /&gt;&lt;br /&gt;The venerable &lt;a href="http://www.iana.org/"&gt;IANA&lt;/a&gt;, &lt;a href="http://tools.ietf.org/html/rfc2468"&gt;our Internet Assigned Numbers Authority&lt;/a&gt;, maintains &lt;a href="http://www.iana.org/assignments/character-sets"&gt;official names for character sets&lt;/a&gt;. On the other hand, nobody really cares. According to IANA, "UTF-8" is an encoding name, with no aliases. Therefore, "UTF8", "UTF_8" or any such aliases should be invalid. That doesn't really work in the real world.&lt;br /&gt;&lt;br /&gt;So Python normalizes encoding names received from codecs.lookup. How exactly this is done isn't really specified. It turns out that CPython does normalization in two separate places: one in Python in the standard library, and one in C in the implementation. There are normalize_encoding function in Lib/encodings/__init__.py, and normalizestring function in Python/codecs.c. Moreover, these two functions perform different normalizations.&lt;br /&gt;&lt;br /&gt;IronPython, being an implementation of Python trying to be compatible with CPython, needs to cope with this. You will be surprised by the number of ways things can go wrong if you don't exactly match how this is done. But did you know that the following code work with CPython? (I don't recommend this!!!)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;import codecs&lt;br /&gt;codecs.lookup('utf!!!8')&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Yes, those are three exclamation marks. I'm not kidding...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-6335136792468203171?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/6335136792468203171/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=6335136792468203171' title='1개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/6335136792468203171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/6335136792468203171'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2008/12/encoding-name-normalization-in-python.html' title='Encoding name normalization in Python'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-2844753449013900956</id><published>2008-06-29T12:03:00.007+09:00</published><updated>2012-01-15T19:14:04.150+09:00</updated><title type='text'>My reading list</title><content type='html'>I haven't blogged for a while, so here is a lame blog post listing feeds I am currently subscribed to. I am a &lt;a href="http://liferea.sourceforge.net/"&gt;Liferea&lt;/a&gt; user, by the way. I tried to migrate to online feed reader, but somehow it didn't seem more convinient.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Software projects&lt;/h2&gt;&lt;br /&gt;I am subscribed to two software project feeds. One is of course &lt;a href="http://ironpython.codeplex.com/"&gt;IronPython&lt;/a&gt;, which I mainly use to monitor the issue tracker. I would prefer mail notification for this, but it's not implemented in CodePlex.&lt;br /&gt;&lt;br /&gt;Another is &lt;a href="http://morepypy.blogspot.com/"&gt;PyPy&lt;/a&gt;. Quoting somebody on YouTube (hah!), "PyPy is the most ambitious project any language has ever had", and I believe it. Even if you don't believe it, it's well worth subscribing if you are into programming languages. By the way, the YouTube video is &lt;a href="http://www.youtube.com/watch?v=GnPmErtqPXk"&gt;PyPy - Automatic Generation of VMs for Dynamic Languages&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Programming language developers&lt;/h2&gt;&lt;br /&gt;I am subscribed to blogs of developers implementing programming languages. For IronPython, I have &lt;a href="http://blogs.msdn.com/dinoviehland/"&gt;Dino Viehland&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/mmaly/"&gt;Martin Maly&lt;/a&gt; on the list. For JRuby, &lt;a href="http://headius.blogspot.com/"&gt;Charles Nutter&lt;/a&gt; and &lt;a href="http://ola-bini.blogspot.com/"&gt;Ola Bini&lt;/a&gt; are great.&lt;br /&gt;&lt;br /&gt;Just like about everybody else, I read &lt;a href="http://www.iunknown.com/"&gt;John Lam&lt;/a&gt; to follow IronRuby. From Mono developers, I only read &lt;a href="http://evain.net/blog/"&gt;Jb Evain&lt;/a&gt;. If signal-to-noise ratio for me were a bit higher, I would have read &lt;a href="http://tirania.org/blog/"&gt;Miguel de Icaza&lt;/a&gt; -- but I don't.&lt;br /&gt;&lt;br /&gt;For JVM, I read &lt;a href="http://gbenson.net/"&gt;Gary Benson&lt;/a&gt; and &lt;a href="http://blogs.sun.com/jrose/"&gt;John Rose&lt;/a&gt;, although both are usually over my head. Last two blogs in this category are from GCC developers (among other things): &lt;a href="http://www.airs.com/blog/"&gt;Ian Lance Taylor&lt;/a&gt; and &lt;a href="http://tromey.com/blog/"&gt;Tom Tromey&lt;/a&gt;. Surprisingly, Ian and Tom are usually &lt;b&gt;not&lt;/b&gt; over my head! I thank them for their generosity -- I am entirely sure that they are capable of writing posts inscrutable to me. :)&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Others&lt;/h2&gt;&lt;br /&gt;Being a science fiction fan, I read &lt;a href="http://www.antipope.org/charlie/blog-static/"&gt;Charles Stross&lt;/a&gt;. There are many great science fiction writers, but that set somehow doesn't seem to intersect with the set of great bloggers a lot.&lt;br /&gt;&lt;br /&gt;Being a fan of mathematics, I read &lt;a href="http://terrytao.wordpress.com/"&gt;Terence Tao&lt;/a&gt;. I don't pretend to understand technical materials there, but occasional posts directed to the "public" is simply great. For computer science fans (as &lt;b&gt;opposed&lt;/b&gt; to software engineering!) I recommend &lt;a href="http://scottaaronson.com/blog/"&gt;Scott Aaronson&lt;/a&gt;. Be sure to check out his lecture notes!&lt;br /&gt;&lt;br /&gt;I read &lt;a href="http://www.atoker.com/blog/"&gt;Alp Toker&lt;/a&gt; for no particular reason. His posts always have been enjoyable to me. I temporarily have &lt;a href="http://antoniocangiano.com/"&gt;Antonio Cangiano&lt;/a&gt; on the roll, mainly not to miss his Ruby shootout.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Korean blogs&lt;/h2&gt;&lt;br /&gt;That leaves me some Korean blogs. &lt;a href="http://openlook.org/"&gt;Hye-Shik Chang&lt;/a&gt;, a Python developer and a FreeBSD port maintainer, is the best Korean blogger in his niche. &lt;a href="http://extrad.egloos.com/"&gt;Park, Seong Chan&lt;/a&gt; is a theoretical physicist who writes great approachable posts on physics news. &lt;a href="http://gyuhang.net/"&gt;Kim Gyuhang&lt;/a&gt; is a progressive columnist. I sympathize with his political views. He is also my writing model for how to write clear and affecting Korean prose.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-2844753449013900956?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/2844753449013900956/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=2844753449013900956' title='1개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/2844753449013900956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/2844753449013900956'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2008/06/my-reading-list.html' title='My reading list'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-6808133775765713817</id><published>2008-03-24T18:36:00.005+09:00</published><updated>2008-03-24T18:43:26.000+09:00</updated><title type='text'>Inlining in Mono JIT</title><content type='html'>It seems that as of Mono 1.9, the inliner in Mono JIT compiler never inlines functions with any branching opcode. To those in the position to know, I ask:&lt;br /&gt;&lt;br /&gt;1. Is this true?&lt;br /&gt;2. If it is true, should I manually inline functions like the following?&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;public static int Min(int x, int y) {&lt;br /&gt;    if (x &lt; y) return x;&lt;br /&gt;    else return y;&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-6808133775765713817?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/6808133775765713817/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=6808133775765713817' title='3개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/6808133775765713817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/6808133775765713817'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2008/03/inlining-in-mono-jit.html' title='Inlining in Mono JIT'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-7037862778797115047</id><published>2008-01-13T10:39:00.000+09:00</published><updated>2008-01-13T10:51:14.202+09:00</updated><title type='text'>CLR Add-In</title><content type='html'>Today I came across &lt;a href="http://blogs.msdn.com/clraddins/"&gt;CLR Add-In&lt;/a&gt;. You can start reading from "System.AddIn Resources" link on the left sidebar.&lt;br /&gt;&lt;br /&gt;Its discovery and adaptation model looks rather comparable to those of &lt;a href="http://pypi.python.org/pypi/zope.interface"&gt;zope.interface&lt;/a&gt;, but it also deals with isolation. Reading the blog, it's interesting to see what design choices there are, and how and why CLR Add-In Team made those decisions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-7037862778797115047?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/7037862778797115047/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=7037862778797115047' title='1개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/7037862778797115047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/7037862778797115047'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2008/01/clr-add-in.html' title='CLR Add-In'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-4023926851120353207</id><published>2008-01-11T00:11:00.000+09:00</published><updated>2008-01-11T01:34:49.629+09:00</updated><title type='text'>Using AT-SPI from IronPython (2)</title><content type='html'>Before continuing, let me mention that all the relevant code is in the FePy repository:&lt;br /&gt;&lt;a href="https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/atspi/"&gt;https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/atspi/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now IIOP.NET is built, it's time to compile IDL. IDL stands for "Interface Description Language", and it is used to (surprise) describe the interface. AT-SPI's CORBA interface is described in /usr/share/idl/at-spi-1.0/Accessibility.idl, and it includes a bunch of other files. Some of these files are in different directories, so one needs to specify them.&lt;br /&gt;&lt;br /&gt;The compiler built is under IDLToCLSCompiler/IDLCompiler/bin. Copy these files (IIOPChannel.dll, IDLPreprocessor.dll, IDLToCLSCompiler.exe) to the current directory, and run:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ mono IDLToClsCompiler.exe \&lt;br /&gt;-idir /usr/share/idl/bonobo-2.0 \&lt;br /&gt;-idir /usr/share/idl/bonobo-activation-2.0 \&lt;br /&gt;Accessibility /usr/share/idl/at-spi-1.0/Accessibility.idl&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This should produce Accessibility.dll in the same directory. build.sh in the repository automates the process up to this point (download, build, and IDL compilation).&lt;br /&gt;&lt;br /&gt;So how does one connect to the server? This is "a well known problem" that has &lt;a href="http://www.gnome.org/projects/ORBit2/orbit-faq/faq/faq.html#ClientConnection"&gt;its own FAQ entry&lt;/a&gt;. Basically, one obtains IOR, "Interoperable Object Reference", by out-of-band mean, as one gets URL from the bookmark. After one got the first object reference, one can follow links to other objects.&lt;br /&gt;&lt;br /&gt;It turns out that AT-SPI publishes IOR as a property of X root window under the name "AT_SPI_IOR". Now one could go read X protocol specification and manually construct GetProperty request (opcode 20), etc., but there is an easier way. xprop utility can display X properties, so one runs "xprop -root AT_SPI_IOR" and parses the output. xprop.py in the repository implements this.&lt;br /&gt;&lt;br /&gt;Now IOR is a long sequence of hexademical digits, and one needs a tool to decode it. ior-decode-2 in orbit2 package can do so. If you decode IOR from xprop, you can notice a problem. AT-SPI (actually CORBA implementation it is using, namely ORBit2) uses Unix domain socket by default, but IIOP.NET can't use it. One solution is in the ORBit2 FAQ I linked above. Create .orbitrc with this line.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ORBIIOPIPv4=1&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This post is already quite long, so let's quickly skim the rest. corba.py implements the necessary initializations from IIOP.NET documentation. typed.py is a workaround for IronPython's limitation (namely the lack of cast operator), first &lt;a href="http://lists.ironpython.com/pipermail/users-ironpython.com/2006-June/002536.html"&gt;suggested&lt;/a&gt; by Dino Viehland. And this is the meat of cliatspi.py.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;orb = corba.init()&lt;br /&gt;ior = xprop.get('AT_SPI_IOR')&lt;br /&gt;obj = orb.string_to_object(ior)&lt;br /&gt;registry = typed.typedproxy(obj, Accessibility.Registry)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;tree.py is an example AT-SPI client I wrote, printing a tree of accessible objects in the current desktop. It imports cliatspi on IronPython, but imports an existing AT-SPI binding on CPython. (I used one in Debian python-at-spi package.) As IDL is language-neutral, this script actually runs identically on both CPython and IronPython. Extending tree.py to be a useful tool like UISpy on Windows is left as an exercise to the readers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-4023926851120353207?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/4023926851120353207/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=4023926851120353207' title='1개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/4023926851120353207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/4023926851120353207'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2008/01/using-at-spi-from-ironpython-2.html' title='Using AT-SPI from IronPython (2)'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-5356341604324530578</id><published>2008-01-10T22:48:00.000+09:00</published><updated>2008-01-10T23:59:47.053+09:00</updated><title type='text'>Using AT-SPI from IronPython (1)</title><content type='html'>This adventure started when Jim Hugunin &lt;a href="http://lists.ironpython.com/pipermail/users-ironpython.com/2008-January/006202.html"&gt;mentioned&lt;/a&gt; System.Windows.Automation library new in .NET 3.0.&lt;br /&gt;&lt;br /&gt;GUI test automation and assistive technology (such as screen readers) share some common needs. While &lt;a href="http://en.wikipedia.org/wiki/UI_Automation"&gt;UI Automation&lt;/a&gt; is named after the former, &lt;a href="http://en.wikipedia.org/wiki/AT-SPI"&gt;AT-SPI&lt;/a&gt; is named after the later. AT-SPI, which stands for "Assistive Technology Service Provider Interface" -- this is the first of lengthy acronyms that will appear in this post -- is an accessibility standard for Unix/X world. Initially developed by the GNOME project, now it is also supported by Java, Mozilla, OpenOffice.org, and Qt 4.&lt;br /&gt;&lt;br /&gt;While Microsoft-Novell interoperability agreement announced an intention to implement UI Automation on Linux (see above Wikipedia links for details), that's not available today on my Debian GNU/Linux desktop. So I looked for a way to use AT-SPI from IronPython on Mono.&lt;br /&gt;&lt;br /&gt;First thing I did was to install at-spi package from the Debian repository. That was obvious... Less obvious was how to use it after installation, especially because I am not using GNOME desktop (I am an IceWM user). After some search, I added following two lines to my .xsession.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;export GTK_MODULES=gail:atk-bridge&lt;br /&gt;/usr/lib/at-spi/at-spi-registryd &amp;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now AT-SPI has an accessibility broker which clients talk to, and it talks CORBA. CORBA, which stands for (I warned you) "Common Object Request Broker Architecture", is like a big brother of IPC mechanisms. CORBA has been around for a long time, and while it is sometimes accused of bloat, its bloat is nothing compared to certain XML-based "Simple" Object Access Protocol.&lt;br /&gt;&lt;br /&gt;So how does one use CORBA from Mono? A little search found a nice project named &lt;a href="http://iiop-net.sourceforge.net/"&gt;IIOP.NET&lt;/a&gt;, which "allows a seamless interoperation between .NET, CORBA and J2EE distributed objects." Cool. This project even has a support table for Mono on its status page! The download page mentions both binary and source release, but I couldn't find the binary release. No problem. Download the source release, unzip, and run "make -f Makefile.mono". Note that Makefile is for nmake, a Microsoft dialect of make, which is not compatible with GNU make. The build finished with no problem.&lt;br /&gt;&lt;br /&gt;Bah, this is getting too long. Let's continue on the next post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-5356341604324530578?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/5356341604324530578/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=5356341604324530578' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/5356341604324530578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/5356341604324530578'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2008/01/using-at-spi-from-ironpython-1.html' title='Using AT-SPI from IronPython (1)'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-2140216842433861351</id><published>2007-12-20T18:58:00.000+09:00</published><updated>2007-12-20T19:01:50.274+09:00</updated><title type='text'>Seo? What Seo?</title><content type='html'>My name is Seo Sanghyeon. Apparently, SEO also stands for Search Engine Optimization. That seems to be an enough reason for "SEO professionals" to spam my blog. Too bad.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-2140216842433861351?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/2140216842433861351/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=2140216842433861351' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/2140216842433861351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/2140216842433861351'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2007/12/seo-what-seo.html' title='Seo? What Seo?'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-8785444841518409058</id><published>2007-09-26T23:24:00.000+09:00</published><updated>2007-09-26T23:38:37.383+09:00</updated><title type='text'>IronPython/Mono benchmarks</title><content type='html'>There have been significant improvements in the performance of Mono runtime this year. Three Mono releases were made:&lt;br /&gt;&lt;br /&gt;2007-02-07 Mono 1.2.3&lt;br /&gt;2007-05-15 Mono 1.2.4&lt;br /&gt;2007-08-30 Mono 1.2.5&lt;br /&gt;&lt;br /&gt;I adapted some benchmarks from &lt;a href="http://shootout.alioth.debian.org/"&gt;"shootout" benchmarks&lt;/a&gt;, namely cheap-concurrency, nsieve, recursive, and ran it with IronPython 1.1 using Mono 1.2.3, 1.2.4, 1.2.5, and current SVN version. Here is a result:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp3.blogger.com/_UcyRBKtcX6U/RvptSFLPXcI/AAAAAAAAAAM/y1OfirnnbH4/s1600-h/plot.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center;" src="http://bp3.blogger.com/_UcyRBKtcX6U/RvptSFLPXcI/AAAAAAAAAAM/y1OfirnnbH4/s320/plot.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Great work!&lt;br /&gt;&lt;br /&gt;By the way, the plot was done with &lt;a href="http://matplotlib.sourceforge.net/"&gt;Matplotlib&lt;/a&gt;. Highly recommended.&lt;br /&gt;&lt;br /&gt;All code to run the benchmark is available from FePy SVN:&lt;br /&gt;&lt;a href="https://fepy.svn.sourceforge.net/svnroot/fepy/bench/"&gt;https://fepy.svn.sourceforge.net/svnroot/fepy/bench/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And so is the raw data:&lt;br /&gt;&lt;a href="http://sparcs.kaist.ac.kr/~tinuviel/download/IronPython/bench/"&gt;http://sparcs.kaist.ac.kr/~tinuviel/download/IronPython/bench/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-8785444841518409058?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/8785444841518409058/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=8785444841518409058' title='7개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/8785444841518409058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/8785444841518409058'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2007/09/ironpythonmono-benchmarks.html' title='IronPython/Mono benchmarks'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_UcyRBKtcX6U/RvptSFLPXcI/AAAAAAAAAAM/y1OfirnnbH4/s72-c/plot.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-9148155354867537331</id><published>2007-07-26T23:38:00.000+09:00</published><updated>2007-10-25T15:25:09.723+09:00</updated><title type='text'>Teaching IronRuby math tricks</title><content type='html'>The first release of &lt;a href="http://www.iunknown.com/2007/07/a-first-look-at.html"&gt;IronRuby&lt;/a&gt; brought a lot of buzz, and in my opinion rightly so. However, if you expect it to run Rails, seemlessly integrating ASP.NET widgets today, I must say you're delusional. Have you tried to run it at all? People, there are reasons why it is versioned Pre Alpha.&lt;br /&gt;&lt;br /&gt;In the post titled "&lt;a href="http://antoniocangiano.com/2007/07/26/is-ironruby-mathematically-challenged/"&gt;Is IronRuby mathematically challenged?&lt;/a&gt;", Antonio Cangiano rightfully complains of these fads. He writes:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Well, I was very interested in trying out IronRuby, but I immediately discovered that it is very crippled from a mathematical standpoint, even for a pre-alpha version. (...) However after running some simple tests, it is clear that a lot of work is required in order for this project to live up to the buzz that is being generated online about it, when you take into account that even some simple arithmetic functionalities are either flawed or missing altogether.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;To be fair, the focus of this release is working method dispatch core and built-in class Array and String, as John Lam himself wrote. But it is understandable for people to worry that these problems may be difficult to remedy. Fortunately, it is not the case, as I will demonstrate below.&lt;br /&gt;&lt;br /&gt;Remember, IronRuby is open source, so you can fix problems yourself. Can't divide two floating numbers? It turns out to be as easy as adding one-line method to FloatOps class. Big numbers don't work? Conviniently, DLR provides a high performance class to deal with arbitrary precision arithmetic, namely Microsoft.Scripting.Math.BigInteger. This is how Python long type is implemented in IronPython.&lt;br /&gt;&lt;br /&gt;Without further ado, here's a small patch (34 lines added, 1 lines deleted) to remedy problems Antonio pointed out. I think you will be able to understand it even if you don't know C#! It's that simple.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/pre-a1/patch-math"&gt;http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/pre-a1/patch-math&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you are using a certain operating system which lacks such a basic tool like patch, I heartily recommend you to head to GnuWin32 and &lt;a href="http://gnuwin32.sourceforge.net/packages/patch.htm"&gt;get it&lt;/a&gt;. Add it to your PATH. Let's assume that you extracted the zip file to C:\. You need to pass --binary option to patch because of different line endings; I generated the patch on Linux.&lt;br /&gt;&lt;br /&gt;C:\IronRuby-Pre-Alpha1&gt;patch --binary -p1 &lt; patch-math&lt;br /&gt;patching file Src/Ruby/Builtins/Bignum.cs&lt;br /&gt;patching file Src/Ruby/Builtins/FixnumOps.cs&lt;br /&gt;patching file Src/Ruby/Builtins/FloatOps.cs&lt;br /&gt;&lt;br /&gt;After that, you need to build ClassInitGenerator. This is necessary because the patch adds new methods to built-in classes.&lt;br /&gt;&lt;br /&gt;C:\IronRuby-Pre-Alpha1&gt;cd Utils\ClassInitGenerator&lt;br /&gt;C:\IronRuby-Pre-Alpha1\Utils\ClassInitGenerator&gt;msbuild&lt;br /&gt;&lt;br /&gt;Now it is built, you need to run it to regenerate Initializer.Generated.cs. There is a batch file to do this, GenerateInitializers.cmd, but for some inexplicable reasons it won't work because it got the parent directories(..) one too many. It seems that they haven't tested this.&lt;br /&gt;&lt;br /&gt;C:\IronRuby-Pre-Alpha1\Utils\ClassInitGenerator&gt;cd ..\..&lt;br /&gt;C:\IronRuby-Pre-Alpha1&gt;Bin\Debug\ClassInitGenerator &gt; Src\Ruby\Builtins\Initializer.Generated.cs&lt;br /&gt;&lt;br /&gt;Now to the main build.&lt;br /&gt;&lt;br /&gt;C:\IronRuby-Pre-Alpha1&gt;msbuild&lt;br /&gt;&lt;br /&gt;Let's test! Did IronRuby learn the math we taught?&lt;br /&gt;&lt;br /&gt;C:\IronRuby-Pre-Alpha1&gt;cd Bin\Debug&lt;br /&gt;C:\IronRuby-Pre-Alpha1\Bin\Debug&gt;rbx&lt;br /&gt;&lt;br /&gt;IronRuby Pre-Alpha (1.0.0.0) on .NET 2.0.50727.832&lt;br /&gt;Copyright (c) Microsoft Corporation. All rights reserved.&lt;br /&gt;&gt;&gt;&gt; 1/3.0&lt;br /&gt;=&gt; 0.333333333333333&lt;br /&gt;&gt;&gt;&gt; 1.0/3.0&lt;br /&gt;=&gt; 0.333333333333333&lt;br /&gt;&gt;&gt;&gt; 2**3&lt;br /&gt;=&gt; 8&lt;br /&gt;&gt;&gt;&gt; 1_000_000 * 1_000_000&lt;br /&gt;=&gt; 1000000000000&lt;br /&gt;&gt;&gt;&gt; exit&lt;br /&gt;&lt;br /&gt;It did!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-9148155354867537331?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/9148155354867537331/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=9148155354867537331' title='6개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/9148155354867537331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/9148155354867537331'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2007/07/teaching-ironruby-math-tricks.html' title='Teaching IronRuby math tricks'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-978754342259896303</id><published>2007-06-11T02:05:00.000+09:00</published><updated>2007-06-11T02:44:53.061+09:00</updated><title type='text'>pyprof progresses</title><content type='html'>It has been a week since the beginning of pyprof. The project is progressing well.&lt;br /&gt;&lt;br /&gt;The code is in the usual place:&lt;br /&gt;&lt;a href="https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/pyprof/"&gt;https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/pyprof/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are some Makefile updates. Some variables are now defined at the top of the file. You may want to change the path to Mono, Python, and IronPython there.&lt;br /&gt;&lt;br /&gt;I wrote a call tracer in pure Python using &lt;span style="font-weight: bold;"&gt;sys.setprofile&lt;/span&gt; which should print the essentially same output as pyprof. The filename is prof.py, and you can type "make testpy" to see its output. Compare the output with one from "make test".&lt;br /&gt;&lt;br /&gt;You can type "make test.out" to update the reference output. This file is quite long, as I swapped the sample script to one using &lt;span style="font-weight: bold;"&gt;nntplib&lt;/span&gt; from the Python standard library. The script connects to &lt;a href="http://gmane.org/"&gt;Gmane&lt;/a&gt; and print the description of comp.lang.python newsgroup.&lt;br /&gt;&lt;br /&gt;Some new features of the call tracer includes obvious ones like printing method leave events, and indenting messages to show the call depth. After some refactoring, logic for filtering non-Python assemblies and IronPython-internal methods now live in the separate function. I plan to split them to the separate file actually.&lt;br /&gt;&lt;br /&gt;IronPython-internal &lt;span style="font-weight: bold;"&gt;TryGetExtraValue&lt;/span&gt; calls are now ignored. This was obvious once I moved to profiling real programs.&lt;br /&gt;&lt;br /&gt;In the last post, I wrote that test output assumes you have blank site.py. Then I remembered that Python has a command line option -S to disable importing of site.py. Unfortunately, this revealed a bug in IronPython. I &lt;a href="http://lists.ironpython.com/pipermail/users-ironpython.com/2007-June/005029.html"&gt;reported&lt;/a&gt; the bug to the IronPython mailing list and &lt;a href="https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/patches/1.1/patch-ironpython-option-s"&gt;wrote&lt;/a&gt; a patch to fix it.&lt;br /&gt;&lt;br /&gt;Development of pyprof also revealed a bug in the Mono runtime. When the method is left by throwing an exception, the profiler was not notified about the event. This is problematic, because the Python Library Reference specifies about &lt;span style="font-weight: bold;"&gt;sys.setprofile&lt;/span&gt; (&lt;a href="http://www.python.org/doc/2.5/lib/module-sys.html#l2h-5157"&gt;link&lt;/a&gt;) that "the return event is reported   even when an exception has been set".&lt;br /&gt;&lt;br /&gt;I &lt;a href="http://lists.ximian.com/pipermail/mono-devel-list/2007-June/023814.html"&gt;reported&lt;/a&gt; the bug to the Mono mailing list and subsequently wrote a 4-line patch. That patch actually took 4 hours to come with (a line per an hour :-), but I learned a lot in the process. Miguel de Icaza promptly &lt;a href="http://lists.ximian.com/pipermail/mono-patches/2007-June/094000.html"&gt;applied&lt;/a&gt; the patch for me.&lt;br /&gt;&lt;br /&gt;Now I need to look at the profiling API for Microsoft .NET runtime, as demanded by Michael Foord.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-978754342259896303?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/978754342259896303/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=978754342259896303' title='1개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/978754342259896303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/978754342259896303'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2007/06/pyprof-progresses.html' title='pyprof progresses'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-2245544298436018087</id><published>2007-06-04T10:22:00.000+09:00</published><updated>2007-06-04T17:09:44.487+09:00</updated><title type='text'>pyprof: Mono profiler for IronPython</title><content type='html'>CPython distribution comes with debuggers and profilers. More importantly, it comes with hooks so that you can write your own debuggers and profilers. You can set these hooks by built-in functions &lt;span style="font-weight: bold;"&gt;sys.settrace&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;sys.setprofile&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Here is what &lt;a href="http://www.python.org/doc/2.5/lib/lib.html"&gt;Python Library Reference&lt;/a&gt; says about &lt;span style="font-weight: bold;"&gt;sys.settrace&lt;/span&gt; (&lt;a href="http://www.python.org/doc/2.5/lib/module-sys.html#l2h-5159"&gt;link&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;settrace&lt;/span&gt;(&lt;span style="font-style: italic;"&gt;tracefunc&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Set the system's trace function, which allows you to implement a Python source code debugger in Python. See section &lt;a href="http://www.python.org/doc/2.5/lib/debugger-hooks.html#debugger-hooks"&gt;24.2&lt;/a&gt;, "How It Works," in the chapter on the Python debugger. The function is thread-specific; for a debugger to support multiple threads, it must   be registered using settrace() for each thread being debugged. &lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt; The &lt;span style="font-weight: bold;"&gt;settrace&lt;/span&gt;() function is intended only for implementing debuggers, profilers, coverage tools and the like. Its behavior is part of the implementation platform, rather than part of the language definition, and thus may not be available in all Python implementations.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;In other words, another Python implementation like IronPython is within its own right not to implement these functions. As a matter of fact:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;IronPython 1.1 (1.1) on .NET 2.0.50727.42&lt;br /&gt;Copyright (c) Microsoft Corporation. All rights reserved.&lt;br /&gt;&gt;&gt;&gt; sys.settrace(f)&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;NotImplementedError: sys.settrace is not yet supported by IronPython&lt;br /&gt;&gt;&gt;&gt; sys.setprofile(f)&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;AttributeError: 'module' object has no attribute 'setprofile'&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Don't get this wrong, this is fully okay. Both .NET Framework and Mono have their set of tools to do debugging, profiling, tracing, and coverage, often better than what CPython provides.&lt;br /&gt;&lt;br /&gt;But when you debug a Python program, usually you don't need to single step inside Python runtime. When you trace a Python program, you don't necessarily want to know how a single line of Python code expands to 20 low-level function calls. So it's desirable to restrict tools to Python methods only.&lt;br /&gt;&lt;br /&gt;Enter pyprof.&lt;br /&gt;&lt;br /&gt;pyprof is a Mono profiler for IronPython. Mono provides an interface to write custom profilers, and there are quite &lt;a href="http://www.mono-project.com/Performance_Tips#Other_Mono_profilers"&gt;some of them&lt;/a&gt;. pyprof uses this API to query a custom attribute, &lt;span style="font-weight: bold;"&gt;IronPython.Runtime.PythonModuleAttribute&lt;/span&gt; from method's defining assembly. Messages are printed only if the attribute is present.&lt;br /&gt;&lt;br /&gt;The code is here:&lt;br /&gt;&lt;a href="https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/pyprof/"&gt;https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/pyprof/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Type "make test" to see what it can do. It should print the output in test.out file. (This assumes that you have blank site.py. The output will differ if you don't.)&lt;br /&gt;&lt;br /&gt;Disclaimer: pyprof is a less-than-a-day old software. Don't expect much. But I do have great plans for this baby. :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-2245544298436018087?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/2245544298436018087/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=2245544298436018087' title='1개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/2245544298436018087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/2245544298436018087'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2007/06/pyprof-mono-profiler-for-ironpython.html' title='pyprof: Mono profiler for IronPython'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1938537367225443542.post-8894318713846032481</id><published>2007-06-04T02:56:00.000+09:00</published><updated>2007-06-04T02:58:43.977+09:00</updated><title type='text'>Hello, world!</title><content type='html'>Due to peer pressure, I decided to start a blog. I will talk about the development of FePy project here.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://fepy.sourceforge.net/"&gt;FePy project&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1938537367225443542-8894318713846032481?l=fepy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fepy.blogspot.com/feeds/8894318713846032481/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1938537367225443542&amp;postID=8894318713846032481' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/8894318713846032481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1938537367225443542/posts/default/8894318713846032481'/><link rel='alternate' type='text/html' href='http://fepy.blogspot.com/2007/06/hello-world.html' title='Hello, world!'/><author><name>Seo Sanghyeon</name><uri>http://www.blogger.com/profile/00961438344137964299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
