scriptcs - scripting, hosting and extending
DESCRIPTION
TRANSCRIPT
![Page 1: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/1.jpg)
![Page 2: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/2.jpg)
scriptcs.net
@scriptcsnet www.scriptcs.net
![Page 3: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/3.jpg)
scriptcs.net
@filip_woj github.com/filipw
www.strathweb.com
![Page 4: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/4.jpg)
![Page 5: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/5.jpg)
scriptcs.net
What is scriptcs?
OSS project enabling rich C# scripting experience
Script and execute -or- use REPL
Low ceremony, lightweight
Use your favorite text editor
No compilation/projects/solutions
![Page 6: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/6.jpg)
![Page 7: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/7.jpg)
scriptcs.net
Now C#!
![Page 8: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/8.jpg)
scriptcs.net
![Page 9: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/9.jpg)
scriptcs.net
Key scriptcs features Relaxed C# syntax & code semantics
As defined in “Interactive C#/VB REPL and Script - Code Semantics Spec“ white paper
REPL
Node.js-like extensibility model (script packs)
Debug & step through in Visual Studio
Sublime text plugin
Scriptcs.Core available as a hostable service
Nuget integration
![Page 10: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/10.jpg)
scriptcs.net
Demo: 101
![Page 11: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/11.jpg)
scriptcs.net
Demo: #load & #r
![Page 12: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/12.jpg)
scriptcs.net
Demo: REPL
![Page 13: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/13.jpg)
scriptcs.net
Script code semantics
No top level class
No script namespaces
No Main method
Global functions allowed
Script packs accessible through Require<T>
#load directive to load script from script
#r directive to reference an assembly from script
Modules, assemblies loaded automatically/by convention
![Page 14: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/14.jpg)
![Page 15: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/15.jpg)
![Page 16: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/16.jpg)
scriptcs.net
Typical C# experience
Need access to source code base
Start Visual Studio (...wait...)
Choose VS project template
Create new solution
Add references, install Nuget packages, import namespaces
Compile and run (repeat: compile+run)
Difficult to distribute code (bloated)
![Page 17: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/17.jpg)
![Page 18: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/18.jpg)
scriptcs.net
![Page 19: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/19.jpg)
scriptcs.net
Typical scriptcs experience
Install Nuget packages with “scriptcs –install”
Write code in any text editor
Run (edit & run)
Easy to distribute code (just CSX + packages.config)
![Page 20: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/20.jpg)
![Page 21: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/21.jpg)
![Page 22: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/22.jpg)
![Page 23: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/23.jpg)
scriptcs.net
Extend scriptcs
Script packs Expose functionality for scripts
Modules Customize scriptcs
Replace any scriptcs internals
![Page 24: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/24.jpg)
scriptcs.net
Demo: Script packs in action
![Page 25: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/25.jpg)
scriptcs.net
Demo: Web REPL module
![Page 26: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/26.jpg)
scriptcs.net
Demo: Hosting in a .NET app
![Page 27: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/27.jpg)
scriptcs.net
Demo: Mono module
![Page 28: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/28.jpg)
scriptcs.net
Demo: Writing a new scripting engine
![Page 29: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/29.jpg)
scriptcs.net
Interesting developments
ConfigR – write C# config files in... C#
Executify.net – execute C# snippets in the browser
scriptcs F# Engine by Dave Thomas / Ryan Riley
Bau – build system powered by scriptcs
scriptcs WebConsole / Glimpse.scriptcs
scriptcs PowerShell module by Jim Christopher
scriptcs support in OctopusDeploy
scriptcs in [NDA]
![Page 30: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/30.jpg)
![Page 31: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/31.jpg)
scriptcs.net
Get scriptcs
v0.8
CLI distributed via Chocolatey cinst scriptcs
Libs available on Nuget
Nightly builds on MyGet
Build from source github.com/scriptcs
![Page 32: scriptcs - scripting, hosting and extending](https://reader035.vdocuments.net/reader035/viewer/2022062319/553b46904a7959d9368b4688/html5/thumbnails/32.jpg)
scriptcs.net
Who is scriptcs?
Community (!)
Coordinators Glenn Block (@glennblock)
Justin Rusbatch (@jrusbatch)
Filip Wojcieszyn (@filip_woj)
Core Commiters Damian Schenkelman (@dschenkelman)
Kristian Hellang (@khellang)