Skip to content

Instantly share code, notes, and snippets.

@Zaidos
Last active December 19, 2015 01:09
Show Gist options
  • Save Zaidos/5873843 to your computer and use it in GitHub Desktop.
Save Zaidos/5873843 to your computer and use it in GitHub Desktop.
GitHub script(cs) meetup

script(cs)

Glenn Block @gblock

Justin Rushbatch @jrusbatch

  • C# on a diet
  • node.js + npm
  • nuget

TODO: Get slides

Links:

Lightweight experience

  • No IDE
  • Any editor will do
  • No project
  • Package manager
  • No namespace, class

Introducing script(cs)

#r "System.Data"
using System.Data;
using System.Foobar; // Roselyn error thrown
#load 'Greeter.csx'
scriptcs .\Greeter.csx
scriptcs -- custom parameters here

Packages in script(cs)

scriptcs --install MongoDb
scriptcs -install // restores everything from packages.config

If packages.config exists, the REPL will autoload all the packages automatically.

Frameworks like Web API and Nancy look for assemblies in the file system, instead of looking in memory.

Everything runs in a single thread by default.

Script packs

  • Add reference assemblies
  • Add using statements
  • Make libraries easier to consume

Script Packs can be loaded from NuGet. Samples:

  • ScriptCs.Contracts
  • ScriptCs.WebApi

Takes care of some of the boiler plate code and friction.

var webApi = Require<WebApi>();
var server = webApi.CreateServer("http://localhost:8080");

Repo Link: https://github.com/scriptcs/scriptcs-samples/tree/master/webapihost

Steps to coding in VS

  • Open VS
  • Open a new project from EXE
  • Add existing csx files
  • Right click EXE -> Properties -> set args, path

Hosting script(cs)

code name: feather

Product roadmap. What's next:

  • Pluggable CLI commands
  • Pluggable REPL commands
  • Hosting for popular frameworks
  • Mono support
  • Script packs as scripts
  • More langauges (F#)
  • VS integration?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment