A comparison from 2 weeks using Go.
Akka's central principle is that there you have an ActorSystem which runs Actors. An Actor is defined as a class and it has a method to receive messages.
| import com.thoughtworks.binding.{Binding, FutureBinding, dom} | |
| import io.udash.i18n.{Bundle, Lang, LocalTranslationProvider, Translated, TranslationKey, TranslationKey0, TranslationKey1, TranslationKey2, TranslationProvider} | |
| import scala.concurrent.Future | |
| import scala.util.{Failure, Success, Try} | |
| import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue | |
| trait Adam extends INDArrayWeights { | |
| import org.nd4j.linalg.ops.transforms.Transforms | |
| trait INDArrayWeightApi extends super.INDArrayWeightApi { | |
| this: INDArrayWeight => | |
| private var m0: Option[INDArray] = None | |
| def m = m0.getOrElse(Nd4j.zeros(data.shape: _*)) | |
| def m_=(value: INDArray) = m0 = Some(value) | |
| private var v0: Option[INDArray] = None |
| object RDDasMonadPlus { | |
| import org.apache.spark.{ SparkContext } | |
| import org.apache.spark.rdd.RDD | |
| import scalaz._ | |
| import Scalaz._ | |
| import scala.reflect.ClassTag | |
| // RDDMPlus is the type for which we will define the Monad instance. it can be | |
| // constructed from an RDD using the RDDClassTag constructor. this | |
| // implementation is based on insights from |
| import akka.http.scaladsl.model.HttpHeader | |
| import akka.http.scaladsl.model.HttpMethods._ | |
| import akka.http.scaladsl.model.HttpResponse | |
| import akka.http.scaladsl.model.headers.`Access-Control-Allow-Credentials` | |
| import akka.http.scaladsl.model.headers.`Access-Control-Allow-Methods` | |
| import akka.http.scaladsl.model.headers.`Access-Control-Allow-Origin` | |
| import akka.http.scaladsl.model.headers.Origin | |
| import akka.http.scaladsl.server.Directive0 | |
| import akka.http.scaladsl.server.Directives._ | |
| import akka.http.scaladsl.server.MethodRejection |
| object RDDasMonadPlus { | |
| import org.apache.spark.{ SparkContext } | |
| import org.apache.spark.rdd.RDD | |
| import scalaz._ | |
| import Scalaz._ | |
| import scala.reflect.ClassTag | |
| // RDDMPlus is the type for which we will define the Monad instance. it can be | |
| // constructed from an RDD using the RDDClassTag constructor. this | |
| // implementation is based on insights from |
| import haxe.macro.Context; | |
| import haxe.macro.Expr; | |
| import haxe.macro.Type; | |
| using Lambda; | |
| /** | |
| Old school abstract class. | |
| Classes that implements it, and their sub-classes, will be able to declare abstract methods (methods that without body). | |
| There will be a check in compile-time such that no public constructor is allowed without all abstract methods implemented. | |
| */ |