We have a Scala Room!
What follows is the stream-of-conciousness and research that lead up to our newest sample room!
tl;dr
Day 0
So for me 2017/18 is going to include adventures in polyglot.
This will include but will not be only restricted to
Kotlin
,Prolog
,Erlang
,Racket
,Haskell
,Closure
,Scala
Day 1
Decide on tooling.
- scala is the language.
- sbt is the build tool.
- giter8 to set up starter directories.
- play is the Websocket Framework.
- ensime is the plugin for emacs.
play
has a web socket apigiter8
has a starter template forplay
.
ensime
looks fun as a development environment.
Learn to stop hating and love regexes
|
|
Day 2
- Learn about how the play framework works with json
- Add some code to parse the (roomHello|roomJoin) message and reply correctly.
- commit
Day 3
- add websocket chat response
- commit
Day 4
- hack up some room replies when home late after midnight
- commit
Day 5
- tidy up a bit, make the code space a bit more cozy
- commit
- commit
- start working on “room is running page”, which leads to having to understand
- the javascript security settings for play
- and also more specifically content security policy
- and also
- realise that you need bootstrap to make it look decent
- using bootstrap, make a your room is running page with test buttons, to test web socket calls.
- commit
Day 6
ooh, its getting addictive to play with the bootstrap
- make it possible to edit preformed test message, or send arbritary message in the tests provided on the page.
- commit
- learn that in bootstratp 1 == 12 so that the room test screen flows responsively.
Day 7
stay up until 3am refactoring code unrelated to this, but in Scala. So all the ensime skillz gained were useful, and got to use partial functions and currying. w00t!
Day 8
oops… fix repo name from sample-scala-room
to sample-room-scala
- enter the whale which has its own native sbt plugin.
- add a secret to conf, using well something from here, not that secret if its in github though, is it? also allow the app to run on any host. also allow web socket calls on any host.
- woohoo and we have docker for the room.. so simple, no docker files. Yay!
- so room is now running locally, and test screen works.. almost ready to publish image to clouds and connect up to gameon!
- commit
|
|
Day 9
- add license
- upload image to dockerhub : ilanpillemer/sample-scala-room
- install bluemix command line
- copy image from docker hub to bluemix
- still have one more ip address available on free tier at blue mix, so use that and start container
- though no more free ones left now… :(
- http://134.168.52.95:9000/ is up and running…
- register room in gameon!
- go to room and see it working. (roomid: 3a4fb6dee190696852882ba3e78921a4)
- add the proforma stuff to the README
- job done