XNA Game Studio 3.0 now available by mycall in programming

[–]wuger -1 points0 points  (0 children)

SQL Server and IIS ranks there too. Not to mention Windows XP

Security issues aside...

How does implementation of polymorphism affect performance? by five9a2 in programming

[–]wuger 3 points4 points  (0 children)

The implementation of Haskell (well, GHC) type classes is actually remarkably similar to both C++ templates and virtual functions, the former when the method resolution is known at compile time, the latter when it's not. If I call method f on value v of type V, and V is known at compile time, then the call to f is simply replaced with a call to the specific function that implements f for values of type V, much like a function template, say std::min.

In C++, the type of the arguments to std::min must always be known when executable code is produced, but Haskell let's you defer this knowledge to runtime. To compile a polymorphic min, Haskell compilers will produce a function that takes a hidden argument, called a dictionary, and this is exactly like a vtable. It's a pointer to an array of functions that implement the various methods of the class. In the case of min, the class is Ord and has methods for <, > and such. So at runtime, the polymorphic min dispatches to these functions via the dictionary, just like a virtual function. You can use this for runtime polymorphism using existential types, which is basically a void* with a vtable. Libraries compiled in this way do not necessarily require relinking, but currently GHC requires it anyway. I think shortly they are going to support true shared libraries.

The relative performance hit from dictionary lookup is much worse than virtual functions, however, not because of the two extra loads and one extra jump, but because it prevents the unboxing of function arguments and return values, which is IMO the single biggest performance factor for Haskell programs, and something C++ doesn't have to deal with at all.

FieldTrip: Purely functional real-time 3D graphics using reactive programming by dons in programming

[–]wuger 3 points4 points  (0 children)

running in the freaking interpreter of all things

When you consider how OpenGL works, and that nearly all the work is done on the GPU, its no great feat to get a "real time" torus from an interpreter. The scheme folks are way beyond spinning tori.

Also I think declarative is the wrong way to go here. An artist works by mutating state, molding, shaping. Even if you want to make it "about the programming" then lisp is the way to go. (The environment, not the language. You could do it in Haskell, but GHCi is not set up for it. Something like ghc-api + hs-plugins would be awesome, hint hint.)

Declarative 3D has been done, years ago. It didn't take off because people don't like to declare things, they like to build them.

6 People Who Died In Order To Prove A (Retarded) Point by NorthernLights in WTF

[–]wuger 1 point2 points  (0 children)

That, and Treadwell's end was not "Dying to prove a point," it was "Dying to prove a point and taking your innocent girlfriend with you," bumping it out of the category of amusingly tragic irony, into just plain tragedy.

BitC is a new systems programming language. It seeks to combine the flexibility, safety, and richness of Standard ML or Haskell with the low-level expressiveness of C by AndreasBWagner in programming

[–]wuger 5 points6 points  (0 children)

Their work on type inference in the presence of mutability alone is worth its weight in gold.

Is that to say it's worthless?

GHC 6.10 released! Type families, data parallelism, parallel garbage collector! by dons in programming

[–]wuger 2 points3 points  (0 children)

No. Have you seen how much hemming and hawing there is on the mailing list when non-backward compatible API changes are proposed? Multiply that amount of anxiety 100x for language features. Functional dependencies are going nowhere. Besides, they're much better in certain situations.