Pure and Julia are cool languages worth checking out

By Mark Gibbs, Network World |  Software, julia, programming

Ah! The fresh aroma of the New Year accompanied by the aroma of fresh new tech! I love the smell of geekiness ... Mmmm. This week, we'll start with some uber-geekosity: A couple of really interesting programming languages.

The first is called Pure and it's web site describes the language as "a modern-style functional programming language based on term rewriting. It offers equational definitions with pattern matching, full symbolic rewriting capabilities, dynamic typing, eager and lazy evaluation, lexical closures, built-in list and matrix support and an easy-to-use C interface."

Wikipedia explains that "functional programming" is "a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data," and the site gives an example of a Pure program that prints the first 1,000 Fibonacci numbers:

extern int puts(char*); do (puts.str) (take 1000 (fibs 0L 1L)) with fibs a b = a : fibs b (a+b) & end;

Fascinating stuff. Pure is available, for free, for FreeBSD, GNU/Linux, Mac OS X, and Windows and licensed under the GNU Lesser General Public License V3.

The other language that's worth checking out is Julia, "a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library."

Julia's support for parallelism is intriguing as the language "provides a number of key building blocks for distributed computation, making it flexible enough to support a number of styles of parallelism, and allowing users to add more." The site gives an example of counting, in parallel, the number of heads in a large number of coin tosses:

nheads = @parallel (+) for i=1:100000000 randbit() end

The @parallel directive automatically distributes the calculation "across all available compute nodes, and the result, reduced by summation (+), is returned at the calling node."


Originally published on Network World |  Click here to read the original story.
Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

SoftwareWhite Papers & Webcasts

See more White Papers | Webcasts

Answers - Powered by ITworld

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question