This page is no longer maintained — Please continue to the home page at www.scala-lang.org

what Scalers think about.... C# 4.0?

4 replies
Szymon Jachim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
I know it's slightly off topic, but I just thought that some of you might find it interesting.

http://channel9.msdn.com/pdc2008/TL16/

I'd be very interested to know what you think about all these additions to C#?
(By this I don't propose anything in regards to Scala)


Thanks.

Szymon
Ricky Clarkson
Joined: 2008-12-19,
User offline. Last seen 3 years 2 weeks ago.
Re: what Scalers think about.... C# 4.0?

C# is the best mainstream language, in my opinion, since 3.0. Where
mainstream means "top 10 on the TIOBE index".

Linq is pretty much the same thing as for-comprehensions (and
do-notation, and LOOP).

The covariance and contravariance annotations are the same as Scala's,
but with a different syntax. I imagine the need for wildcards is
reduced a little because generics are not erased as they are on the
JVM.

Named parameters are much easier to implement on the CLR because the
bytecode contains the parameter names already. Most Java bytecode
doesn't.

It's a small shame that it does a few things the wrong way around
though, e.g., readonly fields can be written to multiple times in a
constructor, locals cannot be readonly. Private is the default, which
encourages monoliths to sprout. Enums are untyped.

The community is far less closed to new (or old) ideas than Java's is,
though there are occasional moans about local variable type inference
being 'unclear' etc.

2009/2/12 Szymon Jachim :
> I know it's slightly off topic, but I just thought that some of you might
> find it interesting.
>
> http://channel9.msdn.com/pdc2008/TL16/
>
> I'd be very interested to know what you think about all these additions to
> C#?
> (By this I don't propose anything in regards to Scala)
>
>
> Thanks.
>
> Szymon
>

Jorge Ortiz
Joined: 2008-12-16,
User offline. Last seen 29 weeks 3 days ago.
Re: what Scalers think about.... C# 4.0?
I disagree that Linq is the same as for-comprehensions. Linq is for-comprehensions plus expression trees, which open up a whole world of possibilities. Granted, you can define your own expression types, but that means requiring users to know and use custom constructs like Eq(q, p) instead of the more natural construct q == p. You might think it's just a minor annoyance, but if so then I'd argue that using functions as values is perfectly natural in Java...

--j

On Thu, Feb 12, 2009 at 5:55 AM, Ricky Clarkson <ricky [dot] clarkson [at] gmail [dot] com> wrote:
C# is the best mainstream language, in my opinion, since 3.0.  Where
mainstream means "top 10 on the TIOBE index".

Linq is pretty much the same thing as for-comprehensions (and
do-notation, and LOOP).

The covariance and contravariance annotations are the same as Scala's,
but with a different syntax.  I imagine the need for wildcards is
reduced a little because generics are not erased as they are on the
JVM.

Named parameters are much easier to implement on the CLR because the
bytecode contains the parameter names already.  Most Java bytecode
doesn't.

It's a small shame that it does a few things the wrong way around
though, e.g., readonly fields can be written to multiple times in a
constructor, locals cannot be readonly.  Private is the default, which
encourages monoliths to sprout.  Enums are untyped.

The community is far less closed to new (or old) ideas than Java's is,
though there are occasional moans about local variable type inference
being 'unclear' etc.

2009/2/12 Szymon Jachim <sjachim [at] gmail [dot] com>:
> I know it's slightly off topic, but I just thought that some of you might
> find it interesting.
>
> http://channel9.msdn.com/pdc2008/TL16/
>
> I'd be very interested to know what you think about all these additions to
> C#?
> (By this I don't propose anything in regards to Scala)
>
>
> Thanks.
>
> Szymon
>

Ricky Clarkson
Joined: 2008-12-19,
User offline. Last seen 3 years 2 weeks ago.
Re: what Scalers think about.... C# 4.0?

Yes, but even expression trees have their limits. See the equals
keyword in linq, and why it exists.

2009/2/13 Jorge Ortiz :
> I disagree that Linq is the same as for-comprehensions. Linq is
> for-comprehensions plus expression trees, which open up a whole world of
> possibilities. Granted, you can define your own expression types, but that
> means requiring users to know and use custom constructs like Eq(q, p)
> instead of the more natural construct q == p. You might think it's just a
> minor annoyance, but if so then I'd argue that using functions as values is
> perfectly natural in Java...
>
> --j
>
> On Thu, Feb 12, 2009 at 5:55 AM, Ricky Clarkson
> wrote:
>>
>> C# is the best mainstream language, in my opinion, since 3.0. Where
>> mainstream means "top 10 on the TIOBE index".
>>
>> Linq is pretty much the same thing as for-comprehensions (and
>> do-notation, and LOOP).
>>
>> The covariance and contravariance annotations are the same as Scala's,
>> but with a different syntax. I imagine the need for wildcards is
>> reduced a little because generics are not erased as they are on the
>> JVM.
>>
>> Named parameters are much easier to implement on the CLR because the
>> bytecode contains the parameter names already. Most Java bytecode
>> doesn't.
>>
>> It's a small shame that it does a few things the wrong way around
>> though, e.g., readonly fields can be written to multiple times in a
>> constructor, locals cannot be readonly. Private is the default, which
>> encourages monoliths to sprout. Enums are untyped.
>>
>> The community is far less closed to new (or old) ideas than Java's is,
>> though there are occasional moans about local variable type inference
>> being 'unclear' etc.
>>
>> 2009/2/12 Szymon Jachim :
>> > I know it's slightly off topic, but I just thought that some of you
>> > might
>> > find it interesting.
>> >
>> > http://channel9.msdn.com/pdc2008/TL16/
>> >
>> > I'd be very interested to know what you think about all these additions
>> > to
>> > C#?
>> > (By this I don't propose anything in regards to Scala)
>> >
>> >
>> > Thanks.
>> >
>> > Szymon
>> >
>
>

Szymon Jachim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: what Scalers think about.... C# 4.0?
Yes Jorge. Scala lacks stable introspection/reflection.
Both expression trees and manifests need a lot of work...


What do you think about their (C#) special dynamic type?

<OT>
In my opinion Anders is putting into C# another idea from his old child Delphi, where there it's called Variant and method calls on it are dispatched by name at run time... In the world of Delphi it could be used for communication with scripts written in dynamic languages, the same thing that he did in this presentation. Different thing about it is that Delphi 2009 just got closures and generic types. I wonder when it will get GC.... ;-)
Tossing closures around a compilcated multithreded system without GC. Priceless.
</OT>

I had an idea to make a compiler plugin which would inject into the parse tree something like
  .get.asInstanceOf[def methodName(a: AType; b: BType): RType]
when it find out that the methodName is called on a object of a special type scala.dyn.Dynamic.

Do you think it would be even possible? Any hints where I should start?

Sz.

On Fri, Feb 13, 2009 at 9:42 PM, Jorge Ortiz <jorge [dot] ortiz [at] gmail [dot] com> wrote:
I disagree that Linq is the same as for-comprehensions. Linq is for-comprehensions plus expression trees, which open up a whole world of possibilities. Granted, you can define your own expression types, but that means requiring users to know and use custom constructs like Eq(q, p) instead of the more natural construct q == p. You might think it's just a minor annoyance, but if so then I'd argue that using functions as values is perfectly natural in Java...

--j

On Thu, Feb 12, 2009 at 5:55 AM, Ricky Clarkson <ricky [dot] clarkson [at] gmail [dot] com> wrote:
C# is the best mainstream language, in my opinion, since 3.0.  Where
mainstream means "top 10 on the TIOBE index".

Linq is pretty much the same thing as for-comprehensions (and
do-notation, and LOOP).

The covariance and contravariance annotations are the same as Scala's,
but with a different syntax.  I imagine the need for wildcards is
reduced a little because generics are not erased as they are on the
JVM.

Named parameters are much easier to implement on the CLR because the
bytecode contains the parameter names already.  Most Java bytecode
doesn't.

It's a small shame that it does a few things the wrong way around
though, e.g., readonly fields can be written to multiple times in a
constructor, locals cannot be readonly.  Private is the default, which
encourages monoliths to sprout.  Enums are untyped.

The community is far less closed to new (or old) ideas than Java's is,
though there are occasional moans about local variable type inference
being 'unclear' etc.

2009/2/12 Szymon Jachim <sjachim [at] gmail [dot] com>:
> I know it's slightly off topic, but I just thought that some of you might
> find it interesting.
>
> http://channel9.msdn.com/pdc2008/TL16/
>
> I'd be very interested to know what you think about all these additions to
> C#?
> (By this I don't propose anything in regards to Scala)
>
>
> Thanks.
>
> Szymon
>


Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland