The Script Center Goes Multilingual

What’s Up with All the Sample Scripts Written in Different Languages?

Over the past year or so, the Scripting Guys have had several opportunities to travel around the world. Last year the legendary Peter Costantini traveled to Nepal, where he gladly made a … donation … to a band of Maoist guerillas. Greg Stemp emerged from his cave to travel to Japan, where he (unwittingly) ate a pastry filled with hot mayonnaise and watched his 14-year-old son play baseball against the best the Tokyo area had to offer. And Dean Tsaltas has been back and forth “across the pond” on several occasions, venturing to Oxford University to obtain a master’s degree in software engineering.

Note. Couldn’t Dean have just gotten a master’s degree in the Seattle area, without having to go all the way to England? Sure. But let’s not tell him that, OK? He’d be so embarrassed to find that out.

One of the things we learned as we broadened our horizons is this: not everyone in the world speaks English. And as it turns out, there’s nothing wrong with that. In fact, there are actually some advantages to being conversant in more than one language; Greg would have been much better off had he known how to say, “No hot mayonnaise filling, please” in Japanese. And so, recognizing the diversity in language use throughout the world, and recognizing the value of knowing more than one language, the Scripting Guys decided that it was time that Script Center spoke more languages, too. As a result, the Script Repository now features sample scripts written not only in VBScript, but in these scripting languages as well:

Perl

Python

Kixtart

Object REXX

JScript

Note. As time goes by, there’s a good chance additional languages will be added to the Script Center. The list of available scripting languages can always be found in the Scripting Languages home page.

At this point in time, the Script Center has about 120 or so sample scripts written in each of these five languages. As time goes by, we’ll add additional scripts and (maybe) additional languages. In the meantime, we can see you have plenty of questions, so let’s try to answer some of them.

I’m a Perl scripter, and you said that you have about 120 Perl scripts in the ScriptCenter. However, you have over 1600 VBScript scripts in the ScriptCenter. What’s the deal here? Are you Scripting Guys treating Perl like a second-class citizen?

That depends on how you want to look at it. Do we have anywhere near the same number of Perl scripts as we do VBScript scripts? No. Will we ever have the same number of Perl scripts as we do VBScript scripts? To be honest, no: we’re a small team, and we’re not very good at writing Perl scripts. So does that mean Perl is being given short-shrift? Well, purely from a numbers standpoint, yes.

However, we prefer to look at this a bit different. How many Perl scripts did we have in the Script Center last week? Zero. How many do we have now? About 120. It might not be much, but it’s a start. And at least we’ve shown that it’s possible to carry out system administration tasks using Perl. If you don’t like VBScript, now you know that you aren’t irrevocably bound to that language when it comes to system administration scripting.

So it’s just that Microsoft products get special treatment, right?

No; after all, JScript is a Microsoft product, and we only have about 120 or so JScript scripts in the Script Center. VBScript will always remain our primary focus simply because most Windows administrators who write system administration scripts use VBScript. Like we said, JScript is a Microsoft product, but relatively few people use that language for system administration. We went with the most bang for the buck, which happens to be VBScript. If our focus had been on something other than system administration (for example, if we focused on scripting for Web developers) we likely would have taken a different tack.

When do you expect to post more scripts written in Perl?

To tell you the truth, we don’t have a timetable. Within the next month or two, we’ll try to post some samples that use ADSI, and maybe some that manage a totally different technology (such as Virtual Server). Beyond that, we’ll see. If there’s a lot of customer demand, we’ll try to get additional scripts up sooner rather than later. If there’s not a lot of customer demand then we’ll play it by ear.

I’m a Python scripter, and I sure wouldn’t write my Python scripts the way you guys wrote yours. Why are your scripts so different from mine?

Most likely it’s because you know how to write Python scripts and we don’t. We don’t claim to be experts in any language (even VBScript), nor do we claim that we’ve written the definitive set of Python scripts. Instead, we look upon our scripts as being proof-of-concept: we wanted to show that it’s possible to do things like write WMI scripts in Python. If you can write better WMI scripts in Python, then that’s exactly what you should do. Our script samples are really geared towards people who are having problems getting started. Ideally, we give them a nudge in the right direction, and then they take it from there.

Of course, we don’t want to do anything that’s downright dumb, either. If you have suggestions for how we could have/should have put together our sample scripts, please email those suggestions to scripter@micosoft.com.

I’m a HaskellScript scripter, and I don’t see any HaskellScript scripts in the ScriptCenter. What do you guys have against HaskellScript?

Nothing. Nor do we have anything against RubyScript or TCL/TK or any other scripting language. It’s just that we had to start somewhere, and so we started with Perl, Python, Kixtart, Object REXX, and JScript. If there are other scripting languages you’d like to see covered in the Script Center, then send an email to scripter@micosoft.com. And if you have sample scripts that could help us get started in using HaskellScript or whatever language you’d prefer, please send those as well.

I don’t like the way you’ve categorized the sample scripts. Sometimes you have to click the mouse three times to get to a category, and then you find out there’s only one script there.

We faced a bit of a dilemma when it came time to categorize these new scripts. We are moving – albeit slowly – towards the day when all the scripts will be in a fully-searchable database. Because of that, we wanted to categorize the new scripts in the exact same way we categorized the VBScript scripts, even though this left situations like the one you described above.

Alternatively, we could have started with a much simpler classification scheme, but then we would have had two different problems. First, the categories for the Perl scripts would not be the same as the categories for the VBScript scripts. That could be confusing, and would also make it difficult for us to link from one category to another. Second, as we added more scripts, we’d likely have to change the category scheme, and we want to avoid doing that as much as possible.

In the end, we decided to go with the same category scheme as we used with the VBScript scripts, despite the fact that this approach might not be 100% user friendly. However, we did try to make up for that by providing a single page that lists all the Perl scripts, another that lists all the Python scripts, etc. That way, you can get to a script in one of at least three ways:

By browsing the categories.

By accessing the index page that lists all the scripts for a given language.

By accessing a category page in the VBScript section of the Repository, and then clicking a link to the corresponding category in, say, the Kixtart section.

It’s not a perfect solution but, then again, anything we do now is only an interim step towards our ultimate database/Web service solution anyway. If you find it totally unusable and if you have suggestions for how we could make it better, please email us at scripter@micosoft.com.

Thanks!


Top of pageTop of page