www.digitalmars.com         C & C++   DMDScript  

D - OT: C# critique

reply Mark T <Mark_member pathlink.com> writes:
http://www.heron-language.com/c-sharp-critique.html
Feb 01 2004
next sibling parent reply "Walter" <walter digitalmars.com> writes:
"Mark T" <Mark_member pathlink.com> wrote in message
news:bvj7r4$30rl$1 digitaldaemon.com...
 http://www.heron-language.com/c-sharp-critique.html
It's an interesting read. I'd like to know what language the author *does* use, and why.
Feb 01 2004
next sibling parent reply Andy Friesen <andy ikagames.com> writes:
Walter wrote:

 "Mark T" <Mark_member pathlink.com> wrote in message
 news:bvj7r4$30rl$1 digitaldaemon.com...
 
http://www.heron-language.com/c-sharp-critique.html
It's an interesting read. I'd like to know what language the author *does* use, and why.
Looks like he made his own: <http://www.heron-language.com/spec.html> -- andy
Feb 01 2004
parent reply "Walter" <walter digitalmars.com> writes:
"Andy Friesen" <andy ikagames.com> wrote in message
news:bvjkpt$kmp$1 digitaldaemon.com...
 Walter wrote:

 "Mark T" <Mark_member pathlink.com> wrote in message
 news:bvj7r4$30rl$1 digitaldaemon.com...

http://www.heron-language.com/c-sharp-critique.html
It's an interesting read. I'd like to know what language the author
*does*
 use, and why.
Looks like he made his own: <http://www.heron-language.com/spec.html>
I can understand his motivation to do that <g>.
Feb 01 2004
parent reply Vathix <vathix dprogramming.com> writes:
Walter wrote:
 "Andy Friesen" <andy ikagames.com> wrote in message
 news:bvjkpt$kmp$1 digitaldaemon.com...
 
Walter wrote:


"Mark T" <Mark_member pathlink.com> wrote in message
news:bvj7r4$30rl$1 digitaldaemon.com...


http://www.heron-language.com/c-sharp-critique.html
It's an interesting read. I'd like to know what language the author
*does*
use, and why.
Looks like he made his own: <http://www.heron-language.com/spec.html>
I can understand his motivation to do that <g>.
This seems interesting from heron: |> Operator The "|>" or pipe operator works as both an input and an output operator allowing data to be recieved from any source that implements the IWritePipe interface and to any source that implements the IReadPipe interface.
Feb 01 2004
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
While I can see the motivation for an operator like that, I truly fail to
see what's so different about it from the ordinary assignment operator.

They both implement "data <verb>s from point A to point B" where <verb> can
be replaced by any number of words, such as move, flow, transfer.  I suppose
if the language has weak (i.e. programmer-supported) notions of reference
vs. value vs. abstracted contents, as evidenced by D's plethora of
comparison operators, such a language may want to separate assignment of
reference from assignment of value from assignment of contents, as well, but
personally I'd rather unify, basically shield the programmer from having to
worry about implementation details of the class types.

Unfortunately D doesn't allow you to overload assignment.

Sean

Vathix wrote:
| This seems interesting from heron:
|
|
||| Operator
| The "|>" or pipe operator works as both an input and an output
| operator allowing data to be recieved from any source that implements
| the IWritePipe interface and to any source that implements the
| IReadPipe interface.
Feb 01 2004
next sibling parent reply "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:bvjrpf$10ne$1 digitaldaemon.com...
 Unfortunately D doesn't allow you to overload assignment.
I have a strong negative view of the value of overloading assignment. By not overloading it, the semantics of it are reliable and repeatable. (For example, does it do a deep, shallow, or reference copy?)
Feb 01 2004
parent reply Matthias Becker <Matthias_member pathlink.com> writes:
 Unfortunately D doesn't allow you to overload assignment.
