Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×

Comment Monads! (Score 2) 536

Monads monads monads monads monads from Haskell.

Or "workflows" in F#. Related to, I think, "generators" in Scala?

Roughly (and I'm going to make up some C++/Java style syntax here), you write something like this:

workflow someExpressionMaybeAnObject
{
        int x = someassignment;
        some statement;
        someotherstatement;
}

At the end of each line, you check the return value for errors, and use the handlers defined by the object up top, which could short-circuit the rest of evaluation.

These are actually a lot more general than error handling. For example, they generalize Python-style list comprehensions when used in a certain way.

In Haskell-land, there's a lot of interesting math about how they work, but you don't need it for error handling.

Moral: Learn a wider variety of languages!

Comment Re:Imagine that... (Score 1) 282

English isn't particularly more fault-tolerant than other languages. All languages are fault tolerant. It's why things like noun-verb agreement exist: they provide redundancy and error detection and correction.

English is so dominant on the Internet because England conquered the world and the US is enormously influential.

Comment Re:Regardless (Score 2, Informative) 742

When I was 10, I was making elaborate 3D models in a modeler called Form-Z, and, while I like to think I'm pretty smart, I don't think that it was that hard. Kids from like 8 to 12 have an incredible ability to hyperconcentrate on cool things like that.

When I was five, I was using a mouse to make drawings in KidPix. I don't think it is that unreasonable to expect a four year old to have a lot of fun with blender. And you are vastly underestimating them if you think they can't use a mouse.

Comment Re:Only 20 light years??? (Score 1) 575

Re: temperature, Wired article says "minus 24 degrees to 10 degrees above zero Fahrenheit" would be expected, except that it is almost certainly tidally locked, so one side is boiling with the other freezing. There would be a temperate zone in the middle.

http://www.wired.com/wiredscience/2010/09/real-habitable-exoplanet/

Comment Re:Only 20 light years??? (Score 1) 575

Apparently this one was easier to find because the star was a red dwarf. This means that, because it is not as bright as the Sun, the habitable zone is much closer in and so the gravitational force between the star and the planet was larger. Moreover, the red dwarf is much less massive than the Sun. Together these two facts mean that the star wiggles a lot more do to gravitational effects than an Earthlike planet would cause a Sunlike star to, and so it was easier to find. Aliens on this planet trying to find planets around the Sun with the same techniques would be able find only Saturn and Jupiter.

So says my science writer friend.

Comment Re:Ideally the best metric would be (Score 1) 661

The problem with that is that operations per second on a multicore machine does not mean the same thing as on a single core machine. If I increase the number of cores, the number of operations per second goes up, but your programs won't run any faster unless the programmer wrote really good threaded code. Which he or she didn't, because that's hard. On the other hand, if I increase the clock speed, the number of operations per second goes up, and your program also runs faster.

Of course, commodity processors stopped getting faster clock speeds in 2003, while Moore's law keeps marching, so now the added complexity goes into more cores, which is useless for many applications.

(FLOPS is used as a metric by the scientific computing community, which tends to deal with large, well structured problems which can be easily distributed across thousands of machines, and which use floating point arithmetic. It's a useful metric there, but it's not really useful for commodity machines.)

Slashdot Top Deals

Any circuit design must contain at least one part which is obsolete, two parts which are unobtainable, and three parts which are still under development.

Working...