proj-plbook-plChJavaLang

Table of Contents for Programming Languages: a survey

Java

Because it is so well-known, Java gets its own chapter.

Attributes:

Pros:

Cons:

JVM Pros:

JVM Cons:

Best practices and style guides:

Respected exemplar code:

Retrospectives and whitepapers:

Opinions:

Opinionated comparisons:

Popularity:

Tours and tutorials:

Specs:

Implementations:

Java also attempted to be a platform to run 'applets' in the web browser. It wasn't so successful. Some reasons given have been:

Variants:

Popular libraries outside of stdlib

frameworks:

Features

Safety

Java guarantees no segfault/null pointer error crashes. This simple idea is an innovative one, particularly in light of its high performance and usage of an intermediate bytecode representation; in fact, this safety property is present in the JVM itself, not just at the Java level; the JVM won't run bytecode that might cause a segfault.

Closures with immutable upvalues

http://lambda-the-ultimate.org/node/4735#comment-75278

Pass-by-?

Primitives are passed by value; object references are passed by value.

(it is often said that objects are 'passed by reference' in Java, but as [15] points out, that's not quite correct, as you cannot write a 'swap' function in Java)

Gotchas

Internals and implementations

Core data structures: todo

Number representations

Integers

Floating points todo

array representation

Java arrays are typically stored with a length header [17].

Java array lengths are immutable (once set; you can have a data type of an array of uncertain length)

java vectors (resizable arrays) use arrays internally to have a block of memory to grow into [18].

Java multidimensional arrays are stored as a row of pointers, where each pointer points to a columnar slice [19] [20]

Java array have a maximum size [21], typically close to Integer.MAX_VALUE, typically around 2^31.

string representation

Java strings are arrays of chars. [22]

Since Java arrays are typically stored with a length header, this means they are 'Pascal-style' strings.

Representation of structures with fields

todo

Internals and implementation links

Implementations