cloudparts

Run on a virtual machine

The compiler emits portable bytecode for a runtime such as the JVM, .NET or BEAM, which loads it, compiles the busy parts to machine code and manages memory and threads.

How they work

Java, Scala and Clojure compile to JVM class files; C# and F# to Common Intermediate Language for .NET; Erlang and Elixir to .beam files for BEAM. One build runs on every platform the runtime supports, and the runtime supplies the garbage collector, threads or processes, and the standard library. Languages on the same runtime share libraries: Scala imports Java classes directly, and a class written in one .NET language can be subclassed in another.

The cost is the runtime itself: it has to be installed or bundled, it takes time to start, and code runs slower until the JIT has compiled the hot paths. Ahead-of-time options such as GraalVM Native Image and .NET Native AOT trade some dynamic features for a single native executable. See Runtime virtual machines for how the JVM, CLR and BEAM differ.

Technologies

What all programming languages have in common →
C#Open sourceMicrosoft’s statically typed, object-oriented language for .NET, which made async and await mainstream and gains a new version every November.ClojureOpen sourceA dynamic Lisp hosted on the JVM, built around immutable persistent data structures and interactive development at the REPL.ElixirOpen sourceA dynamic, functional language on the Erlang virtual machine, created by José Valim: Erlang’s processes, supervisors and hot code loading, with modern tooling, macros and gradual types being added to the compiler.ErlangOpen sourceA dynamically typed functional language from Ericsson, built for systems that must never stop: lightweight processes that share nothing, supervisors that restart what fails, and code that can be upgraded while it runs.F#Open sourceA functional-first language from the ML family that runs on .NET, with type inference, immutable data by default and computation expressions.JavaOpen sourceA statically typed, object-oriented language that compiles to portable bytecode for the Java Virtual Machine, with a new release every six months.JavaScriptOpen sourceThe language of the web: dynamically typed, garbage collected and single-threaded per event loop, shipped as source and compiled by the engine while it runs.ScalaOpen sourceA statically typed language that fuses object-oriented and functional programming, compiles to JVM bytecode and calls Java libraries directly.TypeScriptOpen sourceJavaScript with a static, structural type system that is checked at build time and erased before the code runs; since version 7.0 its compiler is written in Go.

Sources

Improve this page on GitHub