Free Newsletters

   All InfoWorld Newsletters
Strategic Developer | Martin Heller » TAG: Computer Languages

April 07, 2008 | Comments: (0)

Will you like Curl?

As Doug Dineley and I were discussing my draft review of Curl last week, now posted here, he asked me a serious question:

You essentially recommend readers to give Curl a try. Is there a way to tell who is the best kind of match for this product? I mean, what sort of developer, in general, trying to meet what sort of need?

My answer about the need being addressed made into the final review. On the other issue, I responded:

The sticking point for a lot of developers is that the Curl language is different from what they already know.

In the early 1980s I ran a software development, publishing and sales business focused on engineering and scientific applications. One of the products we resold was Asyst, which was based on Forth. (There are still companies doing business under that name, but I doubt that any of them are related to the one that produced this product.)

After handling many returns of Asyst, I told the sales staff to ask the customer what kind of calculator he or she used, as a screening mechanism: if the answer was TI, then Asyst probably wasn’t for them, but if the answer was HP, then they’d probably be able to learn Asyst because they already knew Reverse Polish Notation.

I haven’t found a similar touchstone for Curl, but then again I’m not trying to sell it. I’m fairly sure that anyone who has learned Lisp, Scheme, Smalltalk or Logo will pick up Curl very easily; most people who have learned OOD/OOP in any language will be able to pick up Curl without encountering any serious barriers.

Since it’s a free product for evaluation purposes, however, the simplest way to tell if you’re going to like Curl is to try it.

So there you have it.

Posted by Martin Heller on April 7, 2008 06:51 AM



February 12, 2008 | Comments: (0)

Yet Another Computer Language

You can't know how much it excites me to hear that Microsoft is designing yet another computer language. Why, what a novel idea! It isn't like there were hundreds of new computer languages designed every year. If that were the case, there would be conferences about the subject. Oh, wait: that's how we first heard about this one, at the Lang .NET conference on the Redmond campus.

But it's a declarative language! Ah, yes: that eliminates maybe half of the languages proposed every year. "Declarative" is an awfully broad term, with multiple meanings. Standard ML is considered declarative, and so are its derivatives OCAML and F#.

Prolog and rule-based AI systems are considered declarative. You declare the rules: the logic engine decides how to run them. SQL queries are declarative: you describe the data you want to see, and the query optimizer figures out how to get it out of the database.

Haskell is considered declarative as well as functional, not to mention that it has monads. Don't ask me to explain monads in the context of functional programming: it's not a short answer. The "Summarizing Proust" contest isn't on today, thank you very much.

Back to declarative languages. XAML is a declarative language for the domain of graphics. It was designed as an extension of XML. It's such an expressive language that Charlie Petzold, arguably one of XAMLs most vocal proponents, built himself a alternative to Microsoft's XAMLPad called XAML Cruncher, so that he could "interactively type XAML code and see the object it creates." In Visual Studio 2008, Microsoft included a bidirectional, split-screen XAML designer, so that you can create XAML by dragging and dropping objects and by typing XAML code, with the ability to freely switch back and forth between the two methods. I freely admit to needing these tools; I can almost never write XAML that will display correctly on the first try.

Watching the Connected Systems Division (CSD) at Microsoft over the years, it has been clear that they have been on a code-reduction path. Why? SOAP was invented by Don Box and others to be an XML-based lingua franca for communication among disparate computer applications and systems. The functional deficiencies of SOAP were addressed by the WS-* series of standards, to give it security, authentication, reliability, and so on.

All of those standards made it harder to write conformant client and server code, raising the complexity by orders of magnitude. CSD engaged in a series of efforts to counter this by raising the level of abstraction for programmers developing connected systems. Web Services Enhancements (WSE) for Microsoft .NET cut the amount of code you needed to write drastically, but not enough for mere mortals.

Windows Communication Foundation (WCF) brought the amount of code down by another order of magnitude or so, partly by using attributes in code and by depending on XML-based configuration files. Attributes are of course one approach to making a language more declarative, and configuration files are another.

Looking at WCF in Visual Studio 2008, it seems like the classes and attributes and design tools are fairly mature, but are still built on top of the general-purpose C# language and the .NET Framework. I wouldn't be at all surprised to hear that the CSD architects decided to try starting over from scratch with a new language that would raise the level of abstraction and reduce the amount of code that needed to be written for a connected application by another order of magnitude. But it's not like nobody else has ever tried that: there's a robust research community working on that kind of problem.

