scriptcs.net
@scriptcsnet www.scriptcs.net
scriptcs.net
@filip_woj github.com/filipw
www.strathweb.com
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
scriptcs.net
Now C#!
scriptcs.net
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
scriptcs.net
Demo: 101
scriptcs.net
Demo: #load & #r
scriptcs.net
Demo: REPL
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
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)
scriptcs.net
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)
scriptcs.net
Extend scriptcs
Script packs Expose functionality for scripts
Modules Customize scriptcs
Replace any scriptcs internals
scriptcs.net
Demo: Script packs in action
scriptcs.net
Demo: Web REPL module
scriptcs.net
Demo: Hosting in a .NET app
scriptcs.net
Demo: Mono module
scriptcs.net
Demo: Writing a new scripting engine
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]
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
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)