News for hackers. Stuff that matters.
Re:“Mostly functional” programming does not work (2014) by j-pb on Monday June 22, 2015 @08:36AM (#9757798)
Here's your perfect counterexample.

The only language that allows you to build things that won't fail even when the hardware breaks.

Erlang.

Re:“Mostly functional” programming does not work (2014) by hueving on Monday June 22, 2015 @08:46AM (#9757851)
What? The only possible way that constraint could be satisfied (working under any hardware failure) would be if erlang didn't let you write any programs that did anything.
Re:“Mostly functional” programming does not work (2014) by thyrsus on Monday June 22, 2015 @09:39AM (#9758193)
The argument is that Erlang (and its OTP environment) gives you the tools to distribute your system in such a manner that hardware failure is observed and that the failed portion of the system is restarted elsewhere. The granularity provided is better than most STONITH models. It provides a lot of help, but one still needs to make an effort to assure that, e.g., merchandise is not sent unless an invoice is generated.

STONITH: https://en.wikipedia.org/wiki/STONITH

Re:“Mostly functional” programming does not work (2014) by fnordsensei on Monday June 22, 2015 @08:49AM (#9757874)
Excuse the aside, but this reminds me of this old Bash quote:

  <FreeFrag> The most secure computer in the world is 
             one not connected to the internet. 
  <FreeFrag> Thats why I recommend Telstra ADSL.
Also, agreed. Some elaboration on that point would be most welcome.
Re:“Mostly functional” programming does not work (2014) by TazeTSchnitzel on Monday June 22, 2015 @09:03AM (#9757959)
Re:“Mostly functional” programming does not work (2014) by r0naa on Monday June 22, 2015 @08:44AM (#9757843)
It would be nice if you could add a citation, or elaborate a little bit!
Re:“Mostly functional” programming does not work (2014) by vezzy-fnord on Monday June 22, 2015 @09:15AM (#9758040)
I think the parent poster's point is more that the article's extensive focus on side effects and monadic encapsulation as the central concern for reliable software engineering is short-sighted, as Erlang is a dynamically typed impure functional language that nevertheless is robust in its use of multi-node distribution, supervisor trees, sophisticated error/exception models, scheduling guarantees, SMP, dynamic code upgrade as first-class VM constructs, as well as the language itself being homoiconic and driven by a small number of basic data structures (tuples and lists).

The language's module system offers namespacing and then the OTP framework implements standard behaviors that have (in gen_server's case) state calculation, supervision, code change, termination and messaging callbacks all exported.

I presume "surviving hardware failures" was in reference to native Erlang epmd machine distribution, which is intended for fault tolerance and based on heartbeats. It's one step further than most languages go.

Ultimately, there is much more to be considered than state and side effects.

Re:“Mostly functional” programming does not work (2014) by j-pb on Tuesday June 23, 2015 @03:38AM (#9763143)
Yes, exactly. Well put :)
Re:“Mostly functional” programming does not work (2014) by TazeTSchnitzel on Monday June 22, 2015 @08:43AM (#9757836)
Even when the hardware breaks? What?

If radiation hits the CPU, Erlang won't save you.

Re:“Mostly functional” programming does not work (2014) by klibertp on Monday June 22, 2015 @09:26AM (#9758097)
It will, if by "Erlang" you mean "language + set of libs + set of conventions (all of this battle-tested for years)".

In short: (some) Erlang systems have backup hardware and support moving running systems from one machine to the other (or one cluster to the other, etc), achieving very high "uptime" values.

Re:“Mostly functional” programming does not work (2014) by sqeaky on Monday June 22, 2015 @11:51AM (#9759155)
If radiation hits, oh say, a CPU register it might just change the value in a register. That is completely uncatchable and almost unobservable on modern hardware.

With any system on relying on hot switching to backups you must have a mechanism to detect errors. The mechanisms exist in many languages there are plenty of robust C++, Java, php, ruby, and sadly cobol systems out there. No new language gets to claim backups as a core feature of the language, unless cobol does too.

I am moving to my third job that has a cobol legacy system being replaced by something new. All three of these shops have backup systems that the business owners would never consider separating from their legacy cobol apps.

Re:“Mostly functional” programming does not work (2014) by Sanddancer on Monday June 22, 2015 @12:46PM (#9759534)
It is catchable and observable on modern hardware; mainframes have been doing it for years, with the operation also existing on some specialty Intel chips. Cores are paired, with each operation going through each of them simultaneously with the results compared. If the results don't match, they're run through again. If they still don't match, that pair of cores is shut down and operations are redirected.
Re:“Mostly functional” programming does not work (2014) by sqeaky on Monday June 22, 2015 @01:42PM (#9759922)
Pairing like that would find this kind of error. It is also believable that mainframe shops would be willing to cut their throughput in half to get that level of reliability.

I was completely unaware of it even in a research setting. Yet I was aware of things like ECC RAM, RAID, Chipkill RAM and algorithms for continuous checking of results including some implemented in hardware to isolate faulty CPUs but they all added extra hardware or software and none reused existing commodity cores. Its so simple, of course it should be a thing.

Could you post a link to some reading on this?

Re:“Mostly functional” programming does not work (2014) by Sanddancer on Monday June 22, 2015 @05:18PM (#9761267)
This link from wikipedia has pretty much a good laundry list of descriptions different companies have taken for doing lock-stepping, etc https://en.wikipedia.org/wiki/Lockstep_%28computing%29 . It's also one of the reasons this level of machine is so expensive. Each mainframe core would be two cores in a "normal" system, plus mainframes have logic to decommission a cpu without needing a shutdown, by migrating the workload to a spare processor.
Re:“Mostly functional” programming does not work (2014) by sqeaky on Friday June 26, 2015 @12:43PM (#9785920)
I only spoke with such confidence in my previous post because I thought I had worked on high end machines. I worked with a number of Sun and oracle machine with CPU failure detection and CPU hot swapping. But This feature was always flaky. I am eager to learn about what I missed.
Re:“Mostly functional” programming does not work (2014) by marcosdumay on Monday June 22, 2015 @03:50PM (#9760746)
In theory, Haskell could do that too.

Some people even started a fork of GHC aimed at cluster parallelism a few years ago, but I don't think they got it working.