+ All Categories
Home > Documents > Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact...

Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact...

Date post: 30-Sep-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
39
Implementation of Programming Languages (Project)
Transcript
Page 1: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Implementationof

ProgrammingLanguages

(Project)

Page 2: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Outline

• Administrivia

• Intro

• Schedule

• Topics

Page 3: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

GENERALINFORMATION

Page 4: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Administrivia

• GuidoSalvaneschi,

• PascalWeisenburger

• Findusbyemail

[email protected]

[email protected]

Page 5: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Intro

• Goal:Implementasoftwareartifactaccordingtoa

givenspecification.

• Generalscope:programminglanguages:

– Extensions,codegenerators

– Tools,IDEs

– Analysistechniques

– Performanceassessments

– Prototypeswithinnovativeabstractions

Page 6: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Timeline

• Periodicdiscussions/meetings.

• Presentationanddeliveryoftheartifactandthe

documentation:endofthesemester.

Page 7: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Weeklyprogress

• Allocateonedayperweektoworkontheproject

• Sendmeanemailabouttheweeklyprogress.

• NotanissueIfyouhavenotimefor1or2weeks

– E.g.,exams.

– Sendmeanemailanyway.

– Don’tabusethis.

Page 8: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

GuidelinesandSuggestions

• Dependingonthegoaloftheproject

• Somegeneralremarks:

– DeliverRUNNINGcode

– Deliversomedocumentation

– Optional:finalpresentation/demotodiscussyourwork

• Teamworkingisgood!

– Organizeateamevenwithpeopleyoudon’tknow(yet)

Page 9: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Grades

• Dependingontheproject

• Someguidelines:

– Howmuchofthespecificationwasimplemented?

– DidIsaythatthecodehastorun?

– Whatistheoverallqualityofthecode?

• E.g.isitpainfultomodify/extendit?

• Isitself-documenting?

– Whatisthequalityofthe“documentation”?

Page 10: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Wheretostart

• Sendmeanemailwithyourname(s)andalistof3

topicsinorderofpreferencebySunday26th.

• Orarrangeanappointment:

– Askclarificationsifneeded

– Discusspossiblecustomizations

– Discusstheprojectsinmoredetail

– Consideryourprogrammingskills

• Topicswillbeassigned

• Discusstheprojectindetailwiththeinstructor

Page 11: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

TOPICS

Page 12: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

DistributedEventSystem

• Scaladomain-specificlanguageforevent-based

programming

• Distributedsystem

– Akka actors

– Esper correlationengineinsideeachactor

• Qualityofservicerequirements

Findallstockoptionswhosevalueincreased

ofatleast30%inthelastmonth

Statementstmt=conn.createStatement();

ResultSet rs =SELECTLname FROMCustomers

WHERESnum =2001

https://github.com/pweisenburger/AdaptiveCEP

https://dl.acm.org/citation.cfm?id=3105530

Page 13: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

SecureScala:DSLfor

SecureComputation

• Noneedofcryptographicknowledge.

• Codecanbeexecutedonanuntrusted

platformwithoutleakingdata.

• MonadicDSL:extensibilityandexchangeablebackends.

– E.g.,localvs.distributedexecution

// 20 * 2 + 2

val program: Crypto[EncInt] = for {

x1 <- EncInt(20) * EncInt(2) // or

x2 <- x1 + EncInt(2) // or

} yield x2

SELECT car AS license, number, speed

FROM CheckPoint

WHERE Interp.isTooFast(speed)

object Interp {

val keyRing: KeyRing = KeyRing.create

val interpret = LocalInterpreter(keyRing)

val speedLimit: EncInt = encrypt(keyRing)(130)

def isTooFast(s: EncInt): Boolean =

interpret(s > speedLimit)

}

[MarkusHauck, Savvas Savvides, PatrickEugster, MiraMezini, GuidoSalvaneschi,SecureScala:

ScalaEmbeddingofSecureComputations,ScalaSymposium2016]

Page 14: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

https://allprojects.github.io/securescala/

Page 15: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

DistributedEventSystem

• Combineseveralprivacypreservingmechanisms

– Operatorplacement

– Multipartycomputation

– Differentialprivacy

– Secureenclaves(e.g.IntelSGX)