I can guess about the process they're going through, but I can't guess what the outcome will be. It's an emergent experiment, and there are a dozen ways it could go. Nevertheless the criteria are kind of obvious:

High level of abstraction? Check.

Regularity of syntax? Check.

Easy to write? Check.

Easy to read and understand? Check.

Suitable for connection to disparate systems over multiple protocols? Check.

Posted by Martin Heller on February 12, 2008 07:35 AM



February 09, 2008 | Comments: (0)

Cobra is an interesting work in progress

I'm grateful to Savio for mentioning the Cobra language in his Open Sources blog. I had a look at Cobra this weekend, and found it rather interesting.

Microsoft has always touted the .NET Framework as being language-agnostic. In the early days of the Framework, that sounded more like coordinated PR than a real technical characteristic of the Framework. As it turns out, though, it was true.

C# may be the premier .NET language, because that's the language in which most of the class libraries are written, and Visual Basic .NET may be a close runner-up. But there are dozens of other languages written for the .NET Framework, with a range of styles and amenities. Some of these are from third-party language developers -- Eiffel comes immediately to mind -- and some are from internal Microsoft groups, like the ML-derived F# language from Microsoft Research. Still others are or were open source efforts: a classic example is Jim Hugunin's IronPython, which is now sponsored by Microsoft.

In some ways, Cobra reads like a blend of Python and Eiffel. It uses indentation like Python, and supports contracts like Eiffel. It has additional influences, listed here.

When I talk about a new programming language, I usually start with its "Hello, World!" program.

"""
This is the infamous "Hello, world." example.

And this text you are reading right now is the "doc string" for the whole
program. You can also put doc strings underneath classes, class variables,
methods and properties.
"""

class Hello

    def main is shared
        print 'Hello, world.'

That little sample doesn't do justice to the language, however. This page explains some of the key features. The Wordcount sample illustrates Cobra's inline tests and object-oriented programming in a reasonably sized program that actually does something.

It's worth downloading Cobra and trying it yourself. You'll need .NET 2.0 or Mono. Don't expect Visual Studio integration, Windows Forms support, debugging support, or even a syntax-aware editor. Do expect an interesting language for console applications that's on the verge of becoming useful.

Posted by Martin Heller on February 9, 2008 08:08 PM



December 14, 2007 | Comments: (0)

When Languages Interfere

I've learned a lot of languages, both human and computer. When I learned Latin in High School, it mostly helped my English. When I learned German, I had both help and interference from my knowledge of Yiddish; ditto for when I learned Dutch. Similar things happened with Russian (college) and Chinese (grad school), although that wasn't quite the same mechanism: my brain would sometimes serve up a word from a different language than the one I was trying to speak.

As I mentioned Wednesday, there are some common constructions that have different meanings in the different languages that were inspired by C. The new object constructor isn't the only place where subtle errors can occur if you get confused.

On the other hand, learning Pascal back in the day mostly helped my Fortran. Learning many different assembly languages didn't seem to cause any interference: writing assembly language was such a painstaking process that I could usually remember what processor I was writing for at the time.

I hear from people who would rather write Java or C# than mess with JavaScript. They're the kind of people who like tools like GWT and Script# and Volta. I also hear from people who would much rather write JavaScript than Java or C#.

Do you program in more than one language? On balance, does already knowing one programming language help you to learn another, or do the languages interfere with each other and cause you to make errors? Do you find yourself preferring one language over another?

Discuss.

Posted by Martin Heller on December 14, 2007 08:18 AM



September 26, 2007 | Comments: (0)

Belated Notice Department: WORA vs WOTE

Way back in February, in response to an ignorant-sounding comment to a previous posting, I talked about how Write Once languages have never quite done it for me. As is often the case, I tried to restrict myself to my personal experience rather than generalize from that.

Today, while searching for another article I'd written, I came across this lengthy response to that little blog post: Keep an Open Eye ยป Programming Languages Dynamics.

InfoWorld blogs don't accept track-backs, because otherwise we bloggers would spend all our time killing track-back spam. So this is the first I've seen that essay from March. JBSurveyer raised a bunch of interesting issues, although he also read my posting as being much more generalized than I intended, and tended to put a lot of words in my mouth that I never said.

I'd be happy to reopen the discussion here. Have any languages that claim to be write-once fulfilled their promise? Why or why not?

Try to stick to your personal experience, though. I'm not interested in political pronouncements, or in cheap shots against vendors.

Posted by Martin Heller on September 26, 2007 11:15 AM



August 06, 2007 | Comments: (0)

Curl Demos

