 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29
"C#'s principal designer and lead architect [...] has stated that flaws
in most major programming languages (e.g. C++, Java, Delphi, and
Smalltalk) drove the fundamentals of the CLR, which, in turn, drove the
design of the C# programming language itself."
"Multiple inheritance is not supported, although a class can implement
any number of interfaces."
...so they implemented Java's flawed MI-but-not-MI model? How is that
fixing the flaws from other major programming languages?
Oh, wait... He said that "flaws drove the fundamentals of the design".
So... you designed it to *keep* all the best flaws of other languages? :-D
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
> ...so they implemented Java's flawed MI-but-not-MI model? How is that
> fixing the flaws from other major programming languages?
Ever attempted to use multiple inheritance in C++? Things get really
interesting when you have more than one base class, and some members
overlap. I think the :: operator helps keep things relatively straight,
though. There are other issues, of course, such as which copy of the
base class is used when 2 classes share a common base class and are
inherited by a further derived class. (Looks like a diamond on an
inheritance diagram)
> Oh, wait... He said that "flaws drove the fundamentals of the design".
> So... you designed it to *keep* all the best flaws of other languages? :-D
>
Use C# for a while, especially the newer version (3.0) It's actually
quite nice. I've sort of grown to like it since I've started actually
using it. C++ish syntax, some stuff borrowed from Java.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
C# is a strange mix of Delphi's ideas and Java syntax and implementation. The
main designer and his team was bought by M$ from Borland where they worked on
Delphi. In fact, he was also Turbopascal implementer.
BTW, Orchid, you know some major Haskell designers and implementers work for M$,
right? Simon Peyton Jones works at M$ Research, long after he started work on
Haskell. Erik Meijer too. The thing is, many ideas of Haskell, like monadic
IO are present in .NET nowadays in a builtin framework named LINK.
You may find the ideas of Erik Meijer somewhat interesting:
http://research.microsoft.com/~emeijer/Papers/fpca91.pdf
http://research.microsoft.com/~emeijer/
the first paper is interesting, but Meijer is an idiosyncratic personality with
strong opinions. In his view, Haskell is just a scripting language... ;)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford wrote:
> Invisible wrote:
>
>> ...so they implemented Java's flawed MI-but-not-MI model? How is that
>> fixing the flaws from other major programming languages?
>
> Ever attempted to use multiple inheritance in C++?
No.
Given that I can't handle C and C++ is more complicated, I figured it
was just a bad idea. ;-)
> Things get really
> interesting when you have more than one base class, and some members
> overlap.
Ever tried to use multiple inheritance in Eiffel?
Since I am presumably the only person here who has ever heard of Eiffel,
let me go over it.
Suppose that class A inherits from classes B and C, which themselves
inherit from D. Suppose that D defines an attribute called, say, banana.
That means that B and C each have a copy of banana. In A, these two
copies are automatically merged by default.
Alternatively, you can rename one (or both) copies to something else.
Stop and think about that for a moment.
Suppose I rename the banan from B to banana_b and the other to banana_c.
That means that anybody who tries to access "banana" through the B
interface actually gets banana_b, anybody trying to access "banana"
through the C interface gets banana_c instead, and anybody trying to
access the A interface directly can see two seperate bananas. A similar
thing happens with methods. [Except that you can override both inherited
methods, or rename one, or...]
It's funny really. Eiffel's slogan is "Simple. Elegant. Powerful." That
first is *highly* debatable...
> Use C# for a while, especially the newer version (3.0) It's actually
> quite nice. I've sort of grown to like it since I've started actually
> using it. C++ish syntax, some stuff borrowed from Java.
It sounds like it's fixed a few of the things that makes C and C++ so
impossible. I'm still not sure I'd like it very much. [And I'm certainly
not keen to shell out money to find out.]
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible escribió:
> Since I am presumably the only person here who has ever heard of Eiffel,
> let me go over it.
>
I heard of it. I know some of its features. I have never used it, and
don't even know what the syntax looks like.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Invisible" <voi### [at] dev null> wrote in message
news:47b1c6c2$1@news.povray.org...
>
> It sounds like it's fixed a few of the things that makes C and C++ so
> impossible. I'm still not sure I'd like it very much. [And I'm certainly
> not keen to shell out money to find out.]
You don't have to. There's a free IDE (more than sufficient for trying stuff
out) and the underlying framework and compiler are freely downloadable.
There's more than enough docs, tuts and info on the net that you won't have
to read a book if you don't want to.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Nicolas Alvarez" <nic### [at] gmail is the best com> wrote in message
news:47b1c743$1@news.povray.org...
> Invisible escribió:
> > Since I am presumably the only person here who has ever heard of Eiffel,
> > let me go over it.
> >
>
> I heard of it. I know some of its features. I have never used it, and
> don't even know what the syntax looks like.
Very much like C++ or Java at a first glance.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
nemesis wrote:
> C# is a strange mix of Delphi's ideas and Java syntax and implementation. The
> main designer and his team was bought by M$ from Borland where they worked on
> Delphi. In fact, he was also Turbopascal implementer.
Mmm, I wonder if C# is any more object-oriented than TP 5.5? ;-)
> BTW, Orchid, you know some major Haskell designers and implementers work for M$,
> right?
*sigh* Yes.
Indeed, everything I mention M$ I get flamed for insulting people's
employer.
Here's the part I can't figure out. M$ basically exists to steal other
people's ideas, pass them off as "new" and "original", and con people
out of huge sums of money for it. So... why is M$ even interested in
something geniunely advanced and revolutionary?
> The thing is, many ideas of Haskell, like monadic
> IO are present in .NET nowadays in a builtin framework named LINK.
Yeah, looking at the Wikipedia page for C# I see they've stolen a whole
crapload of good ideas from Haskell. [No doubt in a few years everybody
will say how C# is the best programming language because of these
features. And Haskell still isn't the best. For the same reason.]
> the first paper is interesting, but Meijer is an idiosyncratic personality with
> strong opinions. In his view, Haskell is just a scripting language... ;)
Oh, sure. It has compilation, strong typing, compile-time error
checking, pervasive optimisation techniques, and an elegant underlying
algebra. Definitely a scripting language. :-P
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Gail Shaw wrote:
>> I heard of it. I know some of its features. I have never used it, and
>> don't even know what the syntax looks like.
>
> Very much like C++ or Java at a first glance.
Er, what?
class
HELLO_WORLD
create
make
feature
make
do
print("Hello, world!%N")
end
end
Sure, looks just like C++ or Java. ;-)
[Actually, I think Pascal would be closer... Unlike certain other
languages, the syntax is more heavy on language keywords than exotic
punctuation.]
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Invisible" <voi### [at] dev null> wrote in message
news:47b1cbd9$1@news.povray.org...
> Gail Shaw wrote:
>
> >> I heard of it. I know some of its features. I have never used it, and
> >> don't even know what the syntax looks like.
> >
> > Very much like C++ or Java at a first glance.
>
> Er, what?
Sorry. Misread. Thought he was talking about C#
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Gail Shaw wrote:
>> Er, what?
>
> Sorry. Misread. Thought he was talking about C#
Ah. OK. Well I guess this *is* a C# thread. ;-)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford <mra### [at] hotmail com> wrote:
> Ever attempted to use multiple inheritance in C++?
Yes, I have needed it a few times. It's very handy.
For example, recently I have been programming in a system where there
are basically two widget managers, each with their own widget types.
Both widget types have data inside them (such as their geometry) as
well as member functions. These widgets *need* those data members in
order to function properly.
Usually these managers and their widgets can be kept separate, but in
this one case I needed to be able to gave the same objects to both
managers.
Without multiple inheritance this would have been simply impossible.
I can't think of any way to accomplish this if multiple inheritance was
not supported. With C++'s multiple inheritance it worked beautifully.
I could create objects which were of both widget types at the same time,
and which could be given to both widget managers without even the
slightest of problems.
I just can't even begin to imagine how I could have done this eg. in
Java. (At least not without crippling the system really badly and making
it really cumbersome to use.)
> Things get really
> interesting when you have more than one base class, and some members
> overlap.
Ambiguity problems may sometimes happen, but rarely, and when they do,
it's seldom a problem.
If, for example, both base classes have a function with the same name
and you need to call it for a derived class, you simply specify which
one should be called. It's basically no different than if the functions
in the base classes were named differently.
Besides, it's not like two Java/C# interfaces couldn't have functions
with same names... (Ok, I have to admit that I don't know if they can,
but I assume they do.) This is not a problem exclusive to C++.
> There are other issues, of course, such as which copy of the
> base class is used when 2 classes share a common base class and are
> inherited by a further derived class. (Looks like a diamond on an
> inheritance diagram)
Just avoid diamond inheritance if you are unsure. It's not that hard.
Being able to inherit from two (completely distinct) classes is extremely
handy regardless.
> Use C# for a while, especially the newer version (3.0) It's actually
> quite nice. I've sort of grown to like it since I've started actually
> using it. C++ish syntax, some stuff borrowed from Java.
I don't like languages which artificially limit what I can do just
because the creators feared diamond inheritance.
(I have never understood, and never will understand why they disallow
multiple inheritance *completely* given that the only problem they fear
is *diamond inheritance*. Why not disallow diamond inheritance? That
would solve the problem.)
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible <voi### [at] dev null> wrote:
> "Multiple inheritance is not supported, although a class can implement
> any number of interfaces."
I have never understood this, and never will. My question is: Why?
If the answer to this question contains the term "diamond inheritance",
then my counter to that is: "Then forbid diamond inheritance, not multiple
inheritance."
Having Problem with diamond inheritance is not a valid excuse to forbid
multiple inheritance completely.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
> Here's the part I can't figure out. M$ basically exists to steal other
> people's ideas, pass them off as "new" and "original", and con people
> out of huge sums of money for it. So... why is M$ even interested in
> something geniunely advanced and revolutionary?
to take the glory too.
> Yeah, looking at the Wikipedia page for C# I see they've stolen a whole
> crapload of good ideas from Haskell.
in fact, that Erik Meijer guy is overly provocative and even gone as far
as saying functional programming for the masses is really Visual Basic!
http://lambda-the-ultimate.org/node/1406
> Oh, sure. It has compilation, strong typing, compile-time error
> checking, pervasive optimisation techniques, and an elegant underlying
> algebra. Definitely a scripting language. :-P
read the PDF I linked to. It's called "Functional programming with
bananas, lenses, envelopes and barbed wire". Despite the title, it's
genuinelly interesting...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> Usually these managers and their widgets can be kept separate, but in
> this one case I needed to be able to gave the same objects to both
> managers.
>
> Without multiple inheritance this would have been simply impossible.
> I can't think of any way to accomplish this if multiple inheritance was
> not supported. With C++'s multiple inheritance it worked beautifully.
> I could create objects which were of both widget types at the same time,
> and which could be given to both widget managers without even the
> slightest of problems.
>
> I just can't even begin to imagine how I could have done this eg. in
> Java. (At least not without crippling the system really badly and making
> it really cumbersome to use.)
It has its uses. There's no clean way to handle this situation in C# or
Java.
>
> Just avoid diamond inheritance if you are unsure. It's not that hard.
>
> Being able to inherit from two (completely distinct) classes is extremely
> handy regardless.
>
Only one problem with that: in both C# and Java, all classes have a
common base. So, with multiple inheritance, diamonds are a given. Rather
than address this, they chose to not allow multiple inheritance. I'm
guessing Java has interfaces, like C#.
>
> I don't like languages which artificially limit what I can do just
> because the creators feared diamond inheritance.
>
Not completely artificial. They made a design decision with the
language, which could potentially create problems later.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Gail Shaw wrote:
> You don't have to. There's a free IDE (more than sufficient for trying stuff
> out) and the underlying framework and compiler are freely downloadable.
> There's more than enough docs, tuts and info on the net that you won't have
> to read a book if you don't want to.
yes, in no time you'll be hooked and badly shaking when away from it...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Mike Raiford <mra### [at] hotmail com> wrote:
>> Ever attempted to use multiple inheritance in C++?
>
> Yes, I have needed it a few times. It's very handy.
For example, perhaps you want to define a matrix class which is a
collection but also a number. [Or at least, you can do arithmetic on it.
Depends on how the number classes are structured.]
There are other important examples. It gets quite awkward without MI.
> Besides, it's not like two Java/C# interfaces couldn't have functions
> with same names...
Ah yes, the real WTF: Java's MI-but-not-MI doesn't even actually fix the
problem! ;-)
> I don't like languages which artificially limit what I can do just
> because the creators feared diamond inheritance.
I can understand that...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>> "Multiple inheritance is not supported, although a class can implement
>> any number of interfaces."
>
> I have never understood this, and never will. My question is: Why?
So, you can't have MI. OK, well that's a bit silly, but... Oh, but you
can have "interfaces", which is just like MI, but... not. WTF?
OOC, have you ever looked at C# yourself?
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Orchid XP v7 <voi### [at] dev null> wrote:
> OOC, have you ever looked at C# yourself?
Not really. From what I understand, it's a kind of "C++ with the same
limitations as Java".
Just the reason for its existence repulses me: Since Microsoft had to
abandon their own, standard-breaking version of Java because they lost
their battle against Sun about it (MS had to rename their version of the
language "J++"), they then developed a different language to compete with
Java. That language was C#.
I don't even care if C# is a thousand times better than Java. I hate
it by principle and by extreme prejudice, and I'm not ashamed to admit it.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> I don't even care if C# is a thousand times better than Java. I hate
> it by principle and by extreme prejudice, and I'm not ashamed to admit it.
Heh. OK. I had a feeling that's kind of the answer I might get. ;-)
If I ever had round to actually playing with it, I'll let you know what
I think... [Don't hold your breath though.]
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp escribió:
> MS had to rename their version of the language "J++")
>
I think it's actually J#.
> I don't even care if C# is a thousand times better than Java. I hate
> it by principle and by extreme prejudice, and I'm not ashamed to admit it.
>
I know Java, and use it sometimes. I don't know C# and refuse to get
anywhere close to .NET
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nicolas Alvarez wrote:
> Warp escribió:
>> MS had to rename their version of the language "J++")
>>
>
> I think it's actually J#.
No, I think J++ and J# are seperate languages. J++ is M$'s non-compliant
"Java" VM, whereas J# is a Java-like language for the .NET framework.
> I know Java, and use it sometimes. I don't know C# and refuse to get
> anywhere close to .NET
Likewise.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nicolas Alvarez <nic### [at] gmail is the best com> wrote:
> I know Java, and use it sometimes. I don't know C# and refuse to get
> anywhere close to .NET
What's wrong with .NET?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp escribió:
> Nicolas Alvarez <nic### [at] gmail is the best com> wrote:
>> I know Java, and use it sometimes. I don't know C# and refuse to get
>> anywhere close to .NET
>
> What's wrong with .NET?
>
It's from Microsoft...?
Principle and extreme prejudice, I guess.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nicolas Alvarez <nic### [at] gmail is the best com> wrote:
> Warp escribió:
> > Nicolas Alvarez <nic### [at] gmail is the best com> wrote:
> >> I know Java, and use it sometimes. I don't know C# and refuse to get
> >> anywhere close to .NET
> >
> > What's wrong with .NET?
> >
> It's from Microsoft...?
> Principle and extreme prejudice, I guess.
Not *everything* from Microsoft is that bad. I just detest C# because
of the reason why the developed it.
However, the little I have heard about .NET, it doesn't sound
all that bad. If I'm not mistaken, it makes it easy to develop
language-independent modules (for example, you could develop a
library module in C++, ASP, C# or probably even Java, and use it
in any of the other languages at will). I might have understood
wrongly what .NET is about, though.
Perhaps a bit surprisingly, Microsoft even has some open-source
projects, under OSI-compliant licenses. For example:
http://en.wikipedia.org/wiki/Windows_Template_Library
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp escribió:
> Nicolas Alvarez <nic### [at] gmail is the best com> wrote:
>> Warp escribiïż½:
>>> Nicolas Alvarez <nic### [at] gmail is the best com> wrote:
>>>> I know Java, and use it sometimes. I don't know C# and refuse to get
>>>> anywhere close to .NET
>>> What's wrong with .NET?
>>>
>
>> It's from Microsoft...?
>
>> Principle and extreme prejudice, I guess.
>
> Not *everything* from Microsoft is that bad.
I know. I didn't say everything from Microsoft is bad. So? That won't
make me use .NET.
I once saw a website of some guy increasing his ego by claiming he could
do one application a day, in .NET (probably C#). And indeed he could,
and finished saying "can you do THIS in your programming language?".
Well I hope I can't. Even the most silly apps used at least 40MB of
memory. That little thing is one more point against .NET in my mind.
> Perhaps a bit surprisingly, Microsoft even has some open-source
> projects, under OSI-compliant licenses. For example:
> http://en.wikipedia.org/wiki/Windows_Template_Library
I know. There's also WiX, a free toolset to make MSI-based installers
from XML configuration files. Released under the Common Public License.
And probably many others.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> However, the little I have heard about .NET, it doesn't sound
> all that bad.
The install binary is pretty vast though... :-S
> If I'm not mistaken, it makes it easy to develop
> language-independent modules (for example, you could develop a
> library module in C++, ASP, C# or probably even Java, and use it
> in any of the other languages at will). I might have understood
> wrongly what .NET is about, though.
That's the general impression I got too...
> Perhaps a bit surprisingly, Microsoft even has some open-source
> projects, under OSI-compliant licenses. For example:
> http://en.wikipedia.org/wiki/Windows_Template_Library
Apparently it doesn't provide everything that the closed-source version
does. (I.e. part of the class library isn't there.) However, without
having a detailed understanding of what the CS version provides and what
isn't in the OS version, it's hard to make an intelligent comment about
how significant that is.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
> ....so they implemented Java's flawed MI-but-not-MI model? How is that
> fixing the flaws from other major programming languages?
Probably fixing what they saw as flawed MI in C++. :-)
Me, I like the Common Lisp object system.
> Ever tried to use multiple inheritance in Eiffel?
I used Eiffel a bit. I kind of gave it up when the compiler for this
language which is supposed to support extreme correctness couldn't
compile the hello world program that was the skeleton project the IDE
created for you when you start a new project.
> Since I am presumably the only person here who has ever heard of Eiffel, let me go
over it.
Nah. I used it for a bit.
> Suppose that class A inherits from classes B and C, which themselves inherit from D.
Suppose that D defines an attribute called, say, banana. That means that B and C each
have a copy of banana. In A, these two copies are automatically merged by default.
> Alternatively, you can rename one (or both) copies to something else.
Did they ever actually implement this? It's how it's *supposed* to work,
but never did, IME.
--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Why not disallow diamond inheritance?
Technically, you can't, since there's a common base type for all objects
in those languages.
--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Darren New wrote:
> Invisible wrote:
>> ....so they implemented Java's flawed MI-but-not-MI model? How is that
>> fixing the flaws from other major programming languages?
>
> Probably fixing what they saw as flawed MI in C++. :-)
Hmm, yeeeeessss.......
> Me, I like the Common Lisp object system.
Me, I dislike anything that says "Lisp" in it. :-S
>> Ever tried to use multiple inheritance in Eiffel?
>
> I used Eiffel a bit. I kind of gave it up when the compiler for this
> language which is supposed to support extreme correctness couldn't
> compile the hello world program that was the skeleton project the IDE
> created for you when you start a new project.
I gave up when the language libraries were so obviously stupid...
>> Since I am presumably the only person here who has ever heard of
>> Eiffel, let me go over it.
>
> Nah. I used it for a bit.
That's a miracle. It's a pretty rare language...
>> Suppose that class A inherits from classes B and C, which themselves
>> inherit from D. Suppose that D defines an attribute called, say,
>> banana. That means that B and C each have a copy of banana. In A,
>> these two copies are automatically merged by default.
>> Alternatively, you can rename one (or both) copies to something else.
>
> Did they ever actually implement this? It's how it's *supposed* to work,
> but never did, IME.
Didn't try it personally, no. But that's what the language spec says.
(IIRC it's an ISO standard now or something?)
Note that Eiffel Studio isn't the only implementation. There's Smart
Eiffel (AKA Small Eiffel) that reguarly does quite well in the language
shootout benchmarks... But either way, the libraries are very poor.
[E.g., Eiffel provides strong generics support with a whole heap of
infrastructure to support writing really generic code. So they designed
one class for character I/O, and a completely unrelated one for binary
I/O. GAH! >_< Why?!]
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> What's wrong with .NET?
>
Un-cross-compatibility. Get .Net 1.1 -software, .Net 2.0 -software and
.Net 3.0 -software, one for each. Something light, like a simple
card-game. Now, open them all up simultaniously and check the consumed
resources - while .Net -environments are not (fully, to some extent they
are) cross-compatible, you won't get off with just loading .Net 3.0, but
you'll have every one of them ripping theier (big) bits of memory.
AFAIK frameworks like .Net should ease up programming by providing basic
functions allready-coded and ease up resource-consuming as being
something like shared libraries. Need of multiple versions of the same
frameworks simultaniously just.. hmm.. breaks this illusion.
--
Eero "Aero" Ahonen
http://www.zbxt.net
aer### [at] removethis zbxt net invalid
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Orchid XP v7 <voi### [at] dev null> wrote:
>> OOC, have you ever looked at C# yourself?
>
> Not really. From what I understand, it's a kind of "C++ with the same
> limitations as Java".
Not really. It's more like "this is what Java would be like if we threw
it away and started over from scratch, knowing what we learned from the
first Java."
> Just the reason for its existence repulses me: Since Microsoft had to
> abandon their own, standard-breaking version of Java
It didn't break the Java standard. It ran more acceptance tests
correctly than Sun's implementation did. It also offered a way to
access Microsoft functionality from within Java.
Which is not to say C# isn't designed as a Java killer, mind. :-)
--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Orchid XP v7 wrote:
>> Me, I like the Common Lisp object system.
> Me, I dislike anything that says "Lisp" in it. :-S
You don't need to like LISP to appreciate the object system CLOS
provides. It really isn't much lisp-specific in concept.
> I gave up when the language libraries were so obviously stupid...
Well that too. I was just doing text in/out with it.
> That's a miracle. It's a pretty rare language...
I used Icon too, which is also a pretty cool language. :-)
> Didn't try it personally, no. But that's what the language spec says.
It has been an ongoing complaint that nobody actually implements the
hard parts of the language.
> Note that Eiffel Studio isn't the only implementation. There's Smart
> Eiffel (AKA Small Eiffel) that reguarly does quite well in the language
> shootout benchmarks... But either way, the libraries are very poor.
Unless you use Eiffel.NET. *That* is the power of the .NET stuff, in my
view.
> [E.g., Eiffel provides strong generics support with a whole heap of
> infrastructure to support writing really generic code. So they designed
> one class for character I/O, and a completely unrelated one for binary
> I/O. GAH! >_< Why?!]
Meyers was really desiging a language for designing data structures in.
The data structure libraries are really nicely thought out. A shame the
*useful* stuff isn't there.
--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Eero Ahonen wrote:
> you'll have every one of them ripping theier (big) bits of memory.
Yah, that's called "side-by-side execution". It's a selling point,
because you don't wind up with having to support old stuff in new
runtimes, and you can leave the old bugs buggy, avoiding "DLL Hell".
> AFAIK frameworks like .Net should ease up programming by providing basic
> functions allready-coded and ease up resource-consuming as being
> something like shared libraries.
They do.
> Need of multiple versions of the same
> frameworks simultaniously just.. hmm.. breaks this illusion.
Wow, I run Java and C# next to each other, and they both take up memory! :-)
One really has two choices: Run different versions of the runtime and
use up those resources, or have DLL hell where upgrading the runtime
breaks working programs. The "upgrade the runtime and maintain 100%
backward compatibility" eventually turns into a nightmare.
--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>> That's a miracle. It's a pretty rare language...
>
> I used Icon too, which is also a pretty cool language. :-)
OK then...
>> Didn't try it personally, no. But that's what the language spec says.
>
> It has been an ongoing complaint that nobody actually implements the
> hard parts of the language.
Heh. I never actually tried it, so I can't comment. I just assumed it
would work. ;-)
>> Note that Eiffel Studio isn't the only implementation. There's Smart
>> Eiffel (AKA Small Eiffel) that reguarly does quite well in the
>> language shootout benchmarks... But either way, the libraries are very
>> poor.
>
> Unless you use Eiffel.NET. *That* is the power of the .NET stuff, in my
> view.
Depends. How good are the .NET libraries? [I hope to God they're better
than the Java ones!]
>> [E.g., Eiffel provides strong generics support with a whole heap of
>> infrastructure to support writing really generic code. So they
>> designed one class for character I/O, and a completely unrelated one
>> for binary I/O. GAH! >_< Why?!]
>
> Meyers was really desiging a language for designing data structures in.
> The data structure libraries are really nicely thought out. A shame the
> *useful* stuff isn't there.
Yeah. Bloody type-I languages...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> Warp wrote:
> > Why not disallow diamond inheritance?
> Technically, you can't, since there's a common base type for all objects
> in those languages.
No, there isn't: The so-called "interfaces" are not inherited from the
common base class. What would stop these interfaces from having member
variables and function implementations?
Besides, does this common base class have member variables? If not,
there is no problem with diamond inheritance.
And even if it had, since it's an automatic inheritance forced
by the compiler, it's perfectly possible for it to automatically do
the same thing as C++'s "virtual inheritance" does. That is, even if
you multiple-inherit, there's still only one base class part in the
resulting objects and everything referring to this base class uses
this unique instantiation.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> One really has two choices: Run different versions of the runtime and
> use up those resources, or have DLL hell where upgrading the runtime
> breaks working programs. The "upgrade the runtime and maintain 100%
> backward compatibility" eventually turns into a nightmare.
Third choice: Design the system so that you don't *have* to upgrade
ever. ;)
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> It also offered a way to
> access Microsoft functionality from within Java.
Isn't that precisely breaking standards?
If Microsoft's version of Java didn't break any Java specifications,
how come Sun sued and won?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> Invisible wrote:
> > ....so they implemented Java's flawed MI-but-not-MI model? How is that
> > fixing the flaws from other major programming languages?
> Probably fixing what they saw as flawed MI in C++. :-)
They "fixed the problems" by removing multiple inheritance completely?
Maybe MI in C++ has some problems. I has never stopped me from using
MI in C++ efficiently and for really useful stuff, though.
Ok, one small problem with C++'s multiple inheritance might be that
if you want to use virtual inheritance in a diamond inheritance situation,
you would have to have editing access to both base classes you are inheriting
from if they are not virtual-inheriting already. If these classes are eg.
in a library you don't have access to, tough luck.
Of course this is because of technical reasons. The only alternative
would be that classes are *always* virtually-inherited by default, which
would introduce overhead in the vast majority of situations where virtual
inheritance is not needed. (Once again, the possibility of precompiled
libraries and dynamically-loadable libraries makes it not possible to
perform some post-compilation optimizations. Having shared system-wide
dynamically-loadable libraries is too much of an advantage to simply drop
that feature.)
(Btw, I have always wondered: How are you supposed to build huge systems
with languages which do not support dynamically loadable shared libraries?
The advantage of these is that it reduces memory consumption a lot,
because libraries which are common to most programs are loaded into memory
only once, and all the programs use those one unique instantiations.
Without this possibility each program would have to be statically linked
with all the system libraries, and thus the same system libraries would be
loaded into memory multiple times. If there's eg. a huge library used by all
programs, it would be loaded to memory as many times as there are programs
running.)
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Orchid XP v7 <voi### [at] dev null> wrote:
> Me, I dislike anything that says "Lisp" in it. :-S
Says the person who is infatuated with functional languages such as
Haskell...
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Orchid XP v7 <voi### [at] dev null> wrote:
>> Me, I dislike anything that says "Lisp" in it. :-S
>
> Says the person who is infatuated with functional languages such as
> Haskell...
Aren't you that guy who loves C++ but hates C? ;-)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible <voi### [at] dev null> wrote:
> Warp wrote:
> > Orchid XP v7 <voi### [at] dev null> wrote:
> >> Me, I dislike anything that says "Lisp" in it. :-S
> >
> > Says the person who is infatuated with functional languages such as
> > Haskell...
> Aren't you that guy who loves C++ but hates C? ;-)
C isn't object-oriented.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>>>> Me, I dislike anything that says "Lisp" in it. :-S
>>> Says the person who is infatuated with functional languages such as
>>> Haskell...
>
>> Aren't you that guy who loves C++ but hates C? ;-)
>
> C isn't object-oriented.
True. But C and C++ are vastly more closely related than Haskell and Lisp.
[And if you wanted to split hairs, Haskell is a pure-functional
language, while Lisp isn't.]
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible <voi### [at] dev null> wrote:
> [And if you wanted to split hairs, Haskell is a pure-functional
> language, while Lisp isn't.]
A pure-functional language which has things like indexable arrays and
assignment? Hardly.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Invisible <voi### [at] dev null> wrote:
>> [And if you wanted to split hairs, Haskell is a pure-functional
>> language, while Lisp isn't.]
>
> A pure-functional language which has things like indexable arrays and
> assignment? Hardly.
Really? And indexable arrays are impure because...?
Similarly, all side-effecting operations are implemented using
referentially-transparent monadic constructs. In Lisp, if you want a
side-effect, you just do it. That's the difference.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible <voi### [at] dev null> wrote:
> Warp wrote:
> > Invisible <voi### [at] dev null> wrote:
> >> [And if you wanted to split hairs, Haskell is a pure-functional
> >> language, while Lisp isn't.]
> >
> > A pure-functional language which has things like indexable arrays and
> > assignment? Hardly.
> Really? And indexable arrays are impure because...?
Because it's not a feature of the functional programming paradigm,
but the imperative programming paradigm.
Purely functional languages are mostly impractical.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>> Really? And indexable arrays are impure because...?
>
> Because it's not a feature of the functional programming paradigm,
> but the imperative programming paradigm.
>
> Purely functional languages are mostly impractical.
Tell me Warp, do you actually understand what "functional programming"
means?
You seem to think it means "programming with lists", which isn't correct.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible <voi### [at] dev null> wrote:
> Tell me Warp, do you actually understand what "functional programming"
> means?
A purely functional programming language doesn't have side-effects.
If I'm not mistaken, for example assignment produces a side-effect.
Even I/O causes side-effects.
Thus a purely functional language is mostly impractical. Quoting
wikipedia:
"Purely functional programs have no side effects. This makes it easier
to reason about their behavior. However, almost no programmers bother
to write purely functional programs, since, by definition, a program
with no side effects (one that accepts no input, produces no output,
and interfaces with no external devices ) is formally equivalent to a
program that does nothing; typically, purity is used to enforce a
separation of concerns where one clearly-delineated section of the
program does impure operations like I/O, and calls pure functions and
libraries as needed to compute answers."
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Thus a purely functional language is mostly impractical. Quoting
> wikipedia:
>
> "Purely functional programs have no side effects. This makes it easier
> to reason about their behavior. However, almost no programmers bother
> to write purely functional programs, since, by definition, a program
> with no side effects (one that accepts no input, produces no output,
> and interfaces with no external devices ) is formally equivalent to a
> program that does nothing;
Quoting wikipedia is not always that useful: that section is most
likely vandalism by some angry COBOL programmer.
Surely separation of concerns is good as is reducing side-effects to a
minimum. To say a purely functional program is incapable of accepting
input or generating output is not correct: if anything, a purely
functional program is able to, in shared memory, take a list as input
and generate a list as output. An outside program can write the input
list in memory, call the pure program on it and read its output and
write to file. That's, AFAIK, is what was done in the old days of
Haskell: delayed list IO.
More practically, functional language compilers and runtimes carry out
the ugly side-effect bits while the purely functional programs do their
stuff and get written as if acting on purely side-effect free
datastructures. That's monadic IO today.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Invisible <voi### [at] dev null> wrote:
>> Tell me Warp, do you actually understand what "functional programming"
>> means?
>
> A purely functional programming language doesn't have side-effects.
Indeed.
> If I'm not mistaken, for example assignment produces a side-effect.
> Even I/O causes side-effects.
Assignment and I/O are both side-effects. Accessing an indexed array
does not. There is absolutely no reason why a pure functional language
cannot have arrays.
> Thus a purely functional language is mostly impractical.
Depends on your definition of "practical".
> Quoting wikipedia:
>
> "Purely functional programs have no side effects. This makes it easier
> to reason about their behavior. However, almost no programmers bother
> to write purely functional programs, since, by definition, a program
> with no side effects is formally equivalent to a program that
> does nothing."
Indeed, a program with absolutely no side effects at all is rather
pointless. (!) There are several approaches to this apparent problem.
One approach is to *allow* side-effects, but say "hey, don't use this
unless you have to". This is the Lisp approach. (And Erlang. And a few
others.)
The Haskell approach is different. A Haskell "program" just returns a
list of instructions to the Haskell runtime, and the Haskell runtime
actually "does" the instructions on the program's behalf.
Why is that different? Well, it means that the entire program remains
referentially transparent. And *that* is the defining characteristic of
functional programs.
In Haskell, *every* expression can be replaced by the value it returns
without altering the result of the program. [Indeed, this is notionally
how you execute a Haskell program.] The same statement does *not* apply
to Lisp. Hence, Haskell is pure, and Lisp is not. QED.
Note that you *could* write referentially transparent code in just about
any programming language, if you wanted to. It's just that in Haskell
you can't write code that isn't. ;-)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |