Feeds

Anders Heljsberg on what's next for C#

Pointers not considered harmful

  • alert
  • submit to reddit

Security and trust: The backbone of doing business over the internet

According to ancient scriptures, Anders Heljsberg "journeyed to the wilderness, and wept and wailed and cried out unto the Lord, saying: 'Shall I spend the rest of my days tinkering with a Pascal compiler I wrote 15 years ago? Couldn't I have a go at something else?'"

And he did have a go at something else, leading the design for C#.

We caught up with Anders at the launch of Visual Studio DONT [shouldn't that be 'DOT NET?' - pedantic ed.] in San Francisco where he filled us on what he's up to right now, starting with a bit of history on the language.

"We started in January 1999, a really capable design group with four or five of the best people I've ever worked with," he told us. "We met every Monday, Wednesday and Friday and worked all afternoon, going through all the issues that as language designers we needed to work on. Within a year we had a working implementation"

"There's no such thing as a perfect language, You sit in front of a big panel and twiddle all the knobs. You can add more but it becomes less productive. We're pretty happy with the balance."

What came first then, and in terms of the runtime was there already?

"There were the beginnings of the CLR, some of the beginnings of the class libraries"

We asked how the specification C# would avoid getting bloated, an accusation levelled at C++ and Java?

"Yes, it's easier to make the first specification clean, but I'm sympathetic to their plight. But C# was designed as a general purpose language. We're not going to have specific extensions that deal with this or that corner. We'll always try to find a way to implement things in a generic fashion."

According to Anders, generics (parametic polymoprhism) is one of the directions in which C# would evolve. Microsoft already has a prototype of the runtime in generics. "The trick is to proceed with caution," he advises.

He is examining more declarative programming languages. (This was slightly embarrassingly for us - at the time we couldn't remember the name of the best known of the post-Prolog declarative languages, Mercury, which has been recommended to us very warmly, and for which Microsoft is helping develop a .NET back end. Not wanting to refer to "that Australian one" we didn't solicit his opinion on Mercury itself.)

"You've got to get there without taking away the tools people have today. The problem with declarative languages is that they've been domain specific. The trick is finding a combination of declarative and imperative, and that's not impossible."

Imagine, he says, HTML as an imperative language: you'd have to declare a HEAD, then assign a value to t_HEAD, etc.

Six degrees of indirection

We couldn't help asking at what stage in the language design he'd decided that pointers were a necessary evil. Java doesn't support pointers...

"When? That was pretty early on. It all boils down to interoperability and leveraging code you've already written - so many APIs use pointers. That was the concept we had to work with for twenty years.

"So we could sort of look at this in one of two ways - either you have to rewrite everything and make it pure and wonderful, or you can focus on interoperability as a discipline, one that's important to our customers. It gives them ways of making these unsafe operations that are known to be unsafe. So although we support unsafe code in the security model we will never let you execute that code."

"But compared to something like JNI - JNI can get you into a lot of trouble. You can fall off the cliff: you have to remember to pin an object before you can address its data, and, oh my god, you get these random errors"

We asked what the team thought of Miguel de Icaza's desire to move to base GNOME on the .NET frameworks, with his open source Mono project.

"It's great."

David Treadwell, the .NET frameworks manager, predicts that there'd be multiple implementations - although we did point out that the Mono Project's "clean room" approach recommends that developers who've seen the Microsoft "shared source" CLR should not join Mono.

Rather modestly, Anders downplays the design of the language in the bigger scheme of things. After all, he says, learning the API now takes up 97 per cent of the programmer's craft: learning the language takes up three per cent.

This was a group interview, but Peter Monadjemi, a German freelancer filing for Computerwoche, asked a humdinger of a question.

Which was - how did Anders feel about wanting to develop the language, even though such decisions were now in the hands of ECMA, a standards body. You'll have to read Computerwoche to find out his final answer, but for a second he knew what a good question it was, and we knew that he knew, too. ®

Related Stories

Official: Microsoft C# iscool
Microsoft describes its Java killer
Microsoft pulls stealth release of Java for .NET

New hybrid storage solutions

More from The Register

next story
JINGS! Microsoft Bing called Scots indyref RIGHT!
Redmond sporran metrics get one in the ten ring
Phones 4u slips into administration after EE cuts ties with Brit mobe retailer
More than 5,500 jobs could be axed if rescue mission fails
Murdoch to Europe: Inflict MORE PAIN on Google, please
'Platform for piracy' must be punished, or it'll kill us in FIVE YEARS
Phones 4u website DIES as wounded mobe retailer struggles to stay above water
Founder blames 'ruthless network partners' for implosion
Found inside ISIS terror chap's laptop: CELINE DION tunes
REPORT: Stash of terrorist material found in Syria Dell box
OECD lashes out at tax avoiding globocorps' location-flipping antics
You hear that, Amazon, Google, Microsoft et al?
Show us your Five-Eyes SECRETS says Privacy International
Refusal to disclose GCHQ canteen menus and prices triggers Euro Human Rights Court action
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
WIN a very cool portable ZX Spectrum
Win a one-off portable Spectrum built by legendary hardware hacker Ben Heck
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Security and trust: The backbone of doing business over the internet
Explores the current state of website security and the contributions Symantec is making to help organizations protect critical data and build trust with customers.