Does someone already have tried the .NET software? Like or not? Opinion
Originally posted by dockeen:
Hmmm, funny, they send it to people who aren't that
interested, me, they want to charge for.
Only kidding, I bet you are MSDN or something important,
in contrast to me...
I keep trying to figure out how to qualify for academic,
because these days, I AM pretty academic.
Wayne
Originally posted by dockeen:
I am still just getting a rough picture of the whole .net idea with the CLS - bytecode idea. It seems an interesting idea. The big point they seem to be making is that you can program in whatever you want and work seemlessly with others programming in what they want. That sounds great, I don't know the degree to which it actually works.
Wayne
While .NET's runtime tries to be language-neutral, this is true mostly for languages that look a lot like C#..
- Implementation Inheritance. The CLS only supports single, static inheritance.
Languages such as C++ and Eiffel need multiple inheritance of implementation. Cross-language support for MI may not be possible, as MI creates some hard problems (like repeated inheritance and name clashes) that different languages solve in different, incompatible ways.
Another alternative is mix-ins (considered by many a superior alternative for MI, enabling a dynamic, loosely-coupled mechanism for behavioral reuse). This is not supported by the CLR, but required by languages such as Python.
The result: Dialects that cripple the original languages to become CLR-compatible. Examples are Managed C++ and Eiffel#, both not supporting implementation MI.
- Generic Types. There is currently zero support for generic programming in the CLS.
Compile-time mechanisms like C++'s templates are supported, but they are not cross-language: no way to instantiate your stack<T> from C#. Instantiated templates will be accessible from other languages, but not interoperable. If a C++ stack<T> class expands to stack<Dog>, methods such as stack<Dog>::add(Dog) will be generated according to some set of rules (such as name mangling rules) that are not part of the CLS. This makes impossible for an Eiffel program to "see" this class as Eiffel's STACK[DOG], unless accepting C++'s rules as a de facto standard. The erasure model, used for example by Generic Java, is another challenge. Again, generic types are not made all equal; creating a cross-language standard may also prove to be impractical.
The Result: Half-baked generic type support without cross-language capability. Crippling important details of some implementations, like covariance (gone from Eiffel#). Enforcement, through the system libraries, of "poor man's generics" (use of opaque Object references).
- Static Typing. The CLS offers a mix of primitive and structured types and objects, requiring static declaration of at least the fundamental type information. (Objects can have their specific type [the class] discovered at runtime, but the system must be informed statically that a particular memory word is an object pointer, integer, float or some other primitive).
This is not good for languages that use completely dynamic typing to avoid the complexity of static type systems. Examples are Smalltalk, LISP and their relatives. However, storing critical values such as integers, floats and booleans as full-blown dynamic-typed entities is expensive. Therefore, these languages resort to tagged memory: a few bits of every memory word are used as type IDs, to cheaply identify end encode at least the most critical objects. (A common side effect of this implementation is that integral types have odd sizes, e.g. 30 bits instead of 32 for a 4-byte integer; this is because 2 bits were taken by the tag bits.)
Techniques used in such systems are different from those used elsewhere. The major problem is that any high-performance GC needs to identify pointers precisely. In static-typed systems, the JIT compiler generates "type maps" for every class and method. The GC uses these maps to know which fields, stack positions, or registers are pointers. But this is not good enough for dynamic-typed languages, where the GC relies on tag bits to tell objects from primitives. The CLR would need to support a mix of tagged and untagged primitives in the same heap (plus references); and different dynamic languages may use different tagged memory specs.
- Methods. If the CLS has some deficiencies for inheritance models, it's even worse for methods. The CLS only supports a standard model of vtable-based / single-receiver method dispatch, static-typed signatures, and single return. There are no first-class methods.
Again, not all languages agree how to define and dispatch methods. In dynamic-typed languages, there is no way to automatically produce typed signatures for methods. The compiler could declare 'Object' for everything, but users of other languages would hate such interfaces.
Some languages support multi-methods, where the dispatch is polymorphic on several arguments and not on a single argument (the receiver, a.k.a. this or self). For example if you may have Float and Matrix classes and four versions of "multiply (lhs, rhs)", and the correct version is selected at compile time after inspecting the type of both arguments. (Overloading emulates this behavior in many languages, but dispatch is static, so it doesn't play well with by-ref parameters. Multi-method dispatch is dynamic and it fully supports inheritance and polymorphism.)
Vtables (tables of code pointers) are not capable enough for all languages. This dispatch mechanism is great when there is static type data specifying, at least, the invoked method. For example, if you're calling "obj1.doThis()" and "doThis()" is defined by type X, you need to know at least that obj1 is an X. If you lack this information, alternative dispatch methods are required (reflection works, but not efficiently). Dynamic languages often use a model where method invocations use a selector (an internalized signature). The receiver's dynamic type is combined with the selector to efficiently locate methods in hash tables maintained by the VM.
Finally, the CLR supports method pointers but not full closures (a.k.a. blocks). A method pointer associates the method address and a receiver in one variable, and it's good enough for tasks such as event handlers. A closure goes one step beyond; it is bound to all variables visible at its static scope (possibly another closure). This makes possible a range of novel programming techniques (if you want to make a Smalltalker happy, ask him to explain these). Just like Java's inner classes, C# (and the CLR) chose a crude alternative to closures with the excuse of performance.
Originally posted by dockeen:
OK, here is a top level, "what planet are we on?" sort of question.
Are the problems you cite indicative of the difficult or impossible nature of the problem, or shortcomings in the .Net approach to solving the problems?
Remember, in asnwering this question, I am a Physicist, which means I don't know a lot about a lot of things...err..something like that.
Wayne
Unless you have an academic discount, or access to an MSDN subscription, it is pretty expensive.How much does .NET cost? Does it is posssible to download somewhere for free?
My observation. I do feel that once I am up to speed, my productivity will be greatly improved under .NET.Right now I would say I code 20 times slower with .Net, but I guess that is what they call a learning curve.
Pity he copied it verbatim from a Battlefront discussion...By the way, I was very impressed by HITMAN's respnse to my follow-up question.
Originally posted by dockeen:
Are the problems you cite indicative of the difficult or impossible nature of the problem, or shortcomings in the .Net approach to solving the problems?
Wayne
Well.. I think the point of it will be so different that there will be more effort/cost involved with trying to port code from exsisting regular versions of a language to the limited subset .NET versions that cost/benifit will not be there... at best it would only be of use when you could start fresh and accept all the various limitations you have using .NET, and can design/work around all of them... but then the questions is.. .WHY... why not use the more powerfull industry standard versions of the language...