HackerTrans
TopNewTrendsCommentsPastAskShowJobs

dfa11

no profile record

Submissions

[untitled]

1 points·by dfa11·geçen ay·0 comments

[untitled]

1 points·by dfa11·geçen ay·0 comments

Java: Rethink Domain Primitives with Valhalla

dfa1.github.io
31 points·by dfa11·2 ay önce·11 comments

Show HN: Java RocksDB Without JNI

github.com
3 points·by dfa11·3 ay önce·0 comments

[untitled]

1 points·by dfa11·3 ay önce·0 comments

comments

dfa11
·geçen ay·discuss
> Underengineering (I just invented this term): Too little engineering and too few patterns for a complex problem.

actually this is well-known: like a PoC that goes to production...
dfa11
·2 ay önce·discuss
yeah 100% agree! In some critical area, I'm forced to drop all the "good things" and pack 2 shorts into 1 int to build a tuple(short,short)...
dfa11
·2 ay önce·discuss
True: this compiles and the test passes today on JDK 27-jep401ea3:

  record Person(String name, Age age, Iban iban) {}

  // {"name": "SuperMario", "age": null, "iban": null}
  Person result = mapper.readValue(json, Person.class);

  assertThat(result.age()).isNull();   // passes — value class field, null
  assertThat(result.iban()).isNull();  // passes — value class field, null

  Jackson bypasses the constructor for null JSON tokens (getNullValue() short-circuits), so the
  validation in new Age(...) never runs. Both Age and Iban are value classes; both fields are null.
What do you think? Of course, there are limitations as Person cannot be flattened anymore but I guess Valhalla will ship more JEPs later?
dfa11
·2 ay önce·discuss
[flagged]
dfa11
·2 ay önce·discuss
Valhalla removes the historical performance tax on tiny domain objects. This article argues that value classes finally make domain‑safe primitives practical in real systems — strong invariants, flat layout, no wrapper overhead.

I’d love feedback from folks who’ve experimented with Valhalla or have opinions on modelling domain types in Java.
dfa11
·3 ay önce·discuss
[dead]
dfa11
·3 ay önce·discuss
this is really interesting +1 star

PS is there a plan to include hermetic builds, from local sources / git submodules?