Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
Note: You can take 10% off all Slashdot Deals with coupon code "slashdot10off." ×

Comment Re:Infinity (Score 1) 1067

I've written algorithms for machine learning, where I'm constantly doing things like multiplying 0 and infinity. And, depending on the situation it is totally clear what the correct result must be (either 0 or infinity).

Take for example computation of the entropy of a deterministic Bernoulli distribution: You have 1 * ln 1 + 0 * ln 0. The correct result is 0.

Mostly I am relying on the proper handling of infinity and NaN by the floating-point implementation; but sometimes I have to catch cases and correct the result by hand.

Comment Re:Casting (Score 1) 757

I was able to avoid casting completely for over two years while working in Scala. Certainly, the kind of work I did somehow supported this.

Only lately I had to resort to casting sometimes. But this happened only when dealing with rather complex types that abstract over nearly arbitrary computations. At one point you reach the ceiling of what is achievable with some fixed type system—and then you need casting.

I am now using shapeless for meta-programming, but I think this is the point where you yearn for more a expressive (dependently typed) type system than the one offered by Scala (or even Haskell). I hope the next generation of programming languages will make this practical.

Comment Casting (Score 3, Insightful) 757

Casting is telling the compiler to do what you want. It's like saying "Shut up! I know what I'm doing, this thing is a XY pointer, even if you can't figure it out yourself."

In every language (which supports casting) you can make an error while casting by claiming something that isn't correct. Surprise!

Comment Super efficient amphibiuous propulsion (Score 1) 73

It sounds like magic! Scientists at Slashdot have invented a mechanism that can propell any vehicle, both under water and on land. The invention works by attaching an external string. An also external human then pulls said string, and the object moves in direction of the string. Youtube video follows.

Comment Re:This is obviously correct (Score 1) 174

In reality there no such thing as a (formal) proof. You cannot prove the simplest things.

You can prove things based on axioms and hypothesis. This works for theoretical settings like mathematics. In reality, even the most simple statement (like "This is an apple.") cannot be verified with certainty (what IS an apple?). Even if you do a DNA analysis of the genome of the object, you have uncertainty in the analysis, e.g. random misreadings of your equipment.

All you can do is be "pretty certain" about something. But that's not a proof.

Comment This is obviously correct (Score 0) 174

Is it possible that using secure email services can be construed as an indicator of being a terrorist?

Take the experiment of drawing a random person. Define two events

  • T - the person is a terrorist
  • X - the person uses encrypted internet messaging

If P(T|X) (probability of the person is a terrorist given he uses encryption) is larger than P(T) (probability of the person being a terrorist using no other evidence), I'd call the fact of using encryption an indicator of being a terrorist.

Any objections?

Of course the "indication strength" might be low. But I think the fact of using encryption increases my belief in someone being a terrorist. And taken together with other observations this might be enough to take according action.

Comment Re:I no longer think this is an issue (Score 1) 258

I strongly disagree. The idea that AI will be based on logics is from the 70ies and plain wrong. If some program will develop something that can be called a conciesness, then this program will be "black box" in the sense that we built it, but have no idea how it is working. It will have goals and motivations, and maybe it will be able to find or reinterpret those goals in a non-inspectable way. Asimovs laws are also not practical because there will be no way to implement them. How would you implement these rules in a human brain?

Comment Let's compare these advantages to Haskell (Score 2) 62

It combines the strengths of dynamic scripting languages (less boiler-plate, fast and easy start-up, a REPL, no required compilation step).

Let's see whether the great dynamic scripting language Haskell also fulfills these points.

  • - less boiler-plate: in addition to not requiring type annotations, Haskell even gets rid of parens; check
  • - fast and easy start-up: you can compile it to native; check
  • - REPL: check
  • - no required compilation step: if you use runhaskell it looks like interpreted, check (thouch technically that's a lie, as it is for JITed scripting languages

Now we see Haskell has all the advantages of dynamic scripting languages. How about the advantages of compiled languages?

with the strengths of traditional compiled languages (fast execution, static error detection, modularity, zero-overhead Java platform integration).

  • - fast execution: ghc creates very efficient native code, check
  • - static error detection: uhm, yes; though better than traditional languages, check
  • - modularity: dunno what this means. Since there are modules in Haskell we call it check.
  • - zero-overhead Java platform integration: unfortunately not. But since exactly when is Java-integration zero overhead?

Which proves that Haskell has all the advantages of dynamic scripting languages, and most of the advantages of traditional compiled languages.

Btw., you can do the same using any other modern compiled language. This post wants to show the "advantages of dynamic scripting languages" have nothing to do with the languages being "dynamic" or "scripting", whatever that means.

Comment Script languages have few concurrency errors (Score 1) 217

See Figure 2. They even stress this in the text:

Among the dynamic languages, only Erlang is more prone to concurrency errors. The regression analysis also shows that projects written in dynamic languages like CoffeeScript, TypeScript, Ruby, and Php have fewer concurrency errors

Now everyone knows that Erlang is bs for doing concurrent stuff, right? I do all my concurrency related programming in Ruby, as every other sane developer would do!

"Pok pok pok, P'kok!" -- Superchicken

Working...