traveling through the 4th dimension with sbt 0.13

in

Warning: This is a memo about sbt for intermediate users.

setting system

At the heart of sbt 0.13 is the setting system, just like sbt 0.12. Let's look at Settings.scala:

trait Init[Scope] {
  ...
 
  final case class ScopedKey[T](
    scope: Scope,
    key: AttributeKey[T]) extends KeyedInitialize[T] {
    ...
  }
 
  sealed trait Initialize[T] {
    def dependencies: Seq[ScopedKey[_]]
    def evaluate(map: Settings[Scope]): T
    ...
  }
 
  sealed class Setting[T] private[Init](
    val key: ScopedKey[T], 
    val init: Initialize[T], 
    val pos: SourcePosition) extends SettingsDefinition {
    ...
  }
}

If we ignore pos for now, a setting of T consists of the lhs key whose type is ScopedKey[T], and the rhs init whose type is Initialize[T].

tetrix in Scala, an html5 book

I rebuilt tetrix in Scala series that I wrote last year into an html5 book using @n8han's Pamflet. I went through the git history commit by commit and upgraded the libraries and toolset to the state of the art as of 2013. This means multi-project build.sbt using sbt 0.13.0, Scala 2.10.2, every specs2 specs interpolated, and Akka 2.2.1 loaded on Android using pfn/android-sdk-plugin 1.0.6.

In addition, an extra day 13 was added for debugging and tuning up tetrix on Android.

what is object-oriented programming?

How do you define oop?

purely object-oriented programming

Purely object-oriented programming is defined to be:

programming with objects.

What's an object?

It is an atom that can hold references to other objects, receive predefined list of messages, and send messages to other objects and itself; and nothing else. A message consists of a name and a list of reference to objects.

This is it. The wording is mine, but the idea is from Alan Kay (2003), the guy who coined the term object-oriented programming. Anything else is either not directly tied to oop or an implementation detail.

sbt-logo proposal

in


.sbt build definition

Scala: the flying sandwich parts

in

JavaScript existed since 1995 long before 'JavaScript: The Good Parts' (2008), jQuery (2006), and V8 (2008) happened. The interesting thing about Douglas Crockford's 'The Good Parts' is that unlike the other additive work, it's a book about subtracting features from the language.

I've been thinking about exploring a subset of Scala in a wonderland setting without the "real world" constraints such as Java familiarity and interoperability. If using Scala as an alternative Java is acceptable, why not try using it as an alternative functional programming language? Another point of this thought experiment is to see some of the duplicate constructs can be reduced. In this article, I'm not interested in finding out the idiomatic way, or calling something good or bad. I'm calling this The Flying Sandwich Parts (TFSP).

scopt 3.0

in

scopt is a little command line options parsing library.

Today, I'm releasing scopt 3.0. If you're not interested in the implementation details, skip to the readme.

Around March 4th, 2010, I became a committer to scopt, a fork of Aaron Harnly's scala-options that was written in 2008. I think I wanted to make a few changes around the usage text, key=value options, and argument list. Since then I've been fielding all the bug reports, including the request to publish the jar on scala-tools.org. On March 18, 2012, I forked the project again to scopt/scopt and released scopt 2.0.0 that added immutable parser.

After years of adding features on top of the other, I decided to rewrite scopt3 from scratch. The tipping point was Leif Wickland asking if there's a "philosophical reason that scopt doesn't have an intArg().".

how to write a Dispatch plugin

in

Dispatch has been the de facto library to get to the Internet from Scala. To keep in step with the recent move towards non-blocking IO, @n8han rewrote the library as Reboot based on Async Http Client. This became Dispatch 0.9. Then Dispatch 0.10 came out to replace its own Promise type with the standarized SIP-14 Future.

As with Dispatch Classic, Reboot lets you write plugins to wrap around web APIs. In this post we'll port a plugin from Classic to explore how it works.

working on your own twitter bot?

Notes on 'Monads Are Not Metaphors'

in

This is a translation of 「モナドはメタファーではない」に関する補足 by Kenji Yoshida (@xuwei_k), one of the most active Scala bloggers in Japan covering wide range of topics from Play to Scalaz.

Daniel Spiewak's Monads Are Not Metaphors was written about two and a half years ago, but seeing how its Japanese translation is still being tweeted and being bookmarked by 250 users on Hantena, its popularity doesn't seem to cease. I just remembered something to note about the example code used in the post, which could be an unstylish critique, but I'm going to jot it down here. It's an unstylish critique, because I'll be digging into the part where the author likely knew from the beginning but omitted it intentionally for the sake of illustration. Also I'll be using Scalaz in this post.

learning Scalaz, an html5 book

in

Scalaz 7.0 is out. For easier reading and toc, I converted learning Scalaz series into an html5 book using @n8han's Pamflet:

translating a conference

It's been a month now, but on March 1, 2013 I flew to Japan to attend "Scala Conference in Japan 2013." That's the name of the conference.

from a podcast

One day (June 2, 2012), I was listening to Scala Types recorded at Scala Days 2012, and someone (turns out it's @timperrett) said "I would love to see Scala Days in Asia. We had two in Europe now. It would be wicked to have it in China or Japan, or somewhere like that." I relayed this info on twitter saying there's an opportunity for the Scala community in Japan to invite the conference.

Syndicate content