Thread overview | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 10, 2013 Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Maybe it would be possible to get some good idea from next version of C# It's only ideas about next version, but new future maybe next: http://damieng.com/blog/2013/12/09/probable-c-6-0-features-illustrated |
December 10, 2013 Re: Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Posted in reply to Suliman | Suliman: > Maybe it would be possible to get some good idea from next version of C# Discussed a little here: http://forum.dlang.org/thread/naeqxidypkpehynmiacz@forum.dlang.org Bye, bearophile |
December 10, 2013 Re: Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Posted in reply to Suliman | I love Monadic null checking. Would be great if D would have it. |
December 10, 2013 Re: Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Posted in reply to Suliman | On Tue, 10 Dec 2013 10:57:59 -0800, Suliman <evermind@live.ru> wrote: > Maybe it would be possible to get some good idea from next version of C# > It's only ideas about next version, but new future maybe next: http://damieng.com/blog/2013/12/09/probable-c-6-0-features-illustrated Let's not forget the biggest feature of C# 6.0, Roslyn and Compiler-as-a-Library! *nudgenudge* Also I was reading an interview with Anders and he talked about something VERY interesting. Immutable AST's... I wonder how they did that? Since D has immutability, rewriting the front-end as a library in D could be extremely interesting, and unlike Roslyn, it'd be native-code... I'm just saying... :-D -- Adam Wilson IRC: LightBender Project Coordinator The Horizon Project http://www.thehorizonproject.org/ |
December 10, 2013 Re: Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam Wilson | Am 10.12.2013 23:49, schrieb Adam Wilson:
> On Tue, 10 Dec 2013 10:57:59 -0800, Suliman <evermind@live.ru> wrote:
>
>> Maybe it would be possible to get some good idea from next version of C#
>> It's only ideas about next version, but new future maybe next:
>> http://damieng.com/blog/2013/12/09/probable-c-6-0-features-illustrated
>
> Let's not forget the biggest feature of C# 6.0, Roslyn and
> Compiler-as-a-Library! *nudgenudge*
>
> Also I was reading an interview with Anders and he talked about
> something VERY interesting. Immutable AST's...
>
> I wonder how they did that? Since D has immutability, rewriting the
> front-end as a library in D could be extremely interesting, and unlike
> Roslyn, it'd be native-code...
>
> I'm just saying...
>
> :-D
>
Except Rosylin is also native code when you deploy with NGEN, Windows Phone 8 or the upcoming native C# compiler mentioned at Visual 2013 launch keynote.
--
Paulo
|
December 10, 2013 Re: Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Posted in reply to Suliman | On Tuesday, 10 December 2013 at 18:58:01 UTC, Suliman wrote:
> Maybe it would be possible to get some good idea from next version of C#
> It's only ideas about next version, but new future maybe next: http://damieng.com/blog/2013/12/09/probable-c-6-0-features-illustrated
I really like the "Inline declarations for out params" feature(number 9). The example given in the article is kind of lame, but combined with conditionals it can be a really big improvement:
if(int.TryParse(a,out int b)){
//some code that uses `b`
}
If this works as I expect it to work, `b` will only be defined in the scope of the `if` statement. If we had to declare `b` beforehand, it would have polluted the surrounding scope, when not only we don't use it after the `if` but it doesn't have a meaningful value if `TryParse` yields `false`!
Also - it allows using type inference when declaring those out parameters, which is always a good thing.
This feature can be compared to D's declare-in-if syntax, but they are not equivalent. Consider:
if(int b=a.tryParse!int()){
//some code that uses `b`
}
if `a` is "0" we won't enter the then-clause even though we managed to parse. This is why we don't have this `tryParse` function in D...
|
December 10, 2013 Re: Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam Wilson | On 12/10/2013 11:49 PM, Adam Wilson wrote:
> Also I was reading an interview with Anders and he talked about
> something VERY interesting. Immutable AST's...
>
> I wonder how they did that?
I assume they just don't expose any mutating operations.
|
December 10, 2013 Re: Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Posted in reply to Namespace | On 12/10/13 5:35 PM, Namespace wrote:
> I love Monadic null checking. Would be great if D would have it.
What does a monad have to do with that?
(just out of curiosity... BTW, the other day I friend tried to explain me monads and he realized couldn't understand them himself)
|
December 10, 2013 Re: Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | On Tue, 10 Dec 2013 14:54:23 -0800, Paulo Pinto <pjmlp@progtools.org> wrote: > Am 10.12.2013 23:49, schrieb Adam Wilson: >> On Tue, 10 Dec 2013 10:57:59 -0800, Suliman <evermind@live.ru> wrote: >> >>> Maybe it would be possible to get some good idea from next version of C# >>> It's only ideas about next version, but new future maybe next: >>> http://damieng.com/blog/2013/12/09/probable-c-6-0-features-illustrated >> >> Let's not forget the biggest feature of C# 6.0, Roslyn and >> Compiler-as-a-Library! *nudgenudge* >> >> Also I was reading an interview with Anders and he talked about >> something VERY interesting. Immutable AST's... >> >> I wonder how they did that? Since D has immutability, rewriting the >> front-end as a library in D could be extremely interesting, and unlike >> Roslyn, it'd be native-code... >> >> I'm just saying... >> >> :-D >> > > Except Rosylin is also native code when you deploy with NGEN, Windows Phone 8 or the upcoming native C# compiler mentioned at Visual 2013 launch keynote. > > -- > Paulo Agreed. But those are implementation details in practice. From the standpoint of the language it's still C#. And indeed the Native C# compiler is probably the most interesting to me personally, however, for the moment, according to Anders the default mode of Roslyn is JIT'ed IL. :-) -- Adam Wilson IRC: LightBender Project Coordinator The Horizon Project http://www.thehorizonproject.org/ |
December 11, 2013 Re: Probable C# 6.0 features | ||||
---|---|---|---|---|
| ||||
Posted in reply to Namespace Attachments:
| On 11 December 2013 06:35, Namespace <rswhite4@googlemail.com> wrote:
> I love Monadic null checking. Would be great if D would have it.
>
Yeah that's awesome. Definitely the most interesting one to me too. It's that sort of little detail that can make code better/safer due to a convenient side-stepping of coder laziness.
That said, I've always wished D had '??'. So maybe this isn't likely to be added...
|
Copyright © 1999-2021 by the D Language Foundation