From 1093943d3771ecfa344848cd50836dd4ef803b92 Mon Sep 17 00:00:00 2001 From: AneesHl Date: Mon, 19 Feb 2024 20:16:38 +0100 Subject: [PATCH] syntax improvements for typescript benchmarks --- TS/Savina/src/micro/Big.lf | 10 +++++----- TS/Savina/src/micro/Chameneos.lf | 10 +++++----- TS/Savina/src/micro/CountingActor.lf | 6 +++--- TS/Savina/src/micro/Throughput.lf | 8 ++++---- TS/Savina/src/parallelism/Sieve.lf | 10 +++++----- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/TS/Savina/src/micro/Big.lf b/TS/Savina/src/micro/Big.lf index 92f12a1..29bc7dc 100644 --- a/TS/Savina/src/micro/Big.lf +++ b/TS/Savina/src/micro/Big.lf @@ -10,7 +10,7 @@ target TypeScript { import BenchmarkRunner from "../BenchmarkRunner.lf"; -main reactor Big(numIterations:number(12), limit:number(25000)) { +main reactor Big(numIterations:number=12, limit:number=25000) { runner = new BenchmarkRunner(numIterations = numIterations); @@ -86,7 +86,7 @@ main reactor Big(numIterations:number(12), limit:number(25000)) { // Index is the number of this ping ponger and must be set // to x with 1 <= x <= numberOfActors, when the instance is created. -reactor PingPonger(limit:number(25000), index:number(-1), numberOfActors:number(5)) { +reactor PingPonger(limit:number=25000, index:number=-1, numberOfActors:number=5) { input start:boolean; output done:null; output send1:string; @@ -110,7 +110,7 @@ reactor PingPonger(limit:number(25000), index:number(-1), numberOfActors:number( input ack4:string; input ack5:string; - state remainingServes:number(limit); + state remainingServes:number=limit; logical action nextServe:null; // As in ping pong serve @@ -187,14 +187,14 @@ reactor PingPonger(limit:number(25000), index:number(-1), numberOfActors:number( } -reactor Sink(numberOfActors:number(5)) { +reactor Sink(numberOfActors:number=5) { input done1:null; input done2:null; input done3:null; input done4:null; input done5:null; output stopTimer:boolean; - state count:number(0); + state count:number=0; reaction(done1) -> stopTimer {= count++; diff --git a/TS/Savina/src/micro/Chameneos.lf b/TS/Savina/src/micro/Chameneos.lf index 8f0ff43..cad009b 100644 --- a/TS/Savina/src/micro/Chameneos.lf +++ b/TS/Savina/src/micro/Chameneos.lf @@ -12,7 +12,7 @@ target TypeScript { import BenchmarkRunner from "../BenchmarkRunner.lf"; -main reactor Chameneos(numIterations:number(12), limit:number(25000)) { +main reactor Chameneos(numIterations:number=12, limit:number=25000) { // Conversions for updateColor from https://wiki.haskell.org/Shootout/Chameneos preamble {= @@ -101,7 +101,7 @@ main reactor Chameneos(numIterations:number(12), limit:number(25000)) { l4.ackFriend3 -> l3.responseFriend4; } -reactor Mall(limit:number(25000)) { +reactor Mall(limit:number=25000) { preamble {= function permuteLizards(freeLizards: Array): Array { @@ -130,7 +130,7 @@ reactor Mall(limit:number(25000)) { output l3instruction:number; output l4instruction:number; - state count:number(0); + state count:number=0; // Randomly pick a lizard and randomly assign it a friend. // Then repeat for every other available pair of lizards. @@ -183,7 +183,7 @@ reactor Mall(limit:number(25000)) { =} } -reactor Lizard (initialColor:Color({=Color.BLUE=})) { +reactor Lizard (initialColor:Color={=Color.BLUE=}) { input instruction:number; input fromFriend0:Color; input fromFriend1:Color; @@ -206,7 +206,7 @@ reactor Lizard (initialColor:Color({=Color.BLUE=})) { output ackFriend2:Color; output ackFriend3:Color; output ackFriend4:Color; - state color:Color(initialColor); + state color:Color=initialColor; timer t(0,1 sec); diff --git a/TS/Savina/src/micro/CountingActor.lf b/TS/Savina/src/micro/CountingActor.lf index 4904784..8554ae7 100644 --- a/TS/Savina/src/micro/CountingActor.lf +++ b/TS/Savina/src/micro/CountingActor.lf @@ -4,10 +4,10 @@ target TypeScript{ import BenchmarkRunner from "../BenchmarkRunner.lf"; -reactor Counter(limit:number(25000)) { +reactor Counter(limit:number=25000) { input receive:number; output done:boolean; - state count:number(0); + state count:number=0; reaction (receive) -> done {= count++; if (count == limit -1) { @@ -25,7 +25,7 @@ reactor Sender { send = 1; =} } -main reactor CountingActor(numIterations:number(12), limit:number(25000)) { +main reactor CountingActor(numIterations:number=12, limit:number=25000) { runner = new BenchmarkRunner(numIterations = numIterations); diff --git a/TS/Savina/src/micro/Throughput.lf b/TS/Savina/src/micro/Throughput.lf index ef73232..fe1f788 100644 --- a/TS/Savina/src/micro/Throughput.lf +++ b/TS/Savina/src/micro/Throughput.lf @@ -10,7 +10,7 @@ target TypeScript { import BenchmarkRunner from "../BenchmarkRunner.lf"; -reactor ThroughputReactor(totalMessages:number(10000)) { +reactor ThroughputReactor(totalMessages:number=10000) { preamble {= function performComputation(theta: number): void { @@ -28,13 +28,13 @@ reactor ThroughputReactor(totalMessages:number(10000)) { } -reactor ThroughputProducer(totalMessages:number(10000), numConsumer:number(60)) { +reactor ThroughputProducer(totalMessages:number=10000, numConsumer:number=60) { input start:boolean; output outMessage:boolean; output finished:boolean; - state sent_messages: number(0); + state sent_messages: number=0; logical action sendNextMessage; @@ -56,7 +56,7 @@ reactor ThroughputProducer(totalMessages:number(10000), numConsumer:number(60)) =} } -main reactor (numIterations:number(12), numMessagesPerReactor:number(100), numWorkers:number(60)) { +main reactor (numIterations:number=12, numMessagesPerReactor:number=100, numWorkers:number=60) { runner = new BenchmarkRunner(numIterations=numIterations); producer = new ThroughputProducer(totalMessages=numMessagesPerReactor, numConsumer=numWorkers); diff --git a/TS/Savina/src/parallelism/Sieve.lf b/TS/Savina/src/parallelism/Sieve.lf index 3334089..1b6fba2 100644 --- a/TS/Savina/src/parallelism/Sieve.lf +++ b/TS/Savina/src/parallelism/Sieve.lf @@ -12,7 +12,7 @@ import BenchmarkRunner from "../BenchmarkRunner.lf"; -reactor Ramp(totalNumber:number(100000), period:time(1 nsec)) { +reactor Ramp(totalNumber:number=100000, period:time=1 nsec) { input start: boolean; output value: number; output end: boolean; @@ -35,13 +35,13 @@ reactor Ramp(totalNumber:number(100000), period:time(1 nsec)) { =} } -reactor Filter(primeStart: number(2), primeNumber: number(1000)) { +reactor Filter(primeStart: number=2, primeNumber: number=1000) { input inp: number; output out: number; - state localPrimes: {=Array=}({= [] =}); - state hasChild: boolean(false); + state localPrimes: {=Array=}={= [] =}; + state hasChild: boolean=false; mutation (inp) -> out {= let div = false; @@ -76,7 +76,7 @@ reactor Filter(primeStart: number(2), primeNumber: number(1000)) { } -main reactor Sieve(numIterations:number(12), totalNumber:number(100000), primeStart: number(2), primeNumber: number(1000), period: time(1 nsec)) { +main reactor Sieve(numIterations:number=12, totalNumber:number=100000, primeStart: number=2, primeNumber: number=1000, period: time=1 nsec) { runner = new BenchmarkRunner(numIterations=numIterations); source = new Ramp(totalNumber=totalNumber, period=period); filter = new Filter(primeStart=primeStart, primeNumber=primeNumber);