• Large-scaledeployment

• TypesystemforvariousPETS

Page 16: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

https://allprojects.github.io/SecQL/

Page 17: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

ConsistencyinDistributedSystems

https://dl.acm.org/citation.cfm?id=2611290

https://dl.acm.org/citation.cfm?id=3104044

Page 18: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

ConsistencyLevelsformaLattice

Noconsistency

Eventualconsistency

Serializability

Causalconsistency…

Page 19: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

19

Eventualconsistency

Causalconsistency

Fifo consistency

….

Page 20: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

ConSysT ProgrammingFramework

classConcert{

Datedate;

Ref<@Weak ConcertHall>hall;

Ref<@Weak Band>band;

Ref<@Strong Counter>soldTickets;

}

Programmingmodelsupports

explicitconsistencylevels

Informationflowstaticanalysis

ensuressafemixingofconsistencylevels

Page 21: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

https://consyst-project.github.io/

Page 22: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Consistency

• ImplementaTwitterclonewithdifferentconsistencylevels

– Consistenttweetsensureordering

– Butaremoreexpensive

• Consistencycanbeassociatedtotypese.g.,High[Int]

– Designconsistencyforoperations,e.g.,shopCheckout()

• Languagesupportformultipleconsistencylevelsontopofexistingmiddleware,e.g.,Cassandra

Page 23: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Tierless Languages

• TraditionaldevelopmentofWebapplications

– Serverside(e.g.servlet,php script,..)

– Clientside(Javascript,…)

• Tierless languagesunifythedevelopmentofserver-

sideandclient-sidecomponents

– Networkcommunicationishidden

– Thecompilerautomaticallygeneratesthecodeforthe

serverandfortheclient

https://github.com/scala-loci

Page 24: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

PlacementTypes

val message: Event[String] on Registry

trait Registry extends Peer

trait Node extends PeerPeers

PlacementTypes

= placed { getMessageStream() }

Page 25: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

CompleteDistributedChat

@multitier object Chat {

}

trait Server extends Peer { type Tie = Multiple[Client] }

trait Client extends Peer { type Tie = Single[Server] }

val message = placed[Client] { Evt[String] }

placed[Client].main {

for (line <- io.Source.stdin.getLines)

message fire line }

val publicMessage = placed[Server] {

message.asLocalFromAllSeq map { case (_, msg) => msg } }

publicMessage.asLocal observe println

Client

Server

Client

messageprintln

public

Message

messageprintln

Page 26: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

