Search Results: "will"

6 April 2006

David Welton: Language Design - weak types and easy marshalling

Weak/Dynamic typing One of the things I really like about Tcl is how very, very dynamic it is. It's possible to replace just about everything 'on the fly', including control commands like if and while (in Tcl, they're just commands, not special syntax). Like Lisp, Tcl gets a lot of its flexibility from its simplicity, and one of the ways that things are kept simple is via the concept of "Everything Is a String". Some people erroneously recall the early days of Tcl and take this to mean that Tcl represents everything as a string internally, making it very slow for numerical operations. That hasn't been true for something like 8 years - Tcl values are translated into a more appropriate internal representation 'on demand'. However, the concept still gives you lots of flexibility:
set a b
You don't have to quote things - they default to strings - the variable 'a' now contains the value 'b'.
set lst  a b c d e 
No fiddling around with lots of syntax - the above is defined as a string (we could have used "" to group the words), but it gets turned into a list
llength $lst
5
Things are automatically converted into the type you want to work with. Of course, this also makes it really easy to work with code as strings and vice versa:
proc until  cond code   
    while  1   
        uplevel $code
        if   [uplevel [list expr $cond]]     return  
     
 
set i 0
until  $i == 10   
    puts "i is $i"
    incr i
 
and so on and so forth. Ruby (and Python) handles things a bit differently than Tcl does. Even though it's still very dynamic, it is more strongly typed:
"5" + 5 # error
Whereas the same code runs just fine in Tcl - "5" is transformed into a number, because if the programmer is trying to add to it, they must want it to be a number. On the other hand, strong typing can help catch errors, may help make things clearer, and in corner cases, probably helps catch nasty surprises. One of the things that Tcl's system facilitates, at least with simple types (lists, strings, numbers, dicts) is 'marshalling' or 'serializing'. Want to send a hash table down a socket?
 puts $sk $mydict
 # And on the other side:
 gets $localsk mydict
 dict get $mydict key
When you start treating it as a dictionary, it "just turns into one" - or throws an error. Good programmers will check for errors, but that goes for whatever language you use. This often comes in handy for code-creation, as well - it's very easy to build up a string programmatically and then evaluate it, much as you might do with a list in Lisp. It also makes coding short scripts... well, shorter, because you don't have to fiddle around telling the language what you mean, in most cases. Treat it like how you want to use it, and it will work out what you want to do. Hecl Hecl comes into the picture, because I've borrowed a lot of design ideas from Tcl, but the language is still used by only a few people, so we're free to hack on it and change things that we don't like about Tcl. Lately, we've been having an interesting debate on the merits of Tcl style weak typing, vs stronger Ruby-style typing, as well as the string representation you get when you attempt to print a type: http://sourceforge.net/mailarchive/message.php?msg_id=15254941 http://sourceforge.net/mailarchive/message.php?msg_id=15254942 There are certainly some things that could be improved in Tcl's way of dealing with things - one area where it doesn't do so well is in dealing with NULL values - you can't really deal with that in a string, because a blank string is different from no value at all. Wolfgang would like to go towards more Ruby-style values. I'm willing to consider most anything at this stage, because it's interesting, and I like going over the possibilities, in order to make Hecl as useful as possible. "Everything is a string" has its limits in Tcl, in any case, because what ends up happening is that 'complex' types (files, say), are tied, via a hash table, to the C struct that actually implements them, meaning that the string representation is really only a pointer to something else, and isn't "meaningful", as it is with lists or dicts. I think, though, that in this case I'll mostly want to keep types weak/dynamic, as Hecl aims to be a complement, not a replacement for Java, so in many cases, I'd rather see it make nearly the opposite design decision, where it's reasonable. We'll see, though, who knows what 'type' of interesting compromise we might end up with. Of course, I'm always happy to see new people join the discussion.

Mike Beattie: A solution for blocking ssh probers/scanners.

Erich, There's a much easier solution to blocking those ssh scanning bastards... some nice friendly iptables rules! (I forward ssh to an internal system, so this is in the FORWARD chain.. use the INPUT chain otherwise)
### Catch SSH probes
iptables -A FORWARD -p tcp --dport 22 -d <local net> -o eth0 -s 0/0 -i ppp0
         -m state --state NEW
         -m recent --rcheck --hitcount 3 --seconds 60 --name SSH_PROBERS
         -j LOG --log-prefix "Adaptive-FW SSH Prober: "
iptables -A FORWARD -p tcp --dport 22 -d <local net> -o eth0 -s 0/0 -i ppp0
         -m state --state NEW
         -m recent --update --hitcount 3 --seconds 60 --name SSH_PROBERS
         -j DROP
iptables -A FORWARD -p tcp --dport 22 -d <local net> -o eth0 -s 0/0 -i ppp0
         -m state --state NEW
         -m recent --set --name SSH_PROBERS
         -j ACCEPT
So, in the INPUT chain, you wouldn't use -o, and -d would be the IP on your external link.. in this example, ppp0. What it does, is uses the ipt_recent module, tracking connections from a given IP. 3 incoming connections in 60 seconds will cause the remote host to be blocked. Of course, this affects normal logins too, so for known hosts, it pays to insert a rule beforehand that does a -j ACCEPT. I'm enjoyng the very short log entries for a given ssh scanning host in my logcheck mail :).UPDATE 2006/04/07: Whoops...
Sorry Erich, didn't notice that :)

Martin F. Krafft: Sawasdee, Thailand!

The day of our departure to Thailand was remarkably stressless, I even found the time for lunch and coffee with one of my dearest friends. We had plenty of time catching the flight to Vienna, and if it wasn't for the filthy Danish sex tourist who kept burping, snorting, and generally being a bother next to me on the fliught from Vienna to Bangkok, I would have said the trip was perfect. We got in to the city in the afternoon, found a fair hotel next to Sukhumvit Road and headed off to run errands, cashing traveller cheques, drinking juices, and walking around. Just ready for sunset, we got up to the 59th floor of the amazing Banyan Tree Hotel, and two further flights of stairs led us to the roof-top bar. That evening, we went through Patphong and Soi Cowboy, the two centres of the infamous Thai ladyboys, and after a beer or two, we headed for the hotel and drifted away almost immediately. Our plans to head for Lumphini Park in the morning to participate in the Tai Chi sessions were foiled by oversleeping, but we can do Tai Chi on other days. Rested, we headed for the train station to send off the bag with clothing via train cargo to Chiang Mai, where it will (hopefully) be waiting when we arrive in two weeks' time. This message reaches you from Chinatown, we're catching something to eat before going 3rd class to Ayuthaya. Tourists usually take a taxi for 1000 Baht (about 20 EUR), we pay 15 Baht each and will be in touch with the locals. This being my first post on my trip towards Myanmar, so there's nothing much to write. One thing I found noteworthy is the change in the way taxis work these days. Two years ago, I learnt to insist on taxis starting their meters rather than quoting a price up front. Last year, my cousin and I made first experiences with taxi drivers refusing to go with the meter. This years it's nearly impossible; apparently too many tourists didn't think enough and now the drivers are unwilling to give up the profit from ripping them off. Example: Sukhumvit to Hua Lamphong station was 69 Baht in a taxi (our hotel told the driver to behave), and I sure we would have been quoted 200 Baht with a possibility to bargain the driver down to 140 or so. Anyway, that's it form today. I'll write again from Ayuthaya or Khorat.

Daniel Baumann: EiffelStudio is Free Software

Eiffel Software has finally relicensed EiffelStudio. The binary-only pain is over. Some weeks ago, roumors had it that Eiffel Software will only release the sources under a non-free license (non-commercial use only). The ceremony, where Bertrand Meyer pushed the magical red button to import the sources into the repository was held today. Unfortunately, I was not informed about the particular date and time, so I did not have a chance to attend it... too bad. However, EiffelStudio is now dual-licensed, under their previous non-free EULA and under the GNU General Public License. It have the impression that Eiffel Software does not understand the GPL, they're claiming that one is not allowed to create commercial applications with the GPL version of Eiffel Studio: "Users who write commercial proprietary software must purchase the corresponding licenses and may freely choose how to distribute their software. Users who donate their source code to the Open Source community can use the Open Source version and must distribute their software under the same license." Remember: The GPL does not restrict the act of running a program at all and the Eiffel standard library is licensed under the DFSG-compliant Eiffel Forum License (a BSD License derivative). There is no possiblity to enforce such a non-commercial use only of EiffelStudio with these two very licenses. Thanks Eiffel Software and Bertrand Meyer for finally doing the right thing, and to Eiffel Team at the ETH Zurich for constantly bitching them about the issue while the last years. Of course, I'll prepare packages for Debian based on my non-free unofficial packages.

