Preston L. Bannister { random memes }

2004.07.27

Mozilla trumps IE – again

Filed under: Web — Preston @ 10:11 pm

Got to feel a bit sorry for the poor guy from the IE team. Pretty amusing story…

Compilers – back to basics

Filed under: Software — Preston @ 10:00 pm

C++ is growing, and I am a bit disappointed.

I heard recently that the working group is considering how to add garbage collection to the C++ standard. This is a bad idea. The C language was all about writing low-level code, and did this job well. The C++ language should have been the introduction of some new ideas into C without changing the nature of the language.

If you ignore the right bits then C++ is exactly a better C. If you need to write code that allows you exact low-level control and extreme performance, then C/C++ is a good tool. Not every application needs this kind control, and so you want to pick a higher-level language in which to express your solutions.

Garbage collection is a great idea, but does not belong in a language for writing low-level code. Unfortunately there are bits in C++ that should not be there, and this looks to be another addition to an already overstuffed bag.

How to explain this has bothered me. The answer seems to lie at the intersection of a series of notions.

  • Complex languages have “dusty corners” where behavior differs.
  • Compilers should translate between machine independent notation to machine dependent executable code.
  • First class languages are extensible.
  • Minimalist design.

Dusty corners

Quite a ways back the guy in the next office was part of a group working on one of the first compilers for Ada. When he ran into problems where the solution was unclear, he would call me over and we would try to work out the most reasonable solution. Now recall that at the time Ada was meant to be a model of the most carefully designed and rigorously defined programming language. The Ada language was also stuffed full of all the coolest features of the day. In implementing the Ada compiler we found the complexity of the language introduced quite a few dusty corners where more than one behavior could be reasonable, and it was up to the compiler writer to choose the most reasonable (hopefully after careful thought).

Clearly there was something not quite right. Differing behaviors in different implementations is not a good thing.

Today with ready communication via email and Internet we might have gotten in contact with the language designer, and sought clarification. The reference manual describing the Ada language was already pretty thick and hard to digest. Cleaning out all the dusty corners would have made the manual thicker and even more difficult to read.

The job of a compiler

Recall that the original purpose of a compiler was to translate from a human readable notion into executable machine code. Writing in machine code was a drag. Assembly code was better but still a drag, and not at all portable.

When moving your code from one machine to another you would like the compiled code to behave the same. The more the implementation in the compiler differs from one machine to another, the greater the chance that some decision in the compiler code will cause the behavior of the generated code to differ.

First class languages and shared implementations

The templates in C++ are essentially very fancy macros. Note that the interpretation of templates into expanded C++ code should be entirely machine independent, and must be the same across compilers. Historically we have seen a lot of trouble with C++ template code behaving differently with different compilers.

Since compilers are all about translating machine independent notation into machine specific code, why is the code for templates built into the compiler?

In Lisp there are lots of examples of things like templates in C++. The key difference is that in Lisp the code for interpreting templates is also written in Lisp. Note that the implementation is not buried in the compiler. Note that the Lisp code can be moved to another Lisp system (discounting the effect of dialects) and can be expected to behave the same everywhere.

Minimalist design

Instead of trying to find more things to add, might it not be better to look for things to take away? Not many folks remember the Algol-68 experience (it is a bit before my time even). I do like the approach Wirth took with the Pascal/Modula-2/Oberon family, in looking to build the least possible into the compiler.

Eh – somehow I doubt this explanation is at all as clear as I would like…

Display envy

Filed under: General — Preston @ 9:40 pm

A case for display envy… Apple’s new flat panel displays (via Windows Media Player or RealPlayer).

One screen at 4.1 megapixels and 8.2 megapixels with two screens – very cool. Just hope no one runs a Java app with double-buffered graphics on such a display.

2004.07.14

Books read recently

Filed under: General — Preston @ 3:34 am

Save Your KneesBetween Parent and TeenagerBetween Parent and Child : The Bestselling Classic That Revolutionized Parent-Child CommunicationDreamers, Discoverers and Dynamos : How to Help the Child Who Is Bright, Bored and Having Problems in School

In May 2003 I took three fast hikes in four days, and could barely walk the following day. Did something bad to my left knee, and have only been able to resume hiking (carefully!) in the last few weeks. Only resumed walking and hiking after reading in this book that (limited) exercise of an injured knee is encouraged, and in some cases the only treatment.

The author notes that considerable progress was made in the 17 years between when he began his practice to when the book was written. Since the book was written about 17 years ago, you might expect an update to the book is in order.

As you might guess from the remainder … I have a teenager :) .

2004.07.11

Klunky user interfaces

Filed under: Software — Preston @ 12:03 pm

Several months back I switched to Verizon and bought an Audiovox CDM8900 cellphone with built-in 640×480 camera, and support for BREW. Verizon’s service has been decent – certainly better than Sprint whose coverage became useless both at home and at the office.

The cellphone camera is … passable. I did not have very high expectations of the built-in camera, and got pretty much what I expected.

But the user interface – holy revenge of the twerps! – is really very horrible. This is my third and fanciest cellphone, and with each successive generation the user interface design gets worse. Sure we get pretty colors, higher resolution screens, and more features – but the fundamental user interface gets worse every time. We have an pretty substantial literature on user interface design accumulated over the past couple decades. Even some really lightweight usability testing could have easily caught the really bad parts of the design.

The cellphone camera isn’t going to get much use, as the user interface is just too painful to use. (How can they get so many things wrong in one application!??).

Don’t know how to solve this problem.