class TaskManagerGateway {def disconnectFromJobManager(instanceId: InstanceID, cause: Exception,

mgr: ActorRef) = {mgr ! Disconnect(instanceId, cause)

}

def stopCluster(applicationStatus: ApplicationStatus, message: String,mgr: ActorRef) = {

mgr ! StopCluster(applicationStatus, message)}

def requestStackTrace(mgr: ActorRef) = {(mgr ? SendStackTrace).mapTo[StackTrace]

}

def submitTask(tdd: TaskDeploymentDescriptor, mgr: ActorRef) = {(mgr ? SubmitTask(tdd)).mapTo[Acknowledge]

}

def stopTask(executionAttemptID: ExecutionAttemptID, mgr: ActorRef) = {(mgr ? StopTask(executionAttemptID)).mapTo[Acknowledge]

}

def cancelTask(executionAttemptID: ExecutionAttemptID, mgr: ActorRef) = {(mgr ? CancelTask(executionAttemptID).mapTo[Acknowledge]

}

def updatePartitions(executionAttemptID: ExecutionAttemptID,partitionInfos: Iterable[PartitionInfo], mgr: ActorRef) = {

(mgr ? UpdateTaskMultiplePartitionInfos(executionAttemptID, partitionInfos)).mapTo[Acknowledge]

}

def failPartition(executionAttemptID: ExecutionAttemptID, mgr: ActorRef) = {mgr ! FailIntermediateResultPartitions(executionAttemptID)

}

def notifyCheckpointComplete(executionAttemptID: ExecutionAttemptID,jobId: JobID, checkpointId: long, timestamp: long, mgr: ActorRef) = {

mgr ! NotifyCheckpointComplete(jobId, executionAttemptID, checkpointId,timestamp)

}

def triggerCheckpoint(executionAttemptID: ExecutionAttemptID, jobId: JobID,checkpointId: long, timestamp: long, checkpointOptions: CheckpointOptions,mgr: ActorRef) = {

mgr ! TriggerCheckpoint(jobId, executionAttemptID, checkpointId, timestamp,checkpointOptions)

}

def requestTaskManagerLog(logTypeRequest: LogTypeRequest, mgr: ActorRef) = {(mgr ? RequestTaskManagerLog(logTypeRequest)).mapTo[BlobKey]

}}

class TaskManager extends Actor {def receive = {

case SendStackTrace => sendStackTrace() foreach { message =>sender ! decorateMessage(message)

}

case Disconnect(instanceIdToDisconnect, cause) =>if (instanceIdToDisconnect.equals(instanceID)) {

handleJobManagerDisconnect("JobManager requested disconnect: " +cause.getMessage())

triggerTaskManagerRegistration()} else {

log.debug("Received disconnect message for wrong instance id " +instanceIdToDisconnect)

}

case StopCluster(applicationStatus, message) =>log.info(s"Stopping TaskManager with final application status " +

s"$applicationStatus and diagnostics: $message")shutdown()

case RequestTaskManagerLog(requestType) =>blobService match {

case Some(_) =>handleRequestTaskManagerLog(requestType, currentJobManager.get) match {

case Left(message) => sender() ! messagecase Right(message) => sender() ! message

}case None =>

sender() ! akka.actor.Status.Failure(new IOException("BlobService not available. Cannot upload TaskManager logs."))

}

case UpdateTaskMultiplePartitionInfos(executionID, partitionInfos) =>sender ! decorateMessage(updateTaskInputPartitions(executionID, partitionInfos))

case FailIntermediateResultPartitions(executionID) =>log.info(s"Discarding the results produced by task execution $executionID")try {

network.getResultPartitionManager.releasePartitionsProducedBy(executionID)} catch {

case t: Throwable => killTaskManagerFatal("Fatal leak: Unable to release intermediate result partition data", t)

}

case SubmitTask(tdd) =>sender ! decorateMessage(submitTask(tdd))

case StopTask(executionID) =>val task = runningTasks.get(executionID)if (task != null) {

try {task.stopExecution()sender ! decorateMessage(Acknowledge.get())

} catch {case t: Throwable =>

sender ! decorateMessage(Status.Failure(t))}

} else {log.debug(s"Cannot find task to stop for execution $executionID)")sender ! decorateMessage(Acknowledge.get())

}

case CancelTask(executionID) =>val task = runningTasks.get(executionID)if (task != null) {

task.cancelExecution()sender ! decorateMessage(Acknowledge.get())

} else {log.debug(s"Cannot find task to cancel for execution $executionID)")sender ! decorateMessage(Acknowledge.get())

}

case TriggerCheckpoint(jobId, taskExecutionId, checkpointId, timestamp,checkpointOptions) =>

log.debug(s"Receiver TriggerCheckpoint $checkpointId@$timestamp " +s"for $taskExecutionId.")

val task = runningTasks.get(taskExecutionId)if (task != null) {

task.triggerCheckpointBarrier(checkpointId, timestamp, checkpointOptions)} else {

log.debug(s"TaskManager received a checkpoint request " +s"for unknown task $taskExecutionId.")

}

case NotifyCheckpointComplete(jobId, taskExecutionId, checkpointId, timestamp) =>log.debug(s"Receiver ConfirmCheckpoint $checkpointId@$timestamp " +

ś"for $taskExecutionId.")

val task = runningTasks.get(taskExecutionId)if (task != null) {

task.notifyCheckpointComplete(checkpointId)} else {

log.debug(s"TaskManager received a checkpoint confirmation " +s"for unknown task $taskExecutionId.")

}}

}

Page 27: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

class TaskManagerGateway {def disconnectFromJobManager(instanceId: InstanceID, cause: Exception,

mgr: ActorRef) = {mgr ! Disconnect(instanceId, cause)

}

def stopCluster(applicationStatus: ApplicationStatus, message: String,mgr: ActorRef) = {

mgr ! StopCluster(applicationStatus, message)}

def requestStackTrace(mgr: ActorRef) = {(mgr ? SendStackTrace).mapTo[StackTrace]

}

def submitTask(tdd: TaskDeploymentDescriptor, mgr: ActorRef) = {(mgr ? SubmitTask(tdd)).mapTo[Acknowledge]

}

def stopTask(executionAttemptID: ExecutionAttemptID, mgr: ActorRef) = {(mgr ? StopTask(executionAttemptID)).mapTo[Acknowledge]

}

def cancelTask(executionAttemptID: ExecutionAttemptID, mgr: ActorRef) = {(mgr ? CancelTask(executionAttemptID).mapTo[Acknowledge]

}

def updatePartitions(executionAttemptID: ExecutionAttemptID,partitionInfos: Iterable[PartitionInfo], mgr: ActorRef) = {

(mgr ? UpdateTaskMultiplePartitionInfos(executionAttemptID, partitionInfos)).mapTo[Acknowledge]

}

def failPartition(executionAttemptID: ExecutionAttemptID, mgr: ActorRef) = {mgr ! FailIntermediateResultPartitions(executionAttemptID)

}

def notifyCheckpointComplete(executionAttemptID: ExecutionAttemptID,jobId: JobID, checkpointId: long, timestamp: long, mgr: ActorRef) = {

mgr ! NotifyCheckpointComplete(jobId, executionAttemptID, checkpointId,timestamp)

}

def triggerCheckpoint(executionAttemptID: ExecutionAttemptID, jobId: JobID,checkpointId: long, timestamp: long, checkpointOptions: CheckpointOptions,mgr: ActorRef) = {

mgr ! TriggerCheckpoint(jobId, executionAttemptID, checkpointId, timestamp,checkpointOptions)

}

def requestTaskManagerLog(logTypeRequest: LogTypeRequest, mgr: ActorRef) = {(mgr ? RequestTaskManagerLog(logTypeRequest)).mapTo[BlobKey]

}}

class TaskManager extends Actor {def receive = {case SendStackTrace => sendStackTrace() foreach { message =>sender ! decorateMessage(message)

}

case Disconnect(instanceIdToDisconnect, cause) =>if (instanceIdToDisconnect.equals(instanceID)) {handleJobManagerDisconnect("JobManager requested disconnect: " +cause.getMessage())

triggerTaskManagerRegistration()} else {log.debug("Received disconnect message for wrong instance id " +instanceIdToDisconnect)

}

case StopCluster(applicationStatus, message) =>log.info(s"Stopping TaskManager with final application status " +s"$applicationStatus and diagnostics: $message")

shutdown()

case RequestTaskManagerLog(requestType) =>blobService match {case Some(_) =>handleRequestTaskManagerLog(requestType, currentJobManager.get) match {case Left(message) => sender() ! messagecase Right(message) => sender() ! message

}case None =>sender() ! akka.actor.Status.Failure(new IOException("BlobService not available. Cannot upload TaskManager logs."))

}

case UpdateTaskMultiplePartitionInfos(executionID, partitionInfos) =>sender ! decorateMessage(updateTaskInputPartitions(executionID, partitionInfos))

case FailIntermediateResultPartitions(executionID) =>log.info(s"Discarding the results produced by task execution $executionID")try {network.getResultPartitionManager.releasePartitionsProducedBy(executionID)

} catch {case t: Throwable => killTaskManagerFatal("Fatal leak: Unable to release intermediate result partition data", t)

}

case SubmitTask(tdd) =>sender ! decorateMessage(submitTask(tdd))

case StopTask(executionID) =>val task = runningTasks.get(executionID)if (task != null) {try {task.stopExecution()sender ! decorateMessage(Acknowledge.get())

} catch {case t: Throwable =>sender ! decorateMessage(Status.Failure(t))

}} else {log.debug(s"Cannot find task to stop for execution $executionID)")sender ! decorateMessage(Acknowledge.get())

}

case CancelTask(executionID) =>val task = runningTasks.get(executionID)if (task != null) {task.cancelExecution()sender ! decorateMessage(Acknowledge.get())

} else {log.debug(s"Cannot find task to cancel for execution $executionID)")sender ! decorateMessage(Acknowledge.get())

}

case TriggerCheckpoint(jobId, taskExecutionId, checkpointId, timestamp,checkpointOptions) =>

log.debug(s"Receiver TriggerCheckpoint $checkpointId@$timestamp " +s"for $taskExecutionId.")

val task = runningTasks.get(taskExecutionId)if (task != null) {task.triggerCheckpointBarrier(checkpointId, timestamp, checkpointOptions)

} else {log.debug(s"TaskManager received a checkpoint request " +s"for unknown task $taskExecutionId.")

}

case NotifyCheckpointComplete(jobId, taskExecutionId, checkpointId, timestamp) =>log.debug(s"Receiver ConfirmCheckpoint $checkpointId@$timestamp " +ś"for $taskExecutionId.")

val task = runningTasks.get(taskExecutionId)if (task != null) {task.notifyCheckpointComplete(checkpointId)

} else {log.debug(s"TaskManager received a checkpoint confirmation " +s"for unknown task $taskExecutionId.")

}}

}

@multitier trait TaskManagerGatewayClusterTask {trait JobManager extends Peer { type Tie <: Multiple[TaskManager] }trait TaskManager extends Peer { type Tie <: Single[JobManager] }

def disconnectFromJobManager(instanceId: InstanceID, cause: Exception,mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(instanceId, cause){if (instanceId.equals(instanceID)) {handleJobManagerDisconnect(s"JobManager requested disconnect: " +cause.getMessage())

triggerTaskManagerRegistration()} else {log.debug(s"Received disconnect message for wrong instance id " +instanceId)

}}

}

def stopCluster(applicationStatus: ApplicationStatus, message: String,mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(applicationStatus, message){log.info(s"Stopping TaskManager with final application status " +s"$applicationStatus and diagnostics: $message")

shutdown()}

}

def requestStackTrace(mgr: Remote[TaskManager]) = placed[JobManagerPeer] {remote.on(mgr).capture(tdd){ sendStackTrace() }.asLocal.map(_.left.get)

}

def submitTask(tdd: TaskDeploymentDescriptor,mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(tdd){ submitTask(tdd) }.asLocal.map(_.left.get)}

def stopTask(executionAttemptID: ExecutionAttemptID,mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(executionAttemptID){val task = runningTasks.get(executionAttemptID)if (task != null) {try {task.stopExecution()Left(Acknowledge.get())

} catch {case t: Throwable =>Right(Status.Failure(t))

}} else {log.debug(s"Cannot find task to stop for execution $executionAttemptID)")Left(Acknowledge.get())

}}.asLocal.map(_.left.get)

}

def cancelTask(executionAttemptID: ExecutionAttemptID,mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(executionAttemptID){val task = runningTasks.get(executionAttemptID)if (task != null) {task.cancelExecution()Acknowledge.get()

} else {log.debug(s"Cannot find task to cancel for execution $executionAttemptID")Acknowledge.get()

}}.asLocal

}}

@multitier trait TaskManagerGatewayPartitionCheckLog {trait JobManager extends Peer { type Tie <: Multiple[TaskManager] }trait TaskManager extends Peer { type Tie <: Single[JobManager] }

def updatePartitions(executionAttemptID: ExecutionAttemptID,partitionInfos: java.lang.Iterable[PartitionInfo],mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(executionAttemptID, partitionInfos){updateTaskInputPartitions(executionAttemptID, partitionInfos)

}.asLocal.map(_.left.get)}

def failPartition(executionAttemptID: ExecutionAttemptID,mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(executionAttemptID){log.info(s"Discarding the results produced by task execution $executionID")try {network.getResultPartitionManager.releasePartitionsProducedBy(executionID)

} catch {case t: Throwable => killTaskManagerFatal("Fatal leak: Unable to release intermediate result partition data", t)

}}

}

def notifyCheckpointComplete(executionAttemptID: ExecutionAttemptID,jobId: JobID, checkpointId: Long, timestamp: Long,mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(executionAttemptID, jobId, checkpointId, timestamp){log.debug(s"Receiver ConfirmCheckpoint $checkpointId@$timestamp " +s"for $executionAttemptID.")

val task = runningTasks.get(executionAttemptID)if (task != null) {task.notifyCheckpointComplete(checkpointId)

} else {log.debug(s"TaskManager received a checkpoint confirmation " +s"for unknown task $taskExecutionId.")

}}

}

def triggerCheckpoint(executionAttemptID: ExecutionAttemptID, jobId: JobID,checkpointId: Long, timestamp: Long, checkpointOptions: CheckpointOptions,mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(executionAttemptID, jobId, checkpointId, timestamp,checkpointOptions){

log.debug(s"Receiver TriggerCheckpoint $checkpointId@$timestamp " +s"for $executionAttemptID.")

val task = runningTasks.get(executionAttemptID)if (task != null) {task.triggerCheckpointBarrier(checkpointId, timestamp, checkpointOptions)

} else {log.debug(s"TaskManager received a checkpoint request " +s"for unknown task $executionAttemptID.")

}}

}

def requestTaskManagerLog(logTypeRequest: LogTypeRequest,mgr: Remote[TaskManager]) = placed[JobManagerPeer] {

remote.on(mgr).capture(logTypeRequest){blobService match {case Some(_) =>handleRequestTaskManagerLog(logTypeRequest, currentJobManager.get)

case None =>Right(akka.actor.Status.Failure(new IOException("BlobService not available. Cannot upload TaskManager logs.")))

}}.asLocal.map(_.left.get)

}}

Eliminated23 non-exhaustivepatternmatches

and8 typecasts

Page 28: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

www.scala-loci.github.io

Page 29: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

Dynamicpalacement

Datastreams

crossTier

boundaries

Compiler

splitsthe

code

Application

deployment

Dynamic

Placement

Page 30: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

IoT &Edge:Drones

Dynamic

Placement

Page 31: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

DistributedGarbageCollection

• Expensiveinthegeneralcase!

• Useatypesystemtotrackownership

– Thetypesystemguaranteesthatthere

arenootherrefstoanobject

– Theobjectcanbedeleted

https://soft.vub.ac.be/amop/research/dgc

Page 32: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

LanguagesforSmartContracts

• DApp:clientscommunicateviaacontract

– Tierless programmingmodel

• Placements

– Client(e.g.,web)

– Contract

– OffChain!

https://ethereum.stackexchange.com/questions/383/what-is-a-dapp

Page 33: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

SecureTierless Languages

• Placefunctionalitiesbasedonprivacy requirements

– Functionf(x)mayrunontheserverorontheclient

– Decidebasedontheprivacyofx

Challenges:

• Informationflowanalysis

• Decisionatruntime?

SecureWebApplicationsviaAutomaticPartitioning

Page 34: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

DynamicSoftwareUpdates

• Complexcomponent-based

systemsrequireupdates

withoutdowntime

• Whenisanupdatesafe?

• Developasystemfor

safedynamicupdates

https://dl.acm.org/citation.cfm?id=3084561

Page 35: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

CRDTs

A data structure which can be replicated across multiple computers where

replicas can be updated independently and concurrently without coordination,

and where it is always mathematically possible to resolve inconsistencies

Example:collaborativeediting

CRDT:Grow-onlycounter

Applications

• Redis:adistributed,highlyavailableandscalablein-memorydatabase

• Riak:adistributedNoSQLkey-valuedatastorebasedonCRDTs

• FacebookimplementsCRDTsintheirApollolow-latency"consistencyatscale"database

Page 36: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

CRDTs

• Implementationof CRDTsinScala

• CDRTsdefine consistency for operations.Combine

them with consistency ontypes,e.g.,Strong[Int]

• Composability of CRDTs.

How to derive new CRDTsby composition?

https://arxiv.org/abs/1803.02750

Page 37: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

ReactiveProgramming

List<String>myList = Arrays.asList("a1", "a2", "b1", "c2", "c1");

myList.stream()

.filter(s-> s.startsWith("c"))

.map(String::toUpperCase)

.sorted()

.forEach(System.out::println);

www.rescala-lang.com

Page 38: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

TestingforReactiveApplications

• Defineinputvaluestotestthegraph

• Coverageonnodes”

• Propertybasedtestingtodefinerangesoflegalvaluesforalltypesofnodes

• Usethosetoautomaticallytesteachnode.

Page 39: Implementation of Programming Languages (Project) · • Presentation and delivery of the artifact and the documentation: end of the semester. Weekly progress ... –Espercorrelation

QUESTIONS?


Recommended