Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Skinney
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
151.
▲
by
Skinney
5y ago
Yes, which is perhaps the best part about virtual threads. Java, Kotlin, Scala, Clojure, Gradle... everyone benefits.
152.
▲
by
Skinney
5y ago
Green threads only used a single os thread, so no parallelism. This is much better.
153.
▲
by
Skinney
5y ago
Up to 1mb of stack memory. It starts lower, only consuming what it needs. It doesn’t resize down again, though, which virtual threads do. The other cost is context switching, which is much cheaper with virtual threads.
154.
▲
by
Skinney
5y ago
JEP 401 (candidate status) was updated this september: https://openjdk.java.net/jeps/401 Also in September, a brief status was posted: https://mail.openjdk.java.net/pipermail/valhalla-spec-observ..
155.
▲
by
Skinney
5y ago
var shouldn’t increase compilation time in any meaningful way. The compiler has to figure out the type anyway (otherwise, how would you get type errors?).
156.
▲
by
Skinney
5y ago
Really? They’ve already written the JEPs. It seems to me that they just have a few more details to iron out. Wouldn’t be surprised to see something land for Java 19.
157.
▲
by
Skinney
5y ago
Parametric types and the unification of primitive and reference types is the goal of project valhala.
158.
▲
by
Skinney
5y ago
Excessive nesting? Optional supports both .map and .flatMap.
159.
▲
by
Skinney
5y ago
My point was: it still takes longer time to de-allocate a large array even if the only thing that needs to be freed is the array itself, when compared to a GC. GC never needs to free anything, it instead overwrites garbage memory with live
160.
▲
by
Skinney
5y ago
I used to work in a C/C++ embedded shop, and I work now at a place where only GCed languages are used. The statement about enabling lower-skilled employers to be hired is pretty much false. Embedded development payed significantly less
161.
▲
by
Skinney
5y ago
Erlang is a good example of a per “thread” GC (erlangs unit of concurrency is the process). When one GC triggers, it doesn’t pause the rest of the program. Not sure if you can disable the GC entirely, but you can set the initial heap high e
162.
▲
by
Skinney
5y ago
And if the array is heap allocated.
163.
▲
by
Skinney
5y ago
Sure, and in your specific use case, the tradeoff of dealing with memory seems worth it. My point was that there are tradeoffs, which you admit. The comment i responded to indicated that there wasn’t one.
164.
▲
by
Skinney
5y ago
Exactly zero pauses only exist if you never free memory, which for most purposes is not an option. In most languages, freeing all all the heap-allocated objects of a big array will take longer than in a language with GC. The reason pauses t
165.
▲
by
Skinney
5y ago
> For example, did you know that C#'s string's hash code calculation is nondeterministic across runs? ... iterating Rust's/Go's default hash maps, etc. I do, but I also know that in Java, C#, Rust and Go it'
166.
▲
by
Skinney
5y ago
> I'd imagine it would be easier to just call a method on whatever we want to update, instead of lowering all our methods into enums. Why wouldn't we do that instead? Easier how? The difference in lines of code is minimal. It&#
167.
▲
by
Skinney
5y ago
There are several benefits to using enums as opposed to closures: 1. All your actions are in one place. Figuring out what can happen as a result of a series of user interactions can be done without navigating through a component hierarchy.
168.
▲
by
Skinney
5y ago
Do notation would only benefit Java, not all the other languages on the JVM. Do-notation would also not solve the problem outlined in the "What color is my function" article. By doing it this way, the entire JVM ecosystem get'
169.
▲
by
Skinney
5y ago
What you're proposing is more work than simply spawning one thread per task, which is what Loom let's you do at scale. Why change your app into microservices if you don't need to?
170.
▲
by
Skinney
5y ago
In that case you should be fine. It should work as well as goroutines and async/await in other languages. As long as you do IO or other blocking operations which block for a significant amount of time (ms instead of ns), Loom will be b
171.
▲
by
Skinney
5y ago
> I thought the promise was we'd use Threads for everything and forget to worry about blocking calls. That is the promise, yes, but you specifically mentioned a CPU-bound task. A CPU-bound workload cannot hope to do much better than
172.
▲
by
Skinney
5y ago
For a CPU bound workload you’ll be better off using one «full» thread per cpu in a pool and submitting tasks to said pool. Then again, the same would be true in Go. Loom simply brings goroutines to the JVM. Go might perform better, but that
173.
▲
by
Skinney
5y ago
I guess it would be fair to say that Loom brings the benefits of async/await without any change in language syntax, and by being compatible with your run-of-the-mill threads
174.
▲
by
Skinney
5y ago
> which is the ideal scenario in a non-async app - why would you create more threads than CPUs? For workloads that involves a lot of IO. If you perform much more than 2-3 IO ops per request, a lot of time spent per request is simply wait
175.
▲
by
Skinney
5y ago
At the time sqlite was written, the author of sqlite was heavily involved with tcl, a dynamicly typed programming language. Sqlite also started out as a tcl extension. Having the database match the typing philosophy of the language it was s
176.
▲
by
Skinney
5y ago
Running builds from the repl let’s you skip the startup cost associated with Clojure. It’s faster if you need to run more than build command, or one build command several times. Lein is easy to get started with, and for simple projects does
177.
▲
by
Skinney
5y ago
To me, a very appealing feature is how everything becomes a pipeline. Other languages needs careful api design for objects/structs/records to be used in a pipeline, but in concatenative languages it is implicit.
178.
▲
by
Skinney
5y ago
Currently, all there is are some simple stack manipulators, simple math stuff, a Pair (tuple) type, a Maybe (nullish) type and a linked List. The stdlib will get more datastructures (Array, Dict, Set, Result, Triple...), some basic side eff
179.
▲
by
Skinney
5y ago
Stabel has generics, but no protocols/interfaces/typeclasses _yet_. Stabel allows you to define structs and unions, which gives you a lot of flexibility.
180.
▲
by
Skinney
5y ago
I agree in principle about the benefits of everything being uniform. For Stabel, specifically, I need some way of seperating function-definition from function-implementation, and a prefix meta language seemed like the best bet. Didn't
More ›