SlideShare une entreprise Scribd logo
1  sur  18
C# Scripting
with Project Roslyn
BASTA! Spring 2014

Rainer Stropek
software architects gmbh

C# Scripting

Web http://www.timecockpit.com
Mail rainer@timecockpit.com
Twitter @rstropek

with Project Roslyn

Saves the day.
Why Scripting?
 Typical

use cases

Automate routine jobs (macros)
Interfaces
Installation, maintenance, updates
Prototyping
Software factories

 Advantages

Possibility to customize and extend at the customer site  business opportunity
No complex prerequisites (e.g. Visual Studio), just a text editor
REPL and dynamic scripting is efficient in certain situations
Why Scripting?
Software Factory
Projekt A

Projekt B

Custom Code

Custom Code

Base Class Library
Why Scripting?
Software Factory
Projekt A

Projekt B

Model, Extensions, Configuration, Scripts

Custom
Component

Custom
Component

Model, Extensions, Configuration, Scripts

Common Components

Base Class Library

Custom
Component

Custom
Component
Why Scripting?
Software Factory
 Use

classical .NET/C# for building the foundation

 Use

scripting as the „glue“ between the building blocks

Class libraries and APIs
Complex business logic
Domain-specific libraries

Combine existing components to working solutions using scripts
Keep simple programs simple by executing text-based code assets
Scripting with .NET
 Dynamic

Language Runtime (DLR)

E.g. IronPython (nuget)

 JavaScript

based on Google‘s V8

E.g. ClearScript (nuget), V8.NET, Javascript.NET, …
Embedded browser (e.g. Chromium Embedded Framework (CEF), Awesomium, etc.)

 C#

or VB Scripting with Project Roslyn

Roslyn home
Roslyn scripting specs
Scripting with .NET




DLR with IronPython

Part of .NET for quite a while
Very good .NET integration
Access to entire .NET framework
Open source with active community
Production-level quality
Simple programming model
Language is platform-independent
Open source, future?

JavaScript with V8

Compatibility to browsers and server (nodejs)
Not core part of .NET
Weaker .NET integration



C# and VB Scripting

Not production yet
The programming language you know and
love
Naturally very good .NET integration
Powerful programming model (entire C#
compiler pipeline)
Dynamic programming (dynamic keyword)
currently not supported
Getting Started
Add nuget package
Roslyn.Compilers.CSharp
Roslyn.Scripting.CSharp.ScriptEngine
 Store

a set of assembly references and imported
namespaces

ScriptEngine.AddReference
ScriptEngine.ImportNamespace

 You

can create multiple engine instances in an AppDomain
Script Engine
Setting up the basics

Demo
Roslyn.Scripting.Session
 Created

based on an engine

ScriptEngine.CreateSession
References and Namespaces copied from engine when session is created

 Add

assembly references and imported namespaces to the
ones defined on engine-level

Session.AddReference
Session.ImportNamespace

 Represents

a cumulative execution context

E.g. define function in one code snippet, use it in the second snippet
Script Session
Setting up the basics

Demo
Roslyn.Scripting.Session
 Executing

scripts

Session.Execute  returns object
Session.Execute<T>  returns T
Session.ExecuteFile

 Host

Object

Script host’s object model (e.g. dedicated scripting API)
Parameter to ScriptEngine.CreateSession
Top-level identifiers are bound to the host object

 Returning

Delegates

With Session.Execute<Func<…>>(…) you can return a delegate (lambda or function)
Script Session
Having fun with scripting…

Demo
BASTA! Spring 2014

Rainer Stropek
software architects gmbh

Q&A

Mail rainer@timecockpit.com
Web http://www.timecockpit.com
Twitter @rstropek

