Statically typed languages vs. dynamically typed languages
How is the association of type and parameter different in a dynamically typed language than a statically typed language? ...
How is the association of type and parameter different in a dynamically typed language than a statically typed language? ...
The FAQ for the new Go language explicitly makes this claim: There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript. Is there (non-anecdotal) data to actually support such a claim? I've always found dynamic typing slo...
In Andrew Koenig's An anecdote about ML type inference, the author uses merge sort as a learning exercise for ML and is pleased to find an "incorrect" type inference: Much to my surprise, the compiler reported a type of 'a list -> int list In other words, this sort function accepts a list of any type at all and returns a list ...
There are some nice libraries for testing in Scala (Specs, ScalaTest, ScalaCheck). However, with Scala's powerful type system, important parts of an API being developed in Scala are expressed statically, usually in the form of some undesirable or disallowed behavior being prevented by the compiler. So, what is the best way to test whet...
What OOP principles, if any, don't apply or apply differently in a dynamically typed environment as opposed to a statically-typed environment (for example Ruby vs C#)? This is not a call for a Static vs Dynamic debate, but rather I'd like to see whether there are accepted principles on either side of that divide that apply to one and not...
Hi, I am looking for a scripting engine that can be integrated in .NET but NOT with dynamic typing! For example, JavaScript is not suitable, because it is a dynamically typed language. Do you know any? ...
There's not much info in the spec on what type ascription is, and there certainly isn't anything in there about the purpose for it. Other than "making passing varargs work", what would I use type ascription for? Below is some scala REPL for the syntax and effects of using it. scala> val s = "Dave" s: java.lang.String = Dave scala> va...
I know you can create an anonymous function, and have the compiler infer its return type: val x = () => { System.currentTimeMillis } Just for static typing's sake, is it possible to specify its return type as well? I think it would make things a lot clearer. ...
I am new to Boo, and trying to figure out how to declare the type of a hash. When I do: myHash = {} myHash[key] = value (later) myHash[key].method() the compiler complains that "method is not a member of object". I gather that it doesn't know what type the value in the hash is. Is there any way I can declare to the compil...
Is there any overhead when we cast objects of one type to another? Or the compiler just resolves everything and there is no cost at run time? Is this a general things, or there are different cases? For example, suppose we have an array of Object[], where each element might have a different type. But we always know for sure that, say, e...
In my reading on dynamic and static typing, I keep coming up against the assumption that statically typed languages are compiled, while dynamically typed languages are interpreted. I know that in general this is true, but I'm interested in the exceptions. I'd really like someone to not only give some examples of these exceptions, but tr...
I see these terms banded around all over the place in programming and I have a vague notion of what they mean. A search shows me that such things have been asked all over stack overflow in fact. As far as I'm aware Static/Dynamic typing in languages is subtly different to Strong/Weak typing but what that difference is eludes me. Differen...
I wondered if there is a programming language which compiles to machine code/binary (not bytecode then executed by a VM, that's something completely different when considering typing) that features dynamic and/or weak typing, e.g: Think of a compiled language where: Variables don't need to be declared Variables can be created doing ru...
I am wondering if there are any statically typed, embeddable scripting languages. Python, JavaScript, etc. are great languages, but they are dynamically typed (that is, types are checked at run time). I am just wondering if anyone knows of any statically typed scripting languages that can be embedded in a C++ application? ...
In my current job I'm building a suite of Perl scripts that depend heavily on objects. (using Perl's bless() on a Hash to get as close to OO as possible) Now, for lack of a better way of putting this, most programmers at my company aren't very smart. Worse, they don't like reading documentation and seem to have a problem understanding ...
I want to do some metaprogramming in a statically typed language, where both my programs and my meta-programs will be typed. I mean this in a strong sense: if my program generator compiles, I want the type system to be strong enough that only type-correct programs can be generated. As far as I know, only metaocaml can do this. (No, ne...
Can you name language with Static Type checking(like Java) and where Code is Data(like in LISP)? I mean both things in one language. ...
I want to write code like this: /*something*/ Fn() { ... } int main() { /*something*/ fn = Fn; while(fn) fn = fn(); return 0; } Is it possible to do this is a fully type safe way? Assume C, C++, D, C#, Java, or any other statically typed language. ...
Imagine two languages which (apart from the type information) do have exactly the same syntax, but one is statically typed while the other one uses dynamic typing. Then, for every program written in the statically typed language, one can derive an equivalent dynamically typed program by removing all type information. As this is not necce...
Is a statically-typed full Lisp variant possible? Does it even make sense for something like this to exist? I believe one of a Lisp language's virtues is the simplicity of its definition. Would static typing compromise this core principle? ...