Skip to content

Commit

Permalink
Merge branch 'main' into feat/force-header-LNG-308
Browse files Browse the repository at this point in the history
  • Loading branch information
InversionSpaces committed Jan 12, 2024
2 parents f2e16b5 + 098fac7 commit bf3496c
Show file tree
Hide file tree
Showing 54 changed files with 7,813 additions and 282 deletions.
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.13.3"
".": "0.13.4"
}
2 changes: 1 addition & 1 deletion .github/workflows/sbt-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
apps: sbt

- name: Run tests
run: sbt test
run: env JAVA_OPTS="-Xmx4G" sbt test
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## [0.13.4](https://github.com/fluencelabs/aqua/compare/aqua-v0.13.3...aqua-v0.13.4) (2024-01-11)


### Features

* **compiler:** `for ... rec` [LNG-307] ([#1026](https://github.com/fluencelabs/aqua/issues/1026)) ([ae32f80](https://github.com/fluencelabs/aqua/commit/ae32f8027729bfd463cddc57f857c307e1e3c709))
* **compiler:** Enhance message of type error [LNG-313] ([#1033](https://github.com/fluencelabs/aqua/issues/1033)) ([d5cd77b](https://github.com/fluencelabs/aqua/commit/d5cd77bb865433fdff46fefb48875bf8f5e585dc))


### Bug Fixes

* **compiler:** Add outside context to closures [LNG-317] ([#1038](https://github.com/fluencelabs/aqua/issues/1038)) ([85f3ecd](https://github.com/fluencelabs/aqua/commit/85f3ecdf3985c8bd3a4c68fb827968b79516f9b3))
* **compiler:** Passing closures with abilities [LNG-314] ([#1035](https://github.com/fluencelabs/aqua/issues/1035)) ([5241f52](https://github.com/fluencelabs/aqua/commit/5241f522d8bc58649f4048aada034e3cbe320eb7))
* **compiler:** Type check arrow calls on services and abilities [LNG-315] ([#1037](https://github.com/fluencelabs/aqua/issues/1037)) ([d46ee03](https://github.com/fluencelabs/aqua/commit/d46ee0347fee94055a6690a4d4b8d0e1cf29430c))

## [0.13.3](https://github.com/fluencelabs/aqua/compare/aqua-v0.13.2...aqua-v0.13.3) (2023-12-22)


Expand Down
2 changes: 1 addition & 1 deletion api/api-npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluencelabs/aqua-api",
"version": "0.13.3",
"version": "0.13.4",
"description": "Aqua API",
"type": "module",
"main": "index.js",
Expand Down
41 changes: 36 additions & 5 deletions aqua-src/antithesis.aqua
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
export arr
aqua M

aqua Aaa
export bugLng317

service MyOp("op"):
identity(s: string) -> string

ability WorkerJob:
runOnSingleWorker(w: string) -> []string

func arr() -> string:
n = "str"
<- n
func runJob(j: -> []string) -> []string:
<- j()

func disjoint_run{WorkerJob}() -> -> []string:
run = func () -> []string:
r <- WorkerJob.runOnSingleWorker("a")
<- r
<- run

func empty() -> string:
a = "empty"
<- a

func bugLng317() -> []string:

res: *string

outer = () -> string:
<- empty()

clos = () -> -> []string:
job2 = () -> []string:
res <- outer()
res <- MyOp.identity("identity")
<- res
<- job2
worker_job = WorkerJob(runOnSingleWorker = clos())
subnet_job <- disjoint_run{worker_job}()
finalRes <- runJob(subnet_job)
<- finalRes
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BundleJS.*

val aquaVersion = "0.13.3"
val aquaVersion = "0.13.4"

val scalaV = "3.3.1"
val catsV = "2.10.0"
Expand Down
23 changes: 23 additions & 0 deletions integration-tests/aqua/examples/abilitiesClosure.aqua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
aqua M

export bugLNG314

ability WorkerJob:
runOnSingleWorker(w: string) -> string

func disjoint_run{WorkerJob}() -> -> string:
run = func () -> string:
r <- WorkerJob.runOnSingleWorker("worker")
<- r
<- run

func runJob(j: -> string) -> string:
<- j()

func bugLNG314() -> string:
job2 = () -> string:
<- "strstrstr"
worker_job = WorkerJob(runOnSingleWorker = job2)
subnet_job <- disjoint_run{worker_job}()
res <- runJob(subnet_job)
<- res
38 changes: 36 additions & 2 deletions integration-tests/aqua/examples/closures.aqua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aqua Closure declares *

export LocalSrv, closureIn, closureOut, closureBig, closureOut2, lng58Bug, multipleClosuresBugLNG262
export LocalSrv, closureIn, closureOut, closureBig, closureOut2, lng58Bug, multipleClosuresBugLNG262, lng317Bug

import "@fluencelabs/aqua-lib/builtin.aqua"

Expand Down Expand Up @@ -80,4 +80,38 @@ func create(a: i8) -> -> i8:
func multipleClosuresBugLNG262() -> i8, i8:
arr1 <- create(1)
arr2 <- create(2)
<- arr1(), arr2()
<- arr1(), arr2()

ability WorkerJob:
runOnSingleWorker(w: string) -> []string

func runJob(j: -> []string) -> []string:
<- j()

func disjoint_run{WorkerJob}() -> -> []string:
run = func () -> []string:
r <- WorkerJob.runOnSingleWorker("a")
<- r
<- run

func empty() -> string:
a = "empty"
<- a

func lng317Bug() -> []string:

res: *string

outer = () -> string:
<- empty()

clos = () -> -> []string:
job2 = () -> []string:
res <- outer()
res <- MyOp.identity("identity")
<- res
<- job2
worker_job = WorkerJob(runOnSingleWorker = clos())
subnet_job <- disjoint_run{worker_job}()
finalRes <- runJob(subnet_job)
<- finalRes
16 changes: 0 additions & 16 deletions integration-tests/aqua/examples/recursiveStreams.aqua

This file was deleted.

22 changes: 22 additions & 0 deletions integration-tests/aqua/examples/recursiveStreams/multiRec.aqua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
aqua MultiRec

export TestService, multiRecStream

service TestService("test-srv"):
handle(i: i32) -> []i32

func multiRecStream(init: i32, target: i32) -> []i32:
result: *string
loop: *i32

loop <<- init
for l <- loop rec:
news <- TestService.handle(l)
for n <- news:
loop <<- n
if l == target:
result <<- "done"

join result!

<- loop
19 changes: 19 additions & 0 deletions integration-tests/aqua/examples/recursiveStreams/nested.aqua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
aqua Nested

export nested

func nested(n: u32) -> []u32:
result: *u32
iterator: *u32

iterator <<- 0
for i <- iterator rec:
if i < n:
for j <- iterator rec:
result <<- j
iterator <<- i + 1

if n > 0:
join result[n * (n + 1) / 2 - 1]

<- result
29 changes: 29 additions & 0 deletions integration-tests/aqua/examples/recursiveStreams/pipeline.aqua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
aqua Pipeline

export pipelineStream

func pipelineStream(init: i32, target: i32) -> []i32:
result: *string

loop1: *i32
loop2: *i32
loop3: *i32

loop1 <<- init
for l <- loop1 rec:
if l < target:
loop1 <<- l + 1
loop2 <<- l * 3

for l <- loop2 rec:
loop3 <<- l
loop3 <<- l + 1
loop3 <<- l + 2

for l <- loop3 rec:
if l == target:
result <<- "success"

join result!

<- loop3
18 changes: 18 additions & 0 deletions integration-tests/aqua/examples/recursiveStreams/range.aqua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
aqua Range

export range

func range(a: i32, b: i32) -> []i32:
result: *i32
iterator: *i32

iterator <<- a
for i <- iterator rec:
if i < b:
result <<- i
iterator <<- i + 1

if b > a:
join result[b - a - 1]

<- result
19 changes: 19 additions & 0 deletions integration-tests/aqua/examples/recursiveStreams/remoteRec.aqua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
aqua RemoteRec

export RemoteSrv, remoteRecStream

service RemoteSrv("remote-srv"):
handle(i: i32) -> i32

func remoteRecStream(init: i32, target: i32, friend: string, friendRelay: string) -> []i32:
loop: *i32

loop <<- init
for l <- loop rec:
on friend via friendRelay:
if l < target:
loop <- RemoteSrv.handle(l)

join loop[target - init]

<- loop
21 changes: 21 additions & 0 deletions integration-tests/aqua/examples/recursiveStreams/yesNo.aqua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
aqua YesNo

export YesNoService, yesNoStream

service YesNoService("yesno"):
get() -> string

func yesNoStream() -> []string:
result: *string
loop: *string

loop <<- "yes"
for l <- loop rec:
if l == "yes":
loop <- YesNoService.get()
else:
result <<- "success"

join result!

<- loop
Loading

0 comments on commit bf3496c

Please sign in to comment.