5 April 2006

Adeodato Sim : grep-dctrl -s Source:Package

I just wanted to say thanks to Antti-Juhani Kaijanaho, the author of grep-dctrl, for implementing a fix for my wishlist bug #355960. Now it is possible to obtain the value for a field (eg. Source) from some other field (eg. Package), when the former is not present. For example, to obtain a list of source packages that need to be rebuilt in a MusicBrainz transition: grep-dctrl -FDepends musicbrainz -ns Source:Package. Formerly, one would have to list binary packages, and do some juggling to get the list of sources. I think regular grep-dctrl users will surely appreciate this capability. NP: Almod var & McNamara, Suck it to me

Clint Adams: Batman was running Wesley Willis amok

Matthew, you continue to be disingenuous. If you, in your official capacity as Debian representative, expressed condolences to the GNOME advisory board with regard to the death of GNOME's UI, I bet that some of the people not laughing might be angry with you. Now how many of them need to speak up before you'd acknowledge them as people and not rabid stick figures?

Clint Adams: Unified platitudes

Matthew, you are violating my Grand Unified Code of Conduct. I am reminded of a story from a long time ago. A fascist authority figure wanted to incite his wards to support a war that was somewhat controversial. He knew that if he insisted directly that all display support for the war, there would be some backlash. Therefore, he announced that whether or not someone supported the war (and that it was okay to have opinions either way), one thing that they could all be unanimous about was that they supported the brave and heroic members of the armed forces, and since this could not possibly be controversial in any way, arguing against it would be an indication of insanity. So the chorus mooed and baaed and appreciated the excellency of this logic, and by the next day most were parading about with signs and ribbons and shouting about how the troops were great and how they sure hoped that they'd win the war quickly. It did not end well for the small minority that did not support the armed forces. So the political aim was achieved with just a little bit of trickery. The one clear thing that we can draw from the thread on debian-private is that a bunch of hysterical people are perfectly willing to act without thinking. Maybe we're talking about different threads. It is offensive to offer condolences on behalf of the entire project if said offer is controversial. It is offensive to pressure people to observe one, two, three, or fifty minutes of silence to make some political statement. It is offensive to derogate the objections of an individual in such matters. It matters not whether the objection is grounded in religion, spirituality, politics, culture, honor, integrity, or an unwillingness to be insincere. Don't fucking speak for me.

Erich Schubert: Programming languages: the next big thing?

I've been thinking a lot about programming languages. Especially on what the "next big thing" after OOP will be (and I'm talking of the magnitude of OOP vs. traditional imperative programming). I'd predict we'll end up with such a new paradigm in like 10 years, and it'll do away with OOP like OOP did with traditional imperative programming. It won't be Aspect Oriented Programming. It won't be UML and all its sublanguages. It won't be a pure functional paradigm, these have been around a long time already. It'll have to have multithreading support in a very natural way (multithreading is somewhat ugly in all the OOP languages with locking and such; in theory it should be very nice in functional and logic languages, but I'm not aware of anyone actually making use of that...) I guess it'll be around data flows, and it will offer a range of detail levels, so that on the one end you can do amazing things with a few lines of code (like in python or ruby), but it'll also be possible to use (and enforce if needed) lots of constraints for validity checking such as typing, value constraints, pre- and postconditions and so on. And it won't be graphical like all the UML stuff, because coders type a lot faster than they click. It will however need to come with a very very powerful editor offering benefits from both the Eclipse and the VI worlds. It will be very interesting to watch these developments. Oh, and I have intentionally no comments on my blog.

MJ Ray: GPLv3: April: two transcripts, two meetings

Ciaran O'Riordon will speak at a British Computer Society meeting in London on Friday 7 April 2006. GPLv3 will probably also be discussed at a multinational free software conference in/near southern Austria. [details...]

Holger Levsen: all FOSDEM videos online

Videos from FOSDEM are now available for download in four different encodings and qualities. Enjoy!

Thanks to Wolfgang Lonien who pointed me to some nice FOSDEM pictures which I will use for creating a DVD. It will be released, when... ;-)

Rapha&#235;l Hertzog: Leader election: last chance to vote

Given the low participation, it looks like the choice of a DPL is difficult this year. It probably means that the platform of the candidates do no suit everybody… however with DPL teams, there’s more than just the DPL and in theory each member should have their own platform. That’s not the case for me because writing a platform is a big job… which I can avoid since I’m not candidate. :-) However I now do feel the need to tell what I would like to propose (and do) if I’m part of a team so that you know better what to expect if you vote for a team where I’m involved. I’d just like to give a warning, those items are quick notes and are in no way full- and flesched out solutions, they will need to be discussed and refined in all cases, and somes ideas may be dropped of course. This list is neither complete nor definitive. Not all items will be achieved but each of them is a real progress IMO and I’d like to be able to work on them. For people who are concerned by those changes, I’m sorry if you discover my ideas by this post even before I had the opportunity to talk to you… I’m posting those ideas now because they may be considered by people who are currently voting, but it does not mean that I’m not interested to discuss them with you. It’s also true that some of those ideas can be implemented without being part of the DPL team and I’ll certainly try to implement some whatever the outcome of the election, but I really believe that being part of a DPL team helps greatly because you have access to some important informations, and you can effectively discuss with core teams which are otherwise difficult to approach for non-technical discussions when you’re a random DD. And last but not least, the trust of the developers is a big motivation (at least for me) to work effectively on those problems. See this post for my personal vote recommandation and see you in 3 days for the result of the election !

Kai Hendry: LPI

Just to scratch an itch, I tried migrating / side-grading to Ubuntu from Debian Etch. I still haven’t quite succeeded as I am still wrestling with aptitude, but I did find something interesting from my Etch migration discussion on ubuntu-devel. Marco Cabizza says that one of the reasons it is quite hard to migrate is due to the Launchpad integration. This sent alarm bells ringing as Launchpad is proprietary and since I might be developing an Ubuntu derivative, I didn’t want to be necessarily locked to the Launchpad suite. The packages with launchpad integration seem to be a bunch of Gnome centric software which thankfully doesn’t worry me. But what if more and more packages are integrated? I don’t think it will happen as it is too hard to easily manage many divergent patched packages. Ubuntu is probably sensibly catching crashes from the Gnome applications so they can make an even slicker desktop.

4 April 2006

Wouter Verhelst: CF adventures

I've been playing with my ColdFire board the last few days. The initial problem of not being able to boot the kernel with useful output has been fixed thanks to one helpful post on a ColdFire-related mailinglist, and it now happily boots. I'm only doing NFS root for the time being, but that will change as soon as I get a decent powersupply to hook up to that thing, so that I can actually use the SCSI controller that I have (which seems to require more than the 5V barrel-connected powersupply that came with it and that I now use, can handle). Anyway One of the initial things I'm trying to do (after compiling myself a full and reasonable system, rather than the default busybox-based one) is to get the modified binutils up and running. Since I'm not sure the version I'm using will properly cross-compile (and since I don't actually care about cross-compiling, either), I've started a native compilation. I was sure that'd work at least to some degree, even if it'd take a (fair) bit longer than cross-compiling. One of the first things that I notice is that it doesn't work. Apparently, the compiler shipped by Freescale doesn't produce working binaries. Every binary that I try to run gives a bus error on startup. Investigating with gdb shows it does so in the PLT section of the ELF binary. This looks so extremely close to #327780 that it isn't funny. Guess I'll know what to do for the time being.

Jos Parrella: Free Software vs. Privative Software in Venezuelan National Assembly

