p. This past year at OSCON I interviewed a lot of people, I mean a lot. I’ve still got more to come after this one. The fun part about the whole OSCON interview series was that almost one half of the interviews I did worked at OmniTI. Here’s is my interview with Wez Furlong. As with others from OmniTI, Wez Furlong proved to be a fascinating subject to talk to. For a little background before we dive into the interview here is what his OmniTI bio page has this to say about him.
bq. Wez joined OmniTI in June 2004 to develop the heart of our Ecelerity [Ed. Now Message Systems] product. Prior to his time at OmniTI, Wez was the Principal of his own small software consultancy based in England, developing internet and desktop systems for clients as far away as Japan and Australia.
Defying the expression “Jack of all trades, but master of none”, Wez’s expertise lies in his deep understanding of a very wide range of technologies and his ability to apply that knowledge to build powerful systems.
p. Here’s how our conversation went.
p. **Hi Wez and thank you for taking the time to sit down with me today. I guess the first thing we need to do is talk a little about your background. Can you tell us a little about how did you get into PHP?**
Back then I was working for a company in England building ASP based applications as well as a full blown professional services consulting. We had a prospective client from Japan who needed a web based application and it needed to run on their Solaris servers. This meant that ASP was not suitable. We took a look at PHP, I think at that time PHP 4 had just been released as stable or a late Beta. So we used it for the application. One of the things we needed to do with this application was to integrate it with a payment gateway and that required using SSL. We could have used curl, and in the end we did, but what I wanted to do was to be able to use fopen() to do HTTPS. So I put together a hack to allow me to do that from within fopen(). The infrastructure to do this in PHP was kind of there but it was a bit nasty to do it and it wasn’t very good. So I proposed that as a patch. From there we developed that idea into the PHP Streams abstraction layer. That has since gone into PHP and I had to touch every corner of PHP to get it integrated.
p. **So is that the main piece of the core you are maintaining right now, streams?**
Well, right now, I’ve not needed to do much with it because it’s stable and I’ve been kind of busy. Also, Sara Golemon has done enough with it now so that she can support a lot of it too, which is great because now the project doesn’t have just one person that knows everything. It’s also great because I can step back and concentrate on newer things like PDO.
p. **Since you brought it up, let’s talk a little about PDO and your work on it. Now that you have the base of PDO built, it’s stable and now included in the core, where do you see it going?**
One of the things that we are working on is making it work with the Unicode stuff coming up in PHP 6. One of OmniTI’s customers has a need for Unicode in ODBC so I already have a prototype that we have shipped to them. So we will refine and extend that to the whole of PDO.
p. **You also work on the SQLite extension. Can you tell us a bit about that?**
The SQLite extension first appeared in PHP 4 and has been in the core for some time now. SQLite is also supported in PDO. Writing the SQLite extension was a great step because it helped clarify how we were going to write PDO. In addition to being useful in its own right, it was a useful stepping stone for us in building PDO.
p. **Very interesting, let’s now turn our eyes to the future for a bit. Everybody is talking about Unicode support in PHP 6. Why is this important for PHP programmers?**
It opens up a lot of avenues. Going back to that project I mentioned for the Japanese client, what we had to do was build a web application that worked in English, Japanese, Chinese, and Korean. So we had to take into account all the nuances of all those languages. Things like working in ASCII text but also working with Japanese encoding. We had to deal with handling all the different character conversions so that we could take input in one character set but then convert it into the one you are working with at the time. Then you have to store that so that you know what the character set was. There are a lot of headaches there.
p. Things like your native string functions don’t function so well. For instance, strpos() has no innate knowledge of multi-byte character sets. If you find a character that happens to match then you’ve actually got the byte offset, not the character offset because there can be more than one byte in the string that corresponds to that character. There is a lot of complexity in there that is really hard for you to work with at the PHP level and you shouldn’t need to worry about that.
p. Using your example, strpos(), is the thinking to convert it to support multi-byte strings or will there be a whole new batch of functions for developers using the Unicode support?
We are actually architecting the Unicode support on top of IBM’s components for Unicode. (ICU) That has a whole library of routines that understand Unicode and how to get through the string and tell you what the character position was for a particular character in the string. Andrei Zmievski can tell you a whole lot more about that than I can as he is leading that effort. [Ed. Andrei did speak on the topic of Unicode in a previously published interview]
p. So there is a library that we are building against, and functions like strlen() and strpos() will all be routed through that library. So yes, you will still use strpos() and it will be transparent if you are using Unicode mode.
p. **Other than Unicode support, is there anything new coming in PHP 6 that we need to know about?**
Unicode is the main focus for PHP 6. I know in PHP 5.2 we have the new input filtering extension but in PHP 6, Unicode is the main thrust.
p. **Given your broad experience in languages, what, in your opinion, is PHP missing as a language? (and I must qualify this by saying I’m not asking you to commit to building anything)**
Hmmm, there are a lot of things that PHP doesn’t have but I can’t say that they are missing because there are ways to do without them. One of the things that would be really nice would be namespaces, another would be closures, like functional closures. For instance, if you do something like usort(), where you provide your own sorting function, rather than define a function, come up with a name for it and give the name to usort(); it would be nice to be able to simply call usort() and define the function inline.
p. Closures would be nice but they are not essential. Namespaces have a lot more direct application and would be really handy. If you integrate more than one library from different sources namespaces really help you separate the code.
p. **Let’s talk a little bit about your OmniTI work. When I interviewed George Schlossnagle, he explained to me a bit about your work at OmniTI. What do you do at OmniTI, what are your responsibilities? (Or do you just sit around and think up cool things.)**
I am the lead architect for Message Systems. My primary role is developing Message Systems. In a way, I do sit there and think up cool things. I think up some of the features based on feedback from our product manager. Then we design those features. Some of these are customer facing features and some are for third party vendors. We do things like design the API that they use to integrate against our core. One of the new features in our latest release is what we call the data source layer. In a way it’s like PDO integrated into Message Systems. With it you can script against databases in the mail server as mail transits through the system. You can access it like any other API in Message Systems but you can also script it from our Sieve language implementation so you can run a sieve script at every phase of the SMTP transaction. The data source layer has integrated caching and with sieve you can actually suspend the session so that you can wait for the data to come in, and continue to serve other sessions. When the query completes, the original session will resume.
p. So I design stuff like that and think about how best to make use of those resources.
p. **So you work exclusively on the Messaging Systems product. Did you start from scratch on that or did you fork an existing open source product?**
We (OmniTI) implemented it from scratch based on one of our customer’s requirements. They had and still have a really big mail infrastructure. They were running exim but their mail queues were extremely large. The only way to look at the queues was to run a shell pipeline with a lot of greps and such. Whenever you needed to do that to figure out what mail you had or which domain had the biggest backlog it could take hours to run and give you the answer. So Theo and George got together and prototyped Message Systems.
p. **Finally a little more looking to the future. What is the one technology out there that really gets you excited?**
Things like dtrace and ZFS in Solaris are really interesting technologies. ZFS is their new file system and it’s a 128 bit native file system, it’s really incredible.
p. What they did was, somebody sat down and said “what does RAID stand for? Redundant Array of Inexpensive Disks. Then why is it so expensive? What can we do to make it better?” So what they did was redesign the filesystem.
p. In a traditional filesystem you have the filesystem layer in the kernel which talks to the block device layer, which then talks to your disk controller. What Sun did was, rather than have different disjointed stages, they unified the whole thing, so that the filesystem is aware of how to store data on the physical disk. With this, you can transparently add disks into the RAID pool; they call it RAID-Z. You can also subtract disks from the pool, it has transparent data integrity. It knows and warns you when your drives are bad so that you can replace them. It can rebuild the data on a bad drive from redundant data elsewhere.
p. **Finally, what one webpage or blog you read on a daily basis.**
Actually, planet-php.org is the one I read on a daily basis. It gives me everybody’s blog in one place.
p. Thank you again Wez for your time and insights.