TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Haxl: Making Concurrency Unreasonably Easy [video]

67 pointsby dmitalmost 8 years ago

6 comments

daxfohlalmost 8 years ago
I wonder how long it will be before compilers&#x2F;interpreters of async-aware languages just do this by default. CPUs and low-level language compilers jump through all kinds of hoops of out-of-order execution, branch prediction, caching, parallel execution, etc.<p>I picture a day maybe 10 years from now where developers in most languages don&#x27;t even have to think about these things. All the old-timers will still be structuring their code &quot;as though it didn&#x27;t exist&quot; whereas the new kids will fly along without even thinking about it. Kind of like garbage collection the first few years.
评论 #14627393 未加载
评论 #14628388 未加载
评论 #14627390 未加载
评论 #14627820 未加载
评论 #14630263 未加载
bandalialmost 8 years ago
Great talk.<p>For more on concurrency and parallelism in Haskell, check out Parallel and Concurrent Programming in Haskell [0], deemed as the best book on the subject, also written by Simon Marlow.<p>[0]: <a href="http:&#x2F;&#x2F;chimera.labs.oreilly.com&#x2F;books&#x2F;1230000000929" rel="nofollow">http:&#x2F;&#x2F;chimera.labs.oreilly.com&#x2F;books&#x2F;1230000000929</a>
vdijkbasalmost 8 years ago
Haxl is a powerful abstraction with IMHO a beatifuly simple implementation.<p>However for our use case at LumiGuide (reading and writing registers of modbus devices) it wasn&#x27;t simple enough. We just needed an abstraction for batching and did not need caching and the other features Haxl provides.<p>So I wrote monad-batcher which as the name implies only provides a batching abstraction (which can also be used to execute commands concurrently). All the other features can be build on top of monad-batcher as separate layers (separation of concerns).<p>The library is available on Hackage but needs a bit more documentation (a tutorial would be nice):<p><a href="http:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;monad-batcher" rel="nofollow">http:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;monad-batcher</a>
sedachvalmost 8 years ago
I looked through the slides but not the video and the slides ignore the hard problem: how do you schedule these requests? How do you know how many parallel requests you can issue without hammering the database or service? How do you batch queries so that you get acceptable latency and a query size that will not choke the database?<p>The last question is probably easy for most use cases where you have independent requests coming in (typical web application) - in the context of a single request you can usually get away with batching as much as is possible. But the scheduling problem is very similar to the promises of &quot;free parallelism because Church-Rosser&quot; - actually taking advantage is an open problem. Even when you know how much time each job takes in advance, multiprocessor scheduling is NP-hard.<p>Anyway, if someone watched the video and the question is addressed there, please let me know so I can watch it.
评论 #14627378 未加载
jankotekalmost 8 years ago
I have not fully digested yet, but seems very similar to Scala Parallel Collections and Java8 Streams. There are databases which implements such interfaces.
评论 #14627631 未加载
评论 #14628630 未加载
pmarreckalmost 8 years ago
How does this differ from BEAM langs which already make concurrency &quot;unreasonably easy&quot;?
评论 #14627709 未加载