For my hispanohablantes readers: this post is written in english since it’s gonna be syndicated into Planet Debian. Expect a post in spanish later in the day. If you can understand spoken spanish, I recommend you to hear the Free Software talk of M.Sc. Ernesto Hern ndez-Novich (Debian Maintainer) which ends noting several benefits of using Debian GNU/Linux. Available here. Update: other posts in spanish are already available in Planeta Linux Venezuela. Yesterday we (SOLVE, a Venezuelan Association of Free Software Users, Developers, Cooperatives and Entrepreneurs) had the opportunity to assist to a Free Software vs. Privative Software forum. This doesn’t sound amazing, indeed. But if you take into account that the Forum was held in the National Assembly (or House of Representatives, anyway I’ll call it AN) it gets better. Now, get this idea: the AN is having a forum to discuss a Law, and it’s listening to the parts involved. Let it sink for a minute. But what if the AN is also bringing this parts to a table to actually write the Law? This is how laws are made in our Country now (Damog always says we are terribly nationalistic. It may be true, indeed.) Anyway, we were there around 10 AM, in the Protocolar Room of the AN. The event was full-house, featuring two thirds of people supporting proprietary software (students between 17 and 20 years from the countryside and big entrepreneurs -and Microsoft, of course-) and one third of people supporting free software, including people working in the Government, students, cooperatives, developers, etc. The session was opened by Representative Luis Tasc n, which once was a great supporter of Free Software (now it seems the same for him, anyway he’s doing a great job changing the law-making roadmap) and the speakers were: Microsoft, the National Center for IT, Cavecom (the association of big software enterprises in Venezuela) in the Dark Side and Felipe P rez Mart (from SOLVE) and Ernesto Hern ndez-Novich (Sim n Bol var University) in the White Side. Kudos for IBM, in the Gray Side with Black Spots. The session of talks was incredibly amusing. The speakers started to change their opinions based on the last talk. So, this way, Berrizbeitia (Director, CNTI) tried to discuss Tascon (Representative), the Microsoft Brazilian guy tried to oppose Berrizbeitia, the guy from Cavecom fighted Microsoft (this guy was a complete moron, by the way: when he was told that a group of venezuelan people had developed translations into wayuunaiki he said that was useless since we only have 800 wayuu - native americans) the IBM-boy tried to say they were the best, Felipe Perez (SOLVE) tried to dismantle Berrizbeitia’s talk and finally Ernesto Heranndez-Novich roundkicked them all. The kids from Microsoft (wearing MSDN and VisualStudio shirts) said that Microsoft is a good company which is open-source and gives the code for free. I argued some of them that they were working free for Microsoft. They “hadn’t see it that way”. They also said the plain-ol’-good excuse that “free software was weaker since everyone can see it’s code”. They were changing their strategies and opinions sistematically as the Forum evolved. They argued no compatibility, security problems, and finally they arrived to their real reason to oppose Free Software. Several girls and boys (Daddy’s Boys, as we say to them) were arguing “no free speech” in the Country (which was amusing since this is the first time the National Assembly is writing the laws with the People) and that the Law was going to make them lose their years of University studies. Then, the most accurate of the interventions came, made by Rogmar Marin from Venezuelan Patents and Author Rights Office. He said that this event was all about the people controlling the State, not the State controlling the people. He cited two articles from the draft and the 3390 decree explicitly saying that Free Software was mandatory for Government (in the Decree it says the “National Public Administration” and in the Law it says the “National Public Power”) so he said that they were not going to lose their “bicoca” (a popular form to say “rivers of money”) since they still can program in whatever they want, just that the State has the right to decie the best for their people, and the best for their people was Free Software. This was the whole quid of the event. This is not about Free Software vs. Proprietary Software. This is not about Linux vs. Windows. This is not about IBM vs. Microsoft vs. Venezuelan Companies. This is about the best for the People (which is the maximum interest of the AN) and, in this case, the People was represented not only by the intellectual-closed-circles of Free and Proprietary Software, but by Ana Maria Morillo, from the Cambalache community in Puerto Ordaz, at the southern part of the Country. She said that their Community had absolutely no access to technology. They were poor and humble, and willing to learn. CVG Telecom, a State-based telecom company, installed a Nudetel (no, it’s not an ethic-relaxed phone operator. It stands for Telecommunications Endogen Development Kernel) in their Community, using Free Software. This was their first approach to technology and computers. They didn’t even know how to turn on a computer. Free Software helped them to approach the reality of computers. They felt prepared to use a computer, and proud of themselves. When they used privative software in other places, they needed to adapt to that technology. This demonstrates that Free Software is as easy as any Software. You need to adapt to it. The difference with Free Software is that you are free when you use it. The people from Cambalache appreciate that. Felipe Perez Marti talk was really good. He slapped Microsoft and opposed very roughly to the “technological neutrality” position of the CNTI Director, Jorge Berrizbeitia. Technological neutrality is a neo-liberal, right-wing doctrine which is the technological counterpart to laissez faire, laissez passer. The problem is that (Felipe is an economist, and a great mathematician) technological neutrality isn’t actual neutral. It happens under the conditions where the Smith’s “Invisible Hand” Theorem is valid, so, in a scenary of technological neutrality, the powerful always wins. So, Microsoft wins. He also noted the recent study funded by the United States Homeland Security and carried on by Carnegie Mellon, Coverity and Symantec, which stated that Proprietary Software had between 20 and 30 bugs per TLOC (thousand lines of code) while FOSS had only 0.434 bugs per TLOC. The Microsoft guy seemed astonished by the “discovery” and the students were offended by this. Great. What next? We brought CD’s for people, made Debian evangelization to several “disident” students, made a great cheer to every Free Software supporter, brought signs and SOLVE shirts. While the Microsoft dudes where more than twice times us, we were a coherent group which stayed until 1930 (they left at 1600, you know, it’s a Micro matter of Soft) and held great arguments, sometimes slapping the student’s moral, but definitely making our voice be heard after tenths of years being discriminated by companies, Universities and the Government. As a Debian Project volunteer, what’s your opinion about this? Is the State violating Free Speech taking this decisions? Does it have the right to take it? Is Free Software the best solution for the corporate environments of the Government, taking into account that it handles the citizen information? What are your general comments about this?

