57
김명신 / 한국 마이크로소프트 Windows, Linux, Mac 신경 안 쓴다 .NET 2015와 C# 살짝 훔쳐보기

Tech Update - The Future of .NET Framework (김명신 부장)

Embed Size (px)

Citation preview

Page 1: Tech Update - The Future of .NET Framework (김명신 부장)

김명신 / 한국 마이크로소프트

Windows, Linux, Mac 신경 안 쓴다

.NET 2015와 C# 살짝 훔쳐보기

Page 2: Tech Update - The Future of .NET Framework (김명신 부장)

우리는 혁신이 필요하고 더 빠르게 개발할 수 있기를 바랍니다.

여러 장치에서 동작하는 앱을 개발하고 싶습니다.

오픈소스 전략이 플랫폼과 커뮤니티를 더욱 풍성하게 할겁니다.

하지만 기존의 응용 프로그램은 그대로 수행되어야 해요.

Page 3: Tech Update - The Future of .NET Framework (김명신 부장)

.NET의지향점

.NET의혁신 오픈소스

.NET Core

ASP.NET 5

크로스플랫폼

Page 4: Tech Update - The Future of .NET Framework (김명신 부장)

RyuJIT + SIMD

Garbage Collector

Runtime components Compilers

.NET Compiler Platform (Roslyn)

Languages innovation

.NET Framework 4.6

Fully-featured and integrated

.NET libraries and runtime for Windows

Modular and optimized

.NET libraries and runtimes

Base class libraries

NuGet packages

Libraries

Page 5: Tech Update - The Future of .NET Framework (김명신 부장)

.NET Framework 4.6

Page 6: Tech Update - The Future of .NET Framework (김명신 부장)

.NET SxS 배포, 대체업데이트

.NET 4 .NET 4.5.NET

4.5.1

.NET

4.5.2.NET 4.6

.NET 2.0 .NET 3.0 .NET 3.5

2002 2003 2005 2006 2008 2010 2012 2013 2014 2015

.NET 1.0

.NET 1.1

Page 7: Tech Update - The Future of .NET Framework (김명신 부장)

.NET

Framework

4

.NET

Framework

4.5

.NET

Framework

4.5.1

.NET

Framework

4.5.2

.NET Framework 4.6

Page 8: Tech Update - The Future of .NET Framework (김명신 부장)

기능 라이브러리

개선점

런타임 도구

Page 9: Tech Update - The Future of .NET Framework (김명신 부장)

기능

WPF 투명 차일드 윈도우 지원

WPF 터치 동작에 대한 성능과 신뢰성 개선멀티터치이벤트에대하여신뢰성개선

UI 스레드가바쁜상황에서도터치 동작이원할 하도록성능 개선

WPF 리스트에 대한 스크롤 가상화 개선리스트상에포함된항목조회의신뢰성향상

가상화중에레이아웃이훼손되지않도록개선

WPF High DPI 지원 개선다중 DPI 커서와모니터지원, 프레임워크요소들에대한 외곽처리개선

윈폼 High DPI 지원 개선

Page 10: Tech Update - The Future of .NET Framework (김명신 부장)

라이브러리

WCF 개선기존 SSL 3.0, TLS 1.0 지원에 TLS 1.1, TLS 1.2 지원추가

다수의 HTTP 연결을통해메시지전송

ADO.NET 개선SQL Server 2016에서사용할수있는 Always Encrypted 기능지원

Async비동기제어흐름상에서특정데이터를유지할수있는기능추가

Network 관련 타입 개선System.Net.Sockets, System.Uri 개선

암호화 관련 라이브러리개선

Page 11: Tech Update - The Future of .NET Framework (김명신 부장)

런타임

64비트 JIT 컴파일러 재작성(“RyuJIT”)대용량의 64비트클라우드작업을수행하기에적합

64비트 CLR의 SIMD 지원SSE2, AVX 등의 하드웨어를지원

하드웨어중립적인코드작성이가능

가비지 수집기 개선피닝(pinning)된객체최적화

Gen1에서 Gen2로의프로모션을메모리효율적으로수행하도록개선

가비지수집금지영역지정

어셈블리 로더 성능 개선

Page 12: Tech Update - The Future of .NET Framework (김명신 부장)

도구

새로운 Blend솔루션탐색기, 팀탐색기, 편집기등의 VS 기술을결합

Roslyn 기반의 새로운 언어 서비스속도와신뢰성개선

코드중심의워크스페이스, WPF의 In-Place 편집

디버깅Xaml UI 디버깅도구, 디버거가결합된분석도구

분석타임라인기반 분석도구

Page 13: Tech Update - The Future of .NET Framework (김명신 부장)

Demo

Page 14: Tech Update - The Future of .NET Framework (김명신 부장)

참고자료Announcing .NET Framework 4.6

http://blogs.msdn.com/b/dotnet/archive/2015/07/20/announcing-net-framework-4-6.aspx

.NET Framework의새로운기능

https://msdn.microsoft.com/library/ms171868.aspx#v46

NET Framework 4.6의응용프로그램호환성

https://msdn.microsoft.com/library/dn833127.aspx

.NET Framework 4.6 list of changes

https://github.com/Microsoft/dotnet/blob/master/docs/releases/net46/dotnet46-changes.md

.NET Framework API diff

https://dotnet2015.blob.core.windows.net/changes/diff_net452_net46.html

.NET Framework Targeting Pack

http://www.microsoft.com/ko-kr/download/details.aspx?id=48136

Web installer(preferred)

http://www.microsoft.com/ko-kr/download/details.aspx?id=48130

Offline installer

http://www.microsoft.com/ko-kr/download/details.aspx?id=48137

Page 15: Tech Update - The Future of .NET Framework (김명신 부장)

Shared Core Technologies

Page 16: Tech Update - The Future of .NET Framework (김명신 부장)

핵심기술

64비트 JIT 컴파일러

RyuJIT

새로운 패키지매니저

nuget

.NET 컴파일러플랫폼

Roslyn

Page 17: Tech Update - The Future of .NET Framework (김명신 부장)

RyuJit?

• .NET을 위한 차세대 64비트 JIT 컴파일러

• 코드 생성 속도 개선, 코드 품질 개선

• 고급 최적화 기능 포함(e.g. SIMD, …)

코드 품질How fast generated code runs

코드 생성 속도How fast JIT compiler generate app code

Page 18: Tech Update - The Future of .NET Framework (김명신 부장)

SIMD(Single Instruction Multiple Data)

• .NET에서 data parallelism을 사용할 수 있도록 함

• 게임, 수식 연산, 이미지 처리 등의 응용 프로그램의 성능을 개선

• nuget을 이용하여 .NET 라이브러리 형태로 이용 가능

Page 19: Tech Update - The Future of .NET Framework (김명신 부장)
Page 20: Tech Update - The Future of .NET Framework (김명신 부장)

Vector<int>.Count

var v1 = new Vector<int>(src1, i);

var v2 = new Vector<int>(src2, i);

var sum = v1 + v2;

sum.CopyTo(dest, i);

Page 21: Tech Update - The Future of .NET Framework (김명신 부장)

Demo

Page 22: Tech Update - The Future of .NET Framework (김명신 부장)

Scalar SIMD (SSE2)

Page 23: Tech Update - The Future of .NET Framework (김명신 부장)

http://nuget.org

Page 24: Tech Update - The Future of .NET Framework (김명신 부장)

Demo

Page 25: Tech Update - The Future of .NET Framework (김명신 부장)

https://github.com/dotnet/roslyn

Page 26: Tech Update - The Future of .NET Framework (김명신 부장)

Team혁신을이어갈수있는깔끔한아키텍쳐

Partners소스기반도구나확장도구 개발

Developers더욱 더강력한 C# IDE 기능제공

OSS

1,000,000s

1,000s

10s

Page 27: Tech Update - The Future of .NET Framework (김명신 부장)

Demo

Page 28: Tech Update - The Future of .NET Framework (김명신 부장)

C# 6

Page 29: Tech Update - The Future of .NET Framework (김명신 부장)

public class Customer

{

public string First { get; set; } = "Jane";

public string Last { get; set; } = "Doe";

}

