Introduction to Caltha
Features
Caltha Language Specification
FAQ
Background
|
As the designer of the Caltha programming language, here are my responses to frequently asked questions. Please email me if you have any additional questions.
List of Questions:
Why do scientists need a new programming language?
The idea of making computer programs look like math is hardly original. What sets Caltha apart from Mathematica, Fortress, and literate programming languages in general?
Would the use of Caltha require scientists to change the way they write mathematics in general? If so, isn't that a lot to ask?
Fortran is known as a fast language, and speed is very important for scientific programming. Will Caltha's implementations be fast enough?
Why do scientists need a new programming language?
It's hard to choose an appropriate language for numerical work. Scientists are often ridiculed for sticking to Fortran. But while Fortran is every bit as cumbersome as it is reputed to be, the most popular alternatives are all an order of magnitude too complicated.
Most of my scientific projects have involved either Fortran, C++, Java, MATLAB, or Python. Of these, I discovered early on that I was most productive while using Python. It was this programming language, in fact, that first inspired me to design a simpler language with many of the same convenient features. I believed that scientists needed such a tool to speed up the implementation of their algorithms.
As I gained experience as a scientific programmer, I began to realize that more time was lost in the presentation of algorithms than in their implementation. (Fortran programmers, armed with "copy and paste", can be surprisingly productive.) It also became clear that one could work on presentation and implementation at the same time, provided they could use the same language for both purposes. Such a language could not be based on a large set of convenient features, but rather a small set of unambiguous mathematical notations. Caltha is the tool that scientists truly need: a language designed for communication.
The idea of making computer programs look like math is hardly original. What sets Caltha apart from Mathematica, Fortress, and literate programming languages in general?
Like many other scientific languages, Caltha adheres to the principle that mathematical notations should be exploited in an effort to make computer programs presentable to humans. But this common philosophy allows for many different approaches. Literate programming requires math and code to be presented in the same document, but permits the use of two completely different sets of notations. Caltha, like Fortress, strives to provide common notations for both humans and computers. While Fortress adheres quite strictly to traditional mathematical conventions, however, Caltha deviates from tradition in places to avoid ambiguity.
Though their notations differ, Caltha's approach is fairly similar to that of the Mathematica language. The most significant difference is the fact that the Mathematica language, like that of MATLAB or Maple, is strongly associated with a specific software package of the same name. While such packages are often convenient for computation and visualization, they are not always desirable for the presentation of algorithms. Many scientists would hesitate to publish a formula that invoked a large number of routines from a commercial product. It's a matter of opinion, but Caltha caters to those who desire a small language independent of any particular implementation.
Would the use of Caltha require scientists to change the way they write mathematics in general? If so, isn't that a lot to ask?
If they wanted, scientists could adopt Caltha for software development only, and stick to traditional mathematical notations for presentation and analytical work. But in order to fully benefit from the language, then yes, they would need to change some of their mathematical conventions as well.
Is changing mathematics a lot to ask? Strangely, it's not as problematic as one would think. Caltha's symbolic notations, for the most part, are the same as those used in traditional math. Addition, subtraction, exponentiation, and division are identical, as are all the comparison operators. Parentheses, curly braces, and square brackets are still used to indicate expressions, selections, and vectors respectively. Even Greek letters, such as "pi", have been included.
Probably the most prominent change that Caltha requires is the use of a dot for scalar multiplication. The dot rectifies an harmful ambiguity in mathematics, and for this reason I do not expect it to provoke too many objections. In my experience, people are willing to accept new conventions so long as they understand the reasons for doing so.
Fortran is known as a fast language, and speed is very important for scientific programming. Will Caltha's implementations be fast enough?
Speed isn't the most important aspect of scientific code, but it is important. Among other things, it allows scientists to model physical systems at higher resolutions. From my work on atmospheric and geophysical models, I've learned that you essentially cannot solve certain problems if you lack the resolution to capture small-scale variations.
I don't know for sure if Caltha's implementations will be fast enough, but I'm gambling that they will be. Caltha takes away the programmer's ability to specify which values are stored as data, and which values are calculated "on the fly". These choices are to be made automatically. The first implementations of Caltha will likely make poor choices, resulting in slow execution. But the omission of all types of jump statements, combined with the absence of all types of data references, will undoubtedly provide new opportunities for optimization. I believe that these simplifications will not only help people present code, but help computers execute it as well.
|
|