News for hackers. Stuff that matters.
Re:Beating the Arc Challenge in Haskell by ericb on Saturday December 19, 2009 @09:59AM (#1004804)
The post above doesn't mention compile time type checking. Are you implying that to support one of the features he asks for that it is required?
Re:Beating the Arc Challenge in Haskell by camccann on Saturday December 19, 2009 @10:06AM (#1004807)
One of Haskell's defining features is a very expressive and powerful static type system, so yeah, compile-time type inference/checking was pretty heavily implied by "similar to Haskell".

And yes, the fact that I was essentially asking for a language with both static typing and runtime self-modification was the reason for the tongue-in-cheek "is that so much to ask". Might as well ask for a program that can compile any legal perl program [0].

That said, I suspect there's a lot that could be done to allow certain subsets of metaprogramming techniques in a static-typed language; some sort of crazy meta-type system that lets the compiler prove that something will only produce code with a particular polymorphic type, maybe? I don't know.

[0] EDIT: My bad, it's actually parsing perl that's impossible, cf. http://www.perlmonks.org/?node_id=663393

Re:Beating the Arc Challenge in Haskell by chriseidhof on Saturday December 19, 2009 @10:27AM (#1004815)
Yes. A lot of the meta-programming is actually programming over the structure. For example, given a Java class, you could generate database code. In Java, this relies heavily on introspection, but you if you're interested in doing this in a type-safe way then you could look at Generic Programming (in Haskell).

Also, you can generate code (at runtime) which is type-safe, compile the code, etc. Everything you ask for is possible in Haskell, however, it is definitely more complicated than in Lisp.

Re:Beating the Arc Challenge in Haskell by fauigerzigerk on Saturday December 19, 2009 @10:46AM (#1004833)
Compiling code at runtime may improve performance, but it doesn't give the kind of guarantees that static typing gives you.

Static type checking proves that certain invariants hold at runtime and hence that certain defects are not possible. If a program can manipulate itself at runtime in arbitrary ways (not just reflect on itself in a read-only fashion), those proofs become invalid.

Re:Beating the Arc Challenge in Haskell by fauigerzigerk on Saturday December 19, 2009 @10:32AM (#1004819)
Yes I do imply that. camccann puts it very well, and as I said, what would Haskell be without its static type system?
Re:Beating the Arc Challenge in Haskell by eru on Saturday December 19, 2009 @05:52PM (#1005341)
There would still remain some cool parts. Like the syntax. And you could do something similar to typeclasses with duck typing.