memory layout • No field order • 7 primitives byte(boolean)/char/short/int/long/float/double + reference (opaque pointer to the heap, unknown size) On stack numeric ops are signed • 4 primitives 32/64bits int/long/float/double + reference • special unsigned variants (>>> or compareUnsigned)
typed languages – Groovy, Clojure Other languages runtimes – JRuby / TruffleRuby for Ruby – Rhino, Nashorn, lilijs for JavaScript – GraalJS for JS – GraalPython for Python
of function coloring* – Rust lifetime attributes (we have GCs) – Async/Reactive method (we have virtual threads) – Use class/type for errors (we have exceptions) and checked exceptions are bad :( * https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
Object Oriented Programming • Must be composable/upgradable fearlessly • Code should be fast – Application : Data Oriented Programming • Business requirements change • Code should be readable
library instead of your own code apart if • The code is trivial • The library has a bus factor of 1 • The library code is awful LLMs generated codes using too many dependencies !!
Behavior should be localized in one place • Use pattern matching – No big hierarchy (unless you need it) • Interfaces are not central to the design – just a lightweight abstraction (A | B) – sealed interfaces should be empty
object with the wrong values • Check BEFORE creating the object Public methods should check their parameters – Fail fast if unexpected values – Use Objects.requireNonNull, null should not propagate – Don’t play god, no default value, make it explicit
stream stacktraces are terrible • Lambdas taken as parameter should have a small stacktrace Performance – Do not use flatMap – Use stateful operations with caution • distinct(), sorted()
j.l.foreign + jextract Leyden Improve startup / warmup time : cache objects / metadata Babylon Code reflection to CUDA, to ONXX Valhalla Encapsulation/Abstraction of small objects for free Nullness Emotion (aka Complex!) Early access at https://jdk.java.net