aqua/aqua-src/imports.aqua
Dmitry Kurinskiy 012cba493c
Op model (#403)
* Separating raw FuncOp from OpModel WIP

* Model compiles, fighting with transform

* Refactoring WIP

* transform compiles

* Fixing AquaCompiler WIP

* Compiler compiles WIP

* AquaContext's allFuncs, allValues

* WIP trying to compile the CLI

* It compiles

* It runs and fails to compile

* Compiles wrong way

* fix TopologySpec

* Sugar bugfix

* fix TransformSpec compilation

* fix test compilation

* fix SemanticSpec

* Topology debugging

* TransformSpec fixed

* Do not import aqua.model

* Take parts in Semantics

* Fix for re-exports

* Maybe a fix for streams

* Maybe a fix for declarations

* streamArgs.aqua in test examples

* more aqua code with bugs

* FuncOp removed

* removed wrapNonEmpty

* fix TransformSpec

* fix SemanticSpec compilation, delete FuncOps

* Separated model/res, model/inline

* tiny fix

* Tests fixed

* TreeNode to wrap labels into cofree standard way

* TreeNodeCompanion with defauls show, equalsOrShowDiff for all Cofree trees we have

* Simple TagInlinerSpec

* Failing test in TagInlinerSpec

* test wip

* test fixed

* delete Node

* delete test-kit, move tests

* fix constants

* Failing TagInliner test

* More complex case for TagInlinerSpec

* TagInlinerSpec fix

* Split RawValueInliner, TagInliner

* Dumb case for ArrowInlinerSpec

* spec for stream renaming

* renaming stream test

* Exports fixed

* SeqModel.wrapWithEmpty for tests

* Deleted EmptyModel

* Bring back EmptyModel

* ArrowInlinerSpec wip

* ArrowInlinerSpec fixed

* Test fixed

* fix

* stream in callback test WIP

* Slightly better logging for TagInliner

* add example in aqua

* test update

* Removed occasional abilities override

* test

* AquaCompilerSpec WIP

* AquaCompilerSpec failing

* AquaCompilerSpec fixed

* fix test

* compiler test, add RestrictionTag

* break test

* fix stream passing to box arguments

* fix exports in context

* Do not reexport builtins

* init for topology bug

* test for topology

* Reproduced the import-reexport bug

* Hops are working...

* Issue #397 does not reproduce!

* foldJoin reproduces the bug

* Reexports inefficiently fixed

* Topology test fixed

* topology bug

* Cache compiled parts

* Cache compiled parts

* ignore the wip topology test

* delete test

* hanging

* add builtin

* Use linked-data-structure `equals` instead of recursive `hashCode`

* A bit more logs

* eq is faster than ==

* Try to join one by one

* op.identity for join

* reverting op.noop for join

* Fix for renaming when value has the same name as argument

* Bump the version to .6

* broken test for names

* second test for renaming

* this test works but i must break it

* add index in call

* JoinModel breaks test

* the test works fine with a fix, but we should check it closely. and `foldJoin.aqua` integration test become broken

* broken test with xor

* Fixed naming issue for lambda's variables substitution

* Topology bug wip

* Fixes #397

* Maybe fix

Co-authored-by: DieMyst <dmitry.shakhtarin@fluence.ai>
2022-01-31 14:48:13 +03:00

18 lines
706 B
Plaintext

import decl_foo, decl_bar from "declare.aqua"
use DECLARE_CONST, SuperFoo, DECLARE_CONST2 as DC2 from "declare.aqua" as Declare
import Op as Noop from "builtin.aqua"
import some_string, MyExportSrv, EXPORT_CONST from "exports.aqua"
service StringService("string_service"):
concat(a: string, b: string) -> string
func concat_foobars() -> string:
res1 <- decl_foo()
res2 <- decl_bar()
res3 <- StringService.concat(res1, res2)
res4 <- Declare.SuperFoo.small_foo()
res5 <- StringService.concat(res3, res4)
res6 <- StringService.concat(res5, EXPORT_CONST)
res7 <- StringService.concat(res6, Declare.DECLARE_CONST)
res8 <- StringService.concat(res7, Declare.DC2)
<- res8