a unix view of

a craftsman’s toolbox

or…

a recipe for

command-line comradery

@softprops
holy SH!#, I
love conscript

I am not the fresh prince of < /dev/tty

But I do have a thing for
  • scala
  • simplicity
  • grassy meadows

platforms

the `cloud`

ios

android

unix _

(we have a lot in common)

composition over

everything

|

$ foo | bar | baz
scala> foo andThen bar andThen baz

one man's out is another man's in
another man's in is some other man's out

#!/bin/sh

echo ”…but geeeez Doug,“

echo “isn’t that what $SHELL is for?“

exit 1

WORA borealis

but really,
happy developers are
productive developers

$ cs _

once apon a time...

sbt

sbt

  • is a pretty sweet REPL
  • is extendable
  • what you make of it
  • a medly of well-written libraries that play nice

s(imple) b(uild) t(ool)

process of invention

1) find the pieces

2) connect them


3) share

n8

Could anyone really have ideas without this guy?
libraryDependencies <+= (sbtVersion)(
  "org.scala-tools.sbt" %
   "launcher-interface_2.9.1" %
    _ % "provided")

launcher

  • resolves and caches dependencies into a boot directory
  • resolves and launches an application’s "main" class
  • awaits an Exit status
$ g8 unfiltered/unfiltered.g8 --name=helloworld
Applied unfiltered/unfiltered.g8 in helloworld

launcher +

launchconfig +

github

g8 -> cs

cs n8han/giter8

cs is

  • an installer for scala apps
  • a recipe for distributing scala apps
  • way, way underhyped+

+ I stole ideas from cs and herald and rolled them into ls

cs is not

  • a scripting language
  • a compiler for the next javascript
  • complicated

tools ⚒

  • ✔ minimal
  • ✔ easy to install
  • ✔ easy to publish
  • ✔ fun to hack on

we need (I want) better tools

tools we

use every day

git

distributed time machine for text

ack

way better then grep

sbt

way better than _

avoid complicated tools

write simplier ones

cs app store is github

g8

github hosted templates (for anything)

cs n8han/giter8

src

herald

hear ‘ye, hear ‘ye changelogs

cs n8han/herald

src

up

instant http serving

cs softprops/unplanned

src

pj

sending json through a salon

cs softprops/pj

src

pshow

you’re looking at it

cs softprops/picture-show

src

???

some pretty rad sh*t

cs you/rad

(coming soon)

cs -l

distribution

cs <user>/<repo>

how to bake a conscript
in 3 easy steps
one: AppMain

libraryDependencies <+= (sbtVersion)(
  "org.scala-tools.sbt" %
  "launcher-interface_2.9.1" %
   _ % "provided")
import xsbt.{ AppMain, AppConfiguration, Exit }

trait AppMain {
  def run(con: AppConfiguration): Exit
}
import xsbti.{ ApplicationConfiguration, AppMain } class Even extends AppMain { case class Exit(val code: Int) extends xsbti.Exit def main(con: ApplicationConfiguration) = Exit(Even.run(con.arguments)) } object Even { def main(args: Array[String]) = println(run(args)) def run(args: Array[String]) = if(args.size % 2 == 0) 0 else 1 }
import xsbti.{ ApplicationConfiguration, AppMain } class Even extends AppMain { case class Exit(val code: Int) extends xsbti.Exit def main(con: ApplicationConfiguration) = Exit(Even.run(con.arguments)) } object Even { def main(args: Array[String]) = println(run(args)) def run(args: Array[String]) = if(args.size % 2 == 0) 0 else 1 }
two: launchconfig(s)

# a & b are script names

src/main/conscript/{a,b}/launchconfig

post script

~/.conscript/user/repo/{a,b}/launchconfig

launchconfig?

kind of like .git/config, but for scala apps

$ cat launchconfig
[app]
  version: 0.1.0
  org:  beep
  name: boop
  class: beep.Boop <- your main class
[scala]
  version: 2.9.1
[repositories]
  local
  maven-central <- these are resolver aliases (sbt defined)
  lessis:http://repo.lessis.me <- this is a new alias
three: deploy

git push

explore

your

ideas