734 karma · joined Jan 6, 2011 (15y ago) · 236 submissions
comment 14y ago · link · parent
comment 14y ago · link · parent
comment 14y ago · link · parent
It's a work in progress, and I often think to myself, "Is this a good idea".
Here's the latest iteration: I'm in the middle of documenting things for an alpha release: https://github.com/ericmoritz/fp/blob/feature/documentation/...
comment 14y ago · link · parent
I never have to backup those files because they're replicated to any running machine with Dropbox installed. One of those machines has my dropbox share on a Drobo, so I'd need a catastrophic failure of my Drobo disks, Dropbox and my laptop in order to lose those files.
comment 14y ago · link · parent
I have seen some ninja FP artists that have written some really terse solutions in a FP style which are completely unreadable to the uninitiated.
Also, I do not think that there is anything intrinsically difficult about FP. Knowing it proves that you are ambitious and that you have mental plasticity but not necessarily that you are a good developer.
You're just as likely to become that weird dude that writes code no one understands as you are to become Mr Wizard.
comment 14y ago · link · parent
That way you could have a backup of all your social data, stored on your server if you wanted but broadcasted to the other servers.
comment 14y ago · link · parent
It is a combination of Go's technique but with panics for exceptional errors.
Like Go, functions should return error values for known errors. For instance, `file:open/2` returns `{error, enoent | eacces | eisdir | enotdir | enospc}` for known error conditions that can be handled. Unknown, exceptional conditions, like a NAS going down, can't be compensated for because the set of unknown errors is unbounded. There could literally be an infinite number of things that can go wrong that you don't know how to handle. For try/catch style error handling, the only safe way to handle the unknown errors is to do a Pokemon catch clause globally or around every single potentially error causing function call.
Because of the fact that you can't stop errors from happening is why Erlang has processes. When an unknown error occurs, the individual process dies and anyone monitoring that process is notified. OTP has supervisors whose sole job is to watch over processes and restart them if they crash.
Any state that needs to be preserved between restarts is stored somewhere safe (Erlangers calls this the "error kernel") so that when the process comes back it'll resume where it left off.
Once you structure your code to "Let it Crash", your code gets much simpler and safer. #1, the error return values forces you to compensate for known errors that can happen with a function, #2 you have to think about data durability in order to "Let it Crash". #3 Supervisors take care of the rest.
Data durability is made much easier with the fact that individual processes are single threaded and data is immutable, this makes them transactional by nature.
comment 14y ago · link · parent
A Kindle Fire with CM9 on it is only worse than the N7 because CM9 is buggier and ICS is uglier than stock Jelly Bean.
EDIT: I ditched my Kindle Fire for a N7 before Jellybean was available for the Fire.
comment 14y ago · link · parent
Probably another week to get up to speed with OTP for all the promises of resilient Erlang applications.
What is often missed about Erlang is that it's not really about highly concurrent applications. That property is actually a means to accomplish its primary goal: fault-tolerant applications.
See: http://www.erlang.org/download/armstrong_thesis_2003.pdf to understand the motives of the Erlang designers.