Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Astronomy and programming languages Date: Fri, 16 Jun 2017 00:23:45 -0700 Organization: A noiseless patient Spider Lines: 40 Message-ID: <87vanw2y66.fsf@nightsong.com> References: <2017Jun3.110911@mips.complang.tuwien.ac.at> <0d8d485a-0917-4211-815c-043bb970db4a@googlegroups.com> <2017Jun3.164811@mips.complang.tuwien.ac.at> <87wp8rmgj3.fsf@nightsong.com> <87shj8e1t0.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="43944ed36a25f98e811d0845b302c495"; logging-data="15727"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jXv/FQUOEdO4zdtdUZBHu" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:27Duj9ZhO2MPKiUUao85UcYp1Ds= sha1:qlEhd3Bs4QYI+g3UbCBCzZrTbto= Xref: csiph.com comp.lang.forth:60803 Melzzzzz writes: >> Riak, written in Erlang) > Interesting choice for language ;) I just tried yaws. It perform rather > bad (12k reqs/sec) Riak is supposed to be a high availability near-unkillable distributed db, not a throughput monster. Network delays alone (because the data is replicated etc.) prevent that. > But if I use MVars/Channels to pass around data (and threads) in > Haskell, that has pretty high overhead alone. Erlang can only be worse I think GHC and Erlang are roughly comparable for that. If you don't have too much actual shared data between threads, you might try STM in Haksell and see if it helps (it's much worse than mvars when there is high contention). With Erlang you can use ETS and there's no actual interprocess communication most of the time (it's faked by the library). You also shouldn't compare GHC or Erlang message passing to a single threaded C++ program. GHC and Erlang both can use all your cpu's cores. > That is because when I write C++ program, rarely I need to worry about > performance. When I write Haskell all the time I have to rewrite > program several times in order to achieve the same ... Idiomatic Haskell will usually beat Ruby, Python, etc. but will be slower than C++ unless you optimize a lot (see Alioth shootout). How often do you care? A rather beefy server stack these days costs a few hundred dollars a month. Unless you're running a huge service like Google, it will usually be cheaper to add a few more servers than pay for the added development/debugging time and bug consequences from using something like C++. If you're really trying to compute something fast nowadays, you wouldn't use C++ any more either, of course. You'd use CUDA or even Verilog: https://www.ovh.ie/dedicated_servers/gpu/ https://www.runabove.com/FPGAaaS.xml https://www.runabove.com/labs/FPGAAccelize/