John Goerzen: Mail Server Comparison

After my mail reader comparison, I've been fortunate enough to have a few mail server troubles. So here, to help you with your mail server decisions, is my mail server comparison.
>



Andree Leidenfrost: I'm on Planet Debian!

Thanks to the indefatigable and ever helpful Amaya, I'm now on Planet Debian! Thank you also for your nice introduction, Amaya! :-)

Just to drop a few words about myself and what I do:

I am an expatriate German and have lived in lovely Sydney for almost seven years now. I work as an IT professional mainly programming and maintaining SAP systems.

I have been a Debian user for about a decade now and finally decided to become a maintainer almost two years ago when I started to get involved with the mindi and mondo packages that form the quite neat, flexible and versatile disaster recovery suite Mondo Rescue.

It turns out that I got sucked into Mondo Rescue upstream development reasonably heavily mainly because it is quite a low-level tool and thus needs reasonably extensive tweaking to get it to work properly on Debian (or any other distribution for that matter). Upstream (at the time) wasn't all too fond of Debian, but I was given CVS commit access pretty early on which suited my fine as I could commit my fixes directly upstream.

Since about half a year ago, upstream has become much more active, mainly thanks to Bruno Cornec (sorry no link), the new lead developer. So, hopefully for Etch, we will have a much cleaned-up codebase and fully operational RAID and LVM2 support! In the meantime, give Mondo Rescue a go - it is quite cool as it is right now! ;-)

Hopefully, there will be some time soon to look after a few more (maybe less demanding) packages and to get more involved in Debian in general. Oh, and hopefully I'll be a real Debian developer soon - DAM approval on 27 Mar looks promising - thanks, Joerg! ;-)

Matthew Palmer: Rewriting in Rails -- A Practical Examination

