the next generation for c# developers

42

Upload: -

Post on 06-May-2015

3.090 views

Category:

Technology


4 download

DESCRIPTION

2014/05/31 のめとべや東京 #4 での発表資料

TRANSCRIPT

Page 1: The Next Generation for C# Developers
Page 2: The Next Generation for C# Developers

仕事

個人活動

http://tanaka733.net

https://www.nuget.org/profiles/tanaka_733/

Page 3: The Next Generation for C# Developers

先生

.NET の行く先は?

C# の新機能は?

これから何ができるの?

※意外とde:codeで話が少なかったんですよ!!!1

Page 4: The Next Generation for C# Developers

.NET vNext

Page 5: The Next Generation for C# Developers

Core .NET

Next gen JIT (“RyuJIT”)

SIMD

Runtime Compilers

.NET Compiler Platform (“Roslyn”)

Languages innovation

Windows DesktopAzure and Windows Server

Universal projects

.NET NativeASP.NET updates

Windows Convergence

Native compilation Cross-devices

Xamarin partnership

Web apps

.NET support for

Azure Mobile Services

Cloud Services

Openness

Windows Store iOS and Android

.NET in devices and services

The Future of C# (Channel 9)

Page 6: The Next Generation for C# Developers

Core .NET

Next gen JIT (“RyuJIT”)

SIMD

Runtime Compilers

.NET Compiler Platform (“Roslyn”)

Languages innovation

Windows DesktopAzure and Windows Server

Universal projects

.NET NativeASP.NET updates

Windows Convergence

Native compilation Cross-devices

Xamarin partnership

Web apps

.NET support for

Azure Mobile Services

Cloud Services

Openness

Windows Store iOS and Android

.NET in devices and services

The Future of C# (Channel 9)

RyuJIT Roslyn

ASP.NET vNext

.NET Native

Page 7: The Next Generation for C# Developers
Page 8: The Next Generation for C# Developers

Mobile First

Cloud First

Page 9: The Next Generation for C# Developers

Roslyn and C# 6.0(仮)新しいコンパイラ、新しい言語仕様

Page 10: The Next Generation for C# Developers

C# とVBのコンパイラの再構築

Openness (ブラックからホワイトへ)

豊富なAPIが公開されている

Page 11: The Next Generation for C# Developers

Quality Improvements

API Readiness

Language Features

Diagnostics

Interactive

IDE Support Roslyn Roadmap

Page 12: The Next Generation for C# Developers

IDEが止まらない

• 並列性を高めるためのPDB

• OSSテストキット

WinRTで使いやすく

Page 13: The Next Generation for C# Developers

XMLコメント

妥当な引数チェック

集合型の合理性

Page 14: The Next Generation for C# Developers
Page 15: The Next Generation for C# Developers

コード解析

• 解析ツール

• 静的解析用

• フロー解析を拡張

Page 16: The Next Generation for C# Developers
Page 17: The Next Generation for C# Developers

パフォーマンス改善

コンフリクト検出の改善

Page 18: The Next Generation for C# Developers
Page 20: The Next Generation for C# Developers

public class Point(int x, int y){

public int X { get; } = x;public int Y { get; } = y;

public double R { get; } = Math.Sqrt(x^x+y^y);

public Point() : this(0, 0){ }

public override string ToString(){

return string.Format("({0},{1},{2})", X, Y, R);}

}

Page 21: The Next Generation for C# Developers

using System.Console;

static class UsingStaticMembers{

static void Dump(){

WriteLine("Hoge");}

}

Page 22: The Next Generation for C# Developers

static class DictionaryInitializer{

public static IDictionary<string, string> Demo(){

return new Dictionary<string, string>(){

["x"] = "hoge",$key = "hoge"

};}

}

Page 23: The Next Generation for C# Developers

if (int.TryParse(text, out var i)){

Console.WriteLine("指定された値は数値に変換できて、{0} です。", i);}else{

Console.WriteLine("指定された値は数値に変換できません。");}

Page 24: The Next Generation for C# Developers

static async Task Demo(){

//Await in catch/finally//Exception filterstry{

var urls = new[] { "http://microsoft.com", "http://bing.com" };var client = new HttpClient();var tasks = urls.Select(url => client.GetAsync(url));var res = await Task.WhenAll(tasks);

}catch (AggregateException e) if (e.InnerExceptions.Count > 2){

await Report("Error");}finally{

await Report("End");}

Page 25: The Next Generation for C# Developers
Page 26: The Next Generation for C# Developers

RyuJIT

Page 27: The Next Generation for C# Developers

64bitでも高速なJITコンパイルをJITの出力結果は64bitで高速に動くが、JIT自体が64bitで遅かった

サーバー側で動く想定で、JITコンパイルは遅くてもいいという想定

でも最近のWebアプリは立ち上がりからもっと早くなってほしい

Page 29: The Next Generation for C# Developers

static void Demo(){

// Array of 2 * Vector<int>.Length valuesint[] values = CreateValues();

// Multiply the first N values with the second// N values (N, being Vector<int>.Length).var x = new Vector<int>(values, 0);var y = new Vector<int>(values, Vector<int>.Length);var z = x * y;

// Store the result in the array where x came fromz.CopyTo(values, 0);

}

Page 30: The Next Generation for C# Developers

.NET NativeC#にNative なみの速さを

Page 31: The Next Generation for C# Developers

C++ 並の速度をC#に!C# のdynamic compilation の自由度を持ったまま、C++のstatic compilation のように実行時コンパイルをなくして、実行速度を高速化したい

Runtime Directive

最初のターゲットはx64 or ARM なWindows Store App

.NET Team の .NET Native タグがついたブログ

Page 32: The Next Generation for C# Developers

http://aka.ms/dotnetnative

Page 34: The Next Generation for C# Developers

ASP.NET vNext

Page 35: The Next Generation for C# Developers

MVC, Web API, Web Pages の統一WebFormsも改善されます

System.Webからの脱却

Cloud最適化モード同一サーバー上に複数のアプリが独立して動かせる (GAC非依存)

セッションやキャッシュのAPIもCloudとオンプレ問わず使えるDIによる切り替え

ブラウザで更新するだけで最新のコードが反映Roslynによるビルド

(従来の).NET Framework とCloud最適化モードはプロジェクトの設定で切り替え可能

Page 36: The Next Generation for C# Developers
Page 37: The Next Generation for C# Developers
Page 38: The Next Generation for C# Developers

閑話休題:その他の話題時間調整かもしれない

Page 39: The Next Generation for C# Developers
Page 40: The Next Generation for C# Developers

まとめ

Page 41: The Next Generation for C# Developers

Core .NET

Next gen JIT (“RyuJIT”)

SIMD

Runtime Compilers

.NET Compiler Platform (“Roslyn”)

Languages innovation

Windows DesktopAzure and Windows Server

Universal projects

.NET NativeASP.NET updates

Windows Convergence

Native compilation Cross-devices

Xamarin partnership

Web apps

.NET support for

Azure Mobile Services

Cloud Services

Openness

Windows Store iOS and Android

.NET in devices and services

The Future of C# (Channel 9)

Page 42: The Next Generation for C# Developers