Home > General Development > Fortress, next Fortran? Fortress, next Fortran? Submitted by ahmetaa 2005-05-05 General Development 33 Comments Fortress is a new language for from a team that includes Guy Steele, Common Lisp guru and contributor of Java. Language is introduced as the “next Fortran”. Fortress language spec and an early overview. About The Author Eugenia Loli Ex-programmer, ex-editor in chief at OSNews.com, now a visual artist/filmmaker. Follow me on Twitter @EugeniaLoli 33 Comments 2005-05-05 6:47 pm Looks nice! 🙂 But… could physicist leave fortran? I don’t belive it… A lot of them still use fortran77. 2005-05-05 7:16 pm Its good to see that Sun is designing a language that is not dumbed down, like Java was. I hope that just like Java made garbage collection and runtime compilation acceptable to the average ignorant business coder, Fortress will widen the acceptable of first class functions, multiple dispatch and type inference. It might take another 10 years for features like procedural macros to trickle down, but eventually, you *will* be using a Lisp-like language… 2005-05-05 7:26 pm If someone translates all the BLAS, LAPACK, NAG, IMSL… to Fortress, maybe people will leave. Until then, Fortran is still the king of simulation for this chemist. 2005-05-05 7:32 pm Fortran isn’t in place because it’s good, it’s in place because it got their first. People use fortran because it’s not broken enough. 2005-05-05 8:13 pm Some interesting concepts (symbols outside of ASCII are active tokens), but the language market is already overcrowded and it is unlikely Sun will fracture its solutionset with another tool, that would likely tip the scales in favor of C# long term (in the same way Nader fractured non-Republican voters). 2005-05-05 8:28 pm Its funny that you draw a parallel with Nader fracturing non-Republican voters, because indeed, Java and C# are identical. There is no advantage in using one over the other, they’re both the same poor attempt at watered-down statically-typed Smalltalk. Fortress on the other hand is quite an improvement over both C# and Java. Using Unicode is a minor thing — what you should be looking at is multiple dispatch, type inference, and so on. These were previously unheard-of in mainstream languages backed by large corporations. 2005-05-05 9:20 pm I’d think procedural macros would be one of the first things ex-Fortran programmers would want. The nice thing about procedural macros is that they allow a lot of abstractive power with minimal runtime overhead. It’s the same thing the C++ folks are getting all giddy about with templates, except far more powerful and easier to use. Science strikes me as one of the natural places for domain-specific-languages, not just for ease of coding, but for the optimization opportunities that a feature like define-compiler-macro presents. 2005-05-05 9:45 pm The language seems interesting, and I did find the overview helpful overall. OTOH, some of the criticisms the reviewer had of the language seemed more than a little odd. For instance, he complains about the ways that it differs from C-like syntax, but the specific ways that he mentions are standard fixes to the worst design mistakes of C-like syntaxes. Also, he complains that its built-in support for numerics will discourage its use as a general-purpose language, when support for numerics is its whole reason for being. And “weak object-oriented support”? Why should a numerics language be object-oriented? I would think that a functional language would be more appropriate. Still, a helpful review overall. 2005-05-05 9:56 pm Does anybody know if an implementation is available ? Seems like an interesting thing to play with. 2005-05-05 10:10 pm could physicist leave fortran? I don’t belive it… A lot of them still use fortran77. A lot of the airline systems I work with still use F66 as well as F77. No CHARACTER variables or block IF statements. 🙂 2005-05-05 10:18 pm Saw this a bit over a week ago. It was discussed on the Perl6-Language mailing list, and some of the big guys liked some of the features. Perl6 may end up borrowing a few ideas from Fortress. I think Fortress and Perl6 have the potentially for being the 2 most revolutionary languages in a long time. 2005-05-05 10:29 pm The criticisms do sound a bit odd, I think. For example, Fortress uses the mysterious bounds instead of the more familiar enum, Languages are best if consistent with themselves, not some other language that was designed for a different problem domain and using different underlying principles. and it differentiates assignment from equality (like Pascal’s = and :=). Yes, the language is meant to be used by mathemiticians, and that is the notation popular in mathematics. [/i]Fortress also decided to declare the type after the variable (x : Int)[/i] This is a far superior way of doing it if you consider that because of type inference, the ‘Int’ doesn’t necessarily need to be there. If you declare your variables properly, each on its own line, then with the Fortress method, the name is always the first token on the line. If you put the type before the name, the name might be the first or second token depend on whether there is an annotation. This also makes the syntax easier to parse, and more consistent, which is a good thing if you have macros. It only has weak object-oriented support and lacks a few important features (no property support, for example, although this would be trivial to add with the concrete syntax extension). I cannot think of a single use for object properties in numeric code. Its native support for numeric calculation might turn off the more general developer crowd and make it look marginal. Which would be a good thing, because that way Fortress could focus on being a good numeric language, instead of another Java clone. Mainstream languages have such shitty numerics, its good that Fortress doesn’t follow in their footsteps. Read up on the Scheme or Common Lisp numeric tower, sometime. These are the features you need to write numeric code without worrying about which language misfeature will bite you in the ass next. 2005-05-05 10:56 pm > I think Fortress and Perl6 have the potentially for being the 2 most revolutionary languages in a long time. Assuming Perl 6 ever gets released. I heard the current implementation is written in Haskell, and is over a thousand times slower than Perl 5, which is no speed daemon itself. 2005-05-05 11:02 pm Assuming Perl 6 ever gets released. I heard the current implementation is written in Haskell, and is over a thousand times slower than Perl 5, which is no speed daemon itself. First, it is A(N) implementation, not THE implementation. It’s not designed to actually be Perl6. But what it does is allow Perl6 devs to play around before doing their implementation, and for people to start porting code. Not only that, it will and has helped speed up actual Perl6 development quite a bit. But yes, PUGS (what you are referring to) is written in Haskell. 2005-05-05 11:05 pm It is interesting that you point out that all languages migrate towards Lisp as time goes by. There is a common saying in the Lisp community, known as Greenspun’s Tenth Rule of Programming: “Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp”. I think we can all concede that Lisp (and even more so Scheme) was cool, hip and trendy in the 70s and earily 80s, as these languages were indeed rather innovative for their time. Still, I have always found it a bit difficult to decipher exactly what it means that all languages (or systems) involve into Lisp. It certainly cannot be that we’ll all be expressing our programs as symbolic expressions. In fact, this seems to be main gripe most non-Lispers have against Lisp, and it will prove rather difficult to convince the masses on this point when we with today’s GLR (and even scannerless GLR) parsers, can come up with really nifty concrete syntax that’s a lot easier on the eyes than the monotonous pile of parentheses. Other features of modern Lisps, many of which were not originally conceived entirely in the Lisp community, include the ability to define functions, higher-order functions, unnamed closures, dynamic dispatch, build abstractions through macros and enjoy dynamic typing (which is definitely not the holy grail it’s hyped up to be), are not exactly unique to Lisp either. It is actually striking that if you look at many of the most popular languages of the day (C, C++, C#, Java, Pascal, Delphi), they come from the a syntactical heritage very unlike Lisp, namely Algol. Also, they are statically typed, which is completely alien to Lisp. While we certainly see an influx of more advanced solutions of the language runtime as the resources permit it — automatic garbage collection and a flexible indirection layer between the language and the hardware usually called a VM — this is also not a trait which has been exclusive to Lisp. Sometimes, but this is just a personal musing, it actually appears as if the Lisp community is bitter about not being at the center of the dominant paradigm. These days, dominance is held by object-oriented systems with Java and C# being the hottest languages. A good runner up “paradigm” is the heterogeneous mass of scripting languages, with the three Ps (PHP, Python, Perl) and VB having the lion’s mindshare. 2005-05-05 11:24 pm Every year a CS student somewhere suddenly learns about Lisp and flails around lamenting that everyone is just too stupid/ignorant to see its magnificence. If some more mainstream language adds support for something in Common Lisp it becomes “Lisp has been doing that for years.” If another language has something you like (syntax, a sophisticated type system, interfaces portably with large swaths of pre-existing libraries, …) if Lisp doesn’t have it then it’s generally bad because it makes writing macros more difficult, because it slows down development, or what have you. 2005-05-05 11:26 pm I don’t think many people are bitter that Lisp is not being hyped. What makes it great is that it is a very high level language, but good implementations are thousands of times faster than PHP, Perl or Python, approaching the speed of C. This is more important than having fancy marketing literature. > Sometimes, but this is just a personal musing, it actually > appears as if the Lisp community is bitter about not being > at the center of the dominant paradigm. These days, > dominance is held by object-oriented systems with Java and > C# being the hottest languages. A good runner up “paradigm” > is the heterogeneous mass of scripting languages, with the > three Ps (PHP, Python, Perl) and VB having the lion’s > mindshare. 2005-05-05 11:44 pm I don’t think you fully realize the implications of Lisp being as old as it is. Lisp was designed in the late 1950s. It predates Algol, and Fortran is the only language in use today that predates it. Paul Graham has a pretty good article about features that were new to Lisp: http://www.paulgraham.com/diff.html The implications of Lisp’s age and influence are enormous. Functional programming itself was born with Lisp. The very machine model Java uses (every variable is a reference into a garbage-collected free store, no explicity pointer access is possible), is the “Lisp machine model”. Most of the things you mentioned in your post, while not unique to Lisp now, did indeed originate in Lisp or Scheme. Many more originated in languages that were descended from Lisp, or heavily influenced by it (Smalltalk). 2005-05-05 11:46 pm Every year a CS student somewhere suddenly learns about Lisp and flails around lamenting that everyone is just too stupid/ignorant to see its magnificence. Odd you say that, because its usually the crotchety old professors that are most entusiastic about Lisp. Most CS students today know nothing more about it than they were forced to learn in college, that is assuming their school is one of the few that still has a decent CS program… 2005-05-05 11:48 pm That CS student you were talking about: http://andrej.com/mathematicians/large/McCarthy_John.jpg 2005-05-06 12:57 am The Smug Lisp Weenie ™ http://c2.com/cgi/wiki?SmugLispWeenie has been overtaken by the smug haskell weenie. http://www.haskell.org or lambda-the-ultimate.org 2005-05-06 1:20 am Is it Lips as fast as Fortran? And most important, are there equivalent libraries like BLAS, LAPACK, FFTW? If this is the case would be interesting to play with Lisp, cause Fortan sometimes……….. 2005-05-06 3:54 am > There is a common saying in the Lisp community, known as Greenspun’s Tenth Rule of Programming: “Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp”. You missed the last sentence: “And Common Lisp implementations are no exception”. Since many Common Lisp implementations themselves qualify as “sufficiently complicated C program”… 2005-05-06 5:50 am I say it because I’ve been the CS student that went “Yay, Common Lisp!” Perhaps you feel that you you are unique for acknowledging the existence of Lisp, but you’re really not. Some kid will follow, find Lisp and suddenly feel like everyone else is an idiot that just doesn’t get it. “Most CS students” is a terrible benchmark for acknowledging trends in behavior in my opinion. It’s not a very high standard given degree inflation. 2005-05-06 12:08 pm What is the main achievement of fortress over ocaml? 2005-05-06 3:12 pm Lisp is better than the crap that is widely used today (C++, Java, etc). And yes most of the new techniques were in Lisp first. Sofar most of Lisp’s criticism here was just stupid. Its biggest fault is its lack of syntax, which is good for compilers, but bad for men. The syntax of a language should be simple for men. Haskell has a wonderful syntax. If I design and implement a new language it’ll have a syntax similar to Haskell, but it will have mixfix syntax and use scannerless GLR parser. 2005-05-06 4:29 pm Lisp and numerics: Fastest standard Lisp (Common Lisp) for floating point: http://http://www.cons.org/cmucl/ CMUCL interface to BLAS and LAPACK: http://matlisp.sourceforge.net/ A non-standard Lisp: http://lush.sourceforge.net/ Lush interfaces to BLAS, LAPACK, FFTW… Of course every major Common Lisp implementation can interface with C and Fortran code with few problems. 2005-05-06 5:52 pm LispStat has an interface to BLAS too (see http://www.stat.umn.edu/PAPERS/tech-reports/tr608.ps), even if its Lisp is not compilable to native (just to bytecode). 2005-05-06 7:04 pm Perhaps you feel that you you are unique for acknowledging the existence of Lisp, but you’re really not. I never claimed I was unique. There aren’t a lot of Lispers, but its not *that* marginal of a language. However, in my experience, most people aren’t familiar with Lisp, and their ignorance of it drives their opinion of it. That is not to say that everyone who knows Lisp likes it, but rather, that anyone who knows Lisp understands the importance of the language, whether they particular like it or not. Some kid will follow, find Lisp and suddenly feel like everyone else is an idiot that just doesn’t get it. Hmm. It’s not so much “everyone else is an idiot”, but rather, “everyone else is so resistant to change that they don’t even bother learning”. And I don’t think you can argue that this is true. Of course, it’s not just Lisp, but lots of things in the world. Ultimately, its not fair to judge someone on whether or not they like something that they know. However, it is fair to judge them for rendering an opinion on something they do not know. 2005-05-07 1:31 am Gracias artime for the links. I will have a look. 2005-05-07 10:51 am “These days, dominance is held by object-oriented systems with Java and C# being the hottest languages.” By dominance you mean hype right? http://www.developer.com/lang/article.php/3433891 2005-05-07 8:23 pm I tried learning lisp/scheme more than once. It was horrible. Those parenthesis drove me mad. And i understood why they use recursion so much. Because the “do” looping construct is too unreadable to use. It has a variable initialization/increment part, an exit part and a body, with no clear separation between them (do (<list-of-vars>) (<exit-test> <exit-actions>) body). The “if” construct is similar: (if <cond> <then-part> <else-part>). Would it be unreasonable to add a few extra “keywords” (or pseudo-keywords)? If the parts get too big (and with nested constructs), you can’t find anything in your code. 2005-05-07 9:35 pm You have a “LOOP” macro (http://www.gigamonkeys.com/book/loop-for-black-belts.html) if you prefer a “readable” syntax. Of course, many lispers hate it (*), and some prefer a non-standard ITERATE (http://www.cliki.net/iterate), more “lyspy”. (*) It is “readable” from a C/Perl/Java/Python… point of view, but not for people already “enlightened” by the beautiful regularity of “sexes” (http://www.cliki.net/SEX).