[Note: this article was mostly written some weeks ago; I left it in my "to be edited" box and then promptly forgot about it. So any and all temporal references are way out of whack. Since originally writing this article, I have commenced an incremental rewrite of an in-house business management application from crazy-PHP (a common -- some may say overwhelmingly so -- dialect of the language noted for it's complete lack of any sort of good software development practices, such as the creation and use of functions (!)) into Rails. Articles on this effort will be appearing presently.] Almost immediately after I'd finished writing my previous discussion on why rewriting software is evil, I decided to make a little experiment. What I did was take a fairly well factored PHP application, and rewite (a portion of) it in Rails. My intent in this was not to produce a production-quality rewrite. I have no interest in proliferating yet more functionally equivalent clones on the world. Instead, I undertook the work simply to get a feel for (a) writing a whole, traditional, Rails app in a short space of time, (b) how quick Rails really was to produce an application, and (c) whether wholesale rewrites really are as boring and life-sucking as I imagined them to be. My methodology was this: with a small amount of knowledge of the target application (SysCP), the existing database schema and templates, and a weekend, rewrite as much of SysCP as I could in a close-as-possible reproduction of critical SysCP functionality. My summary results are: rewrites are as boring as I thought they would be, Rails is powerful but fairly complex and slightly buggy when you get down into it (especially if you're working from an existing -- possibly suboptimal -- database schema), but overall, Rails is Way Good Stuff. On the boredom aspect -- I had two days to write code. I had some domestic duties to attend to (walk the dog, visit the hardware store, help my wife with attaching a new bag rack to her bike, mow the lawn, etc) but on the whole, it was dedicated to programming. I've spent whole days (hell, 40 hour marathon stretches) cutting code before. I knew this wasn't a six-month deathmarch, but only a weekend experiment. Despite that, I feel that my motivation levels were lower than they normally are when coding. I can only imagine what it must feel like, two weeks into several months of hard core coding, knowing that you'll end up with what you had before, functionally speaking. If you are going to do the rewrite thing (and may the Flying Spaghetti Monster have mercy on your soul if you do), then pick the right project. SysCP is large masses of tangled PHP (is there any other kind?) but it has a fair amount of local and global structure once you get down to it -- for instance, it's quite well factored into business logic and display, and the code is broken down fairly logically by action handler, so you get entire source files that look like this:
  if ($action == 'edit')
   
    // 150 lines of twisty passage PHP
   
  else if ($action == 'new')
   
    // Another 150 lines
   
  // repeat for another few actions
and so on. The nice thing about this is that, if you have to look for how something works, you can almost certainly find it in one place in the source. Deciphering it might be another matter, but at least you've got something to start from. As I mentioned, the display in SysCP is pretty nicely split off from the logic -- a large number of templates, with common header/footer files, with some small parts in common templatettes. Some HTML is still generated within the actions, but due to the above action-based structure, it's usually fairly easy to identify all of the HTML that will be associated with a particular action and turn it into a coherent Rails template. I would dread doing a rewrite of the presentation layer of, say, IRM. It's idea of well-factored presentation is to separate print statements from logic by a blank line. To my great shame, I've had the reins of IRM for a year, and it's still this bad. I claim it's because I hate HTML coding with a vengeance, but I think I'm actually just scared to try and tame that particular monster. (Update: Martin Stevens has been doing some good work turning IRM's HTML into Savant templates. The only downside is that I can hear his manic laughter -- caused by IRM's insanity slowly infecting him -- all the way from England, and it's keeping me awake at night). I also had to re-learn that most hated but most important of lessons -- that, no matter how much reading you may have done, until you've cut chunks of code in a language or environment, you have no idea how it actually behaves in your brain. Specifically, I spent a fair amount of my alloted rewrite time learning a few little lessons in how Rails actually behaves, and all of it's cool little features. Of course, everyone is going to have this pain, and I've suffered it in every language that I've done any appreciable amount of programming in, but it's always a shock to the system that -- after all this time programming -- a new language still makes my brane tingle curiously for a while. Luckily, I'd read and digested all of both the Pickaxe (Programming Ruby) and AWDWR (Agile Web Development with Rails) so I knew what was possible, I just usually wasn't sure how exactly, so I spent a lot of time with my head in the books. Rails' little foibles also bit me in the bum more than once. For example, I spent over an hour (a no foolin' hour) trying to hunt down what I was doing stupid in my code to make Rails completely forget about the value of a couple of my fields. The answer turned out to be to restart Webrick (Rails' internal webserver for development testing), and the problem cleared right up. You could hear my screams of anguish from the moon (even through the vacuum of space -- it was a lot of anguish). Rails isn't the Final And Ultimate Solution To The Webapp Problem, but it's a good start. There is near-zero administrative bumf when you're writing a Rails app. Rails is fairly intelligent about working out what you want done from the world around it. Code generators (which produces sensible, minimalist templates -- not the ugly, unmaintainable behemoths produced by Visigoth Studio, which has given the whole code generation world a bad name) handle a lot of the low-level "oh bugger, I have to add a new file" feeling. It's very, very anal about project structure, but (in contrast to many other bondage-and-discipline frameworks I've looked at in the past) this structure seems almost comforting (maybe I'm just getting old and turning into a satisficer). What all this means is that you (a) don't write much code unless it moves you toward your goal, and (b) Common structure means that any Rails app will be fairly familiar to an incoming programmer. Unfortunately it also means that cunning wankers will, sooner or later, work out a whole pile of ugly tricks and contortions to get themselves out of Rails' comfortable-but-no-doubt-incompatible-with-many-people's-ways-of-thinking straitjacket, which I will (sooner or later) end up maintaining. Like many of Rails' (and Ruby's) features, though, I don't see them being any more abusable than most features of any programming language or environment -- and at least they're powerful and useful (unlike, say, register_globals, magic_quotes_gpc, magic single-character variables, mandatory indenting, or banning tabs as indent characters -- I thought I'd spread the slagging amongst lots of languages). Productivity-wise, although I was only just kicking off my Rails webapp knowledge, I felt I was doing fairly well. From experience, what I produced in my weekend was roughly on par with what I could produce in PHP in the same amount of time, had the situation been reversed. Considering that I have about 3 weeks of Ruby/Rails knowledge, and about 5 years of PHP experience, I think that's a big win. (Update: I've since produced a DNS management applet for work in about 6 hours billable time, and a virtual mail account application in about 12 hours, both using Rails. There isn't a hope in hell that I could have performed a similar feat in PHP, especially with the same amount of inherent flexibility that the Rails solutions contain). Overall, my impression of wholesale rewrites as being soul-sucking experiences stands. I suggest they be approached with the greatest of care, and only be permitted after an appropriate period of psychological counselling. There is plenty of code that needs rewriting (but why do I always have to find it?) but replacing it by doing an rm -rf on the source tree and starting again is not the answer.

Erich Schubert: Windows fileservers suck

... give me samba, please! I've recently been fighting windows file servers. They run on totally oversized hardware (P4-HT, 8 SATA drives in a 7-active-1-hotspare RAID-5 set) but still don't perform reasonably. (2.5 MB/s write performance is really bad, read performance is somewhat okay, though) And then it's so easy to confuse windows... seems like Windows can't handle directories ending with a dot. But you can easily create such folders over the network with SMB... name a folder "foo." and windows can't handle it any more. Or "...". Windows can't delete or rename it. And I'm talking NTFS, not plain old legacy FAT. So if you're going to hide data on a windows box, just store it using SMB in such a folder. And if you want to be really evil, write a script that autodiscovers writeable network shares around you and creates "You suck." folders there. Windows users will start running around screaming, but obviously you can't be the culprit, since you can't access Windows shares, can you? I've also been porting a python app to Windows. Python is so nice, and PyGTK works like a charm on windows. Now if Windows just wouldn't suck as much... for example, it doesn't have os.fork(). And it's I/O charset semantics are a complete mess. Once you don't use only 7-bit ASCII you're likely to go crazy. Seems like the console on Windows always uses codepage 437. The filesystem probably cp 1252. Windows internally claims to use 16-bit unicode. So if you want a python script to run on windows: I can recommend python for cross-platform coding however. The PyGTK GUIs are really nice, much nicer than all that java stuff out there. And these "issues" with windows aren't really Pythons fault, but Windows.

David Nusinow: Monolith == Zombie

So you may be wondering why there's no modular Xorg in unstable. The reason is that there was a security update with -5 that went out. That update failed to build on mips(el). As a result, it didn't go in to testing. I asked the secure testing people to handle it, and Micah Anderson bravely stepped up to the task, and got it moving. Just before he was about to finish though, I was informed that without a new upload of xorg building on all arches, any packages on amd64 that needed X wouldn't enter testing. This is because amd64's new testing archive didn't have any X packages, so it needed mine to allow them to transition. So, my allowing the mips(el) stuff to continue to fail to build required a new fixed upload, which will be going in early tomorrow.

Just as a note, I now hate the monolith and was basically guilted in to doing it so I wouldn't be the one holding up amd64, which is even more important to Debian right now than modular X. Once that transition is done, I'll go ahead with modular Xorg. I'm pretty frustrated that it's not done yet, but at least the delay was for a good reason. Be ready though, because modular is coming and it may well break plenty of things that I can't forsee.

3 April 2006

Martin F. Krafft: The design does not allow it

During my trip to Copenhagen, Denmark last weekend, I was booked into a fancy hotel described all over the Internet as the in-hotel of the city (it wasn't my choice). The building had just been converted from a department store to a hotel. After checking in to my room, I noticed that my bathroom lacked a shower curtain, so I promptly went to the front desk to ask them to change that. The guy behind the desk was so incredibly stupid as he smiled at me and answered: "that's because of the design; a shower curtain would not fit the design." He was probably previously selling underwear in the department store and had his role recast without any training. Unfortunately I failed to take a picture of the bathroom, but if there really was some design at work, it was so subtle that you couldn't notice: a regular bathtub, a sink, a toilet, a mirror, and two towel-hangers... nothing more. Oh, and there was one of those blue lines on the otherwise white tiles approximately two metres from the floor. You know, one of those "designs" that you will find in almost every bathroom built in the last five years. Anyway the lack of shower curtains is only one of several reasons why I would never check in to that hotel again, nor recommend it to anyone.

Next.

Previous.