Thank your for coming!
Saves the day.
is the leading time tracking solution for knowledge workers.
Graphical time tracking calendar, automatic tracking of your work using
signal trackers, high level of extensibility and customizability, full support to
work offline, and SaaS deployment model make it the optimal choice
especially in the IT consulting business.
Try
for free and without any risk. You can get your trial account
at http://www.timecockpit.com. After the trial period you can use
for only 0,20€ per user and month without a minimal subscription time and
day without a minimal subscription time and
without a minimal number of users.
ist die führende Projektzeiterfassung für Knowledge Worker.
Grafischer Zeitbuchungskalender, automatische Tätigkeitsaufzeichnung über
Signal Tracker, umfassende Erweiterbarkeit und Anpassbarkeit, volle
Offlinefähigkeit und einfachste Verwendung durch SaaS machen es zur
Optimalen Lösung auch speziell im IT-Umfeld.
Probieren Sie
kostenlos und ohne Risiko einfach aus. Einen
Testzugang erhalten Sie unter http://www.timecockpit.com. Danach nutzen
Sie
um nur 0,20€ pro Benutzer und Tag ohne Mindestdauer
und ohne Mindestbenutzeranzahl.

Contenu connexe

Tendances

Importing Code and Existing Containers to OpenShift - Minneapolis Docker Meet...
Importing Code and Existing Containers to OpenShift - Minneapolis Docker Meet...Importing Code and Existing Containers to OpenShift - Minneapolis Docker Meet...
Importing Code and Existing Containers to OpenShift - Minneapolis Docker Meet...Keith Resar
 
Case Study: Integration Automation Create Delightful API Docs
Case Study: Integration Automation Create Delightful API DocsCase Study: Integration Automation Create Delightful API Docs
Case Study: Integration Automation Create Delightful API DocsPronovix
 
scriptcs - scripted C#, REPL and script extensibility
scriptcs - scripted C#, REPL and script extensibilityscriptcs - scripted C#, REPL and script extensibility
scriptcs - scripted C#, REPL and script extensibilityFilip W
 
Frail & Cast Iron tools - a Postman Case Study
Frail & Cast Iron tools - a Postman Case StudyFrail & Cast Iron tools - a Postman Case Study
Frail & Cast Iron tools - a Postman Case StudyPostman
 
GitHub as a Landing Page
GitHub as a Landing Page GitHub as a Landing Page
GitHub as a Landing Page Pronovix
 
OSCON 2012: ql.io and Node.js
OSCON 2012: ql.io and Node.jsOSCON 2012: ql.io and Node.js
OSCON 2012: ql.io and Node.jsJonathan LeBlanc
 
Designing Auto Generated Codes
Designing Auto Generated CodesDesigning Auto Generated Codes
Designing Auto Generated CodesHiroshi Kikuchi
 
Rescale New Feature: Bring Your Own VPC
Rescale New Feature: Bring Your Own VPCRescale New Feature: Bring Your Own VPC
Rescale New Feature: Bring Your Own VPCTakahisa Shiratori
 
X-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackX-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackHaufe-Lexware GmbH & Co KG
 
Building Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsBuilding Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsPostman
 
Deploying R for Production - SRUG
Deploying R for Production - SRUGDeploying R for Production - SRUG
Deploying R for Production - SRUGHolger Hellebro
 
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservicesDaniel Fisher
 
Serverless Containers
Serverless ContainersServerless Containers
Serverless ContainersNilesh Gule
 
Eclipse 2011 Hot Topics
Eclipse 2011 Hot TopicsEclipse 2011 Hot Topics
Eclipse 2011 Hot TopicsLars Vogel
 
What's coming in c# 9.0
What's coming in c# 9.0What's coming in c# 9.0
What's coming in c# 9.0Moaid Hathot
 
IBM Bootcamp - Text to Speech API Lab
IBM Bootcamp - Text to Speech API LabIBM Bootcamp - Text to Speech API Lab
IBM Bootcamp - Text to Speech API LabColin McCabe
 
What's Coming in C# 9.0
What's Coming in C# 9.0What's Coming in C# 9.0
What's Coming in C# 9.0Moaid Hathot
 