Initializers for auto-properties(C# 6.0)

Getter-only auto-properties(C# 6.0)

public class Customer

{

public string First { get; } = "Jane";

public string Last { get; } = "Doe";

}

Page 30: Tech Update - The Future of .NET Framework (김명신 부장)

Expression bodies on method-like members(C# 6.0)

public Point Move(int dx, int dy) => new Point(x + dx, y + dy);

public static Complex operator +(Complex a, Complex b) => a.Add(b);

public void Print() => Console.WriteLine(First + " " + Last);

public string Name => First + " " + Last;

public Customer this[long id] => store.LookupCustomer(id);

Expression bodies on property-like function members(C# 6.0)

String interpolation(C# 6.0)

var s = $"{p.Name} is {p.Age} year{{s}} old";

var s = $"{p.Name} is {p.Age} year{(p.Age == 1 ? "" : "s")} old";

Page 31: Tech Update - The Future of .NET Framework (김명신 부장)

using static System.Console;

using static System.Math;

using static System.DayOfWeek;

class Program

{

static void Main()

{

WriteLine(Sqrt(3 * 3 + 4 * 4));

WriteLine(Friday - Monday);

}

}

using static(C# 6.0)

Page 32: Tech Update - The Future of .NET Framework (김명신 부장)

int? length = customers?.Length; // null if customers is null

Customer first = customers?[0]; // null if customers is null

int length = customers?.Length ?? 0; // 0 if customers is null

Null-conditional operators(C# 6.0)

nameof expressions(C# 6.0)

if (x == null) throw new ArgumentNullException(nameof(x));

WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode"

Exception filters(C# 6.0)

try { … }

catch (MyException e) when(myfilter(e)) {}

Page 33: Tech Update - The Future of .NET Framework (김명신 부장)

Index initializers(C# 6.0)

var numbers = new Dictionary<int, string>{

[7] = "seven",[9] = "nine",[13] = "thirteen"

};

try { res = await Resource.OpenAsync(…); }

catch (ResourceException e)

{ await Resource.LogAsync(res, e); }

finally { if (res != null) await res.CloseAsync();}

await in catch and finally blocks(C# 6.0)

Page 34: Tech Update - The Future of .NET Framework (김명신 부장)

C# 7 preliminary

Page 35: Tech Update - The Future of .NET Framework (김명신 부장)

Pattern Matching

if (o is Point p && p.X == 5) { WriteLine(p.Y); }

if (o is Point{ X is 5, Y is var y }) { WriteLine(y); }

if (o is Point(5, var y)) { WriteLine(y); }

switch (o)

{

case string s:

WriteLine(s);

break;

case Point(int x, int y):

Console.WriteLine($"({x},{y})");

break;

case null:

Console.WriteLine("<null>");

break;

}

Page 36: Tech Update - The Future of .NET Framework (김명신 부장)

Tuple

public (int sum, int count) Tally(IEnumerable<int> values) { … }

var t = Tally(myValues);

Console.WriteLine($"Sum: {t.sum}, count: {t.count}");

public async Task<(int sum, int count)> TallyAsync(IEnumerable<int> values) { … }

var t = await TallyAsync(myValues);

Console.WriteLine($"Sum: {t.sum}, count: {t.count}");

public (int sum, int count) Tally(IEnumerable<int> values){

var s = 0; var c = 0;foreach (var value in values) { s += value; c++; }return (s, c);

}

Page 37: Tech Update - The Future of .NET Framework (김명신 부장)

nullable references

Dog? nullableDog = new Dog("Nullable");

nullableDog.Bark(); Compiler Error – nullable 참조로는 dereference 하지 못함

cannot dereference nullable reference(yet)

if (nullableDog != null)

{

// 컴파일러는 이 scope 내에서는 nullableDog가 null이 아님을 안다.

nullableDog.Bark(); // OK

}

else

{

// 컴파일러는 이 scope 내에서는 nullableDog가 null임을 안다.

nullableDog.Bark(); // Compiler Error – nullable 참조로는 dereference하지 못함

}

Page 38: Tech Update - The Future of .NET Framework (김명신 부장)

Non-nullable references

Dog! mandatoryDog = new Dog("Mandatory");

mandatoryDog.Bark(); // OK – null 일 수 없으므로 method 호출 가능

string name = mandatoryDog.Name; // OK – null 일수 없으므로 property 참조 가능

Page 39: Tech Update - The Future of .NET Framework (김명신 부장)

.NET Core 5

Page 40: Tech Update - The Future of .NET Framework (김명신 부장)
Page 41: Tech Update - The Future of .NET Framework (김명신 부장)

.NET Core 5

Modular and optimized

.NET libraries and runtimes

.NET Framework의하위집합

이식이가능한모듈화 개발모듈세분화, 의존관계최소화

오픈소스로진행.NET Core runtime : CoreCLR

https://github.com/dotnet/coreclr

.NET Core libraries: CoreFX

https://github.com/dotnet/corefx

Page 42: Tech Update - The Future of .NET Framework (김명신 부장)

Demo

Page 43: Tech Update - The Future of .NET Framework (김명신 부장)

.NET Native

Page 44: Tech Update - The Future of .NET Framework (김명신 부장)

UWP 앱을 위해 클라우드에서 수행되는 차세대 클라우드 컴파일러

C#을머신 코드로 컴파일

정적 링크

극도로 작아진 런타임을 사용하고, VC++의 Optimizer를 이용

MSIL bytecode Machine code

Page 45: Tech Update - The Future of .NET Framework (김명신 부장)
Page 46: Tech Update - The Future of .NET Framework (김명신 부장)

Demo

Page 47: Tech Update - The Future of .NET Framework (김명신 부장)

.NET의 지향점

.NET의혁신 오픈소스

.NET Core

ASP.NET 5

크로스플랫폼

Page 48: Tech Update - The Future of .NET Framework (김명신 부장)

Mono .NET Core 크로스플랫폼모바일 개발과.NET/Xamarin 파트너쉽

.NET

Xamarin

Unity

서비스와웹응용프로그램 모바일앱

Windows Linux Mac OS X

.NET Core

ASP.NET 5

Page 49: Tech Update - The Future of .NET Framework (김명신 부장)

64-bit JIT + SIMD

Garbage Collector

Runtime components Compilers

.NET Compiler Platform (Roslyn)

Languages innovation

.NET Framework 4.6 .NET Core 5

Fully-featured and integrated

.NET libraries and runtime for Windows

Modular and optimized

.NET libraries and runtimes

Base class libraries

NuGet packages

Libraries

Page 50: Tech Update - The Future of .NET Framework (김명신 부장)

• 리눅스 환경에서도 .NET 기반의 앱과 서비스를 수행

• 리눅스 환경에서 구동되는 .NET 기반의 앱을 Visual Studio를

이용하여 개발, 배포, 디버깅 수행

• OSX 사용자는 Visual Studio Code 등을 이용하여 Mac에서 .NET

code를 편집, 컴파일, 디버깅

• .NET Core 전체가 GitHub를 통해 오픈소스로 제공

개발자를위한이점

Page 51: Tech Update - The Future of .NET Framework (김명신 부장)

https://dotnet2015.blob.core.windows.net/binaries/PartsUnlimited-demo-app-darwin.tar.gz

https://dotnet2015.blob.core.windows.net/binaries/PartsUnlimited-demo-app-linux.tar.gz

http://code.visualstudio.com

http://aka.ms/vslovesdocker

Create Cross-Platform .NET Apps

https://github.com/Microsoft/PartsUnlimited

http://github.com/dotnet

참고자료

Page 52: Tech Update - The Future of .NET Framework (김명신 부장)

.NET의 지향점

.NET의혁신 오픈소스

.NET Core

ASP.NET 5

크로스플랫폼

Page 53: Tech Update - The Future of .NET Framework (김명신 부장)

SSCLI (“Rotor”)

Mar 2002

WiX

Apr 2004

F#

May 2005

ASP.NET

Mar 2012

TypeScript

Oct 2012

Roslyn

Apr 2014

.NET Core

Nov 2014

Mono V1

Jun 2004

Mono Started

~2002

Page 54: Tech Update - The Future of .NET Framework (김명신 부장)

.NET의오픈소스화플랫폼

크로스 플랫폼지원

오픈소스

RyuJIT, SIMD

Core-CLR

Runtime components

Compilers.NET Compiler Platform

(“Roslyn”)

Languages

.NET Core 5 Libraries

.NET Framework 4.6 Libraries

Libraries

.NET

Framework 4.6

.NET

Core 5

github.com/microsoft/dotnet

What is Microsoft open sourcing? (2015)

Page 55: Tech Update - The Future of .NET Framework (김명신 부장)

.NET API for Hadoop WebClient

.NET Compiler Platform ("Roslyn").NET Map Reduce API for Hadoop

.NET Micro Framework

ASP.NET MVC

ASP.NET Web API

ASP.NET Web Pages

ASP.NET SignalR

MVVM Light Toolkit

.NET Core 5

Orleans

MEF (Managed Extensibility Framework)

OWIN Authentication MiddlewareRx (Reactive Extensions)

Orchard CMSWindows Azure .NET SDK

Thinktecture IdentityManager

WnsRecipe

Mimekit Xamarin.Auth

Xamarin.Mobile

Couchbase for .NET

Meet the people behind the .NET Foundation

http://www.dotnetfoundation.org/team http://www.dotnetfoundation.org @dotnetfdn

Mailkit

System.Drawing

ASP.NET 5

Salesforce Toolkits for .NET

NuGetKudu

Cecil

MSBuild

Page 56: Tech Update - The Future of .NET Framework (김명신 부장)

Practices VisibilityGovernanceMentorshipSupportFeedback

MediaEventsSponsorship

ProtectionLicensesCopyrightsTrademarksPatents

dotnetfoundation.org

dotnet.github.io

개방

커뮤니티

빠른 혁신

Page 57: Tech Update - The Future of .NET Framework (김명신 부장)

감사합니다.• MSDN Forum http://aka.ms/msdnforum

• TechNet Forum http://aka.ms/technetforum