Roslyn: el futuro de C# Rodolfo Finochietti

Slides:



Advertisements
Similar presentations
Ofir Aspis 1/2010 VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending.
Advertisements

Ahead of Time Dynamic Translation PreJit/NGEN by any other name George Bosworth Microsoft MRE04 March 21, 2004.
Unit 1: Overview of the Microsoft.NET Platform
1 Unit 1: Introduction To.Net. 2 Introduction to.Net Integrated Development Environment (IDE) Languages in the.NET Framework The Common Language Runtime.
Using.NET Platform Note: Most of the material of these slides have been taken & extended from Nakov’s excellent overview for.NET framework, MSDN and wikipedia.
.NET Core Libraries Common Language Runtime CodeGen Garbage Collector Security Model Exception Handling Loader & Binder Profiling & Debugging APIs Entity.
Microsoft. NET Eine neue Generation der Softwareentwicklung Klaus Rohe
Juan Manuel Technical Evangelist.NET Conference 2015 Introducción práctica a Roslyn Y A XB.
Computer and Programming
THE FUTURE OF C# KEVIN PILCH-BISSON MADS TORGERSEN
4/16/2017 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
1.NET and C# Peter Groenewegen Vrije Universiteit
Thursday Evening 6.30VB.NET Introduction 7.30Break for food 8.00VB.NET Migration 8.45Q & A 9.00Done.
Productivity of Visual Studio + Flexibility of Web Interactive HTML / CSS tools for web apps that look and behave the same across any browser Powerful.
“We are required to innovate and deliver much faster” “I need a cross-device development strategy” “Open Source enriches the platform and the community”
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Choose your Editors and Tools Open Source with Contributions Cross-Platform OSS Seamless transition from on-premises to cloud Faster Development.
“Our role is more important than ever before” “We are required to innovate and deliver much faster” “I need a cross-platform mobile development strategy”
Evolutie vs Revolutie Chris de Kok Evolutie vs Revolutie.NET 2015.NET 4.6 ASP.NET 5 -> MVC 6 Visual Studio 2015 C# 6.0 Agenda.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Introducing Xamarin 2.0 Introducing Xamarin 2.0 Michael Hutchinson
A Microsoft IoT víziója
Managed Code Generics Language Integrated Query Dynamic + Language Parity C# VB 11.0 Windows Runtime + Asynchrony C# VB 7.0 C# VB.
Overview of Microsoft.Net and Vb.Net ITSE 2349 Spring 2002 Material from Microsoft.Net an Overview for ACC faculty by Stuart Laughton and Introduction.
Module 1: Introduction to C# Module 2: Variables and Data Types
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Core.NET Next gen JIT (“RyuJIT”) SIMD Runtime Compilers.NET Compiler Platform (“Roslyn”) Languages innovation Windows Desktop Azure and Windows Server.
Component-Based Software Engineering Introduction to.NET Paul Krause.
Mobile Device Programming
Joe Hummel, the compiler is at your service Chicago Code Camp 2014.
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
WHO WILL BENEFIT FROM THIS TALK TOPICS WHAT YOU’LL LEAVE WITH Developers Interested in HTML5 Games Interested in Windows Azure Interested in Game Development.
Future of VB and C# Lucian Wischik VB Language PM Microsoft.
Lagash Systems Mariano Sánchez – Software
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
PerlNET: The Camel Talks.NET Jan Dubois The Perl Conference 6 San Diego, July 26 th 2002.
Session Information Goals CTAs Customer Evidence TBD
Innovation Any app, any platform Openness.NET Core ASP.NET 5.
Joe Hummel, the compiler is at your service SDC Meetup, Sept 2014.
Javascript Static Code Analyzer
RuntimeLibraries Languages Tools.NET First, a look at.NET 4.5 Client & Device Async – for UI responsiveness Windows Store apps -- WinRT Windows Phone.
Wel come To Seminar On C#.
Barbara Doyle Jacksonville University What’s New with Visual Studio and C#?
C# Present and Future Marita Paletsou Software Engineer.
C# 5.0 Alex Davies 22 nd December What we will cover C# 5.0,.NET 4.5, Visual Studio 11 Caller Info Attributes Upgrade from synchronous to asynchronous.
Toni Petrina Ekobit d.o.o. Microsoft MVP za Visual C# Budućnost C#-a.
Joe Hummel, the compiler is at your service Chicago Coder Conference, June 2016.
Your Host & Speaker Shahed Chowdhuri Sr. Technical Microsoft Technology Areas Enterprise Web/Software Development Game Development Mobile.
Data in Windows 10 UWP Andy Wigley XML, JSON, SQLite or EF Core ?
Microsoft Ignite /28/2017 2:36 PM
QML and JavaScript for Native App Development Michael Tims Jen Trieu.
61% YoY Growth.NET Active Developers (VS 2012+) 40%.NET Core downloads by new developers 62% GitHub contributions from outside of Microsoft (corefx.
Unleash .NET 2015 in your apps
JavaScript Introduction
.NET Native & CoreRT.
The Universal Windows Platform
The Future of C# The Future of C# and VB 2-577
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
Introducing ASP.NET Core 2.0
CS360 Windows Programming
.NET and .NET Core 9. Towards Higher Order Pan Wuming 2017.
.NET and .NET Core Foot View of .NET Pan Wuming 2017.
C# Today and Tomorrow Mads Torgersen,
1.2 Key Concepts and Walkthroughs
.Net Framework Details Imran Rashid CTO at ManiWeber Technologies.
Developer Productivity: What’s New in C# 6
1. Azure Data Explorer Azure Data Explorer enables rich data exploration over raw, structured, and semi-structured data delivering fast time to insight.
Build /15/2019 © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION.
CS4540 Special Topics in Web Development Introduction to .NET
C# and ASP.NET Programming
Presentation transcript:

Roslyn: el futuro de C# Rodolfo Finochietti rodolfof@lagash.com http://shockbyte.net

Construir un compilador es complejo

Fundamentos de un compilador © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

? Compilador CSC - VBC program.exe class Program { void Main() } } ▫ 4/11/2017 Compilador CSC - VBC ? class Program { void Main() } } ▫ program.exe © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Fases Se pueden agrupar en Front-end: sintaxis == “gramática“ Back-end: semántica == “significado"

