NonStop Insider

job types


Site navigation


Recent articles


Editions


Subscribe


For monthly updates and news.
Subscribe here
NonStop Insider

Poly Want a Lengua?

HPE

Andy VaseyAndy Vasey

 

 

 

 

 

Keith Moore
Distinguished Technologist at HPE

You have probably heard me over the years go on and on about this computer language or that computer language.  I admit that I have a bit of an obsession with computer languages.   I still recall my first exposure to the concepts of a compiler of Fortran to machine code. Turn in a Hollerith deck, and a day later, I got to see the results on green bar.   Usually leading to a fail and a retry the next week. (We got once a week access to a mainframe back then. I still remember that it was Tuesday night overnight with results received the next afternoon at the school office.)

Like most computer folks, we all learn syntax of languages from Excel to Java, from Python to YAML (yes, a language syntax).  These days, even the most elementary user knows a limited syntax set for a few languages like Excel or HTML.   Most folks don’t even realize that they are proficient in so many languages.   Some are analogous to each other like Comint->TACL->korn->bash.  Some are designed to be friendly for fast compiled execution, others are designed to be dynamically interpreted.   But most often, computer languages are designed for specific domains or are built to provide a semantic map to a programming paradigm.   This is where there has been so much of a tit-for-tat between the object oriented programming (OOP) and the older Procedural Oriented Programming (PoP); and now, a throwback to a more functional programming (FP) paradigm.

 I admit that most folks are not all geeked up about this like I have been over the years, but there is a key takeaway for everyday IT architects. Fighting over “what language’ has become a full-time hobby for many people in the industry. If you only maintain legacy software, you do not see it as much. But there is a trend toward more diverse languages, not less.   In the greater IT world, there are languages for a specific domains, languages for functional programming, and for object languages like Java.   Additionally, there is the need for frameworks abstract programming paradigms for all languages!   Whoo-boy it gets saucy very fast.

Polyglot programming techniques are a common way to build executables that are cross-platform and provide a great deal choice for the programming paradigm (and language) used to build a solution.  Nonstop supports polyglot design using NSJ17 (the JVM) and various build tools like Gradle and Maven which (ironically) have their own “language” of configuration build that support making an executable with disparate languages like Java, Kotlin, Scala, Clojure, and many others. Nonstop also supports access to other domain specific languages like SQL (JDBC) and frameworks that allow mixing languages that access databases into server classes that run on Nonstop with the special capabilities that the platform provides.

If you want, you can do all of this on NonStop! Try that on the TRS-80 sitting on display at Radio Shack!

For fun, here are several ways to say hello using NSJ17!   Mix and match with the same code. Pull and build useful services with a mix of language. This is what Polyglot is. Go to it!

// [Clojure]

(println “Hello, World!”)

//[Kotlin]

fun main() {

    println(“Hello, World!”)

}

// [Scala]

object HelloWorld {

  def main(args: Array[String]): Unit = {

    println(“Hello, World!”)

  }

}

//[Java]

public class HelloWorld {

    public static void main(String[] args) {

        System.out.println(“Hello, World!”);

    }

}

//[Groovy]

println ‘Hello, World!’

//[jPython]

print(“Hello, World!”)

 //[jRuby]

puts “Hello, World!”