I have a strong negative view of the value of overloading assignment. By not overloading it, the semantics of it are reliable and repeatable. (For example, does it do a deep, shallow, or reference copy?)
Right, you can never no in D. class Foo (T) { T data; void method (T value) { data = value; // what happens? } } If T is a class-Type you have a reference copy, if it's not you have a shallow copy. In C++ you allways "know" that the class will do the right (deep copy if needed for the type or shallow copy otherwise). Perhpas something like Eiffels way of doing it would be the best?
Feb 03 2004
parent reply "Walter" <walter digitalmars.com> writes:
"Matthias Becker" <Matthias_member pathlink.com> wrote in message
news:bvnqbm$24kv$1 digitaldaemon.com...
 Unfortunately D doesn't allow you to overload assignment.
I have a strong negative view of the value of overloading assignment. By
not
overloading it, the semantics of it are reliable and repeatable. (For
example, does it do a deep, shallow, or reference copy?)
Right, you can never no in D. class Foo (T) { T data; void method (T value) { data = value; // what happens? } } If T is a class-Type you have a reference copy, if it's not you have a
shallow
 copy. In C++ you allways "know" that the class will do the right (deep
copy if
 needed for the type or shallow copy otherwise).
 Perhpas something like Eiffels way of doing it would be the best?
<g> It is rarely clear in C++ whether one needs to do a deep or a shallow copy. Hence, I just avoid it and use functions to do deep or shallow copies.
Feb 03 2004
next sibling parent Matthias Becker <Matthias_member pathlink.com> writes:
<g> It is rarely clear in C++ whether one needs to do a deep or a shallow
copy. Hence, I just avoid it and use functions to do deep or shallow copies.
OK, seems like we have different experiences on that. In my hirachies I know whether a object has to perform a deep copy or not by defualt. And depending on that I write the copy-c'tor and the assignment operator.
Feb 04 2004
prev sibling parent reply J Anderson <REMOVEanderson badmama.com.au> writes:
Walter wrote:

"Matthias Becker" <Matthias_member pathlink.com> wrote in message
news:bvnqbm$24kv$1 digitaldaemon.com...
  

Unfortunately D doesn't allow you to overload assignment.
        
I have a strong negative view of the value of overloading assignment. By
not
overloading it, the semantics of it are reliable and repeatable. (For
example, does it do a deep, shallow, or reference copy?)

      
Right, you can never no in D. class Foo (T) { T data; void method (T value) { data = value; // what happens? } } If T is a class-Type you have a reference copy, if it's not you have a
shallow
copy. In C++ you allways "know" that the class will do the right (deep
    
copy if
needed for the type or shallow copy otherwise).
Perhpas something like Eiffels way of doing it would be the best?
    
<g> It is rarely clear in C++ whether one needs to do a deep or a shallow copy. Hence, I just avoid it and use functions to do deep or shallow copies.
I think a problem here, is that it's not standardised. Every time you want to do a copy you need to look up the method in the class. In one it might be dup(), in another it might by deepcopy(). I think there needs to be something in the language that standardises copying, particularly for templates. -- -Anderson: http://badmama.com.au/~anderson/
Feb 04 2004
parent "Ben Hinkle" <bhinkle4 juno.com> writes:
[snip]
| ><g> It is rarely clear in C++ whether one needs to do a deep or a shallow
| >copy. Hence, I just avoid it and use functions to do deep or shallow
copies.
| >
| I think a problem here, is that it's not standardised.  Every time you
| want to do a copy you need to look up the method in the class.  In one
| it might be dup(), in another it might by deepcopy().  I think there
| needs to be something in the language that standardises copying,
| particularly for templates.

A consistent naming scheme should be good enough. Since arrays use a "dup"
property for a shallow copy I'd just continue using that and have something
like "deepdup" for a deep copy. Possibly define a couple of interfaces
(Dupable and DeepDupable?) with these properties in them and its all done.
Phobos should set the standard.

| --
| -Anderson: http://badmama.com.au/~anderson/
Feb 04 2004
prev sibling parent "christopher diggins" <cdiggins users.sourceforge.net> writes:
"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:bvjrpf$10ne$1 digitaldaemon.com...
 Vathix wrote:
 | This seems interesting from heron:
 |
 |
 ||| Operator
 | The "|>" or pipe operator works as both an input and an output
 | operator allowing data to be recieved from any source that implements
 | the IWritePipe interface and to any source that implements the
 | IReadPipe interface.

 While I can see the motivation for an operator like that, I truly fail to
 see what's so different about it from the ordinary assignment operator.
x := y; // maps to x.Assign(y); y |> x; // maps to an untyped buffered transfer of bytes. The semantics are very different. For instance : matrix |> text_file; // This makes sense text_file := matrix; // this doesn't make sense So it would be pointless to just lump these together as both assignment. -- Christopher Diggins yet another language designer http://www.heron-language.com
Feb 01 2004
prev sibling next sibling parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
Apparently Heron.  :)

Sean

Walter wrote:
| "Mark T" <Mark_member pathlink.com> wrote in message
|| http://www.heron-language.com/c-sharp-critique.html
|
| It's an interesting read. I'd like to know what language the author
| *does* use, and why.
Feb 01 2004
prev sibling next sibling parent reply "christopher diggins" <cdiggins users.sourceforge.net> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bvjjso$j6h$1 digitaldaemon.com...
 "Mark T" <Mark_member pathlink.com> wrote in message
 news:bvj7r4$30rl$1 digitaldaemon.com...
 http://www.heron-language.com/c-sharp-critique.html
It's an interesting read. I'd like to know what language the author *does* use, and why.
Thanks for the compliment on the article. As a couple of other have pointed out, I am working on my own language Heron. Here is what particularly motivates me about Heron : - no class inheritance, polymorphism based entirely on interfaces and delegation of implementation - memory protection without garbage collection - clear delineation between referencing variables and assigning values - inexpensive templates (no code bloat) - modular organization of code - objects are value types that can be referenced if desired - operator overloading - no special array type, array is just a class defined in the standard library as is every other primitive - restricted run time type information through variants I hope this helps answer your question Walter. -- Christopher Diggins yet another language designer http://www.heron-language.com
Feb 01 2004
parent "Walter" <walter digitalmars.com> writes:
"christopher diggins" <cdiggins users.sourceforge.net> wrote in message
news:bvk72b$1kv9$1 digitaldaemon.com...
 It's an interesting read. I'd like to know what language the author
*does*
 use, and why.
Thanks for the compliment on the article. As a couple of other have
pointed
 out, I am working on my own language Heron. Here is what particularly
 motivates me about Heron :

 - no class inheritance, polymorphism based entirely on interfaces and
 delegation of implementation
 - memory protection without garbage collection
 - clear delineation between referencing variables and assigning values
 - inexpensive templates (no code bloat)
 - modular organization of code
 - objects are value types that can be referenced if desired
 - operator overloading
 - no special array type, array is just a class defined in the standard
 library as is every other primitive
 - restricted run time type information through variants

 I hope this helps answer your question Walter.
Yes, it does. Thanks! And good luck with your efforts.
Feb 01 2004
prev sibling parent reply The Lone Haranguer <The_member pathlink.com> writes:
In article <bvjjso$j6h$1 digitaldaemon.com>, Walter says...
"Mark T" <Mark_member pathlink.com> wrote in message
news:bvj7r4$30rl$1 digitaldaemon.com...
 http://www.heron-language.com/c-sharp-critique.html
It's an interesting read. I'd like to know what language the author *does* use, and why.
I'm surprised he uses English... rather than Esperanto (sp).
Feb 02 2004
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
The Lone Haranguer wrote:
| I'm surprised he uses English... rather than Esperanto (sp).

If you like Esperanto, you'll really like Ido:  http://www.idolinguo.com/
Feb 02 2004
parent reply Luke D <Luke_member pathlink.com> writes:
In article <bvmje8$2iob$1 digitaldaemon.com>, Sean L. Palmer says...
The Lone Haranguer wrote:
| I'm surprised he uses English... rather than Esperanto (sp).

If you like Esperanto, you'll really like Ido:  http://www.idolinguo.com/
Oh you're evil... Because of you, I just spent the last several hours learning Ido... and I have a lot of work to do... *ploras* Me juas ta linguo...
Feb 02 2004
parent Antti =?iso-8859-1?Q?Syk=E4ri?= <jsykari gamma.hut.fi> writes:
In article <bvn5hs$eis$1 digitaldaemon.com>, Luke D wrote:
 In article <bvmje8$2iob$1 digitaldaemon.com>, Sean L. Palmer says...
The Lone Haranguer wrote:
| I'm surprised he uses English... rather than Esperanto (sp).

If you like Esperanto, you'll really like Ido:  http://www.idolinguo.com/
Oh you're evil... Because of you, I just spent the last several hours learning Ido... and I have a lot of work to do...
For some reason, perhaps because of having studied several European languages in school, Ido seems quite familiar to me already... :) Just like programming languages - learn a few and then you know them all! -Antti -- I will not be using Plan 9 in the creation of weapons of mass destruction to be used by nations other than the US.
Feb 23 2004
prev sibling parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
Some good points in there, some of which also apply to D. :(

"Mark T" <Mark_member pathlink.com> wrote in message
news:bvj7r4$30rl$1 digitaldaemon.com...
 http://www.heron-language.com/c-sharp-critique.html
Feb 01 2004