Fases

Compiladores en .NET .NET siempre fue una plataforma amigable para la construcción de compiladores Intermediate Language (IL) Stack de Pila Operaciones de alto nivel Optimizaciones de bajo nivel via la plataforma Reflection Emit Tools para construcción de compiladores http://irony.codeplex.com

Demo Reflection Emit

4/11/2017 9:22 AM Roslyn © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Roslyn – .NET Compiler Platform 4/11/2017 Roslyn – .NET Compiler Platform Completa reescritura de los compiladores C# y Visual Basic Open Source Language Services Code Analysis APIs Extensibilidad Read-Eval-Print-Loop (REPL) Scripting © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Azure and Windows Server 4/11/2017 Ecosistema .NET Core .NET Next gen JIT (“RyuJIT”) SIMD Runtime Compilers .NET Compiler Platform (“Roslyn”) Languages innovation Windows Desktop Azure and Windows Server Universal projects .NET Native ASP.NET updates Windows Convergence Native compilation Web apps .NET support for Azure Mobile Services Cloud Services Openness Windows Store iOS and Android .NET in devices and services © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Compiler APIs

Binding and Flow Analysis APIs API Layers Editor Services Code Actions Classification Completion Outlining … Code Formatting Find All References Name Simplification … Services Workspace API Syntax Tree API Symbol API Binding and Flow Analysis APIs Emit API Scripting API Compiler

Syntax Tree API – Nodes class C { void M() } }// C ▫ CompilationUnit 4/11/2017 Syntax Tree API – Nodes class C { void M() } }// C ▫ CompilationUnit TypeDeclaration MethodDeclaration ParameterList Block var tree = CSharpSyntaxTree.ParseText("..."); © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Syntax Tree API – Tokens class C { void M() } }// C ▫ CompilationUnit TypeDeclaration EOF class C { MethodDeclaration } void M ParameterList Block ( ) { }

Syntax Tree API – Trivia class∙C { ∙∙∙∙void∙M() ∙∙∙∙{ ∙∙∙∙} }// C ▫ CompilationUnit TypeDeclaration EOF class SP C EOL { EOL MethodDeclaration } // C EOL SPx4 void SP M ParameterList Block ( ) EOL SPx4 { EOL SPx4 } EOL

Demo Syntax Tree API Symbol API Syntax Transformation Compilation API

Workspace API Host Environment Workspace Solution Solution2 Solutionn Events (e.g. key presses) Apply Workspace Edit Edit Solution Solution2 Solutionn Compilation Project Project Document Document SyntaxTree

Demo Diagnostics and Code Fix

4/11/2017 9:22 AM C# 6 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Primary Constructor Auto-Property Initializer 4/11/2017 Primary Constructor Auto-Property Initializer 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); } © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Exception Filtering try { Task[] tasks = new Task[10]; 4/11/2017 Exception Filtering try { Task[] tasks = new Task[10]; for (int i = 0; i < 10; i++) tasks[i] = Task.Factory.StartNew(() => DoSomeWork(10000000)); } var res = await Task.WhenAll(tasks); catch (AggregateException e) if (e.InnerExceptions.Count > 2) await WriteStatus(“filtered exception"); finally await WriteStatus(“finished"); © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Null propagating operator 4/11/2017 Null propagating operator © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Using static members 4/11/2017 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Lista completa http://goo.gl/4vtQfr 4/11/2017 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Demo C# 6

4/11/2017 9:22 AM ¿Preguntas? © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4/11/2017 Referencias Libros Compilers: Principles, Techniques, and Tools – Aho et all Compiling for the .NET Common Language Runtime (CLR) - John Gough Web http://irony.codeplex.com http://roslyn.codeplex.com © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

¡ Gracias! rodolfof@lagash.com @rodolfof http://shockbyte.net 4/11/2017 9:22 AM ¡ Gracias! rodolfof@lagash.com @rodolfof http://shockbyte.net © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.