HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Holo314

no profile record

comments

Holo314
·hace 3 años·discuss
Java is built upon it's community :), look no further: https://github.com/Randgalt/record-builder, although hiding the constructor behind the builder is not something I am sure supported by that library

I also remember a discussion in the mailing list about withers: https://mail.openjdk.org/pipermail/amber-spec-experts/2020-M...

Not sure where it stands now, you can ask in the mailing list about this
Holo314
·hace 3 años·discuss
Virtual threads are designed for light, IO-bound, tasks, if your task is heavy/CPU-bound tasks then you won't necessarily want to switch to virtual threads with ScopedValue.
Holo314
·hace 3 años·discuss
- ScopedValue doesn't have a direct equivalent in Kotlin, but CoroutineContext.Element and ThreadContextElement inside of CoroutineContext serve the same purpose. I really think Kotlin overcomplicated this idea.

- Record Patterns are stronger than Kotlins smart cast because of nested patterns

- Kotlin Coroutines works exclusively with Structured Concurrency already. The JEP just adds a way to use Structured Concurrency with threads (it can also be used in Kotlin if you use pure Threads(virtual or not), but I don't see any reason not to use Coroutines