Kubernetes Operators - the next frontier in application automation - Ádám Sándor
Kubernetes Operators - the next frontier in application automation - Ádám SándorKubernetes Operators - the next frontier in application automation - Ádám Sándor
Kubernetes Operators - the next frontier in application automation - Ádám SándorPROIDEA
 
Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019Haufe-Lexware GmbH & Co KG
 

Tendances (20)

Importing Code and Existing Containers to OpenShift - Minneapolis Docker Meet...
Importing Code and Existing Containers to OpenShift - Minneapolis Docker Meet...Importing Code and Existing Containers to OpenShift - Minneapolis Docker Meet...
Importing Code and Existing Containers to OpenShift - Minneapolis Docker Meet...
 
Case Study: Integration Automation Create Delightful API Docs
Case Study: Integration Automation Create Delightful API DocsCase Study: Integration Automation Create Delightful API Docs
Case Study: Integration Automation Create Delightful API Docs
 
scriptcs - scripted C#, REPL and script extensibility
scriptcs - scripted C#, REPL and script extensibilityscriptcs - scripted C#, REPL and script extensibility
scriptcs - scripted C#, REPL and script extensibility
 
server side Swift
server side Swift server side Swift
server side Swift
 
Frail & Cast Iron tools - a Postman Case Study
Frail & Cast Iron tools - a Postman Case StudyFrail & Cast Iron tools - a Postman Case Study
Frail & Cast Iron tools - a Postman Case Study
 
GitHub as a Landing Page
GitHub as a Landing Page GitHub as a Landing Page
GitHub as a Landing Page
 
OSCON 2012: ql.io and Node.js
OSCON 2012: ql.io and Node.jsOSCON 2012: ql.io and Node.js
OSCON 2012: ql.io and Node.js
 
Designing Auto Generated Codes
Designing Auto Generated CodesDesigning Auto Generated Codes
Designing Auto Generated Codes
 
Rescale New Feature: Bring Your Own VPC
Rescale New Feature: Bring Your Own VPCRescale New Feature: Bring Your Own VPC
Rescale New Feature: Bring Your Own VPC
 
X-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackX-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN Stack
 
Building Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsBuilding Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIs
 
Deploying R for Production - SRUG
Deploying R for Production - SRUGDeploying R for Production - SRUG
Deploying R for Production - SRUG
 
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
 
Serverless Containers
Serverless ContainersServerless Containers
Serverless Containers
 
Eclipse 2011 Hot Topics
Eclipse 2011 Hot TopicsEclipse 2011 Hot Topics
Eclipse 2011 Hot Topics
 
What's coming in c# 9.0
What's coming in c# 9.0What's coming in c# 9.0
What's coming in c# 9.0
 
IBM Bootcamp - Text to Speech API Lab
IBM Bootcamp - Text to Speech API LabIBM Bootcamp - Text to Speech API Lab
IBM Bootcamp - Text to Speech API Lab
 
What's Coming in C# 9.0
What's Coming in C# 9.0What's Coming in C# 9.0
What's Coming in C# 9.0
 
Kubernetes Operators - the next frontier in application automation - Ádám Sándor
Kubernetes Operators - the next frontier in application automation - Ádám SándorKubernetes Operators - the next frontier in application automation - Ádám Sándor
Kubernetes Operators - the next frontier in application automation - Ádám Sándor
 
Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019
 

En vedette

UI Configuration in CoFX
UI Configuration in CoFXUI Configuration in CoFX
UI Configuration in CoFXRainer Stropek
 
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...Rainer Stropek
 
Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Rainer Stropek
 
SQL Server Reporting Services Training
SQL Server Reporting Services TrainingSQL Server Reporting Services Training
SQL Server Reporting Services TrainingRainer Stropek
 
Catching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows AzureCatching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows AzureRainer Stropek
 
NRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile ProjectsNRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile ProjectsRainer Stropek
 
Workshop: Modularization of .NET Applications
Workshop: Modularization of .NET ApplicationsWorkshop: Modularization of .NET Applications
Workshop: Modularization of .NET ApplicationsRainer Stropek
 
Whats New for WPF in .NET 4.5
Whats New for WPF in .NET 4.5Whats New for WPF in .NET 4.5
Whats New for WPF in .NET 4.5Rainer Stropek
 
Workshop: .NET Code Contracts
Workshop: .NET Code ContractsWorkshop: .NET Code Contracts
Workshop: .NET Code ContractsRainer Stropek
 
High Quality C# - Codequality in Practice
High Quality C# - Codequality in PracticeHigh Quality C# - Codequality in Practice
High Quality C# - Codequality in PracticeRainer Stropek
 
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureDeveloping Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureRainer Stropek
 
BASTA 2013: Custom OData Provider
BASTA 2013: Custom OData ProviderBASTA 2013: Custom OData Provider
BASTA 2013: Custom OData ProviderRainer Stropek
 
Schema presentation
Schema presentationSchema presentation
Schema presentationl.t.j
 
Business Model Generation Patterns
Business Model Generation PatternsBusiness Model Generation Patterns
Business Model Generation PatternsAkiliKing
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesRainer Stropek
 

En vedette (16)

UI Configuration in CoFX
UI Configuration in CoFXUI Configuration in CoFX
UI Configuration in CoFX
 
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
 
Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#
 
SQL Server Reporting Services Training
SQL Server Reporting Services TrainingSQL Server Reporting Services Training
SQL Server Reporting Services Training
 
Catching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows AzureCatching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows Azure
 
NRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile ProjectsNRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile Projects
 
Workshop: Modularization of .NET Applications
Workshop: Modularization of .NET ApplicationsWorkshop: Modularization of .NET Applications
Workshop: Modularization of .NET Applications
 
Whats New for WPF in .NET 4.5
Whats New for WPF in .NET 4.5Whats New for WPF in .NET 4.5
Whats New for WPF in .NET 4.5
 
Workshop: .NET Code Contracts
Workshop: .NET Code ContractsWorkshop: .NET Code Contracts
Workshop: .NET Code Contracts
 
High Quality C# - Codequality in Practice
High Quality C# - Codequality in PracticeHigh Quality C# - Codequality in Practice
High Quality C# - Codequality in Practice
 
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureDeveloping Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
 
BASTA 2013: Custom OData Provider
BASTA 2013: Custom OData ProviderBASTA 2013: Custom OData Provider
BASTA 2013: Custom OData Provider
 
Portafolio andrés rodriguez
Portafolio andrés rodriguezPortafolio andrés rodriguez
Portafolio andrés rodriguez
 
Schema presentation
Schema presentationSchema presentation
Schema presentation
 
Business Model Generation Patterns
Business Model Generation PatternsBusiness Model Generation Patterns
Business Model Generation Patterns
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
 

Similaire à C# Scripting with Microsoft's Project Roslyn

The Larch - a visual interactive programming environment
The Larch - a visual interactive programming environmentThe Larch - a visual interactive programming environment
The Larch - a visual interactive programming environmentPython Ireland
 
Spring.Net, Feb 2008, PostSharp: A Technical Introduction
Spring.Net, Feb 2008, PostSharp:  A Technical IntroductionSpring.Net, Feb 2008, PostSharp:  A Technical Introduction
Spring.Net, Feb 2008, PostSharp: A Technical Introductiongfraiteur
 
scriptcs - scripting, hosting and extending
scriptcs - scripting, hosting and extendingscriptcs - scripting, hosting and extending
scriptcs - scripting, hosting and extendingFilip W
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldAmazon Web Services
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programmingmaznabili
 
What’s New for Devs
What’s New for DevsWhat’s New for Devs
What’s New for DevsMicrosoftFeed
 
