Run with Scala CLI (https://scala-cli.virtuslab.org/):
scala-cli run .
And then go to http://localhost:9991
Happy coding, Scala is great.
Run with Scala CLI (https://scala-cli.virtuslab.org/):
scala-cli run .
And then go to http://localhost:9991
Happy coding, Scala is great.
What follows are some of my (very) rough thoughts on what we can and should do with respect to CPS transformation in Scala at the language level. I'll try to start with some motivation behind my thinking, as well as some rambling observations on the nature of the problem space, but don't expect too much coherence here. :-)
Async programming is hard.
Okay let's actually be more specific than that. High-performance I/O is hard. Signal multiplexing is a powerful technique for achieving high(er) performance I/O, particularly network I/O, but the tradeoff is that, in order to utilize it, the user-space programming model must allow for suspension and resumption of sequential continuations (often called "fibers" or "coroutines"). Achieving this type of programming model without significant tradeoffs in usability is what is exceptionally hard.
If that wasn't bad enough though, these problems are inextricably conflated with another set of problem spaces which are, themselves, very difficult. In
This gist is out of date and I can no longer help much, as I got rid of my Mac.
Please visit T2 Linux website for more and better information:
This gist is just a compilation of the hard work that others have put in. I'm not a software developer, so if there are any mistakes or better ways of doing things, I'd appreciate any suggestions. Here's a list of the real heroes who made this possible:
It's great for beginners. Then it turns into a mess.
<article role="article" itemid="http://example.com/article-1" itemscope itemtype="http://schema.org/BlogPosting"> | |
<link itemprop="mainEntityOfPage" href="http://example.com/article-1" /> | |
<h2 itemprop="headline"> | |
<a itemprop="url" href="#" title="">Article title</a> | |
Coming this April, HBO NOW will be available exclusively in the U.S. on Apple TV and the App Store. | |
</h2> | |
<img itemprop="image" src="http://images.apple.com/live/2015-mar-event/images/573cb_xlarge_2x.jpg"> | |
<p> | |
Published by <cite itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Mystro Ken</span></cite> | |
<time itemprop="datePublished" datetime="2015-03-09T13:08:00-07:00">March 9, 2015 1:08PM</time> |
import java.nio.ByteBuffer | |
import java.nio.channels.{AsynchronousFileChannel, CompletionHandler, FileLock} | |
import java.nio.file.StandardOpenOption.{CREATE, READ, WRITE} | |
import java.nio.file._ | |
import java.util.concurrent.{Executors, TimeUnit} | |
import scala.compat.java8.FunctionConverters.asJavaConsumer | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.duration.Duration | |
import scala.concurrent.{ExecutionContext, Future, Promise} |
sbt/launcher is a small Scala application that bootstraps an arbitrary Scala program (typically, SBT) described a config file and sourced via Ivy dependency resolution.
This creates a child classloader containing Scala 2.10.6. A child of this contains SBT itself and xsbti/interface-0.13.11.jar.
For testing purposes, the easiest way to go is jitpack:
resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.User" % "Repo" % "Tag"
// These lines go in ~/.sbt/0.13/global.sbt | |
watchSources ++= ( | |
(baseDirectory.value * "*.sbt").get | |
++ (baseDirectory.value / "project" * "*.scala").get | |
++ (baseDirectory.value / "project" * "*.sbt").get | |
) | |
addCommandAlias("rtu", "; reload ; test:update") | |
addCommandAlias("rtc", "; reload ; test:compile") | |
addCommandAlias("ru", "; reload ; update") |