Let's talk programming languages

Oh, it was great. I went to a conference about this programming language. It is a statically typed language with type inference that compiles to native code, with great support for functional programming and strictly monadic error handling. And it's not even garbage collected!

So how was your weekend?

Statically typed

Dynamically typed

interface Typing {
  static void foo() {
    int x = "foo";
  }

  static void main(String[] args) {
    System.out.println("hello");
  }
}
fun foo (x:int) (y:string) = x + y;

print "hello\n";
function foo() {
    var x = undefined;
    x();
}

console.log("hello");
foo();
def foo():
    x = 3 + [2, 3]

print "hello"
foo()

Statically typed

without type inference

Statically typed

with type inference

fun plusOne x = x + 1;

val two = plusOne 1;
int plusOne(int x) {
    return x + 1;
}

int two = plusOne(1);

Compiled

Interpreted

When you hand your source code to a program, what happens?

Java is a compiled object-oriented statically typed language

Standard ML is a functional statically typed language with type inference that is usually interpreted, but sometimes compiled.

JavaScript is an interpreted object-oriented dynamically typed language

Made with Slides.com