Maybe we need regular Consumer Reports reviews of cellphones, with a large weight given to ease-of-use (and assuming they can find someone with a clue about user interface evaluation).

Maybe we need Apple to design a cellphone. Don’t think Apple wants to get into the business of manufacturing cellphones, but they do have have a culture that puts out some well designed (and sometimes brilliant) user interfaces. Perhaps they could license a common software basis for manufacturers to incorporate in their phones.

Maybe we don’t want Microsoft doing cellphone software. Reports from friends and elsewhere describe too much in the way of unreliable operation. Phones running Microsoft software that crash, have to be rebooted, and need to have the software re-installed … at first I thought was just a bad anti-Microsoft joke. Turns out the trouble is real. (I really do not understand this, as Microsoft has some really sharp folks, and almost unlimited resources).

Looked through the downloadable BREW applications (offered by Verizon under “GetItNow!”). These are mostly a joke – a handful of games to play on your cellphone (no thanks), and a couple lame applications. Well, maybe I could hack together something better by way of demonstration … nope, Qualcomm wants you to pay fees for everything related to BREW.

I didn’t sign up for web access on this phone. With the prior two phones I found trying to use the web pretty much a waste of time. Painfully slow response times, and a lack of web applications usable from a cell phone pretty much killed the idea.

iChat AV

Filed under: Software — Preston @ 11:11 am

Ever tried to video or voice conversations over the web with a PC? I have never seen this work well, at least outside commercials.

Hangups include:

  • Standards for video conferencing require a swath of open ports with direct connections between all machines involved. This is a really bad idea as all home users should be behind router/firewall box, and manually configuring ports to specific machines is just too clunky. Not sure why the standards call for so many open ports – seems that one or two connections should be sufficient.
  • Lack of good integration – feedback from microphone to speakers seems to be a common problem.
  • Opaque failures – sometimes things don’t work, and the failure is not clearly explained.

The features in Apple’s Apple iChat AV make me wish I could buy a Mac. Don’t think there is anything as capable for Windows PCs.

2004.07.05

isapi_reward preview

Filed under: Software — Preston @ 11:25 am

Something I started working on some time back with the aim of meeting a particular goal.

  • Allow easy deployment of pure-Java web applications in a Windows environment.

Easy deployment of Java applications means bundling a pure-Java web server (like Jetty, Tomcat, or Geronimo) so the web application is immediately able to run, without a existing web server.

Easy deployment also means simple first-class integration with IIS on Windows. There are a number distinct advantages to routing requests through IIS if you need Windows authentication, encryption, or compression – especially given that many organisations have standardized internally on Windows authentication as is built into IIS. If you are deploying a web application on a company intranet – and the organization is almost certainly using primarily Windows desktops – you really want to use Windows authentication.

With Apache you get pretty much everything you need to rewrite and forward requests in mod_rewrite and stock Apache. With IIS to get the same function – you need some help. Eventually isapi_reward is meant to meet that need, through a combination and URL rewrite and transparent request forwarding (rewrite and forward).

Fair warning: Request forwarding is not implemented in this version!

Routing all your requests through a single IIS server yields a number of benefits.

  • Efficient Windows authentication.
  • Efficient SSL encryption.
  • Efficient (gzip) compression responses.
  • Easy scalability through placing web applications on distinct machines.
  • Outstanding stability for the main web server when web applications run on other machines.

(None of which applies at present).

Less running on the IIS box means more requests can be handled by IIS. Microsoft has worked very hard to optimize IIS. It is not much of a stretch to expect a box running only IIS to be capable of handling requests from your entire organization. What is more, the configuration of the IIS-only box need change very little as new web applications are deployed – which translates into fewer compatibility problems and greater stability.

Imagine what it would be like if all your organizations web applications were available through a single (IIS) web server, and that web server never went down! By placing web applications on separate servers, you can upgrade individual applications without in any way disturbing other applications or the main IIS server.

There is some danger of improving the Netcraft scores for IIS :) .

Again – request forwarding is not – YET – in this version of the code!

So why am I posting this when the original goal is as-yet unreached?

The reason for posting at this early stage because of a not quite expected side effect. I find that installing isapi_reward makes it easier to keep IIS tightly secured.

Turns out even with the just the basic URL-rewrite code working this is pretty useful. As a developer I would like to leave in place the default IIS installation with all the examples. At the same time I know that some of those examples – if left active – may be terribly insecure. By simply defining a request-routing map that blocks everything and allows only explicitly permitted URLs, I can easily block access to everything but the specific installed application I want to test. A simple edit to isapi_reward.ini absolutely controls which web applications are exposed, while leaving the IIS configuration completely intact! This is much easier and less error-prone that mucking around in the IIS configuration.

The installation program for isapi_reward sets up isapi_reward as both an ISAPI filter and extension, and will stop/start IIS as needed. There is some basic documentation in the install. This should be entirely safe to try, and should uninstall cleanly.

Note this is early code. On the other hand with 25-odd years of experience in software – much of the work focused on performance and security – there is a better than average chance I got things right.

2004.07.03

The Wretch, Pat Benatar, Iron & Wine

Filed under: Music — Preston @ 5:52 pm

More new music off Magnatune. Cannot explain why I like this, but I do…

The Wretch: painful ambient industrial noise.

Used the RIAA Radar site to find a new Pat Benatar album from a non-RIAA member (I hope). Bought the Iron & Wine album after seeing the video on iTunes and checking out the label.

Try and find a common thread through the above choices :) .

Next Page »