Scala.js 1.18.2 Harness the Scala and JavaScript ecosystems together. Develop robust apps for browsers, Node.js, and serverless. Strong typing guarantees your code is free of silly mistakes; no more mixing up strings or numbers, forgetting what keys an object has, or worrying about typos in your method names. Scala.js takes care of all this tedious book-keeping for you, letting you focus on the ac
タイトルで嫌な予感がしてる人もいるでしょうが、ScalaがJSに変換されて動きます。やったぜ。 Scala.js http://www.scala-js.org/ 試す このサンプルプロジェクトを git clone するのが良いです。 sjrd/scala-js-example-app https://github.com/sjrd/scala-js-example-app サンプルコードはこんな感じ package example import scala.scalajs.js import js.Dynamic.{ global => g } object ScalaJSExample { def main(): Unit = { val paragraph = g.document.createElement("p") paragraph.innerHTML = "<strong>
今日は、ScalaのOptionの使い方について解説しますよ。OptionはScala使いにとってはなくてはならないものです。これを覚えてしまうと他の言語でもOptionを作りたくなる、かもしれない? Optionってなに? Option型は、値があるかないか分からない状態を表すものです。「Maybeモナド」とか言ってしまうとアレですがまぁそんなようなものらしいです。 Optionの定義 まずは、Optionの定義から見てみましょう。Option型は、抽象クラスOption[+A]と、Option[A]を継承して値がある場合のSome[+A]型とNoneオブジェクトがあります。 Option - Scala Standard Library API (Scaladoc) 2.10.0-20120530-022829-8d38079ab4 - scala.Option // Optionの抽
140文字 ✕ 2で表すとこんな感じ sbt 0.13.1[info] Compiling 1 Scala source[info] Compiling 7[info] Compiling 84[info] Compiling 240[success] Total time: 259 s 2014-01-10 12:56:08 via web sbt 0.13.2-M1[info] Compiling 1 Scala source[success] Total time: 15 sURL URLAwesome!!! 2014-01-10 12:56:52 via web to @xuwei_k 測定方法は Scalazの、現状の最新のcoreモジュールを使って実験 EphemeralStreamにheadOptionとtailOptionという2つのメソッドを追加するコミットを使用 htt
This document is intended to outline some basic Scala stylistic guidelines which should be followed with more or less fervency. Wherever possible, this guide attempts to detail why a particular style is encouraged and how it relates to other alternatives. As with all style guides, treat this document as a list of rules to be broken. There are certainly times when alternative styles should be prefe
先日アルファ版がローンチされた、Trackrr.ioというIoT/GPSトラッキングプラットフォーム、そのアーキテクチャーと開発話の紹介
Usual Scala compilation never seems fast enough. There are two main reasons why: It takes a lot of time to start Scala compiler and to process standard libraries. Scala compiler doesn’t support selective recompilation. The first problem is solved by FSC (Fast Scala Compiler). FSC runs a compilation daemon to avoid subsequent compiler instantiations (at the price of increased memory usage). However
ScalaSeamless data access for your Scala application — Write Scala code to query your database. Type SafeAll database entities and queries are statically checked at compile-time. Slick is an advanced, comprehensive database access library for Scala with strongly-typed, highly composable APIs. Slick makes it easy to use your database in a way that’s natural to it. It allows you to work with relatio
Welcome to JGlobal Limited, the online home of myself, Michael Nash. I am the Director of Capabilities at Lightbend, Inc. This site and my blog and newsletter is all about what I call Reactive Digital Transformations - that is, organizations changing themselves into a digital organization, but using the reactive principles to do it. I have written and co-authored a few books in the software busine
Latest Release - ScalaTest and Scalactic 3.2.19! import collection.mutable.Stack import org.scalatest._ import flatspec._ import matchers._ class ExampleSpec extends AnyFlatSpec with should.Matchers { "A Stack" should "pop values in last-in-first-out order" in { val stack = new Stack[Int] stack.push(1) stack.push(2) stack.pop() should be (2) stack.pop() should be (1) } it should "throw NoSuchEleme
Sébastien Doeraene @sjrdoeraene Scala Days 2013, June 12th LAMP, lamp.epfl.ch École polytechnique fédérale de Lausanne, Switzerland JavaScript The one and only language of the Web A scripting language, designed for programming in the small How to scale to Rich Internet Applications? JavaScript as a target language Compile a higher-level language to JavaScript GWT, Scala/GWT CoffeeScript, Dart, Typ
ニコニコ超会議 2012の超エンジニアミーティングのScalaユーザーグループのコマで「Scalaでプログラムを作りました」のセッションを行いましたが、右の図はそのスライドで用いたDSLの分類です。 ここでは、DSLを分類する軸として、用途の軸と実現方法の軸を用いています。 用途の軸の項目は以下の2つです。 モデルフレームワークAPI実現方法の軸の項目は以下の2つです。 内部DSL外部DSL一口にDSLといっても2×2で4種類のDSLに分類することができるわけです。各象限には、セッションで取り上げた技術を分類して配置しています。 Scalaは、関数型言語の機能と文法上の工夫で内部DSLの実現に適した言語となっています。またパーサーコンビネータを用いることで外部DSLの実現も簡単に行うことができます。 Scalaの名前の由来である「Scalable Language」は、言語をドメイン向けに
HerokuがJavaに対応*1しました。そこで、Play! frameworkのTutorialで作るブログエンジン、「Yabe」をHerokuで動かしてみました。 Herokuにアプリを作成*2 Herokuにアプリを作成しますが、この時に「--stack」オプションを追加して「cedar」スタックを指定してください。アプリの名前を「yabe-nkmrshn」に変更していますが、これは必須ではありません。 $ heroku create --stack cedar $ heroku apps:rename yabe-nkmrshn次にデータベースを追加。とりあえず無料の共有データベースを指定しました。 $ heroku heroku addons:add shared-databaseそして、conf/application.confで設定するPostgreSQLのURLを取得します。
Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Pekko (Play 3) and Akka (Play 2), Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications. Developer friendly. Make your changes and simply hit refresh! All you need is a browser and a tex
2.0で大幅に拡張されたPlay Framework 本連載の第14回、第15回で「Play Framework」(以下、Play)というJavaアプリケーション開発フレームワークを紹介しました。Playは、Ruby on Railsのように簡単なコマンドだけでMVCスタイルのWebアプリケーションの雛形を構築し、開発をスタートさせることができるフレームワークです。 2012年3月13日、そのPlayの新バージョン「Play framework 2.0」(以下、Play 2.0)がリリースされました。この新バージョンでは、核となるアーキテクチャに大幅な変更が加えられました。主なポイントとしては次のような項目が挙げられています。 JavaおよびScalaのネイティブサポート 強力なビルドシステムの構築 型安全性へのフォーカス 非同期プログラミングのより強力なサポート データストアとモデル
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く