Commit Graph

140 Commits

Author SHA1 Message Date
InversionSpaces
b0f3a8c21e
fix(compiler): Fix CRDT Map in array handling [LNG-370] (#1171)
* Stricten CollectibleType

* Add test

* Add comment
2024-07-12 16:06:14 +07:00
InversionSpaces
1c76f75d80
feat(compiler): Allow renaming imports with qualified names [LNG-361] (#1136)
* Reverse ability search order

* Gather arrows from imported services

* Add test

* Refactor AquaContext

* Add test for abilities

* Rewrite parsing

* Update cache

* Make method private

* Use only PName in pick

* Rewrite picking (Compilation savepoint)

* Fix PName.value

* Linearize modules, make tests compile

* Make unit tests pass (Savepoint)

* Refactor a little

* Remove declared argument

* Refactor

* Move scoped to Picker

* Refactor locations to typed names

* Fix pickHeader

* Implement scoped for LspContext

* Refactor exports, rethink HeaderSem monoid

* Fix AquaContext (Savepoint)

* Fix import handling

* Remove println

* Remove unused fields

* Add header to SName.scala

* Add simple test

* Add merge test

* Add renaming test

* Refactor module to separate class

* Add comments

* Remove setAbility method

* Refactor exports handling

* Remove unnecessary variable

* Add integration tests
2024-07-03 20:41:31 +07:00
Dima
4d49279569
feat(compiler): Add feature to insert map from a function result with correct type [LNG-367] (#1159) 2024-07-01 19:58:29 +07:00
InversionSpaces
4ad0655da6
chore: Update files headers to AGPLv3 (#1161) 2024-06-24 12:20:27 +00:00
Dima
934c20c98a
feat(compiler): CRDT-maps implementation (#1142) 2024-06-06 04:24:47 +00:00
Dima
35db82c767
fix(lsp): Go-to-definition for used types (LNG-345) (#1128) 2024-05-14 11:36:25 +00:00
InversionSpaces
faf5b8071f
feat(compiler): Allow redeclaring services (and abilities) [LNG-360] (#1135)
* Reverse ability search order

* Gather arrows from imported services

* Add test

* Refactor AquaContext

* Add test for abilities

* Update cache
2024-05-10 12:43:52 +02:00
Dima
6cc068ac36
fix(lsp): Plugin throws OOM on big projects (#1134) 2024-05-07 11:58:37 +02:00
InversionSpaces
9c23a9d4ef
feat(compiler): Allow redeclaring functions [LNG-357] (#1127)
* Allow dots in use ... as

* Add tests

* Refactor implicits

* Use QName in module name

* Fix test

* Refactor declares

* Add PName

* Propagate nested abilities

* Fix compilation

* Do not propagate context

* Use alignCombine

* Add test

* Add more tests

* Refactor test

* Remove unused function

* Refactor test

* Refactor, add comments

* Checkout aqua-src
2024-04-25 10:40:55 +00:00
Dima
e6c5d0039f
fix(compiler): Return error if SemanticError occures [LNG-356] (#1126) 2024-04-17 12:40:19 +00:00
InversionSpaces
f29e44e52a
fix(compiler): Refactor header semantics [LNG-352] (#1113)
* Initial

* Fix import

* Refactor RawSemantics

* Refactor RawSemantics

* Remove initCtx for export

* Add fromInit

* Remove setInit

* Use init ctx

* Add a hack to ModuleSem

* Remove initCtx

* Refactor HeaderSem finalization

* Remove RawContext#init

* Combine with semigroup op

* Remove unnecessary typeclass

* Remove unused typeclass

* Remove unnecessary typeclass

* Remove unnecessary monoid

* Remove contants from monoid

* Fix tests

* Remove unused monoids

* Refactor declares

* Refactor module sem

* Refactor module sem

* Update LspSemantics

* Remove unused typeclass

* Remove unnecessary method

* Add comments
2024-04-09 12:58:12 +02:00
Dima
07bea1a909
fix(lsp): Fix go-to-definition for abilities as arguments in functions [LNG-343] (#1116) 2024-04-08 12:43:30 +00:00
Dima
8f06ac1cba
fix(compiler): Redeclare imports [LNG-344] (#1109) 2024-04-02 09:04:01 +00:00
Dima
14748c7646
fix(compiler): Create restrictions in inliner [LNG-346] (#1099) 2024-03-28 11:10:13 +00:00
InversionSpaces
a6c8e75c27
fix(compiler): Import abilities with use [LNG-324] (#1077)
* Add IntoApply

* Savepoint

* Add backtrack

* Return ability name

* Add service resolution

* Return import ability

* Add test

* Rewrite toDottedName

* Rewrite ability resolution

* Fix offset

* Add tests

* Add test

* Add comments

* Add test

---------

Co-authored-by: Dima <dmitry.shakhtarin@fluence.ai>
2024-02-29 14:56:05 +01:00
Dima
3e9d385668
fix(language-server): Name clashing in LSP [LNG-342] (#1089) 2024-02-26 13:00:25 +00:00
Dima
245f6640f8
feat(language-server): Resolve paths for imports (#1079) 2024-02-20 12:52:54 +00:00
Dima
17fb77c40f
fix(compiler): Use strict to check types availability [LNG-334] (#1071) 2024-02-12 09:23:14 +01:00
Dima
f7194f0a54
feat(language-server): Support declares and exports in LSP [LNG-304, LNG-319] (#1070)
Co-authored-by: InversionSpaces <inversionspaces@vivaldi.net>
2024-02-07 09:21:42 +00:00
Dima
1a0b3a22c1
fix(compiler): Streams in closures generates wrong AIR (#1055) 2024-01-30 11:34:50 +03:00
Dima
abcb63db3b
perf(compiler): Inliner optimization [LNG-322] (#1047) 2024-01-22 10:08:06 +00:00
InversionSpaces
d057a5e695
feat(compiler)!: Force aqua header [LNG-308] (#1028)
* Refactor

* deprecate `module`, force `aqua`, fix integration and unit tests

* fix ImportFromSpec

* Savepoint

* Fix

* Semantic error on module header

* Refactor

* Add begin token

* Fix tests

* Remove DHT examples

* Use git aqua-lib

* Fix headers

* Fix headers

* Fix headers

* Fix headers

* Fix headers

* Fix headers

* Fix headers

* Fix test

* Unignore tests

* Update aqua-lib

---------

Co-authored-by: DieMyst <dmitry.shakhtarin@fluence.ai>
2024-01-18 10:43:23 +01:00
InversionSpaces
d46ee0347f
fix(compiler): Type check arrow calls on services and abilities [LNG-315] (#1037)
* Rewrite resolveIntoArrow

* Refactor

* Refactor resolveIntoCopy

* Refactor resolveIntoIndex

* Refactor resolveIntoField

* Fix test

* Remove package-lock.json

* Add tests

* Add comment
2024-01-10 11:36:20 +01:00
InversionSpaces
d5cd77bb86
feat(compiler): Enhance message of type error [LNG-313] (#1033) 2024-01-09 15:15:27 +03:00
InversionSpaces
ae32f80277
feat(compiler): for ... rec [LNG-307] (#1026)
* Add parser

* Add semantics

* Add inlining

* Add range test

* Rewrite to for ... rec

* Rewrite tests

* Fix import

* Add nested test

* Remove only

* Add yes|no test

* Add multi rec test

* Add pipeline test

* Unignore tests

* Change timeouts

* Add remote rec test

* Fix integration tests

* Add parser test

* Add semantics test

* Add inlining test

* Add comment
2024-01-09 12:48:02 +01:00
Dima
74d02e1f63
feat(language-server): Pass token types to LSP [LNG-285] (#999) 2023-12-07 12:06:51 +00:00
Dima
4cecab1a26
fix(compiler): Use correct empty stream as argument [LNG-280, LNG-292] (#967) 2023-11-28 10:45:12 +00:00
InversionSpaces
2d4b2aece4
fix(compiler): Allow returning resolved service as ability [LNG-266] (#977)
* Refactor

* Refactor type system

* Remove println

* Fix renaming

* Add unit tests

* Do not convert to call arrow

* Check ability

* Refactor captured values resolution

* Remove println

* Fix fields gathering

* Remove println

* Remove println

* Fix renaming, export ability

* Rename only abilities

* Fix unit tests

* Fix captured arrows renaming

* Add comments

* Refactor

* Rename only arrows

* Add comments, refactor

* Add comments

* Rename method

* Add integration test

---------

Co-authored-by: Anatolios Laskaris <github_me@nahsi.dev>
Co-authored-by: Dima <dmitry.shakhtarin@fluence.ai>
2023-11-23 10:12:44 +00:00
InversionSpaces
11c8970fd8
feat(compiler)!: Make nil option bottom [LNG-279] (#968)
* Make nil option of bottom

* Fix tests

* Make literals of data type

* Add unit tests

* Remove print
2023-11-14 11:02:58 +00:00
InversionSpaces
68425ed42a
feat(compiler)!: Prohibit mutating options [LNG-277] (#960)
* Parse any nested type

* Refactor type system

* Fix restriction

* Refactor type resolution

* Return stream definition

* Update examples

* Refactor

* Refactor

* Refactor integration tests

* Export service

* Add integration test

* Fix args provider

* Add parser unit tests

* Add type resolution unit tests

* Add more unit tests

* DataTypeToken -> CompositeTypeToken

* GeneralStreamType -> MutableStreamType

* Refactor

* Refactor TypeResolution

* colType -> collectionType

* Refactor

* Fix PushToStreamSem

* BasicTypeToken -> ScalarTypeToken

* CompositeTypeToken -> BasicTypeToken

* Fix for nil

* Make stream collectible

* Refactor collectible type

* Use internalError

* Add unit tests
2023-11-13 11:58:36 +03:00
Dima
a1576efad9
fix(compiler): Code generate wrong stream name in AIR [LNG-276] (#958) 2023-11-02 13:13:25 +00:00
InversionSpaces
5a3c5e6666
fix(compiler): Unknown service method call is ignored [LNG-273] (#957)
* Remove property token adjustment

* Revert "Remove property token adjustment"

This reverts commit 27d72f2bff.

* Remove scope word

* Refactor

* Refactor, add error

* Add unit tests

* Fix specifier for struct
2023-11-01 14:55:59 +03:00
InversionSpaces
78ee753c7b
feat(compiler): Always generate last argument of fold [LNG-265] (#947)
* Always generate last in fold

* Fix unit tests

* Add methods
2023-10-30 12:58:51 +03:00
Dima
38f77285f5
fix(compiler): Throw an error when comparing an alias and a named type with the same name [LNG-231] (#946) 2023-10-27 11:18:44 +00:00
Dima
45ca7bbf3e
fix(compiler): Multiple closures in one function [LNG-262] (#941) 2023-10-27 09:24:52 +02:00
InversionSpaces
fcdb5b0fef
feat(compiler): Allow omitting field name in struct creation [LNG-261] (#943) 2023-10-25 09:12:09 +00:00
Dima
fab46ee130
fix(compiler): Return ability arrow [LNG-258] (#935) 2023-10-23 16:59:55 +03:00
InversionSpaces
c83d69e689
fix(compiler): Passed function is not handled correctly [LNG-260] (#940)
* Fix renaming

* Add integration test
2023-10-23 11:54:09 +00:00
InversionSpaces
5f6c47ffea
feat(compiler): Optimize math in compile time [LNG-245] (#922)
* Move service calls for math to inlining

* Fix: add predo

* Introduce CallServiceRaw

* Add comment

* Add optimization to inlining

* Add tests

* map -> mapValues

* Refactor type

* Add optimization

* Add optimization test

* Fix unit tests

* Fix PR comments

* Restrict optimization

* Add substraction to optimization

* Apply optimizations in gate

* Fix sign, move optimization to unfold

* Fix type and tests

* Fix unit tests

* Add unit test

* Fix after merge

* Add optimization, fix unit tests

* Fix comment
2023-10-09 13:02:26 +03:00
InversionSpaces
feb7a167a2
fix(compiler): fix typo (#916)
Fix typo
2023-09-28 15:20:28 +03:00
InversionSpaces
ca6cae96ad
feat(compiler): Make if propagate errors [fixes LNG-202] (#779)
* Change if inlining, add fail model

* Inline if

* Fix, add comments

* Add integration test

* Fix test

* Fix test

* toBe -> toEqual

---------

Co-authored-by: Dima <dmitry.shakhtarin@fluence.ai>
2023-09-27 09:52:52 +00:00
InversionSpaces
a80033b81c
feat(compiler): Replace %last_error% with :error: [fixes LNG-239] (#883)
* %last_error% -> :error:

* Add integration test

* Fix integration tests

* Update integration test
2023-09-26 13:28:13 +03:00
InversionSpaces
27a781dd3f
feat(compiler): Add warnings subsystem [fixes LNG117] (#906)
* ErrorsAlgebra -> ReportAlgebra

* Refactor ReportAlgebra

* Refactor

* Refactor AquaError

* Fixes

* Add warnings, refactor

* Refactor parser

* Move semantics

* Savepoint

* Refactor semantics and compiler

* Refactor types

* Refactor compiler

* Refactor compiler

* Refactor types

* Refactor retunr types

* Return warnings

* Add simple warning

* Refactor to ValidatedNec

* Refactor

* Add comment

* Propagate warnings to LspContext

* Propagate warnings to LSP

* Add warnings to js api

* Update LSP js api

* Use export declare

* Add comment

* Refactor span rendering

* Remove variable name warning

* Add warning on unused call results

* Add unit tests

* Remove println
2023-09-25 13:00:43 +00:00
InversionSpaces
8741c910be
feat(compiler): Fail on internal error [fixes LNG-229] (#905)
* Refactor utils

* Add errors project

* logger.error -> internalError

* Add comment

* Suppress stack trace

---------

Co-authored-by: Dima <dmitry.shakhtarin@fluence.ai>
2023-09-19 17:01:42 +02:00
InversionSpaces
54ddcc8b62
fix(compiler): Do not restrict stream args when ability is present [fixes LNG-233] (#902)
Add test
2023-09-18 14:43:22 +00:00
InversionSpaces
6be2a3d5da
feat(compiler): Services as abilities [fixes LNG-206] (#873)
* Refactor ServiceSem

* Refactor AbilityIdSem

* Remove tokens from state

* Refactor

* Add mangler

* Fix tests

* Refactor valueToRaw

* ServiceIdTag

* AbilityId -> ServiceId

* Add ServiceType

* Fix defineServiceType

* Refactor resolveArrowDef

* Refactor TypesHelper

* Add ServiceIdTag inlining

* Implement resolution

* Add service as ability passing

* Fix importing services

* Fix cli

* Implement default service

* Remove println

* Fix capture

* Add integration test

* Fix id

* Fix test

* Fix test

* Refactor test

* Do not resolve id

* Refactor FuncArrow creation

* Refactor FuncArrow wrapper creation

* Add named arguments

* Add comment

* ensureIsString -> valueToStringRaw, refactor OnSem

* Resolve services as abilities

* Add name to varNames

* Remove service hack

* Capture services, do not rename captured

* Rename arrows along with values

* Fix CallArrowRaw.map

* Fix unit tests

* Remove service case

* Refactor abilities state

* Propagate rootServiceIds

* Remove unused

* Add comments

* Refactor

* Refactor

* Add test

---------

Co-authored-by: Dima <dmitry.shakhtarin@fluence.ai>
2023-09-15 10:34:21 +02:00
InversionSpaces
69a808e243
fix(compiler): Error on not arrow call after <- (#876)
* Add error report

* Add tests
2023-09-08 14:21:19 +02:00
InversionSpaces
443e65e3d8
fix(compiler): Fix closure stream capture [fixes LNG-58] (#857) 2023-09-01 16:05:32 +03:00
InversionSpaces
2a0b207633
feat(compiler): Restrict abilities usage [fixes LNG-208] (#854)
* Refactor

* Refactor

* Refactor

* Remove ScopeRaw

* Refactor, forbid exporting

* Add export checks

* Refactor

* Forbid exporting abilities

* Fix integration tests

* Forbid implicit ability export

* Simplify exports

* Fordbid using non data types in collections

* Forbid unappropriate struct field types

* Refactor

* Add export tests

* Add collection tests

* Add struct fields test

* Fixes

* Fix
2023-08-24 16:09:39 +03:00
Dima
8060695dbb
feat: parseq implementation (fixes LNG-223) (#840)
* parsec implementation

* add test code

* parsec expression

* Refactor

* Refactor

* Add return strategy to on

* Add ExitStrategy

* Add TopologyPath

* Add ExitStrategy.ToRelay

* Handle ToRelay

* Refactor

* Refactor

* Refactor

* Handle OnModel with Relay strategy

* parsec -> parseq

* parsec -> parseq

* Add semantics test

* Add topology tests

* Add comments

---------

Co-authored-by: InversionSpaces <InversionSpaces@vivaldi.net>
2023-08-21 14:26:30 +04:00