In my review of Curl 5.0, which posted today, I called out a generic page for Curl demos, but I didn't go into the details.

First, before you run any Curl demos, download and install the Curl RTE.

There are three demo areas:

  • Enterprise software demos: prototypes of various enterprise-related applications, highlighting Curl capabilities that can help build better business applications.
  • Fun and games: Have some fun. Kick back and relax a bit, while getting a different perspective on the capabilities that Curl has to offer.
  • Code Samples: See how to use various capabilities of the Curl platform, particularly in the areas of dynamic 2D and 3D graphics.

The Enterprise area has 7 demos: Stock Performance Calculator, On-Line Map Exploration, Order Entry, Live Tax Form, Mailing Label, RSS Reader, and Web-Based Training.

The Fun and Games area has 4 demos: Chess, Chinese Checkers, Maki, and Match-it.

The Code Samples area has 9 demos, all with source code. Three samples cover 2D graphics, 4 cover 3D graphics, and the two miscellaneous samples implement a Whack-A-Mole game and a PDF viewer.

In my screencast, I spent a lot of time on the Ray Tracing demo, which personally I found impressive. On the other hand, the Enterprise software demos might shed more light on whether Curl could help your company.

Posted by Martin Heller on August 6, 2007 01:56 PM



April 25, 2007 | Comments: (0)

A C Programmer's Vacation

Not quite 20 years ago, I was consulting for Symbolics, working on a Windows front end for PC Macsyma. I was writing Windows code in C, and working closely with a Symbolics LISP programmer named Frank.

One day the two of us were in my office trying to debug my callback interface between Windows help and the Macsyma engine, which enabled running live demos from help files. After watching me sweat out the semicolons and curly-brace-matching and the pairing of LocalAlloc calls with LocalFree calls and the obsessive care about resource leaks that writing Windows C code required, Frank said "Y'know, Martin, you should switch to LISP. It would be like a little vacation for you."

Of course, it was true: compared to LISP on a Symbolics workstation, I was working with flint knives and bear claws. I think I had an 80386-based PC, and was developing for Windows 3.1 using Microsoft C and the Brief editor.

Fast forward to 2007. I'm still tackling the hard stuff, but it's C++ with ATL, in ActiveX controls. I have much better editing and debugging tools, but I still have to be obsessive about resource leaks. I do get to go on a "little vacation" once in a while, but it's not to write LISP: it's to write C#, or sometimes Python.

I'm just finishing up a little sample site in C# and ASP.NET: my vacation is almost over. Pretty soon, it'll be back to the C++ salt mines for me.

Actually, I'm kind of looking forward to it.

Posted by Martin Heller on April 25, 2007 06:25 AM



April 16, 2007 | Comments: (0)

Windows PowerShell: An Introduction

One of the hazards that Microsoft groups face when they launch their products is competition for attention from other Microsoft groups with bigger marketing budgets. Think about the poor Windows PowerShell team, who basically launched at about the same time as Windows Vista and Office 2007. It was no contest.

If you haven't already heard about Windows PowerShell by that name, you may have heard of it by its rather pretentious code name, Monad, or its temporary name Microsoft Shell, abbreviated MSH. I'm sure that Jeffrey Snover and the PowerShell team wanted "Monad" to convey the unified interface they were building.

Then why do I think Monad was a pretentious choice? It's the other meanings of the term. In philosophy, the term Monad, meaning the "ultimate, indivisible unit" goes back to Pythagoras, and was used by Plato, Aristotle, the neo-Platonists, Liebniz, and the Theosophists to describe some rather lofty concepts, often verging on the divine. In mathematics, a monad is a type of functor in category theory. In functional programming languages, for example Haskell, a monad is a rather complicated implementation of sequential functors.

So, what is Windows PowerShell? It's a command line shell, a programming language, and a unified interface; it's not your father's command line shell. From the Windows PowerShell Getting Started Guide:

Windows PowerShell is a new Windows command-line shell designed especially for system administrators. The shell includes an interactive prompt and a scripting environment that can be used independently or in combination.

Unlike most shells, which accept and return text, Windows PowerShell is built on top of the .NET common language runtime (CLR) and the .NET Framework, and accepts and returns .NET objects. This fundamental change in the environment brings entirely new tools and methods to the management and configuration of Windows.

Windows PowerShell introduces the concept of a cmdlet (pronounced "command-let"), a simple, single-function command-line tool built into the shell. You can use each cmdlet separately, but their power is realized when you use these simple tools in combination to perform complex tasks. Windows PowerShell includes more than one hundred basic core cmdlets, and you can write your own cmdlets and share them with other users.

