8 Alternative JVM languages

 

This chapter covers

  • Language zoology
  • Why you should use alternative JVM languages
  • Selection criteria for alternative languages
  • How the JVM handles alternative languages

If you’ve used Java for any sizable amount of work, you’ve probably noticed that it can tend toward being a bit verbose and clumsy at times. You may even have found yourself wishing that things were different — easier somehow.

Fortunately, as you’ve seen in the last few chapters, the JVM is awesome! So awesome, in fact, that it provides a natural home for programming languages other than Java. In this chapter, we’ll show you why and how you might want to start mixing another JVM programming language into your project.

In this chapter, we’ll cover ways of describing the different language types (such as static versus dynamic typing), why you might want to use alternative languages, and what criteria to look for in choosing them. You’ll also be introduced to the two languages (Kotlin and Clojure) that we’ll cover in more depth throughout the remainder of this book.

8.1 Language zoology

Programming languages come in many different flavors and classifications. Another way of saying this is that there is a wide range of styles and approaches to programming that are embodied in different languages. Mastering these different styles is often easier when you understand how to classify the differences between languages.

8.1.1 Interpreted vs. compiled languages

8.1.2 Dynamic vs. static typing

8.1.3 Imperative vs. functional languages

8.1.4 Reimplementation vs. original

8.2 Polyglot programming on the JVM

8.2.1 Why use a non-Java language?

8.2.2 Up-and-coming languages

8.2.3 Languages we could have picked but didn’t

8.3 How to choose a non-Java language for your project

8.3.1 Is the project area low-risk?

8.3.2 Does the language interoperate well with Java?

8.3.3 Is there good tooling and test support for the language?

8.3.4 How hard is the language to learn?

8.3.5 Are there lots of developers using this language?

sitemap