LoginSignup
7
7

More than 5 years have passed since last update.

ScalaMatsuri 2016 参加メモ

Last updated at Posted at 2016-02-02

一行感想

Septeni ミュージックビデオ かっこいい

Scala Matsuri 2016 / Septeni original

三行感想

前回の2014に比べて、関数型の理論的なセッションは元より、
機械学習や非同期ストリーム処理などの業務経験を元にしたセッションが増え、いわゆるビックデータ関連の前線で普及している印象を受けました。
Apache SparkPlay Frameworkなどキラーフレームワークの影響が大きそう。

概要

イベント: ScalaMatsuri 2016
日時: 2016/1/30(土)~31(日)
場所: 国際交流館

1日目

Refactoring in Scala

  • value typesについて
    • type alias
    • tagged type (scalaz), newtype (shapeless)
    • value class: extends AnyVal
      • phantom type
    • prism (Monocle), optic (shapeless)
      • 片方向がOption
      • 外部ライブラリ間の変換処理が纏められる
  • 質疑
    • abstract type memberも選択肢の一つ

Scalaで始めるDeep Learning

猫という考え方

  • Cats
  • triple equal
    • 型が異なるものを比較するとコンパイルエラーになる
  • 圏論について
    • left identity law, right identity law, associative law
    • uniquness of product
    • uniquness of free monoids
  • flatできる型はだいたいモナド

バッチを Akka Streams で再実装したら100倍速くなった話

  • SIでの夜間バッチ処理高速化
  • Akka Streams
    • まだexperimental
  • Railsと比べて295倍

sbt-awsプラグインを使って簡単デプロイ by j5ik2o

ScalaコードはJVMでどのように表現されているのか

  • クラスファイル
    • cafe babe、Javaマイナーバージョン、Javaメジャーバージョン、...
    • (scala) javap: 逆アセンブラ
    • コンスタントプール (#...)
    • JVM has about 200 instructions
      • 後から追加されたのはinvokeDynamicだけ
  • traitはinterfaceとabstract classに分離される
  • case classはかなり大きくなる
  • パターンマッチはif文やcase文になる
  • カリー化は部分適用ごとにクラス生成

Scala.jsのLT by ChatWorkの方

  • Scala.jsを実戦投入中
  • Scala.jsでロジックのみ実装、UIはTypeScriptで実装、ロジックとUIは関数呼びださずJSON通信している

Functional Programming Patterns v3

  • Free of Interpretation : Free Monads
  • Support Parallel Computation : Free Applicatives
  • Composable pieces : Coproducts
  • Dependency Injection / IOC : Implicits & Kleisli
  • Fault tolerant : Dependently typed checked exceptions

Maverick sponsor LT

Playソースコード完全マスターへの道 by tototoshi

  • コードリーディングでは、まずbuild.sbtを読む
    • libraryDependicies
    • dependsOn: マルチプロジェクトの依存
  • https://github.com/tototoshi/play-dependency-graph
    • play-java, play-scalaに分かれた
    • モジュール化がんばった
  • 簡単なDIを採用
    • Constructor-based Dependenc Injection
      • Compile DI
      • Runtime DI: @injectするとGuice...
      • コンストラクタ見れば依存が分かる
  • 型クラス
    • クラス定義の外で機能を追加
    • implicitで省略できる
    • Writable, ContentTypeOf, QueryStringBindable, PathBindable, ...
  • modules
    • play: core module
    • play-jdbc
    • play-json: json4sに置き換えられるかも
    • play-server
    • play-stream

Scalaでドメイン駆動設計に真正面から取り組んだ話

  • Layered Architecture
    • Domain leakつらい
    • モデルとかシーケンス図をホワイトボードで共有
    • too many conversions: ドメイン隔離のためには仕方ない
  • Command and Query Responsibility Segregation: コマンドとクエリを分離
    • クエリは適宜レイヤーをスキップする
    • コマンドはきちんとレイヤー分離
  • 質疑
    • is-a Root Entityのところはクラス設計が変なのでは

2日目

Domain-Specific Languages with Scala

  • External DSL
    • Parser Combinator
  • Internal DSL
    • implicit
    • case class
    • overload
    • 中間記法
    • アノテーション
    • shallow embedding vs deep embedding (Abstract Syntax Treeいじる)
  • NASAの軌道計算で、C External DSLからScala Internal DSLに移行
  • modbat: Model-based teseting

Scalaz入門 by xuwei_kなど

  • オブジェクト指向せずにHaskellライクな型クラスを使うライブラリ
    • subtypingは避ける
  • Scalaz日本語ドキュメント
  • 主要な型クラスの紹介
  • FP in Scalaは一章だけでも読もう
  • 関数型になりきったコードでないとScalaz導入しても意味ない
  • IOは難しい
    • 多要求: 失敗するかも、ブロックしたくない、パフォーマンス出したい……
  • プロダクトコードでよく使うのはFoldableとかMonoid
  • 使いどころが分かりやすいのはValidation
  • contravariantなモナドについて

Japanese Text Mining with Scala and Spark

  • サンプルコード
  • Spark
    • collect()して初めて実行が始まる
    • パフォーマンスの面ではcache()がとても大事
  • LDA
    • 日本語には単語の区切り文字がない
    • JMecab: インストール大変
    • Kuromoji: Mavenにあるので楽
    • 実用ではカスタム辞書が必要になってくる
    • 言葉から数字を作り出す
    • 前処理頑張れば、機械学習の実行コードはたいてい一行!
    • stop word(です、さん)除去のため、全体の上位50単語は取り除いてしまう
    • predictもできるようになった
  • word2vec
    • 言葉の足し引きができる
    • ほとんど事前処理は必要ない、「、」や「。」も意味空間に配置済み
    • なるべく大きなデータセットを用意するべき
    • Paragraph Vectorsがあればレコメンドできるが、Spark未実装
      • 全てのベクトルを足してしまう手法がある
        • まだ数学的な証明はないと思う
7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7