Better HN
topnewbestaskshowjobs
Log inSign up

daniel_yokomizo

8 karma · joined May 23, 2008 (18y ago) · 6 submissions

Submissions

comment 17y ago · link · parent

1. Most lines of code don't require side-effects, the Haskell way just asks you to structure your program in pure parts and side effecting parts (usually 90/10). 2. Also it's easy to define your own forms of side effects and parameterize your code on them (so I write my code to depend on any monad m that offers references and the code runs using IO, ST or STM), not being constrained by whatever choices the language designers gave you initially 3. Monads (and arrows and other abstractions that can model side-effects) are beautiful by themselves. It's one of the most elegant ways to express, compose and restrict side-effects. In most languages there's no easy way to create different combinators to deal with side-effects, but in Haskell 'do', ';' and '<-' are only pieces of notation, the real meat is '>>=' and 'return' and whatever combinators you build upon these. 4. The Haskell way to deal with side effects is to use a pure language to build a side-effecting program. Instead of writing down the program you abstract its parts and use combinators to mix them. 'IO' is a value that can be manipulated not an action that was already executed.

comment 17y ago · link · parent

It's always a matter of incentives and transaction costs. Now whoever uses this extension has a little bit more incentive and a little bit less cost to pirate. A locked door isn't enough deterrent to thieves that really want to steal from you, but they work well enough against the lazy ones.

comment 17y ago · link · parent

Given 6*10^20 neurons in the human race, we have 10^3 atoms in 12 grams of carbon per neuron, a little bit more than 1 neuron simulation per atom. I'm not a neuron simulation or an atomic computing expert but even a few orders of magnitude above it (e.g. 1.2 kg of carbon) would give us sufficient computing power for a neuron AFAIK.

Also 10^11 neurons fit in roughly 0.001 cubic meters (i.e. a cube of 10cm), a thousand would fit in a cubic meter, your one brain simulation server room has space to a 100,000 actual human brains. Even if the simulation hardware occupies the same space as the human brain requires we would use only 0.01 cubic kilometers for the entire human race simulation. I have to agree that this will cost more than $1k, but is much smaller than your design.

comment 18y ago · link · parent

Most OO languages are based on no theory, while every FP language can trace its roots to the lambda calculus. Functions compose and abstract very well, leading to simpler and more expressive designs. In OOPLs the unit of abstraction is the class, usually these aren't even first class citizens, the syntax is usually too heavyweight for casual use (imagine a FPL where it takes as many lines of code to declare an anonymous function as it takes to declare an anonymous class in Java). Even Smalltalk and Self use blocks (i.e. closures or lambdas) instead of providing some lightweight class/object literal notation. GoF patterns were created to solve these problems of OOPLs. If you're trying to do FP in a language without higher order functions and algebraic data types you'll have to come up with dozens of design patterns to express simple things as folds or pattern-matching. OTOH a hypothetical OOPL with higher-order classes and a lightweight syntax for anonymous object/class literals would provide combinators for almost (if not all) GoF patterns and this wouldn't be an issue. It's not FP that replaces GoF patterns, good languages with a solid theoretical basis replace GoF patterns, independent of the paradigm.

comment 18y ago · link · parent

When PG says that children are helpless and this is a thing we are wired to like, I remembered that in japanese the word used to mean cute is kawaii, and it also means something close to helpless (it is used to express a kind of pity).

comment 18y ago · link · parent

I have a Landau book in my hands right now ;)