Anyone know of any statically-typed scripting languages? [closed] Anyone know of any statically-typed scripting languages? [closed] linux linux

Anyone know of any statically-typed scripting languages? [closed]


Typically the statically typed languages are compiled languages. I guess the reason is, that statical analysis of types is rather expensive and you have to have an in depth look at all the code you're processing. After you've done that it feels like a waste to not write all that information into a file, so that you don't have to do it again next time. So you quickly end up with a compiled language.

On the other hand, to turn a compiled language in a "not-compiled" one is rather easy. You just don't store the results of the compilation anywhere but execute them directly. One compiler I know that provides such a wrapper is GHC, the standard Haskell compiler. You can add #!/usr/bin/runhaskell to your source files and then directly execute them. And since you're planning to be far off the norm, Haskell seems like a perfect fit ;). But expect some rather large startup time for your scripts, because all the "compile time" analysis and optimization isn't free.

Haskell isn't made for shell scripting and it's a functional language, so if you've never seen it before, it might take some time to get used to. But it has very little syntactical overhead and the strength of functional languages is abstraction, so I don't see why you couldn't create a library that makes shell scripting fun. There is even some experimental Haskell shell, but it does seem to be more a proof-of-concept than a real solution.

Generally I would say the overhead of all the type analysis is significant, but I would suggest you pick your favorite statically typed compiled language and look for a wrapper like runhaskell to execute scripts written in it.


F# provides a combination of "type safety, succinctness, performance, expresivity and scripting".


quick google. F3, javaFX script, Linden Scripting Language (scripting for second life), Unlike the comment on the first answer F# can be used as a scripting language http://blogs.msdn.com/chrsmith/archive/2008/09/12/scripting-in-f.aspx

Felix, Tuga, CFGScript, Talc, Angelscript, and guessing there is more than that quick search.

Douglas