The Artima Developer Community
Sponsored Link

Heron-Centric: Ruminations of a Language Designer
Primitive Types ... In a Library?!
by Christopher Diggins
October 26, 2004
Summary
Possibly my favourite feature of Heron, and what sets it apart from C++/Java/C# style languages is that primitives are defined in a library, not by the language. Why other languages don't do this is beyond me.

Advertisement

In many modern imperative languages: C++/Java/C# etc. primitives are predefined and are not even objects. They have no methods, they follow special conversion rules, they have predefined operators, they can not be inherited from. Sometimes they have separate object counterparts to the primitive types which requires a rather unpleasant boxing/unboxing mechanism.

Heron changes all that.

Knowing exactly what a programmer will want in the general case is impossible, so by locking in a particular behaviour or representation of the primitives is needlessly limiting. In fact often the choice of a particular language is done purely because of the primitives available. This just doesn't make sense in today's age. A Heron primitive library can be tuned towards catching bugs, or towards performance, or even towards reducing verbosity.

This catches people examining Heron off-guard because typically when evaluating a language they look at the primitives available to them. There is no reason to reject Heron because of the representation of a string, or inaccurate floating point characteristics. The library is comletely open-source and transparent, if you don't like some part then rewriting it is trivial! For instance you might not like that the primitive names start with capital letters, or you might not like the fact that the standard library initializes the primitives. Well then by all means, write your own version. If you share it with me, maybe I'll even use it as part of my next release.

For more information, download the latest Heron standard library and have a read through at: http://www.heron-language.com/downloads.html.

Talk Back!

Have an opinion? Readers have already posted 5 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Christopher Diggins adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Christopher Diggins is a software developer and freelance writer. Christopher loves programming, but is eternally frustrated by the shortcomings of modern programming languages. As would any reasonable person in his shoes, he decided to quit his day job to write his own ( www.heron-language.com ). Christopher is the co-author of the C++ Cookbook from O'Reilly. Christopher can be reached through his home page at www.cdiggins.com.

This weblog entry is Copyright © 2004 Christopher Diggins. All rights reserved.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use