More Related Content
Similar to Scala Bot for Small Business
Similar to Scala Bot for Small Business (20)
Scala Bot for Small Business
- 2. Who Am I?
藍永倫 @yllan
Working at Hypo (http://hypo.cc)
しもおし
Scala 下忍(⾃自称)
- 5. Scala:
Scalable Language
Able to be changed in size or scale.
拡大縮小が可能なさま。拡張性があるさま。
- 19. Cons for scala scripting
Slow compile
scala -savecompiled script.scala
- 20. Cons for scala scripting
Slow compile
scala -savecompiled script.scala
Hard to memorize classpath
- 21. Cons for scala scripting
Slow compile
scala -savecompiled script.scala
Hard to memorize classpath
JVM boot overhead
- 22. Cons for scala scripting
Slow compile
scala -savecompiled script.scala
Hard to memorize classpath
JVM boot overhead
nailgun? Hmmm
- 23. Cons for scala scripting
Slow compile
scala -savecompiled script.scala
Hard to memorize classpath
JVM boot overhead
nailgun? Hmmm
Default I/O library
- 24. Recommended lib
rapture.io (http://rapture.io)
File / "home" / "work" / "contents" >
Socket("localhost", Services.Tcp.telnet)
dispatch (http://dispatch.databinder.net/)
val svc = url("http://hostip.info/country.php")
val country = Http(svc OK as.String)
- 25. TIPS
Scala REPL comes to rescue!
:cp - add a jar/dir to classpath
:load - load a scala file
:sh
scala> :sh find . -name *.m
res0: s.t.n.i.ProcessResult = `find . -name *.m` (23
lines, exit 0)
scala> res0.exitCode
res1: Int = 0
scala> res0.lines
res2: List[String] = List(...)
import scala.sys.process._
- 43. IM
XMPP
AIM
Google Talk
Facebook Messenger
Smack Library (http://www.igniterealtime.org/
projects/smack/)