P

Parallel Universe Blog

blog.paralleluniverse.co · Company blog · on HN since 2012

Parallel Universe, the company behind Quasar, writes about JVM concurrency, lightweight threads, and functional programming.

What HN saysHN commenters praise the Little's Law post as one of the best on its subject and debate its effects-versus-monads and Java advice.
45HN people shared it
31linked it in comments
46stories submitted
2.6Kstory points
7 years agolast shared
2012people per year2026

Most-shared posts

  1. 1
    An Opinionated Guide to Modern Java Development, Part 1
    14 people · 556 points · first shared 2014 · 396 comments on HN
  2. 2
  3. 3
  4. 4
    Why Writing Correct Software Is Hard
    5 people · 25 points · first shared 2016 · discussion on HN
  5. 5
    Erlang (and Go) in Clojure (and Java)
    5 people · 2 points · first shared 2014 · discussion on HN
  6. 6
  7. 7
  8. 8
    Benchmarking High-Concurrency HTTP Servers on the JVM
    3 people · 7 points · first shared 2016 · discussion on HN
  9. 9
  10. 10
    Quasar and Akka – a Comparison
    2 people · 49 points · first shared 2015 · 44 comments on HN
  11. 11
    Go and Quasar: a comparison of style and performance
    2 people · 35 points · first shared 2016 · 2 comments on HN
  12. 12
    Introducing Comsat and the Parallel Universe Stack
    2 people · 15 points · first shared 2014 · 1 comments on HN
  13. 13
    Farewell to Asynchronous Code
    2 people · 12 points · first shared 2014 · discussion on HN
  14. 14
    Quasar and Kotlin – A Powerful Match
    2 people · 10 points · first shared 2015 · discussion on HN
  15. 15

What HN people wrote when they linked it

thermodynthrway · 2018-06-19
Similar to Quasar then I assume. I'm sure native fibers would be faster, but bytecode is fairly close to ASM and i don't think the performance difference is large. Benchmarks I've seen for Quasar show no performance difference to regular threads at low paralellism but it can scale much higher Found a great article comparing Akka's Actors vs Quasar http://blog.paralleluniverse.co/2015/05/21/quasar-vs-akka/
Rusky · 2018-02-08
> you're effectively talking about a secondary, novel type system, right? Yes, exactly. The main reason I prefer language-level effects rather than monads is for composability with normal imperative control flow. Monads are written in terms of higher order functions passing closures around, and that gets really messy in a language where you not only have early return and loops with break and continue, but you also have destructors that need to run as you enter and leave scopes. You can add that kind of stuff as monads but it gets really messy, and is basically completely untenable in a language like Rust that also cares about memory management. Even if Rust did have HKT, it would still be impossible to write a Monad trait that supports them all, for example. This article makes some great points on the subject: http://blog.paralleluniverse.co/2015/08/07/scoped-continuations/
catchmrbharath · 2016-02-08
One of the best articles I read on the subject was this http://blog.paralleluniverse.co/2014/02/04/littles-law/
pron · 2015-12-21
> Well for me the value of using a monad to capture an effect is to be able to verify that I've sequenced that effect correctly at compile time. > I do prefer to have a type system which verifies the monad laws at compile time, and I do think that the stronger the enforcement around the monad system, the more worthwhile it becomes to manage a given effect explicitly. That's an advantage of having a type system, not of having monads. There are other ways to type-check effects without monads (at least not explicit monads, and the monad laws don't need to be checked): http://blog.paralleluniverse.co/2015/08/07/scoped-continuations/
kodablah · 2015-09-19
"If you're using Java 8, you can use the excellent new Optional type. If a value may or may not be present, wrap it in an Optional class like this" While I agree with most things, overuse of Optional like this is an antipattern IMO. Having done a lot of Java 8 development, I find Optional is best for return types, but otherwise forcing callers to wrap values in Optional is unnecessary as opposed to something like Scala. Those that work on the JDK feel the same [1][2] and I think [2] is even overuse with the prevalence of static analysis tools and @Nullable. Although a tad dated, I find [3] to be a good guide to modern Java all around. 1 - http://stackoverflow.com/questions/26327957/should-java-8-getters-retu… 2 - http://blog.joda.org/2015/08/java-se-8-optional-pragmatic-approach.htm… 3 - http://blog.paralleluniverse.co/2014/05/01/modern-java/
cel1ne · 2014-12-26
Don't know how well you know Java, but look into Reflection and Annotations, it could simplify your development a great deal. Also: http://blog.paralleluniverse.co/2014/05/01/modern-java/
lmm · 2017-11-20
> see my blog post, http://blog.paralleluniverse.co/2015/08/07/scoped-continuati..., with references to work by Oleg Kiselyov on typed continuations. So a theoretical type system extension that Kotlin doesn't actually have could solve this, and looks ok in simple examples. That's not terribly reassuring and not much help to anyone writing Kotlin today; anyone wanting to do the equivalent of something basic like traverse or, I don't know, cataM will still have to either copy/paste their code or give up type safety. > On top of that, Scala can't restrict effects, either. In theory no. In practice I use traverse all the time without worrying about whether the function I called was secretly throwing an exception or modifying a global variable, and it hasn't caused a bug yet; the community and culture can mostly work around the lack of hard restrictions at the language level. > Which, BTW, Java discourages. Option is mainly recommended for use in functional composition in streams. I know that's the official line, but it still works in a first-class way in practice (which to my mind is the sign of good language design; you can't expect language designers to anticipate all your needs, so it's important that things continue to work even if used in unexpected ways). > I believe that the pure functional paradigm in general suffers very strongly from this in a way that's very essential to the core of the paradigm (because typed monads introduce a dependence of code structure on a…
sanderjd · 2015-09-07
I'm going through that right now, and finding it incredibly good, but still fairly outdated. It was written for Java 6, while Java 7 and (especially) 8 have more or less re-written the language. All of the advice is still really great, but some of the items are workarounds for weaknesses in the language that have since been strengthened. I'm working through Java 8 in Action[0] in parallel, and it's been a good experience. I've also been enjoying this Modern Java blog series, which is book-ish[1]. In a similar vein, I really enjoyed Effective Modern C++[2]. I think The Ruby Way[3] is still the best ruby book, and a new edition just came out earlier this year. I'm looking for a good book about modern javascript if anyone has any suggestions. [0]: https://www.goodreads.com/book/show/20534354-java-8-in-action [1]: http://blog.paralleluniverse.co/2014/05/01/modern-java/ [2]: https://www.goodreads.com/book/show/22800553-effective-modern-c [3]: https://www.goodreads.com/book/show/4514.The_Ruby_Way
hkarthik · 2014-12-09
Basecamp and Harvest were both written in Rails. For standing up simple SaaS, Rails is a great choice. However, for a complex SaaS (any SaaS can get here really), you will need to make some sane choices around modularity and building separate, loosely coupled services before things get out of hand. Node.js (or any of its lightweight frameworks on top) is probably a little stronger than Rails in this regard. This service-based approach is more difficult with Rails as the community hasn't blessed any consistent conventions around doing it. Any custom convention you create to integrate multiple Rails applications will likely break compatibility with future Rails framework upgrades. There are many companies that are paralyzed and stuck on older versions of Rails because they ran into this problem. All that being said, Java is still a great choice if you make some modern choices and will help you move forward without being slowed down by learning a new framework. Check out the Modern Java Series here: http://blog.paralleluniverse.co/2014/05/01/modern-java/
rektide · 2013-05-02
There have been several attempts of porting actors to the JVM. Quasar and Pulsar’s main contribution — from which many of their advantages stem — is true lightweight threads[1]. Lightweight threads provide many of the same benefits “regular”, OS threads do, namely a single, simple control flow and the ability to block and wait for some resource to become available while in the meantime allowing other threads to run on the CPU. Unlike regular threads, lightweight threads are not scheduled by the operating system so their context-switch is often faster, and they require far less system resources. As a result, a single machine can handle millions of them. http://blog.paralleluniverse.co/post/49445260575/quasar-pulsar Excellent area to contribute to. In 2006-2008 there was Kilim, which uses some code-rewriting to accomplish similar greenthreading on the JVM to support an actor system with extremely lightweight lock-ree message massing. Kilim comfortably scales to handle hundreds of thousands of actors and messages on modest hardware. It is fast as well – task-switching is 1000x faster than Java threads and 60x faster than other lightweight tasking frameworks, and message-passing is 3x faster than Erlang (cur- rently the gold standard for concurrency-oriented programming). from https://github.com/kilim/kilim/raw/master/docs/kilim_ecoop08.pdf Kilim: https://github.com/kilim/kilim
mannykannot · 2016-10-13
The problem with Ethereum is not 'just' a poor language, it is the general difficulty of verifying a Turing-complete anything. http://blog.paralleluniverse.co/2016/07/23/correctness-and-complexity/ The same applies to all 'formal law language' proposals.
RossBencina · 2016-09-10
From the YouTube link: Extended transcript with more results and full references can be found here: http://blog.paralleluniverse.co/2016/07/23/correctness-and-complexity/
campers · 2016-07-27
You can plug Quasar/Comsat in to get lightweight threads http://blog.paralleluniverse.co/2014/01/22/introducing-comsat/ RatPack is a nice async microframework
calibraxis · 2016-05-15
One is possibly absorbing other paradigms, like you can do language design too, even if you're "just" a user. Take Clojure for recent examples: core.logic, core.async (which gives you Go-like channels). These are distributed as libraries. For many non-Lisp languages, something so small as a new "for" loop often requires you to wait for language implementors. In Lisp, you want pattern matching? Or some Erlang-like semantics? [1] Maybe it's possible! In an accessible way, because you can customize your language's user interface. You are not just a consumer. [1] http://blog.paralleluniverse.co/2013/05/02/quasar-pulsar/
kbouck · 2016-01-22
Parallel Universe made a comprehensive 3-part blog post to modern Java. They cover language features like lambdas, as well as notable libraries for build, deployment, monitoring, and web development. http://blog.paralleluniverse.co/2014/05/01/modern-java/
acjohnson55 · 2015-12-27
I very much like this model, but I wonder how necessary it is when we have IcedCoffeescript [1], ES6 generators + co [2], and ES7 async/await [3] as viable ways of managing async control flow within mostly synchronous-looking code, all as dialects of languages that have strong adoption. I actually think generators + co is a really strong model. Async/await gives you a slight bit of sugar, but I've realized that if you stick with generators, you can wrap your generators to allow you to `yield` more than just promises, effectively giving you something like (untyped) scoped continuations [4]. [1] https://maxtaco.github.io/coffee-script/ [2] https://github.com/tj/co [3] http://masnun.com/2015/11/11/using-es7-asyncawait-today-with-babel.htm… [4] http://blog.paralleluniverse.co/2015/08/07/scoped-continuations/
glogla · 2015-04-24
There's a series of articles about how Java don't have to be slow XML-laden crap: http://blog.paralleluniverse.co/2014/05/01/modern-java/ While I don't necessarily agree with everything in it (like Gradle builds), it's interesting to look at.
dafnap · 2015-03-09
For those who aren't familiar - have a look at this tutorial http://blog.paralleluniverse.co/2015/03/09/up-and-running-with-comsat-…
markc · 2015-02-02
>If you want to make 300,000 threads in Lua or Go, go right ahead, but if you port that application to Java you're going to have a bad time. In Java itself perhaps, but with Java you can use lightweight threads via Quasar. http://blog.paralleluniverse.co/2013/05/02/quasar-pulsar/ "a single machine can handle millions of them"
Monkeyget · 2015-01-26
Apparently this is a republication of a blog article [0] that was heavily commented on hnews [1]. There is also a part two and three there. [0] http://blog.paralleluniverse.co/2014/05/01/modern-java/ [1] https://news.ycombinator.com/item?id=7680338
antrix · 2014-08-25
Java's pluggable type system can do this. The Checker framework provides a Units checker that can be plugged into the compile stage. See this blog for more info: http://blog.paralleluniverse.co/2014/05/01/modern-java/
klibertp · 2014-06-10
> So if Java could have gotten goroutines without having to make a whole new language... would Go be a good idea? http://blog.paralleluniverse.co/2013/05/02/quasar-pulsar/ "We’ll start at the end: Quasar and Pulsar are two new open-source libraries in Java and Clojure respectively that add Erlang-like actor-model (and Go-like coroutine/channel) programs to the JVM."
e12e · 2014-05-07
While I have in general sworn off java, and is rather enamoured by clojure's lein build tool -- I enjoyed the recent post (that was on hn as well): http://blog.paralleluniverse.co/2014/05/01/modern-java/ It does appear grails manage to expose many of the good parts of Ivy/Maven while keeping build-files reasonably sane -- and crucially it appears to offer a pretty solid story in terms of "predictable future deployment" (can I restore a service in two years and deploy it on a contemporary system?).
iadapter · 2014-05-02
I wonder if this is a response to yesterdays post about modern Java [1]. Timing seems too close to be a coincidence. On the other hand it does not address the points of the other post so I'm probably wrong. [1] http://blog.paralleluniverse.co/2014/05/01/modern-java/#comment-136637…
eranation · 2014-05-01
The biggest take I have from this post is that apparently they have created go-like lightweight threads for the JVM with Quasar (http://docs.paralleluniverse.co/quasar/) which is really interesting. If I understand correctly, Quasar uses bytecode instrumentation to enable user-mode threads for the JVM, and they claim they did benchmarks that show X6 to X12 better performance than native JVM threads: http://blog.paralleluniverse.co/2014/02/06/fibers-threads-strands/#ben… This is really something that caught my attention.
danieldk · 2013-12-04
For Java: http://blog.paralleluniverse.co/post/49445260575/quasar-pulsar Yes, you can use Akka from Java. Just to show that you don't need something like Scala to implement an actor system.
piranha · 2013-08-12
The fact that it's not using standard JVM threads? His blog post describes how everything works: http://blog.paralleluniverse.co/post/49445260575/quasar-pulsar
hugoc · 2013-07-26
Lightweight Threads, Channels and Actors for the JVM: http://blog.paralleluniverse.co/post/49445260575/quasar-pulsar
muraiki · 2016-03-24
I've prototyped UIs with RxJS (the javascript version of reactive extensions) both by itself and with Cycle.js. I've also used reactive programming in Perl 6. There are a lot of things to like about reactive programming, but anymore I'm not sure if it's the right answer. Let me first preface this by saying that I'm building upon thoughts presented (by someone else) here: http://blog.paralleluniverse.co/2015/08/07/scoped-continuations/ One problem with reactive programming (and also with promises), is that you are essentially using monadic composition in an imperative language. Because of the lack of special support for monads that you have in a language like Haskell, you have.to.chain.flow.control.methods. As a result of this, you lose access to the standard flow control the imperative language provides you, and you also generally end up with mangled stack traces. Now I know that rxjs5 is working on the stack trace problem through the usage of a recursive scheduler, but I'm not sure how this works on the Java side of things. An alternative approach can be found in languages like Go and Erlang. In these languages you generally do not need to worry about exhausting a thread pool because they have made creating "threads" extremely cheap. As such, you can write normal imperative code that blocks, potentially indefinitely, and also still preserves stack traces and which uses the plain flow control structures (and error handling) of imperative programming. Furthermore, if you…
circlespainter · 2015-05-22
> any library it's used with needs to be retrofitted/wrapped to make it work with Quasar. True, but 1/ to see how easy it can be to integrate a pre-existing library with Quasar, just have a look at the OkHttp integration in Comsat's master and at this post http://blog.paralleluniverse.co/2014/08/12/noasync/ and 2/ the integrations provide an API identical to the original ones, not new ones, which makes the transition (and the opt-out) easy. Further so considering that fibers have API and usage practically identical to regular threads. So there's no API proliferation when integrating Quasar and the integration implementation itself can amount to just few lines of code. > The article makes it seem like Akka cannot be used from Kotlin Akka can surely be used from Kotlin (or even Clojure probably, for that matter), yet it lacks an idiomatic wrapper for it, which Quasar is starting to provide (and has offered for quite some time now for Clojure). Both Kotlin and Clojure are good at using existing Java APIs conveniently but, especially in Clojure's case perhaps, I think the lack of an idiomatic wrapper would be felt as an important minus, especially considering how concise and lean Clojure idiomatic APIs usually are. > I'm unsure if Quasar can't be used from Scala because of the Bytecode manipulation that you're doing being incompatible with the Bytecode that the Scala compiler is putting out. Quasar's bytecode manipulation amounts to user stack management in order to…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close