12.07.2015 Views

Fortress Programming Language Tutorial.pdf - Free

Fortress Programming Language Tutorial.pdf - Free

Fortress Programming Language Tutorial.pdf - Free

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Fortress</strong> <strong>Programming</strong> <strong>Language</strong> <strong>Tutorial</strong>, PLDI, 11 June 2006Simple Example: NAS CG KernelconjGrad 〚Elt extends Number, nat N, 〛Mat extends Matrix〚Elt, N ×N 〛 ,Vec extends Vector 〚Elt, N〛〚 〛 A: Mat, x : Vec:Vec, Eltcgit max= 25z : Vec = 0r : Vec = xp:Vec = r:Elt = r T rfor j seq1:cgit max doq = A p =p T qz := z pr := r− q 0= := r T r = 0p := r pend z , ⋳x−A z⋳It's not new or surprising that codewritten in a programming languagemight be displayed in a conventionalmath-like format. The point of thisexample is how similar the code is tothe math notation: the gap betweenthe two syntaxes is relatively small.We want to see what will happen ifa principal goal of a new languagedesign is to minimize this gap.© 2006 Sun Microsystems, Inc. All rights reserved.33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!