Like many shells, Windows PowerShell gives you access to the file system on the computer. In addition, Windows PowerShell providers enable you to access other data stores, such as the registry and the digital signature certificate stores, as easily as you access the file system.

I have found PowerShell to be extremely useful for exploring the operating system. One of the data stores it supports is WMI, Windows Management Instrumentation, which is a wrapper for many system structures, so you can use PowerShell to dig into the guts of things like Win32 processes, add-remove program lists, and system hardware. It also supports COM, so you can use it to script all sorts of applications and controls that expose COM interfaces.

I was under the mistaken impression that PowerShell would ship with Windows Vista. In fact, you need to download and install PowerShell separately; make sure that you get the right version for your operating system (Vista, XP, Windows Server 2003, or Longhorn Server) and locale, and that you have .NET Framework 2.0 installed before you install PowerShell.

Windows PowerShell in Action The documentation that comes with the Windows PowerShell download will get you started. However, I have found Windows PowerShell in Action, by Bruce Payette (Manning, 2007, 576 pp, ISBN 1-932394-90-7, $44.99) to be an excellent supplement. Payette is a co-designer of the PowerShell language and the principal author of the language implementation. His book not only tells you all the secrets of PowerShell, it tells you what the team was thinking when they designed and implemented the language.

Posted by Martin Heller on April 16, 2007 06:00 AM



February 12, 2007 | Comments: (0)

Apex, SOQL, and salesforce.com

Peter Coffee got in touch the other day, not from eWeek, where he was for 18 years (counting its previous incarnation as PC Week), but from his new gig as Director of Platform Research at salesforce.com. There was a period when I wrote reviews for PC Week and worked closely with Peter.

We had a good laugh about how the general readership media tends to forget the installed base when they talk about software market share, and how that played out in the Windows Vista rollout coverage. Peter has blogged about that issue here.

I suspect that his real reason for contacting me, however, was to tell me about the new Apex programming language launched in preview in January at salesforce.com. Peter certainly knows about my less-than-secret identity as Mr. Computer Language Person. The Apex programming language is not to be confused with the existing salesforce.com Apex platform. So let's explain a bit.

First, salesforce.com: it is at heart a Web-based customer relationship management (CRM) service, aimed at sales force automation, partner relationship management, marketing, and customer service. Apex is both a platform and programming language for for customizing and integrating CRM, as well as developing and deploying brand-new applications. The Apex platform runs at salesforce.com.

There are about 500 Apex applications listed at The AppExchange, including things that have very little to do with CRM, like DreamTeam, a project management and team collaboration application. I happen to know that DreamTeam was developed using DreamFactory's tool set; James Borck reviewed those tools for InfoWorld in 2004. But back to Apex.

Salesforce.com says that:

"Apex is the first on demand programming language and platform, and represents a powerful new tool for developers interested in building the next generation of business applications. With Apex, a whole new breed of on demand applications is possible, featuring sophisticated processes and business logic, entirely on demand and without software."

Now, that "without software" part has me puzzled, but let's just write it off as marketing hype. Basically, salesforce.com is releasing their internal Apex development language to the development community. Apex is a language reminiscent of Java that has embedded SOQL queries, and is described here. Apex applications run on saleforce.com servers.

Here's some sample Apex code from the Apex wiki:

// Define a trigger for the Lead object, and set it to
// fire on the insert and update events
trigger leadDupCheck on Lead(before insert, before update) {
	
	// Make sure the email and zip code fields are not null
	if (Trigger.new.Email != null&& Trigger.new.PostalCode != null ) { 
		// Query for all leads that have the same email and zip code
		// as the new lead 
	    	Integer dupCount = [select count() from Lead WHERE email = :Trigger.new.Email 
	    		AND PostalCode = :Trigger.new.PostalCode ];

	    	if ( dupCount > 0 ) { 
			// Lead exists, so display an error message
	    	 	Trigger.new.email.addError('Lead is a duplicate');
	    	} else { 
	    		// No dup is found, so let the processing continue
	    	}
	 }  	
}

Note the select query defined here inside the square brackets. That's an embedded SOQL (Sforce Object Query Language) query. It looks a lot like normal SQL, but it operates on salesforce.com fields and objects, not SQL database fields and tables, and it can't do joins or order the result set by specific fields.

That's about as much as I can say about this today. For more information about SOQL, you might want to start here.

Posted by Martin Heller on February 12, 2007 06:00 AM



