HackerTrans
トップ新着トレンドコメント過去質問紹介求人

joe_mwangi

94 カルマ登録 11 か月前

投稿

Library for fast mapping of Java records to native memory

github.com
166 ポイント·投稿者 joe_mwangi·2 か月前·37 コメント

Java Data Oriented Programming Concept Proposal, Beyond Records

mail.openjdk.org
2 ポイント·投稿者 joe_mwangi·6 か月前·0 コメント

Typeclasses Prototype Java

mail.openjdk.org
2 ポイント·投稿者 joe_mwangi·6 か月前·1 コメント

Amber Features 2026 for Java

mail.openjdk.org
4 ポイント·投稿者 joe_mwangi·6 か月前·0 コメント

コメント

joe_mwangi
·7 日前·議論
I've done some tests with current value classes in latest prototype with full optimisation through annotation. Apparently, everything was being compiled to assembly code with no gc calls. It seems this old school ideology of slow java is about to end in near future. I'm actually intrigued how it will compete with Rust which can't optimise code further while running, while JVM JIT has more info which it could aggressively further optimise, especially hot paths.
joe_mwangi
·10 日前·議論
Also, this will be used for future null-restricted types.
joe_mwangi
·17 日前·議論
Better late than never.
joe_mwangi
·23 日前·議論
This time, 30mb.
joe_mwangi
·23 日前·議論
Yup. By design, value classes will use cpu registers as a 1st priority instead.
joe_mwangi
·23 日前·議論
Until they implement member patterns. https://openjdk.org/projects/amber/design-notes/patterns/tow...
joe_mwangi
·23 日前·議論
> yet But up the comment section, someone thinks they won't be there 'in the future'
joe_mwangi
·24 日前·議論
And I notice, people aren't aware more things are being planned for. For example, the carrier classes being proposed, they will separate state description with state representation and this is where value classes will shine syntactically.
joe_mwangi
·24 日前·議論
And the only syntax change is adding 'value'.
joe_mwangi
·24 日前·議論
Since they plan to have null-restricted types, then I don't see any issue.
joe_mwangi
·24 日前·議論
But with null-restricted types, Integer! and int has no difference semantically and representation. They plan to introduce null-restricted types in future.
joe_mwangi
·先月·議論
This is awesome. First step to an interesting direction of the language.
joe_mwangi
·2 か月前·議論
More reasons why java value classes will be a game changer.
joe_mwangi
·2 か月前·議論
Java’s planned approach is more like typeclass-style interfaces than unrestricted operator overloading. Types opt into core-defined operator contracts, rather than every library inventing arbitrary meanings for symbols.
joe_mwangi
·2 か月前·議論
Damn. You're old school. Java’s answer is virtual threads, not async/await. The idea is that most server-side IO can stay in direct style enabling blocking-looking code, cheap virtual threads underneath. So you don’t split the whole codebase into sync vs async functions just to avoid blocking OS threads. CompletableFuture and reactive APIs still exist, but Loom reduces the need to use them as the default application model. You can now launch millions of virtual threads to do IO.
joe_mwangi
·2 か月前·議論
Notice you point out features that were easy to add during the beginning where there was no concern of backward compatibility? Now that java is porting value classes to mainline and we might have them soon, and planned operator overloading through type class, I believe java approach is making careful design choices that are semantically sound, rather than adding features that create edge cases such as boxing invariants in unions like C#.
joe_mwangi
·2 か月前·議論
Value types will be optionally null. What java will introduce to the tooling is narrowing of nullness types. Hence Foo! <: Foo? <: Foo. This will assist in enabling safe domains or scope in code that are null-restricted with ease. Hence we can model around such a type system rule.
joe_mwangi
·2 か月前·議論
Great stuff!!!
joe_mwangi
·2 か月前·議論
Yup. They started transferring to the main line, but will require many tests to know if they have any issues. https://github.com/openjdk/jdk/pull/31120
joe_mwangi
·2 か月前·議論
I'm actually planning to resurrect a dead raytracer project (https://github.com/mambastudio/MambaTracer) that has a GPU backend. And possible develop a future 2D API (a lot of work I know). There is an interesting world in multipurpose programming of GPUs, and it took me a while to realise prefix sum is the “hello world” in that area. As a matter of fact, most GPU code without efficient GPU prefix sum, don’t perform well for specific algorithms that might require some scan data, and that’s where CUDA dominates, which has an amazing implementation, and not in other areas such as OpenCL. The raytracer I was making, I encountered a bug that took me I think a month to deduce after some frustration, based on a discovery of my rudimentary struct implementation (through classes and annotation – which I totally agree with you they are a bit annoying) had an misalignment layout which made me rethink, something is wrong with my model approach. So, I needed to solve data and layout representation between java and native code, to be simple, concise, with little headache. If you notice the TypedMemory, the idea is to ensure a user can implement their own libraries with data models without depending on it, and thus becomes a simple plug. Unfortunately, @size will make your code have it as a dependency. Hopefully one day we have multifields as stack allocated arrays (https://web.archive.org/web/20251101203905/https://cr.openjd...) , hence maybe have value `record(char c, float[3] array) {}`