Andreas Raab wrote:
I found the type-system the most unnatural part about StrongTalk.
For me, Strongtalk *is* the typesystem. It's nice, if the Animorphic ST release is also fast, but IMHO the static type system is the more interesting part.
It feels displaced and if you look at methods like "->" in Object you can see that there are some rather nasty complexities associated with it (not to mention readability issues).
One can always argue about syntax. That's something you have to get used to. All it says is that an Association's type is created from the receiver and the parameter type. I don't understand why that isn't written as
-> other <Y def> ^<Association[Self, Y]>
Instead of <Y def>, I might prefer 'Y. I once saw a Smalltalk dialect which used {} instead of <> to declare types. That could be more readable.
However, types don't become easier just by not writing them down... You have to understand them to program.
In Smalltalk (without types) no tool can exactly know the type of an expression and code completion (with is IMHO the best productivity tool of a modern IDE) cannot offer a valid selection of applicable method names.
That has been said many times and yet, I disagree. To the best of my knowledge nobody has ever tried to build a simple type inference system
Perhaps, because it wont't work?
which just goes along with you as you are writing code and tries to discover what the types might be.
Just a little bit of type inferrence doesn't work. Once, I tried it and also had some discussions with somebody who thought about writing is master thesis about this topic and we finally agreed upon that you'd need either a full features type system or stay with no types at all.
Name completion and other utilities can even be used to tell such a type inference system about what types of certain objects are and I still think that you should be able to trivially figure out the types for 90% of the system
someMethod: param param .
Okay, please tell me the methods applicable at the "." ? That's impossile if you don't want to show *all* method names of the system - which are probably 8000-10000.
Code completion is IMHO the most important and best way to learn a class library. VBA is a good example. Using the simple built-in IDE of MS Word, I can script the whole program without much problems, just by some guessing and the code completion.
I would hope that some better syntax can be found than is currently in both StrongTalk and SmallScript.
Here, I agree.
But of course you do realize that *optional* types
Sure, but it wouldn't be Smalltalk if you couldn't simply make the optional mandatory and set the requirement of type in your project.
In addition, I could document my assumption by annotation types which would be then checked by the system and eventually get a better documented, well formed program.
bye