Language Syntax

Started by
50 comments, last by Zahlman 15 years, 6 months ago
I really care for JavaDocs and similar systems. Since types + method name typically doesn't contain enough info, it is vital. For example, does the method return null? Does it throw an exception? Does it require that some argument isn't null? And then there are more complex stuff such as side effects. And there may be examples of use or runtime complexity involved. I love documented methods, and an IDE that pops up the JavaDoc when I'm auto-completing does a lot for my productivity.
Advertisement
Quote:Original post by ToohrVyk
Quote:Original post by Daerax
[EDIT]I suppose we can then proceed to a battle of semantics and say that although the language is intepreted it is not dynamically typed since a full check is done on the source to ensure that terms are all well typed before evaluation during run.
Just so we're clear on semantics:

I consider a language to be statically typed if its expressions have a type that is tested before the execution, and dynamically typed otherwise.

I consider a language to be strongly typed if its values cannot change their type at runtime without an explicit cast, and weakly typed if implicit conversions are possible.

This way, you can have static-strong languages (Objective Caml), static-weak languages (C), dynamic-strong languages (Python) and dynamic-weak languages (PHP).

Your definition of "strong" seems to correspond to my definition of "static-strong", and you seem to collapse the three others into a single definition, which I find wasteful.

Then again, my main field is language semantics, not type systems. I could accept that in type system lingo, only static-strong languages have types, and all the others have data-types. However, in language semanticsm I believe my definition is the common one.


That's pretty much exactly what I was trying to tell him. It's purely semantics, but I maintain that the ones understood by non-type system theorists are more useful for the real world than the ones understood by type system theorists, because in the real world, a belief that the typing system of Python falls into the same category as that of PHP will cause great pain when you try to switch from learning from one to the other.

This topic is closed to new replies.

Advertisement