Roman Shaposhnik's
24 Aug · Fri 2007
Jail time for SSH
30 Jul · Mon 2007
The problem with threads
23 Jul · Mon 2007
Sun Studio and SXDE Live Chat
P.S. Come on! Bring your embarrassing questions with you, 'cause you know what -- quoting snippets of this upcoming live chat might just be the best way to convince PHBs around here. After all you are the customers and you know what that means.
20 Jun · Wed 2007
Git: yet another SCM system or a revolutionary model of software development?
- Distributed vs. centralized development.
Bottom line: centralized SCMs run against the proverbial Bazaar. - Using networks of trust as the key means of conquering complexity of the
modern software projects and dealing with compartmentalization of
key developers/experts.
Bottom line: SCM should reflect how humans are wired. - How to keep the pace of development activity at the highest possible level
(by making it cheap and easy to experiment and not care about breaking other stuff)
yet allow the easiest transition path for the changes that seem to be
beneficial for the project.
Bottom line: branch early, branch often. - Developers vs. gate keepers and why the problems they face are
fundamentally different.
Bottom line: even the best branching is useless without merging
- There is no data coherency model to write home about. Which might not be a problem for most projects but certainly is for something as security sensitive as an OS kernel. Basically with CVS (and I think even Subversion) the only way you know that your data got corrupted is when its too late.
- Branching is waaay too painful because of things like global namespace for branches (read: constant collisions and things like test_12345 branches), all branches being pushed down every developer's throat, etc.
- Subversion patches certain things as far as branches go, but fails miserably as far as merging is concerned.
- The tools you use are supposed to make you more productive. Period.
- Does git really offer a nice way of structuring complex projects like KDE and such? His suggestion of Super projects (workspaced with pointers to individual Git repositories) might be an interesting one, but it certainly requires some practice and experience to be evaluated properly. [2008 Update: It seems that this is no longer an issue. Git got the infrastructure for supporting Submodules and from what it documented on their TWiki looks like they got it right]
- Is the approach Git takes with making it easier to work with projects as a whole at an expense of treating projects as collection of files the right one? See the problem is -- I'm much more of a lone developer than a gatekeeper. So Git might be optimizing for the role I rarely find myself in (and Linus finds all the time)
18 Jun · Mon 2007
If you think that XML is the answer, chances are you misunderstood the question
Date: Wed, 23 May 2007 10:11:57 +0200 From: Lluis BatlleSubject: Re: [9fans] XML To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Lately I've been told at work to use a library in C. Most calls have the signature ErrorType function(const char *xml); I have to pass to them xmls of more than two levels deep, attributes, and around ten elements. When I asked why such interface to a library, claiming that it was uncomfortable to me, the lib developer told me that in fact xml-parameter-passing was one of the techniques he liked most, and helped him solve a lot of problems easily.
16 Jun · Sat 2007
C++ STL: still paying for what I don't use.
qsort [] = [] qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs)at the expense of wasting quite a lot of precious resources such as RAM and CPU cycles.
Now, from time to time I see folks showing examples of C++ code bordering on the same expressive power. Take this little word counter ($ wc -w) for example:
int main() {
std::cout << std::distance(std::istream_iterator(std::cin),
std::istream_iterator());
return 0;
}
It looks impressive if nothing else, and since it is, after all, C++ everybody expects it to perform quite well. But does it?
To answer this question without dragging the reader into the dark realms of assembly language or black art of performance measurements I would really love to have a good old Cfront around. Or any other tool for that matter that would be able to retrace what exactly all the templates and overloaded functions got expanded into. Alas, I don't know of any such tool (if you do -- please leave a comment!). So bear with me while I'll be using my stop watch ;-)
For the speed trial lets compare it to the similar code written in C (and to make it fair I am going to even use scanf instead of a handcrafted code):
int main()
{
int count;
char buf[65535];
for (count = 0; scanf("%s", buf) != EOF; count++)
;
return printf("count %d\n", count);
}
Not that I am surprised, but C++ version ended up being 1.5 slower on my machine. And
if you compile the above example into .s file and look at what main() turned out
to be you can see a reason why. There is about 6 function calls there. Pretty much
nothing got inlined or computed in-place.
Bad implementation of a fine idea? Perhaps (I tried two: G++ and Sun Studio). But it makes one wonder why in 28 years the world hasn't yet seen a good implementation. It's not that the industry hasn't tried, you know.
Am I hearing the ghostly murmur of Algol 68 or is it just my imagination?
15 Jun · Fri 2007
A sandbox for playing with the coolest CPU around.
Well, now I've got an even better answer for all of the OpenSource developers out there: you can ssh into one of these things: ssh.sundemo.ru!
That's right. Apply for the account on the Sun Studio Demo Server and hack away!
P.S. Even thought the form is in Russian, here's what the individual fields mean:
- First name
- Last name
- Address
- Phone
10 Jun · Sun 2007
Roboinvasion @LinuxTAG 2007
And that's how controlling a LEGO Mindstorm NXT robot using Solaris Express Developer Edition and Sun Studio has become THE whole point of the contest:

Here's a funny bit of trivia...[Read More]
08 Jun · Fri 2007
SXDE 5/07: eating your own dog food or sipping your own champagne?
Of course these days I do most of my development on my laptop (good old ThinkPad T43) but the Solaris OS that I have there is kind of clunky. It is a heavily tweaked Solaris 10, which serves more as a proof that it is possible to run Solaris 10 on a ThinkPad after all, rather than a convenient development environment. In short I had all the reasons to upgrade when I settled on a quest for the ultimate development environment based on Solaris OS. The rest is my account of this quest. You've been warned ;-)[Read More]
05 Jun · Tue 2007
What do Sun Studio 12, Project D-Light and SXDE have in common.
P.S. As for Solaris Express Developer Edition I keep entertaining the idea of hijacking it and turning into my third personal project. Although it feels like I might be biting off way more than I can chew ;-)
29 Apr · Sun 2007
DTrace probes -- assert() on steroids?
31 Mar · Sat 2007
What does dynamic linking and communism have got in common?
- all applications are capable of sharing common code at runtime, thus reducing total memory footprint of an entire system
- all applications can reference common code without actually storing it as part of their ELF (or similar) file image, thus reducing total storage footprint of an entire system
- you can fix problems in common code, thus benefiting all of the applications available on your systems at once
The rest of this article discusses why dynamic linking does not deliver on any of its promises and why, just as communism, it might be an idea that only works in an ideal world (as a curious footnote I must add that just as communism done right seems to be doing quite well in one particular eastern country, dynamic linking within a binary compatibility guarantee of one particular OS gets as closed to being true to its promises as one can get).
The goal of this article is not to present an alternative model (I still don't have a 100% satisfactory one even for dynamic linking; not to mention communism) but to merely make the reader question whether static linking is, in fact, long dead and buried or may be the people who try very hard to make us think that way have just spent too much time in an ivory tower and haven't seen the real world in a while.
With that, let me start with tackling the last purported benefit of dynamic linking (an ability to fix problems in common code) not only because it is the easiest to knock down, but also, because once knocked it virtually eliminates the first two benefits completely. An ability to fix problems in common code and effectively addressing it once instead of doing it as many times as you have applications sharing that common code sounds really nice till you ask yourself -- what is a "problem"? What is a bug? And could it be that one application's problem is something that a second application depends upon in order to work properly? The answer to the last question is a resounding YES and there's no better example than a very prominent C++ compiler vendor who had to leave a pretty nasty C++ ABI bug unfixed for a number of years just because any possible fix would break all previously compiled applications. And of course, since C++ runtime library is dynamically linked into any application written in C++ that was unacceptable. You see, in real world programs have bugs. Worse yet -- the line between a bug and a feature sometimes gets quite blurry. That is especially true for common code. Why? For two obvious reasons: first of all, since most likely than not you didn't write the code shared by different applications yourself you have no way of knowing whether your usage patters of that common code do indeed trigger a bug, or whether they are just an example of GIGO principle. Second and most importantly -- you are very likely not to have any control over the common code and even if you can prove that the problem is indeed a bug you'd rather workaround it than wait for a vendor to issue a patch. These two issues combined create a very unpleasant situation where problems in common code now become unfixable not because we can't fix them for good, but because the old buggy behavior is now something that quite a few applications depend upon. This is a classical "doomed if you do, doomed if you don't" principle at work. But where does it leave us as far as dynamic linking goes? In a mess! And a big one at that. All of a sudden we have a system where half of the applications want that piece of common code fixed and the other half wants it broken. All of a sudden we have to make sure that we CAN isolate applications that still depend on an old buggy behavior and the magic of dynamic linking just starts getting blacker and blacker with abominations like LD_LIBRARY_PATH and DSO symbol versioning. What we've got on our hands now is a simple situation where common code becomes segmented in a sense that it is common among just a subset of applications. And that is the point where dynamic linking just breaks. There's no way for my application to be sure that the same common code I tested it with is the one that is being in use. And for any serious software vendor that is just unacceptable. You see, serious software vendors care about their customers and they don't play finger pointing games saying things like: it is all your fault you should have not upgraded that shared library over there. What do they do instead? Well, just try to do
find . -name \.soto see for yourself. If you do that with any commercial piece of software (or even free large ones like Open Office) don't be surprised to see things like private versions of glibc.so being repackaged and redelivered. It is much safer for them to do that instead of constantly dreading the ugly upgrade of /lib/libc.so.
But wait! Haven't it just annulled the first and the second claims that the dynamic linking had? Sure it did. There's no sharing possible between /lib/libc.so and /opt/bigapp/lib/glibc.so. None. The memory gets wasted as much as the diskspace does. It might as well be static linking at that point.
In fact, static linking would be quite beneficial for the application since if done right with the smart compiler it would enable things like: not wasting precious CPU cycles on position independent code (if you think PIC is free see Performance Analyzer in action), doing interprocedural optimization, cross-file inlining and template elimination. And a few others. And unlike dynamic linking you can be dead certain that the very same code you tested would be working at your customer's site. Not only that -- but when you do need to fix it, you fix wouldn't break anybody else.
Ain't this the magic?
30 Mar · Fri 2007
Interested in what's up with Sun Studio?
Kuldip has the latest scoop! And for even more details make sure to login
SDN Channel
21 Mar · Wed 2007
A bit of C code that costs $200 per line.
Temple of the Sun!