Heterogeneous Development With RTC - Sreerupa Sen
Heterogeneous Development With RTC -  Sreerupa SenHeterogeneous Development With RTC -  Sreerupa Sen
Heterogeneous Development With RTC - Sreerupa SenRoopa Nadkarni
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGiPaul Bakker
 
ASPNET for PHP Developers
ASPNET for PHP DevelopersASPNET for PHP Developers
ASPNET for PHP DevelopersWes Yanaga
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressGeorge Kanellopoulos
 
Zero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessZero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessDavalen LLC
 
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana MandziukFwdays
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersDave Bost
 
Build 2017 - B8083 - The future of Visual Studio
Build 2017 - B8083 - The future of Visual StudioBuild 2017 - B8083 - The future of Visual Studio
Build 2017 - B8083 - The future of Visual StudioWindows Developer
 
Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017Mark Tabladillo
 
I T Mentors V S2008 Onramp240 V1
I T Mentors  V S2008  Onramp240 V1I T Mentors  V S2008  Onramp240 V1
I T Mentors V S2008 Onramp240 V1llangit
 

Similaire à C# Scripting with Microsoft's Project Roslyn (20)

The Larch - a visual interactive programming environment
The Larch - a visual interactive programming environmentThe Larch - a visual interactive programming environment
The Larch - a visual interactive programming environment
 
Visual studio 2019 launch
Visual studio 2019 launch Visual studio 2019 launch
Visual studio 2019 launch
 
Spring.Net, Feb 2008, PostSharp: A Technical Introduction
Spring.Net, Feb 2008, PostSharp:  A Technical IntroductionSpring.Net, Feb 2008, PostSharp:  A Technical Introduction
Spring.Net, Feb 2008, PostSharp: A Technical Introduction
 
scriptcs - scripting, hosting and extending
scriptcs - scripting, hosting and extendingscriptcs - scripting, hosting and extending
scriptcs - scripting, hosting and extending
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programming
 
What’s New for Devs
What’s New for DevsWhat’s New for Devs
What’s New for Devs
 
Heterogeneous Development With RTC - Sreerupa Sen
Heterogeneous Development With RTC -  Sreerupa SenHeterogeneous Development With RTC -  Sreerupa Sen
Heterogeneous Development With RTC - Sreerupa Sen
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGi
 
Rupie asp.net
Rupie asp.netRupie asp.net
Rupie asp.net
 
ASPNET for PHP Developers
ASPNET for PHP DevelopersASPNET for PHP Developers
ASPNET for PHP Developers
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy Wordress
 
Introduction to Programming Lesson 01
Introduction to Programming Lesson 01Introduction to Programming Lesson 01
Introduction to Programming Lesson 01
 
Zero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessZero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or less
 
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
 
Build 2017 - B8083 - The future of Visual Studio
Build 2017 - B8083 - The future of Visual StudioBuild 2017 - B8083 - The future of Visual Studio
Build 2017 - B8083 - The future of Visual Studio
 
Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017
 
I T Mentors V S2008 Onramp240 V1
I T Mentors  V S2008  Onramp240 V1I T Mentors  V S2008  Onramp240 V1
I T Mentors V S2008 Onramp240 V1
 
Polymer
PolymerPolymer
Polymer
 

Dernier

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