December 27, 2006 | Comments: (0)

A conversation with Martin Heller about his new blog

Jon Udell wrote the blog "Jon's Radio" and the column and feed "Strategic Developer" for InfoWorld until December 15th, 2006. He announced his departure, to work for Microsoft, in his blog and podcast on December 8th. Jon continues to blog on his own site as well as for Microsoft, on Channels 9 and 10. Martin Heller will be writing this "Strategic Developer" blog, which will become part of the feed by the same name.

In the spirit of Jon's departure announcement, Martin decided to interview himself about his new blog. The podcast, alas, has mysteriously disappeared, but the transcript follows.

Q: Tell us a little about yourself, Martin.

A: I'm kind of a dilettante. As an undergraduate I got degrees in Physics and Music—I played the fiddle, sang, and composed—and I went on to a doctorate in high-energy physics in the hope of being able to eat on a regular basis. Along the way I got interested in computers.

Q: When was this?

A: I'd rather not say. <laughter> OK. I think I wrote my first program in the mid-1960s—I was maybe 14—and started writing serious amounts of code in grad school in the mid-1970s. Programming became part of my first real job as a physicist, and became more of my job as an energy systems analyst and then as manager of the software publishing division of a research company. By the time I went out on my own as a consultant in 1986, I was starting to write professionally about computers as well as program them.

Q: What about languages?

A: I started with English and Yiddish, then learned Latin, Russian, Chinese...

Q: I meant computer languages.

A: Sorry. I started with hex machine code, if you count that as a language. After that, Fortran II seemed simple, and Fortran IV was absolute luxury. <laughter> I wrote a lot of assembly language, too, when Fortran didn't do what I needed, or I was using a minicomputer that didn't have enough core for a useful Fortran compiler. Later on, PL/1 taught me about data structures, and Pascal woke me up to structured code.

There was a very funny essay written in 1983 called Real Programmers Don't Use PASCAL, that said something like "If you can't do it in FORTRAN, do it in assembly language. If you can't do it in assembly language, it isn't worth doing." I held those attitudes myself until I learned Pascal. You could say that I went from a Real Man to a Quiche-Eater in a matter of weeks.

I wrote a lot of Basic on early Z80 microcomputers, then C when the compilers became available for PCs. My first book, Advanced Windows Programming, used C. My second book, Advanced Win32 Programming, used C++. My reviewer for the introductory C++ chapter was Bjarne Stroustrup, and he was both supportive and devastating: his gentle suggestion about class design made me rewrite all my sample code.

I picked up Visual Basic, Perl, Java, JavaScript, and Python after that. Since the .NET Framework came out, I've written a lot of C# and some Visual Basic .NET. I've also picked up Ruby, and I've still got projects going in unmanaged C++.

Q: What do you plan to cover in your blog?

A: Whatever seems like a good idea at the time. <laughter> Seriously, I'll respond to new developments in the field when they happen. Right now, I'm following many of the same technologies that Jon followed, so readers should feel right at home.

Q: How did you come to be writing this blog?

A: Jon thought I might be good at it. We're old friends. Jon was my technical editor at Byte Magazine in the late 1980s and early 1990s.

Q: Where can we read your old columns?

A: My Byte.com columns from 1999 through mid-2006 are still online, and with any luck they'll stay online. It's to Byte's advantage to keep them where they are. My Windows Magazine and Winmag.com columns and reviews from 1993 to 1998 are also still online. By the way, if the music on my Winmag.com index page annoys you, just press Escape. (I wish I could go back and turn it off, but I can't.) For anything earlier than 1993, like the first year of Windows Magazine and the years I wrote for Byte Magazine, or the articles I wrote for PC Tech Journal, you'd have to find the physical magazines in a library or go to an old CD-ROM periodical collection.

Q: What about your other writing?

A: There's a short story on my personal Web site, called 'Adventure,' which you might enjoy. I think all of my programming books have gone out of print, but I doubt that any of my readers still need to learn how to develop for Windows 3.1. <laughter>

Q: Do you use Firefox, Gmail, and OS X?

A: Yes, yes, and no. I don't currently have any Macs, but I do have several flavors of Linux as well as Windows.

Posted by Martin Heller on December 27, 2006 02:00 PM



Technology White Papers

 

InfoWorld Technology Marketplace

» Technology White Papers Library

Technology White Papers by Topic

Technology White Papers E-mail Alert

Find out when the latest white paper is available:
 
 
» BUY A LINK NOW

Sponsored Technology Links