the next generation for c# developers
DESCRIPTION
2014/05/31 のめとべや東京 #4 での発表資料TRANSCRIPT
![Page 1: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/1.jpg)
![Page 2: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/2.jpg)
仕事
個人活動
http://tanaka733.net
https://www.nuget.org/profiles/tanaka_733/
![Page 3: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/3.jpg)
先生
.NET の行く先は?
C# の新機能は?
これから何ができるの?
※意外とde:codeで話が少なかったんですよ!!!1
![Page 4: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/4.jpg)
.NET vNext
![Page 5: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/5.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/6.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/7.jpg)
![Page 8: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/8.jpg)
Mobile First
Cloud First
![Page 9: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/9.jpg)
Roslyn and C# 6.0(仮)新しいコンパイラ、新しい言語仕様
![Page 10: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/10.jpg)
C# とVBのコンパイラの再構築
Openness (ブラックからホワイトへ)
豊富なAPIが公開されている
![Page 11: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/11.jpg)
Quality Improvements
API Readiness
Language Features
Diagnostics
Interactive
IDE Support Roslyn Roadmap
![Page 12: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/12.jpg)
IDEが止まらない
• 並列性を高めるためのPDB
• OSSテストキット
WinRTで使いやすく
![Page 13: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/13.jpg)
XMLコメント
妥当な引数チェック
集合型の合理性
![Page 14: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/14.jpg)
![Page 15: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/15.jpg)
コード解析
• 解析ツール
• 静的解析用
• フロー解析を拡張
![Page 16: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/16.jpg)
![Page 17: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/17.jpg)
パフォーマンス改善
コンフリクト検出の改善
![Page 18: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/18.jpg)
![Page 19: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/19.jpg)
Language feature implementation status
![Page 20: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/20.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/21.jpg)
using System.Console;
static class UsingStaticMembers{
static void Dump(){
WriteLine("Hoge");}
}
![Page 22: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/22.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/23.jpg)
if (int.TryParse(text, out var i)){
Console.WriteLine("指定された値は数値に変換できて、{0} です。", i);}else{
Console.WriteLine("指定された値は数値に変換できません。");}
![Page 24: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/24.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/25.jpg)
![Page 26: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/26.jpg)
RyuJIT
![Page 27: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/27.jpg)
64bitでも高速なJITコンパイルをJITの出力結果は64bitで高速に動くが、JIT自体が64bitで遅かった
サーバー側で動く想定で、JITコンパイルは遅くてもいいという想定
でも最近のWebアプリは立ち上がりからもっと早くなってほしい
![Page 28: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/28.jpg)
RyuJIT: The next-generation JIT compiler for .NET
![Page 29: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/29.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/30.jpg)
.NET NativeC#にNative なみの速さを
![Page 31: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/31.jpg)
C++ 並の速度をC#に!C# のdynamic compilation の自由度を持ったまま、C++のstatic compilation のように実行時コンパイルをなくして、実行速度を高速化したい
Runtime Directive
最初のターゲットはx64 or ARM なWindows Store App
.NET Team の .NET Native タグがついたブログ
![Page 33: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/33.jpg)
My experience with .NET Native Preview
![Page 34: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/34.jpg)
ASP.NET vNext
![Page 35: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/35.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/36.jpg)
![Page 37: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/37.jpg)
![Page 38: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/38.jpg)
閑話休題:その他の話題時間調整かもしれない
![Page 39: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/39.jpg)
![Page 40: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/40.jpg)
まとめ
![Page 41: The Next Generation for C# Developers](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/41.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022052618/554a2cdeb4c90520578b4e66/html5/thumbnails/42.jpg)