C# Scripting with Microsoft's Project Roslyn

  • 2. BASTA! Spring 2014 Rainer Stropek software architects gmbh C# Scripting Web http://www.timecockpit.com Mail rainer@timecockpit.com Twitter @rstropek with Project Roslyn Saves the day.
  • 3. Why Scripting?  Typical use cases Automate routine jobs (macros) Interfaces Installation, maintenance, updates Prototyping Software factories  Advantages Possibility to customize and extend at the customer site  business opportunity No complex prerequisites (e.g. Visual Studio), just a text editor REPL and dynamic scripting is efficient in certain situations
  • 4. Why Scripting? Software Factory Projekt A Projekt B Custom Code Custom Code Base Class Library
  • 5. Why Scripting? Software Factory Projekt A Projekt B Model, Extensions, Configuration, Scripts Custom Component Custom Component Model, Extensions, Configuration, Scripts Common Components Base Class Library Custom Component Custom Component
  • 6. Why Scripting? Software Factory  Use classical .NET/C# for building the foundation  Use scripting as the „glue“ between the building blocks Class libraries and APIs Complex business logic Domain-specific libraries Combine existing components to working solutions using scripts Keep simple programs simple by executing text-based code assets
  • 7. Scripting with .NET  Dynamic Language Runtime (DLR) E.g. IronPython (nuget)  JavaScript based on Google‘s V8 E.g. ClearScript (nuget), V8.NET, Javascript.NET, … Embedded browser (e.g. Chromium Embedded Framework (CEF), Awesomium, etc.)  C# or VB Scripting with Project Roslyn Roslyn home Roslyn scripting specs
  • 8. Scripting with .NET   DLR with IronPython Part of .NET for quite a while Very good .NET integration Access to entire .NET framework Open source with active community Production-level quality Simple programming model Language is platform-independent Open source, future? JavaScript with V8 Compatibility to browsers and server (nodejs) Not core part of .NET Weaker .NET integration  C# and VB Scripting Not production yet The programming language you know and love Naturally very good .NET integration Powerful programming model (entire C# compiler pipeline) Dynamic programming (dynamic keyword) currently not supported
  • 9. Getting Started Add nuget package Roslyn.Compilers.CSharp
  • 10. Roslyn.Scripting.CSharp.ScriptEngine  Store a set of assembly references and imported namespaces ScriptEngine.AddReference ScriptEngine.ImportNamespace  You can create multiple engine instances in an AppDomain
  • 11. Script Engine Setting up the basics Demo
  • 12. Roslyn.Scripting.Session  Created based on an engine ScriptEngine.CreateSession References and Namespaces copied from engine when session is created  Add assembly references and imported namespaces to the ones defined on engine-level Session.AddReference Session.ImportNamespace  Represents a cumulative execution context E.g. define function in one code snippet, use it in the second snippet
  • 13. Script Session Setting up the basics Demo
  • 14. Roslyn.Scripting.Session  Executing scripts Session.Execute  returns object Session.Execute<T>  returns T Session.ExecuteFile  Host Object Script host’s object model (e.g. dedicated scripting API) Parameter to ScriptEngine.CreateSession Top-level identifiers are bound to the host object  Returning Delegates With Session.Execute<Func<…>>(…) you can return a delegate (lambda or function)
  • 15. Script Session Having fun with scripting… Demo
  • 16. BASTA! Spring 2014 Rainer Stropek software architects gmbh Q&A Mail rainer@timecockpit.com Web http://www.timecockpit.com Twitter @rstropek Thank your for coming! Saves the day.
  • 17. is the leading time tracking solution for knowledge workers. Graphical time tracking calendar, automatic tracking of your work using signal trackers, high level of extensibility and customizability, full support to work offline, and SaaS deployment model make it the optimal choice especially in the IT consulting business. Try for free and without any risk. You can get your trial account at http://www.timecockpit.com. After the trial period you can use for only 0,20€ per user and month without a minimal subscription time and day without a minimal subscription time and without a minimal number of users.
  • 18. ist die führende Projektzeiterfassung für Knowledge Worker. Grafischer Zeitbuchungskalender, automatische Tätigkeitsaufzeichnung über Signal Tracker, umfassende Erweiterbarkeit und Anpassbarkeit, volle Offlinefähigkeit und einfachste Verwendung durch SaaS machen es zur Optimalen Lösung auch speziell im IT-Umfeld. Probieren Sie kostenlos und ohne Risiko einfach aus. Einen Testzugang erhalten Sie unter http://www.timecockpit.com. Danach nutzen Sie um nur 0,20€ pro Benutzer und Tag ohne Mindestdauer und ohne Mindestbenutzeranzahl.