apollovm 0.1.18
apollovm: ^0.1.18 copied to clipboard
ApolloVM, a Multilingual portable VM (native, JS/Web, Flutter) for Dart, Java, JavaScript with on-the-fly Wasm compilation.
0.1.18 #
-
ASTExpressionObjectEntryFunctionInvocation:- Added new AST expression class to represent calls to class object entry functions.
- Implements function resolution and invocation on class instances or static context.
- Overrides
runandtoStringmethods for execution and debugging.
-
ApolloCodeGenerator:- Added support for generating code for
ASTExpressionObjectEntryFunctionInvocation. - Updated
generateASTExpressionmethod to handleASTExpressionObjectEntryFunctionInvocation.
- Added support for generating code for
-
ApolloGeneratorinterface:- Added abstract method
generateASTExpressionObjectEntryFunctionInvocation.
- Added abstract method
-
ApolloGeneratorWasm:- Added stub implementation for
generateASTExpressionObjectEntryFunctionInvocationthrowingUnimplementedError.
- Added stub implementation for
-
Dart and Java11 grammars:
- Added parsing rule
expressionObjectEntryFunctionInvocationto support syntax for object entry function invocation expressions.
- Added parsing rule
0.1.17 #
- Added
ApolloImportManagerto manage package/library imports and resolve core packages. VMContext:- Made sealed class.
- Added
importManagerfield andimportmethod to support import resolution and delegation to parent contexts. - Updated function and external function lookup to consider imported functions.
- Added
VMScopeContextas a final subclass ofVMContextfor scoped runtime contexts. - Updated
VMClassContextand other runtime contexts to be final and useVMScopeContextfor nested scopes. ASTStatementImport:- New AST node to represent import statements.
- Supports running import in a context, throwing on failure.
ASTRoot:- Supports tracking and running import statements.
- Considers imported functions in function resolution.
ApolloRunner:- Added
importManagerfield and initialization with default import manager. - Supports auto-import of
dart:mathcore package. - Passes
importManagerto execution and function lookup calls.
- Added
CorePackageBaseandCorePackageMath:- Added
pathgetter for core package identification.
- Added
- Code generators (
dart,java11,wasm):- Added support for generating import statements (
ASTStatementImport).
- Added support for generating import statements (
- Dart and Java11 grammar:
- Added parsing of import statements into
ASTStatementImport.
- Added parsing of import statements into
- Test framework:
- Added support for
auto-import-dart-mathattribute in test XML. - Tests updated to import
dart:mathand usepowfunction.
- Added support for
- Various runtime and AST classes:
- Updated to use
VMScopeContextinstead of baseVMContextfor nested scopes. - Updated
VMObjectfield value methods to useVMScopeContext.
- Updated to use
- Minor fixes and improvements in import handling, context management, and code generation.
0.1.16 #
DartGrammarDefinition:- Changed type of
finalExpressionOpfromASTExpressionOperation?toASTExpression?. - Updated cast of
expressionOpfromASTExpressionOperationtoASTExpression.
- Changed type of
0.1.15 #
-
ApolloCodeGenerator:generateASTValueDouble: replaced manual double string formatting withASTTypeDouble.doubleToStringfor consistent double string representation.
-
ASTStatementVariableDeclaration:_runImpl2: updated type cast check to allow dynamic type to bypass cast validation.
-
ASTTypeDouble:- Added static method
doubleToStringto format double values consistently, optionally allowing scientific notation. - Updated
toStringmethod ofASTTypeNumto return'num'instead of'double'.
- Added static method
-
ASTValueAsStringandASTValuesListAsString:- Updated string conversion to use
valueToStringmethod that formats doubles usingASTTypeDouble.doubleToString.
- Updated string conversion to use
-
CorePackageMath:- Updated math function external static function wrappers to explicitly type parameters as
numand returnASTTypeDouble.instancefor functions returning double values.
- Updated math function external static function wrappers to explicitly type parameters as
-
Test framework (
apollovm_languages_test_definition.dart):- Moved output printing before output assertion in
_testCallfor clearer test logs.
- Moved output printing before output assertion in
0.1.14 #
- Added new
ASTExpressionsubclassASTExpressionNegativeto represent unary negative expressions. - Added new
ASTExpressionsubclassASTExpressionGroupFunctionInvocationto represent function calls on grouped expressions (e.g.,(-d).toStringAsFixed(4)). ApolloCodeGenerator:- Updated
generateASTExpressionto handleASTExpressionNegativeandASTExpressionGroupFunctionInvocation. - Added methods
generateASTExpressionNegativeandgenerateASTExpressionGroupFunctionInvocation. - Refactored function invocation code into private
_generateFunctionInvocationhelper.
- Updated
ApolloGeneratorinterface:- Added abstract methods
generateASTExpressionNegativeandgenerateASTExpressionGroupFunctionInvocation. - Updated
generateASTExpressionto support new expression types.
- Added abstract methods
apollovm_ast_expression.dart:- Added implementation of
ASTExpressionNegativewith type resolution, runtime evaluation, and string representation. - Added implementation of
ASTExpressionGroupFunctionInvocationwith function resolution and invocation logic.
- Added implementation of
- Dart and Java11 grammars:
- Added parsing support for unary negative expressions (
-expr). - Added parsing support for group function invocations (e.g.,
(expr).func(args)).
- Added parsing support for unary negative expressions (
ApolloGeneratorWasm:- Added stub implementations for
generateASTExpressionNegativeandgenerateASTExpressionGroupFunctionInvocation. - Updated expression generation dispatch to handle new expression types.
- Added stub implementations for
0.1.13 #
-
ASTStatementWhileLoop:- Added new AST node class representing a while loop statement.
- Implemented
runmethod to execute the loop with proper context handling. - Added type resolution returning
ASTTypeVoid.instance. - Added children and node resolution methods.
-
ApolloCodeGenerator:- Added support for generating code for
ASTStatementWhileLoopingenerateASTStatement. - Implemented
generateASTStatementWhileLoopmethod to generate while loop source code.
- Added support for generating code for
-
ApolloGenerator:- Added abstract method
generateASTStatementWhileLoop. - Added dispatch for
ASTStatementWhileLoopingenerateASTStatement.
- Added abstract method
-
DartGrammarDefinition:- Added
statementWhileLoopparser to parse while loop statements. - Integrated
statementWhileLoopinto the mainstatementparser.
- Added
-
Java11GrammarDefinition:- Added
statementWhileLoopparser to parse while loop statements. - Integrated
statementWhileLoopinto the mainstatementparser.
- Added
-
ApolloGeneratorWasm:- Added stub for
generateASTStatementWhileLoopmethod throwingUnimplementedError. - Added dispatch for
ASTStatementWhileLoopingenerateASTStatement.
- Added stub for
-
Tests:
- Added new test
dart_basic_printFibonacci.test.xmldemonstrating while loop usage in Dart source and generated code.
- Added new test
0.1.12 #
-
ASTInvocableDeclaration:- Replaced
ASTFunctionDeclarationwith genericASTInvocableDeclarationfor function and constructor declarations. - Added
ASTClassConstructorDeclarationfor class constructors with support forthisparameters. - Added
resolveRuntimeTypemethod to support runtime type resolution with context and node. - Updated
callandrunmethods to support async and context-aware execution. - Added
initializeVariablesfor constructor variable initialization.
- Replaced
-
ASTParametersDeclaration:- Made generic over parameter type
P. - Added
ASTConstructorParametersDeclarationandASTFunctionParametersDeclarationsubclasses. - Updated parameter accessors and type checks to use generic parameter type.
- Made generic over parameter type
-
ASTParameterDeclaration:- Added
ASTConstructorParameterDeclarationwiththisParameterflag. - Added extensions for filtering
thisparameters.
- Added
-
ASTFunctionSetandASTConstructorSet:- Introduced generic base
ASTInvokableSetwith single and multiple implementations. - Added
ASTConstructorSetfor constructors, similar to function sets.
- Introduced generic base
-
ASTClassNormal:- Added support for constructors with
ASTConstructorSet. - Added methods to add, get, and check constructors by name and signature.
- Updated
resolveNodeto resolve constructors.
- Added support for constructors with
-
ASTRoot:- Updated
getFunctionto return constructors if matching class name and signature.
- Updated
-
ASTExpressionandASTValue:- Added
resolveRuntimeTypeandgetHashcodeValuemethods for runtime type and value hashing. - Updated equality and hashCode to use
getHashcodeValue.
- Added
-
ASTExpressionFunctionInvocationand subclasses:- Updated to use
ASTInvocableDeclarationfor function retrieval. - Updated
runmethod to support async and context-aware invocation.
- Updated to use
-
ASTExpressionObjectGetterAccess:- Updated getter retrieval and runtime type resolution to support async and context-aware evaluation.
- Added
_runGetterhelper for getter invocation.
-
ASTStatementVariableDeclaration:- Added
unmodifiableflag. - Updated type resolution and run implementation to use
resolveRuntimeType.
- Added
-
ASTType:- Added
ASTTypeConstructorThissingleton for constructorthisparameter. - Added
resolveRuntimeTypemethod.
- Added
-
ASTVariable:- Added
resolveRuntimeTypemethod.
- Added
-
CorePackageBaseandCoreClassMixin:- Updated external function and class function creation to use
ASTFunctionParametersDeclaration.
- Updated external function and class function creation to use
-
CoreClassList:- Added
firstandlastgetters with runtime component type resolution. - Added empty constructor list and related methods.
- Added
-
DartGrammarDefinitionandJava11GrammarDefinition:- Added parsing support for class constructors with parameters and optional blocks.
- Updated function and constructor parameter parsing to use
ASTFunctionParametersDeclarationandASTConstructorParametersDeclaration. - Added parsing for
thisconstructor parameters.
-
ApolloCodeGeneratorDartandApolloCodeGeneratorJava11:- Added
generateASTClassConstructorDeclarationmethod to generate constructor code. - Updated function parameter generation to use generic parameter declaration.
- Added
-
ApolloParserWasm:- Updated WASM function parsing to use
ASTFunctionParametersDeclaration.
- Updated WASM function parsing to use
-
Test:- Added new test
dart_basic_linearRegression.test.xmlwith Dart source for linear regression and forecast. - Added new test
dart_basic_calculateShippingCost.test.xmlfor shipping cost calculation. - Updated test runner to include new tests.
- Added new test
0.1.11 #
-
ASTValueNum:frommethod:- Added optional
asDoubleparameter to control numeric type coercion. - Improved parsing logic to preserve numeric intent from strings containing decimal points or exponents by forcing double representation.
- Added error handling for unsupported input types when
asDoubleis specified.
- Added optional
-
Added
ASTExpressionNullValueclass to representnullliteral expressions. -
ASTScopeVariable:- Special handling for variable named
'null'to resolve asASTValueNull.
- Special handling for variable named
-
ApolloCodeGenerator:- Added
generateASTExpressionNullValuemethod to generate code fornullexpressions. - Updated
generateASTExpressionto handleASTExpressionNullValue. generateASTValueDouble:- Fixed formatting of double values to ensure consistent decimal representation.
- Added handling to convert scientific notation doubles to fixed decimal format with appropriate fraction digits.
- Added helper method
fractionDigitsFromScientificNotationto determine the number of fraction digits needed for doubles in scientific notation.
- Added
-
ApolloGeneratorinterface:- Added
generateASTExpressionNullValuemethod. - Updated
generateASTExpressionto handleASTExpressionNullValue.
- Added
-
ApolloRunner:- Added optional
importCorePackageMathparameter to constructor andcreateRunnermethod. - When
importCorePackageMathis true, maps math functions fromCorePackageMathto external functions.
- Added optional
-
CorePackageMath:- New core package providing Dart
dart:mathfunctions as external functions for ApolloVM. - Includes
pow,sqrt,sin,cos,tan,asin,acos,atan,atan2,log,exp,abs,min,max.
- New core package providing Dart
-
Language grammars (
dart,java11):- Added parsing support for
nullliteral expressions producingASTExpressionNullValue.
- Added parsing support for
-
Language runners (
dart,java11,wasm):- Added support for
importCorePackageMathparameter in constructors.
- Added support for
-
ApolloGeneratorWasm:- Added stub for
generateASTExpressionNullValuethrowingUnimplementedError. - Updated
generateASTExpressionto handleASTExpressionNullValue.
- Added stub for
-
Test framework:
- Added new test
dart_basic_stdv.test.xmldemonstrating usage of math functions (pow,sqrt) andnullchecks. - Updated test runner to create runners with
importCorePackageMath: trueto enable math functions in tests.
- Added new test
0.1.10 #
ASTAssignmentOperator:- Added new operator
divideAsIntwith symbol'~/'. - Updated
asASTExpressionOperatorgetter to supportdivideAsInt. - Updated
getASTAssignmentOperatorandgetASTAssignmentOperatorTextto handledivideAsIntand its assignment form'~/='.
- Added new operator
ASTExpressionVariableAssignment:- Added support for
divideAsIntoperator in evaluation and string representation.
- Added support for
- Dart grammar (
dart_grammar.dart):- Extended
assigmentOperatorparser to recognize'~/='operator.
- Extended
- Java11 grammar (
java11_grammar.dart):- No changes for
divideAsIntoperator (remains unsupported).
- No changes for
0.1.9 #
-
ASTExpressionListLiteral:resolveType: updated to returnASTTypeArrayof the specified type or deduced common element type.children: fixed to includetypecorrectly.
-
ASTStatementVariableDeclaration:- Constructor enhanced to handle
ASTExpressionListLiteralvalues with type adjustments or cast exceptions.
- Constructor enhanced to handle
-
ASTStatementForEach:- Added
variableTypefield. - Constructor updated to accept
variableType.
- Added
-
ASTType:- Added
commonTypemethod to find common compatible type between two types.
- Added
-
ASTTypeArray:toValue: improved to castASTValueArrayto correct generic type if needed.
-
ASTValueArray:- Added
castmethod to convert to another generic type with optional component type.
- Added
-
Dart grammar (
dart_grammar.dart):statementForEachparser updated to parse explicit variable type before variable name.expressionListLiteralparser updated to infer common element type if not specified.
-
Java11 grammar (
java11_grammar.dart):statementForEachparser updated to parse explicit variable type before variable name.
-
Tests:
- Added Dart test for
findMax(List<int> numbers)function with multiple test cases including empty list handling.
- Added Dart test for
0.1.8 #
-
ASTStatementForEach:- Added new AST statement class representing a for-each loop with a variable name, iterable expression, and loop block.
- Implements
runmethod to iterate over an iterable AST value, declaring the loop variable in a nested context and running the loop block. - Resolves type as
void.
-
ApolloCodeGenerator:- Added support for generating code for
ASTStatementForEachingenerateASTStatement. - Implemented
generateASTStatementForEachmethod to output a for-in loop syntax with variable declaration and loop block.
- Added support for generating code for
-
ApolloGenerator:- Added abstract method
generateASTStatementForEach. - Updated
generateASTStatementto dispatch togenerateASTStatementForEachforASTStatementForEach.
- Added abstract method
-
Dart language grammar (
dart_grammar.dart):- Added parser
statementForEachto parse Dart-style for-each loops (for (var x in iterable) { ... }). - Added helper parser
_forEachVariableDeclto parse optionalvarorfinalbefore variable name.
- Added parser
-
Java language grammar (
java11_grammar.dart):- Added parser
statementForEachto parse Java-style for-each loops (for (Type var : iterable) { ... }).
- Added parser
0.1.7 #
-
CI:
.github/workflows/dart.yml: updatedactions/checkoutfrom v3 to v6 andcodecov/codecov-actionfrom v3 to v5.
-
apollovm.dart:- Exported new utility file
src/apollovm_utils.dart.
- Exported new utility file
-
apollovm_runner.dart:ApolloRunner:executeClassMethod: changed to async, added parameter normalization before execution.- Added
normalizeParametersmethod to normalize positional and named parameters against AST function declarations. executeFunction: added parameter normalization for top-level functions.- Improved parameter handling for function execution.
-
apollovm_utils.dart(new):- Added utilities for generic typed list conversion and case-insensitive map key lookup.
- Extensions on
Listfor typed list creation and onMapfor case-insensitive key lookup.
-
apollovm_ast_toplevel.dart:ASTFunctionDeclaration:- Added
normalizeParameters,normalizePositionalParameters, andnormalizeNamedParametersmethods to convert and normalize parameters according to function declarations.
- Added
- Added extension
IterableASTFunctionDeclarationExtensionwithresolveBestMatchBySignatureto select best matching function overload by parameter signature.
-
apollovm_ast_type.dart:ASTType:- Added
fromTypefactory to create ASTType from DartType. - Added
toASTValuemethod to convert native values to ASTValue according to type.
- Added
- Added
toASTValueoverrides in primitive and collection types (ASTTypeBool,ASTTypeNum,ASTTypeInt,ASTTypeDouble,ASTTypeString,ASTTypeNull,ASTTypeVoid,ASTTypeArray,ASTTypeArray2D,ASTTypeMap,ASTTypeFuture). - Added static
fromTypemethods forASTTypeArrayandASTTypeMapto create instances from Dart generic types. ASTTypeArrayandCoreClassList:- Added typed singleton instances for common generic types (e.g.,
List<String>,List<int>, etc.). - Added factory constructors and
fromTypemethods to resolve types generically.
- Added typed singleton instances for common generic types (e.g.,
ASTTypeMap:- Added
fromTypemethod for common map generic types.
- Added
ASTTypeFuture:- Added
toASTValueoverride to handle conversion from native or future values.
- Added
-
apollovm_ast_value.dart:ASTValue.fromfactory:- Added support for
ASTTypeBoolto createASTValueBool.
- Added support for
-
apollovm_core_base.dart:ApolloVMCore.getClass:- Added optional
genericsparameter. Listclass resolution now usesCoreClassList.fromTypewith generic type.
- Added optional
CoreClassList:- Converted to generic class
CoreClassList<T>. - Added typed singleton instances for common generic types.
- Added
fromTypestatic method to resolve generic list classes. - Constructor updated to accept generic type and resolve
ASTTypeArrayaccordingly.
- Converted to generic class
-
wasm_runner.dart:ApolloRunnerWasm:- Added parameter normalization before calling Wasm functions.
-
wasm_runtime.dart:- Added
ensureBooted()method andlastBootErrorgetter toWasmRuntimeinterface.
- Added
-
wasm_runtime_dart_html.dart,wasm_runtime_generic.dart,wasm_runtime_web.dart:- Implemented
ensureBooted()as no-op andlastBootErroras null.
- Implemented
-
wasm_runtime_io.dart:- Added boot logic with error capture.
- Implemented
ensureBooted()to call boot. - Added
lastBootErrorgetter.
-
Tests (
apollovm_languages_test_definition.dart):- Updated
_parseJsonListto return untypedListwithout generic type conversion. - Removed redundant generic list conversion helpers from test file.
- Updated tests to call
.toListOfType()extension for typed list checks.
- Updated
-
Tests (
apollovm_wasm_test.dart):- Added call to
wasmRuntime.ensureBooted()before checking support. - On unsupported runtime, print last boot error for diagnostics.
- Added call to
0.1.6 #
-
Added support for external getters in
ApolloVM:- New class
ApolloExternalGetterMapperto map Dart getters to ApolloVM. - Added
getGetterandgetMappedExternalGettermethods inVMContextfor getter resolution. - Extended
ASTBlockwith getter management (addGetter,getGetter, etc.). - Added
ASTGetterDeclarationand related classes (ASTClassGetterDeclaration,ASTExternalGetter,ASTExternalClassGetter) to represent getters in the AST. - Added
ASTExpressionGetterAccessbase class and subclassesASTExpressionLocalGetterAccessandASTExpressionObjectGetterAccessfor getter expressions. - Updated
DartGrammarDefinitionto parse getter access expressions. - Updated
ApolloCodeGeneratorandApolloGeneratorinterfaces and implementations to generate code for getter access expressions. - Added
externalGetterMapperfield toVMContextto support external getter mapping.
- New class
-
Core library updates:
- Added
CoreClassListclass implementing coreListtype support with external class functions and getters for common list operations (add,remove,length,isEmpty,sublist, etc.). - Refactored core class base and primitive classes to use
CoreClassMixinfor external function and getter creation.
- Added
0.1.5 #
-
ASTExpressionOperator:- Added new operators:
remainder,and,or. - Updated
getASTExpressionOperatorandgetASTExpressionOperatorTextto support%,&&, and||.
- Added new operators:
-
ASTExpressionOperation:- Updated
resolveTypeto handleremainder,and, andoroperators. - Added evaluation methods:
operatorRemainderfor%operator supporting int and double operands.operatorAndandoperatorOrfor logical&&and||with boolean coercion.
- Added private helper
_toBooleanto convert variousASTValuetypes to boolean. - Updated
throwOperationErrorto handle new operators.
- Updated
-
ASTValueand subclasses:- Added
%operator support inASTValueNum,ASTValueInt, andASTValueDouble. - Fixed incorrect error messages in base
ASTValueoperator overrides. - Added
operator ~/(ASTValue other)implementations inASTValueIntandASTValueDouble. - Updated operator return types for numeric operations to be more specific (
ASTValueNum).
- Added
-
DartGrammarDefinition:- Extended
expressionOperatorparser to recognize%,&&, and||. - Updated expression parsing logic to:
- Split expressions into blocks separated by logical operators
&&and||. - Resolve
%operator with higher precedence within blocks. - Correctly build AST for logical expressions combining blocks with
&&and||.
- Split expressions into blocks separated by logical operators
- Extended
-
WasmGenerator:- Added default case throwing
UnsupportedErrorfor unsupported operators in WASM code generation.
- Added default case throwing
0.1.4 #
-
ASTTypeVar:- Added
unmodifiablefield to distinguishvarandfinaltypes. - Added static instance
instanceUnmodifiableforfinal. - Updated constructor to accept
unmodifiableflag and set name accordingly. - Updated
toStringand equality to reflectunmodifiablestate.
- Added
-
ApolloVMCore:- Added support for
doubleandDoublecore classes returningCoreClassDouble.
- Added support for
-
CoreClassPrimitive:- Added helper
_externalClassFunctionArgs2for external class functions with two parameters.
- Added helper
-
CoreClassString:- Added many new external class functions:
length,isEmpty,isNotEmptysubstring,indexOf,startsWith,endsWithtrim,split,replaceAll
- Updated
getFunctionto support these new string functions.
- Added many new external class functions:
-
CoreClassInt:- Added external static function
tryParse. - Added external class functions:
compareTo,abs,sign,clamp,remainder,toRadixString,toDouble
- Updated
getFunctionto support new int functions.
- Added external static function
-
Added new class
CoreClassDouble:- External static functions:
parseDouble(aliasparse),tryParse,valueOf. - External class functions:
compareTo,abs,sign,clamp,remainder,toStringAsFixed,toStringAsExponential,toStringAsPrecision,toInt,round,floor,ceil,truncate. - Implements
getFunctionto provide these functions.
- External static functions:
-
ApolloCodeGeneratorDart:- Improved string literal concatenation handling:
- Added support for concatenating multiple string literals including raw and multiline strings.
- Added helper
writeAllStringsto write concatenated string parts correctly. - Improved splitting and merging of string literal blocks to avoid unnecessary concatenations.
- Preserves multiline string formatting and raw string prefixes.
- Improved string literal concatenation handling:
-
DartGrammarDefinition:- Added support for
finalkeyword returningASTTypeVar(unmodifiable: true). - Updated
literalStringparser to support concatenation of multiple string literals intoASTValueStringConcatenation.
- Added support for
-
Java11GrammarDefinition:- Added support for
finalkeyword returningASTTypeVar(unmodifiable: true).
- Added support for
0.1.3 #
-
DartGrammarDefinition:getTypeByName: added support for Dart typesvoidandbool.
-
DartGrammarLexer:stringContentQuotedLexicalTokenEscaped: added handling of unnecessary escape sequences for characters(,),{,}, and space in string literals.
-
Tests:
- Added
dart_basic_sumOrDouble.test.xmlwith a test for a Dart functionsumOrDouble. - Added
dart_basic_main_print_multi_line.test.xmltesting multi-line string printing. - Added
dart_basic_main_print_unnecessary_escape.test.xmltesting string literals with unnecessary escape sequences and ASCII art printing.
- Added
0.1.2 #
-
ApolloCodeGeneratorandApolloCodeGeneratorDart:generateASTExpressionOperation: updated to conditionally group complex expressions with parentheses based on operator and presence of literal strings to improve expression formatting and string interpolation merging.- Improved string concatenation merging for
addoperator when involving variables and literal strings.
-
ASTExpressionand subclasses (ASTExpressionOperation,ASTExpressionVariableAssignment,ASTExpressionVariableDirectOperation,ASTExpressionNegation,ASTExpressionFunctionInvocation, etc.):- Added
isComplexgetter to distinguish complex expressions. - Added
hasLiteralStringandhasDescendantLiteralStringto detect literal strings in expression trees. - Updated
toStringmethods to support optional grouping with parentheses for clarity. - Updated
ASTExpressionOperation.toStringto optionally wrap expressions in parentheses. - Updated
ASTExpressionVariableAssignmentandASTExpressionVariableDirectOperationto provide detailedtoStringimplementations reflecting operators. - Added
childrenOperationsanddescendantChildrenOperationshelpers for expression traversal.
- Added
-
ASTAssignmentOperatorenum:- Added
symbolfield for operator symbol representation.
- Added
0.1.1 #
-
lib/apollovm.dart:- Added library-level documentation describing ApolloVM as a portable VM supporting Dart, Java, and WebAssembly compilation.
- Changed
library apollovm;to a library directive without a name.
-
AST classes (
lib/src/ast/):- Updated
childrengetters to use null-aware spread operators (...?and?) for optional fields in:ASTExpressionListLiteralASTExpressionMapLiteralASTStatementVariableDeclarationASTBranchIfElseBlockASTBranchIfElseIfsElseBlockASTTypeASTTypeGenericVariable
- Updated
-
pubspec.yaml:- Updated dependencies:
petitparserfrom^6.1.0to^7.0.2lintsfrom^3.0.0to^6.1.0dependency_validatorfrom^3.2.3to^5.0.5xmlfrom^6.5.0to^6.6.1
- Updated dependencies:
-
Tests (
test/apollovm_languages_extended_test.dart,test/apollovm_version_test.dart):- Added
library;directive at the top of test files for consistency.
- Added
0.1.0 #
-
WasmRuntime:- Added
WasmModuleFunctiontypedef to represent a WebAssembly-exported function with metadata including the Dart function and avarArgsflag. - Updated
WasmModule.getFunctionsignature to returnWasmModuleFunction<F>?instead of justF?.
- Added
-
WasmRunnerWasm:- Updated function invocation logic in
ApolloRunnerWasmto handleWasmModuleFunctionwithvarArgsflag. - Added special handling for functions with no arguments and functions expecting a single
Listargument.
- Updated function invocation logic in
-
wasm_runtime_generic.dart:- Updated
WasmModuleGeneric.getFunctionto returnnullasWasmModuleFunction<F>?.
- Updated
-
wasm_runtime_io.dart:- Updated
WasmModuleIO.getFunctionto return aWasmModuleFunctionwithvarArgs: true.
- Updated
-
wasm_runtime_dart_html.dart:- Deprecated
WasmRuntimeDartHTMLin favor ofWasmRuntimeWeb. - Updated
WasmModuleBrowser.getFunctionto return aWasmModuleFunctionwithvarArgs: true. - Updated
createWasmRuntimeto returnWasmRuntimeDartHTMLwith deprecation warning.
- Deprecated
-
wasm_runtime_web.dart:- New
WasmRuntimeWebimplementation usingdart:js_interopandwebpackage. - Added JS interop bindings for WebAssembly APIs using extension types.
- Implemented
WasmModuleBrowserwrapping_WasmInstancewith proper JS interop. getFunctionreturns a Dart function wrapping JS function calls with argument conversion andvarArgs: false.- Added utilities to convert JS BigInt to Dart
numorBigInt. - Updated
createWasmRuntimeto returnWasmRuntimeWeb. - Added extensions for JS function invocation and JSAny type checks and casts.
- New
-
pubspec.yaml:- Added dependency on
web: ^1.1.1.
- Added dependency on
-
Tests:
- Added new tests
operation3andoperation4verifying multi-parameter Dart functions compiled to Wasm and executed correctly.
- Added new tests
0.0.54 #
-
Updated minimum Dart SDK constraint to
>=3.10.0 <4.0.0. -
Dependency updates:
swiss_knife: ^3.3.14async_extension: ^1.2.22data_serializer: ^1.2.1petitparser: ^6.1.0collection: ^1.19.1args: ^2.7.0wasm_run: ^0.1.0+2crypto: ^3.0.7path: ^1.9.1test: ^1.31.0
-
Reformatted code for Dart 3.10+
-
lib/src/languages/wasm/wasm_runtime_browser.dart- Suppress deprecated
dart:htmlusage warning with// ignore: deprecated_member_useimport directive
- Suppress deprecated
0.0.53 #
- wasm_run: ^0.1.0+1
0.0.52 #
-
New
ASTExpressionVariableDirectOperation(++and--operators). -
New
StrictTypeinterface forequalsStrictoverASTTypeIntandASTTypeDouble. -
ApolloGeneratorWasm:- Improve auto casting to int32/int64 and float32/float64.
- Implemented
generateASTExpressionVariableDirectOperation.
0.0.51 #
-
sdk: '>=3.3.0 <4.0.0'
-
swiss_knife: ^3.2.0
-
data_serializer: ^1.1.0
-
petitparser: ^6.0.2
-
path: ^1.9.0
-
lints: ^3.0.0
-
dependency_validator: ^3.2.3
-
test: ^1.25.2
-
xml: ^6.5.0
0.0.50 #
WasmRuntime: new VM implementation.wasm_runtime_io.dart:- Dart CI: wasm_run:setup (install dynamic library)
- wasm_run: ^0.0.1+3
0.0.49 #
ASTTypeDouble:acceptsType: now also accepts anASTTypeInt.
wasm_generator.dart:- Fix
isBits64.
- Fix
- Improve Wasm test coverage.
0.0.48 #
-
ASTNode:- Now is a mixin.
getNodeIdentifier: added optional parameterrequester.- Added
childrenanddescendantChildren.
-
ASTFunctionDeclaration:getNodeIdentifier: now can also resolve identifiers inside statements.
-
Wasm:
- Encode function names with UTF-8.
Wasm64: addedi64WrapToi32.
-
WasmContext:- Added
returnsstate.
- Added
-
ApolloGeneratorWasm:- Added
_autoConvertStackTypes. generateASTStatementReturnValueandgenerateASTStatementReturnVariable:- Auto cast returning types.
- Added
-
Dart CI: added job
test_exe.
0.0.47 #
- Improve variable type resolution while compiling to Wasm.
0.0.46 #
- Improve type resolution of
ASTTypeVar. - Optimize some
asyncmethods.
0.0.45 #
-
ASTBranchIfElseBlockandASTBranchIfElseIfsElseBlock:blockElse: optional.
-
ASTParametersDeclaration:- Added
allParameters.
- Added
-
ASTTypeIntandASTTypeDouble:- Added
bits - Added
ASTTypeInt.instance32andASTTypeInt.instance64. - Added
ASTTypeDouble.instance32andASTTypeDouble.instance64.
- Added
-
ASTValueNum:- Added field
negative.
- Added field
-
ApolloGeneratorWasm:- Changed to 64 bits.
Wasm: split inWasm32andWasm64with improved opcodes.- Allow operations with different types (auto casting).
- Handle
unreachableend of function cases. - Implemented:
generateASTValue,generateASTValueDouble,generateASTValueInt.generateASTExpressionVariableAssignment,generateASTStatementExpressiongenerateASTBranchIfBlock,generateASTBranchIfElseBlock,generateASTBranchIfElseIfsElseBlock.generateASTStatementReturnWithExpression,generateASTStatementReturn,generateASTStatementReturnValue.
-
ApolloParserWasm:- Identify if an
ASTTypeIntorASTTypeDoubletype is a32or64bits.
- Identify if an
-
ApolloRunnerWasm:- Use the parsed Wasm functions (AST) to normalize the parameters before calling the Wasm function.
-
WasmModule:- Added
resolveReturnedValue.- Browser implementation: when the function returns a
f64, the JSbigintneeds to be converted to a DartBigInt.
- Browser implementation: when the function returns a
- Added
-
New
WasmModuleExecutionError.
0.0.44 #
pubspec.yaml: update description.
0.0.43 #
ApolloRunner:getFunctionCodeUnit: fix returned codeUnit whenallowClassMethod = true.
0.0.42 #
-
New
SourceCodeUnitandBinaryCodeUnit.CodeUnitnow isabstract:- Renamed field
sourcetocode.
- Renamed field
-
Using
SourceCodeUnitinstead ofCodeUnitwhen necessary. -
ApolloParserrenamed toApolloCodeParser:- Allows binary code parsing (not only strings).
- New
ApolloSourceCodeParser.
-
ApolloRunner:- Added
getFunctionCodeUnit.
- Added
-
Using
Leb128from packagedata_serializer. -
BytesOutputnow extendsBytesEmitter(fromdata_serializer). -
ApolloGeneratorWasm:generateASTExpressionOperation: allow operations with different types (auto casting frominttodouble).
-
New
WasmRuntimeandWasmModule.- Implementation:
WasmRuntimeBrowser.
- Implementation:
-
New
WasmModuleLoadError. -
WasmContext:- Added stack status to help code generation.
-
data_serializer: ^1.0.11
-
wasm_interop: ^2.0.1
-
crypto: ^3.0.3
-
path: ^1.8.3
0.0.42+alpha #
- Renamed
ApolloLanguageRunnertoApolloRunner. - Organize runners implementation files.
0.0.41 #
README.md: added Wasm example.- Minor fixes.
0.0.40 #
-
New
ApolloGeneratorWasm.- Basic support to compile the AST tree to Wasm.
-
New
BytesOutputfor binary code generation. -
data_serializer: ^1.0.10
0.0.39 #
ApolloVMNullPointerExceptionandApolloVMCastExceptionnow extendsApolloVMRuntimeError.- AST implementation:
- Changes some
StateErrorwhile executing toApolloVMRuntimeError.
- Changes some
- New abstract
ApolloCodeUnitStorage:- Implementations:
ApolloSourceCodeStorage,ApolloSourceCodeStorageMemory.ApolloBinaryCodeStorage,ApolloBinaryCodeStorageMemory.ApolloGenericCodeStorageMemory.
- Implementations:
ApolloGeneratornow defines the output type.- New
GeneratedOutput.
0.0.38 #
pubspec.yaml:- Added issue_tracker
- Added topics.
- Added screenshots.
README.md:- Added
Codecovbadge and link.
- Added
0.0.37 #
- Update
pubspec.yamldescription. README.md: added TODO list.
0.0.36 #
ApolloCodeGenerator:generateASTValueStringExpression: try to preserve single quotes in concatenations sequence.
- Java 11:
- Added support for
ArrayListandHashMapliterals.
- Added support for
0.0.35 #
ASTRoot:- Added
getClassWithMethod.
- Added
CodeNamespace:- Added
getCodeUnitWithClassMethod.
- Added
ApolloLanguageRunner:executeFunction: added parameterallowClassMethod.
- Added
ASTExpressionListLiteralandASTExpressionMapLiteral:- Support in
dartandjavagrammar.
- Support in
0.0.34 #
ApolloVM:loadCodeUnitnow throws aSyntaxErrorwith extended details.
ParseResult:- Added fields
codeUnit,errorPositionanderrorLineAndColumn. - Added getters
errorLineanderrorMessageExtended
- Added fields
- Added
ASTExpressionNegation:- Added support for
dartandjava11.
- Added support for
0.0.33 #
ASTNodeimplementations:- Implement
toStringwith a pseudo-code version of the node to facilitate debugging.
- Implement
- Fixed parsing of comments in Dart and Java 11.
0.0.32 #
-
Dart CI: update and optimize jobs.
-
sdk: '>=3.0.0 <4.0.0'
-
swiss_knife: ^3.1.5
-
async_extension: ^1.2.5
-
petitparser: ^6.0.1
-
collection: ^1.18.0
-
args: ^2.4.2
-
lints: ^2.1.1
-
test: ^1.24.6
-
xml: ^6.4.2
-
path: ^1.8.3
0.0.31 #
- Improved GitHub CI:
- Added browser tests.
- Optimize imports.
- Clean code and new lints adjusts.
- sdk: '>=2.15.0 <3.0.0'
- swiss_knife: ^3.1.1
- async_extension: ^1.0.9
- petitparser: ^5.0.0
- collection: ^1.16.0
- args: ^2.3.1
- lints: ^2.0.0
- dependency_validator: ^3.2.2
- test: ^1.21.4
- pubspec: ^2.3.0
- xml: ^6.1.0
- path: ^1.8.2
0.0.30 #
- Using
async_extensionto optimize async calls.- Removed internal extensions with similar functionality.
- Migrated from
pedantictolints. - Fixed missing await in
ASTExpressionVariableAssignment. - lints: ^1.0.1
- swiss_knife: ^3.0.8
- async_extension: ^1.0.6
- petitparser: ^4.2.0
0.0.29 #
- Improve
ApolloVMCore:- Implementing portable
intclass fordartandjava11:parse,parseInt.
- Implementing portable
- Code generation:
- Correctly normalize
intandIntegerfordartandjava11.
- Correctly normalize
- Improve
asyncoptimization.
0.0.28 #
- Implement static class accessor, to allow calls to static functions.
- Initial version of
ApolloVMCore:- Implementing portable
Stringclass fordartandjava11:- Mapping:
contains,toUpperCase,toLowerCase,valueOf.
- Mapping:
- Implementing portable
- Fixed class field code generation for
dartandjava11. asyncoptimization:- Avoid instantiation of
Future, usingFutureOrExtensionandListFutureOrExtension:resolve,resolveMappedandresolveAllMapped.
- Avoid instantiation of
- Improved languages tests, to also executed regenerated code.
0.0.27 #
- Runner:
- Strong types.
vartypes can be resolved.ASTTypedNode: nodes can be typed, and resolution is performed and cached while running.
- Optimize resolution of functions.
- Strong types.
- Grammar:
- Dart & Java:
vartypes to be resolved at runtime.
- Dart & Java:
0.0.26 #
- Generator:
- Dart & Java:
- Improve String concatenation with variables.
- Dart & Java:
0.0.25 #
- Grammar:
- Dart & Java:
- Added
forloop statement:ASTStatementForLoop.
- Added
- Dart & Java:
- Adjust
README.md.
0.0.24 #
ApolloVM:parseLanguageFromFilePathExtension
ApolloLanguageRunner:tryExecuteFunctiontryExecuteClassFunction
- Executable:
apollovm
- args: ^2.0.0
- pubspec: ^2.0.1
- path: ^1.8.0
0.0.23 #
- Improve tests, to tests definitions directory of XML files.
0.0.22 #
caseInsensitiveoption for:- setField, getField, getFunctionWithName, getFunction,getClass
0.0.21 #
- Better handling of function signature and how to pass positional and named parameters.
0.0.20 #
- Added
ASTClass.getFieldsMap. ASTEntryPointBlock.executewith extra parametersclassInstanceObjectandclassInstanceFields.- Change signature of
dartRunner.executeFunctionandjavaRunner.executeClassMethod.- Now they use named parameters for
positionalParametersandnamedParameters.
- Now they use named parameters for
0.0.19 #
- Grammar:
- Java & Dart:
- Parse boolean literal.
- Java & Dart:
- Improve API documentation.
0.0.18 #
- API Documentation.
0.0.17 #
- Fix call of function using
dynamictype in parameter value. - Code Generator:
- Better formatting for classes and methods.
- Grammar:
- Dart:
- Fix parsing of function with multiple parameters.
- Java:
- Class fields.
- Fix parsing of function with multiple parameters.
- Return statements ;
- Dart:
0.0.16 #
- Grammars:
- Dart & Java11:
- Fix parsing of multiple parameters.
- Dart & Java11:
- Runner:
- Fix division with double and int.
- Code Generator:
- Dart & Java11:
- Fix variable assigment duplicated ';'.
- Dart:
- Improve string template regeneration, specially when parsed code comes from Java.
- Dart & Java11:
- Improved example.
0.0.15 #
ASTBlock: addedfunctionsNames.ASTClass: addedfieldsandfieldsNames.ApolloLanguageRunner: addedgetClass.
0.0.14 #
- AST:
ASTClassFunctionDeclaration: To ensure that any class function is parsed from a class block and also ensure that is running from a class block.
- Generator:
- Dart:
- Fix non class function: due static modifier.
- Java:
- Will throw an exception if the generation of a function without a class is attempted.
- Dart:
- Runner:
- Fix class object instance context.
0.0.13 #
- Grammar & Runner:
- Dart & Java:
- Class fields.
- Class object instance fields at runtime.
- Dart & Java:
- Code Generator:
- Dart & Java:
- Fix return statement with value/expression ;
- Java:
- Better/shorter code for String concatenation.
- Dart & Java:
0.0.12 #
- Grammars & Code Generators & Runner:
- Dart & Java11:
- Better definition of static methods.
- Class object instance.
- Dart & Java11:
0.0.11 #
- Renamed:
ASTCodeBlock->ASTBlock.ASTCodeRoot->ASTRoot.ASTCodeClass->ASTClass.
- Added support to
asynccalls inASTNodeexecution.- Any part of an
ASTNodecan have anasyncresolution. This allows the mapping of external functions that returns aFutureor other languages that acceptsasyncat any point.
- Any part of an
- Better mapping of external functions:
- Better Identification of number of parameters of mapped functions.
- Now an
ASTRootor anASTClassare initialized:- Class/Root statements are executed once, and a context for each Class/Root is held during VM execution.
0.0.10 #
- Refactor:
- Split
apollovm_ast.dartinto multipleast/apollovm_ast_*.dartfiles.
- Split
0.0.9 #
- Code Generators:
- Fix
elsebranch indentation.
- Fix
0.0.8 #
- Fix package description.
- Renamed Java8 to Java11:
- Java 11 is closer to Dart 2 than Java 8.
- Grammars & Code Generators:
- Dart & Java11:
- Support
if,else ifandelsebranches.
- Support
- Dart & Java11:
0.0.7 #
- Added type
ASTTypeBooland valueASTValueBool. - Added
ApolloVMNullPointerException. - Grammars & Code Generators:
- Dart & Java8:
- Support to expression comparison operators
==,!=,>,<,>=,<=.
- Support to expression comparison operators
- Dart & Java8:
- Upgrade: petitparser: ^4.1.0
0.0.6 #
- Grammars:
- Dart:
- Added support for string templates:
- including variable access:
$x. - including expressions:
${ x * 2 }. - Not implemented for multiline string yet.
- including variable access:
- Added support for string templates:
- Java8:
- Support for string concatenation.
- Dart:
- Code Generators:
- Java8:
- Translate string templates to Java String concatenations.
- Java8:
0.0.5 #
- Grammars:
- Dart:
- Raw single line and raw multiline line strings.
- Improved parser tests for literal String.
- Dart:
0.0.4 #
- Added type check:
ASTType.isInstance.- Function call now checks type signature and type inheritance.
- Grammars:
- Dart:
- Single line and multiline line strings with escaped chars.
- Java8:
- Single line strings with escaped chars.
- Dart:
0.0.3 #
- Removed
ASTCodeGenerator, that is language specific now:ApolloCodeGenerator. - Better external function mapping.
- Grammars:
- Dart:
- Expression operations:
+,-,*,/,~/.
- Expression operations:
- Java8:
- Expression operations:
+,-,*,/.
- Expression operations:
- Dart:
- Improved tests.
0.0.2 #
- Improved execution:
- Now can call a class method or a function.
- Improved code generation:
- Now supporting Java8 and Dart.
- Grammars:
- Dart:
- Basic class definition.
- Java8:
- Basic class definition.
- Dart:
0.0.1 #
- Basic Dart and Java8 support.
- Initial version, created by Stagehand
