New Programming Languages
Go: Simple and dynamic
Google wasn’t the first organization to survey the
collection of languages, only to find them cluttered, complex, and often slow.
In 2009, the company released its solution: a statically typed language that
looks like C but includes background intelligence to save programmers from
having to specify types and juggle malloc calls. With Go, programmers can have
the terseness and structure of compiled C, along with the ease of using a
dynamic script language
.
While Sun and Apple followed a similar path in creating
Java and Swift, respectively, Google made one significantly different decision
with Go: The language’s creators wanted to keep Go "simple enough to hold
in one programmer's head." Rob Pike, one of Go’s creators, famously told
Ars Technica that "sometimes you can get more in the long run by taking
things away." Thus, there are few zippy extras like generics, type
inheritance, or assertions, only clean, simple blocks of if-then-else code
manipulating strings, arrays, and hash tables.
The language is reportedly well-established inside of
Google's vast empire and is gaining acceptance in other places where
dynamic-language lovers of Python and Ruby can be coaxed into accepting some of
the rigor that comes from a compiled language.
Groovy: Scripting goodness for
Java
The Java world is surprisingly flexible. Say what you
will about its belts-and-suspenders approach, like specifying the type for
every variable, ending every line with a semicolon, and writing access methods
for classes that simply return the value. But it looked at the dynamic
languages gaining traction and built its own version that's tightly integrated
with Java.
Groovy offers programmers the ability to toss aside all
the humdrum conventions of brackets and semicolons, to write simpler programs
that can leverage all that existing Java code. Everything runs on the JVM. Not
only that, everything links tightly to Java JARs, so you can enjoy your
existing code. The Groovy code runs like a dynamically typed scripting language
with full access to the data in statically typed Java objects.
Groovy programmers think they have the best of both
worlds. There's all of the immense power of the Java code base with all of the
fun of using closures, operator overloading, and polymorphic iteration -- not
to mention the simplicity of using the question mark to indicate a check for
null pointers. It's so much simpler than typing another if-then statement to
test nullity. Naturally, all of this flexibility tends to create as much logic
with a tiny fraction of the keystrokes. Who can't love that?
Finally, all of the Java programmers who've envied the
simplicity of dynamic languages can join the party without leaving the realm of
Java.
OCaml: Complex data hierarchy
juggler
Some programmers don't want to specify the types of their
variables, and for them we've built the dynamic languages. Others enjoy the
certainty of specifying whether a variable holds an integer, string, or maybe
an object. For them, many of the compiled languages offer all the support they
want.
Then there are those who dream of elaborate type
hierarchies and even speak of creating "algebras" of types. They
imagine lists and tables of heterogeneous types that are brought together to
express complex, multileveled data extravaganzas. They speak of polymorphism,
pattern-matching primitives, and data encapsulation. This is just the beginning
of the complex, highly structured world of types, metatypes, and metametatypes
they desire.
For them, there is OCaml, a serious effort by the
programming language community to popularize many of the aforementioned ideas.
There's object support, automatic memory management, and device portability. An
ideal project for OCaml might be building a symbolic math website to teach
algebra.
CoffeeScript: JavaScript made
clean and simple
Technically, CoffeeScript isn't a language. It's a
preprocessor that converts what you write into JavaScript. But it looks
different because it's missing plenty of the punctuation. You might think it is
Ruby or Python, though the guts behave like JavaScript.
CoffeeScript began when semicolon haters were forced to
program in JavaScript because that was what Web browsers spoke. Changing the
way the Web works would have been an insurmountable task, so they wrote their
own preprocessor instead. The result? Programmers can write cleaner code and
let CoffeeScript turn it back into the punctuation-heavy JavaScript Web
browsers demand.
Missing semicolons are only the beginning. With
CoffeeScript, you can create a variable without typing var. You can define a
function without typing function or wrapping it in curly brackets. In fact,
curly brackets are pretty much nonexistent in CoffeeScript. The code is so much
more concise that it looks like a modernist building compared to a Gothic
cathedral. This is why many of the newest JavaScript frameworks are often
written in CoffeeScript and compiled.
Scala: Functional programming
on the JVM
If you need the code simplicity of object-oriented
hierarchies for your project but love the functional paradigm, you have several
choices. If Java is your realm, Scala is the choice for you.
Scala runs on the JVM, bringing all the clean design
strictures of functional programming to the Java world by delivering code that
fits with the Java class specifications and links with other JAR files. If
those other JAR files have side effects and other imperative nasty headaches,
so be it. Your code will be clean.
The type mechanism is strongly static and the compiler
does all the work to infer types. There's no distinction between primitive
types and object types because Scala wants everything to descend from one
ur-object call Any. The syntax is much simpler and cleaner than Java; Scala
folks call it "low ceremony."
Scala offers many of the features expected of functional
languages, such as lazy evaluation, tail recursion, and immutable variables,
but have been modified to work with the JVM. The basic metatypes or collection
variables, like linked lists or hash tables, can be either mutable or
immutable. Tail recursion works with simpler examples, but not with elaborate,
mutually recursive examples. The ideas are all there, even if the
implementation may be limited by the JVM. Then again, it also comes with all
the ubiquity of the Java platform and the deep collection of existing Java code
written by the open source community. That's not a bad trade-off for many
practical problems.
If you must juggle the data in a thousand-processor
cluster and have a pile of legacy Java code, Scala is a great solution.
Dart: JavaScript without the
JavaScript
Being popular is not all it's cracked up to be.
JavaScript may be used in more stacks than ever, but familiarity leads to
contempt -- and contempt leads to people looking for replacements. Dart is a
new programming language for Web browsers from Google.
Dart isn't much of a departure from the basic idea of
JavaScript. It works in the background to animate all the DIVs and Web form
objects that we see. The designers simply wanted to clean up the nastier,
annoying parts of JavaScript while making it simpler. They couldn't depart too
far from the underlying architecture because they wanted to compile Dart down
to JavaScript to help speed adoption.
The highlight may be the extra functions that fold in
many de facto JavaScript libraries. You don't need JQuery or any of the other
common libraries to modify some part of the HTML page. It's all there with a
reasonably clean syntax. Also, more sophisticated data types and syntactic
shorthand tricks will save a few keystrokes. Google is pushing hard by offering
open source development tools for all of the major platforms.
If you are building a dynamic Web app and are tired of
JavaScript, Dart offers a clean syntax for creating multiple dancing DIVs
filled with data from various Web sources.
Haskell: Functional
programming, pure and simple
For more than 20 years, the academics working on
functional programming have been actively developing Haskell, a language
designed to encapsulate their ideas about the evils of side effects. It is one
of the purer expressions of the functional programming ideal, with a careful
mechanism for handling I/O channels and other unavoidable side effects. The
rest of the code, though, should be perfectly functional.
The community is very active, with more than a dozen
variants of Haskell waiting for you to explore. Some are stand-alone, and
others are integrated with more mainstream efforts like Java (Jaskell, Frege)
or Python (Scotch). Most of the names seem to be references to Scotland, a
hotbed of Haskell research, or philosopher/logicians who form the intellectual
provenance for many of the ideas expressed in Haskell. If you believe that your
data structures will be complex and full of many types, Haskell will help you
keep them straight.
Julia: Bringing speed to
Python land
The world of scientific programming is filled with Python
lovers who enjoy the simple syntax and the freedom to avoid thinking of gnarly details
like pointers and bytes. For all its strengths, however, Python is often
maddeningly slow, which can be a problem if you're crunching large data sets as
is common in the world of scientific computing. To speed up matters, many
scientists turn to writing the most important routines at the core in C, which
is much faster. But that saddles them with software written in two languages
and is thus much harder to revise, fix, or extend.
Julia is a solution to this complexity. Its creators took
the clean syntax adored by Python programmers and tweaked it so that the code
can be compiled in the background. That way, you can set up a notebook or an
interactive session like with Python, but any code you create will be compiled
immediately
For more information, please visit: www.programmingyan.com