Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.12.0-alpha.0 #666

Merged
merged 74 commits into from
Jul 17, 2024
Merged

v0.12.0-alpha.0 #666

merged 74 commits into from
Jul 17, 2024

Conversation

Luna-Klatzer
Copy link
Member

@Luna-Klatzer Luna-Klatzer commented Jul 16, 2024

What type of change does this PR perform?

  • Info or documentation change (Non-breaking change that updates repo info files (e.g. README.md, CONTRIBUTING.md, etc.) or online documentation)
  • Website (Change that changes the design or functionality of the websites or docs)
  • Development or internal changes (These changes do not add new features or fix bugs, but update the code in other ways)
  • Bug fix (Non-breaking change which fixes an issue)
  • New feature (Non-breaking change which adds functionality)
  • Breaking change (Major bug fix or feature that would cause existing functionality not to work as expected.)
  • Requires a documentation update, as it changes language or compiler behaviour

Summary

New development release 0.12.0-alpha.0, which overhauls the entire core type system, adds support for arrays, adds object literal expressions and basic support generation for interfaces.

Detailed Changelog

Not present for website/docs changes

Added

  • Added semantic checking and code generation for object literals and object properties. (#526)
  • Implemented internal representation for custom types such as objects, interfaces and classes. This change means that the entire core type system has been reworked and adjusted to also support custom types as well as complex types (objects, arrays etc.). This does not inherently add functionality but serves as the stepping stone for the implementation of all custom types in the future. (#524)
  • Implemented the generic Array<T> type and single-type array initializers. (#499)
  • New module:
    • semantics/runtime-built-ins, which contains runtime built-in functions, variables and types.
    • semantics/runtime-internals, which contains the runtime internal functions.
    • semantics/types, which contains the runtime types.
  • New classes:
    • InterfaceDeclaration, which represents an AST interface declaration.
    • ClassDeclaration, which represents an AST class declaration.
    • BuiltInType, which represents a built-in type.
    • CustomType, which represents a user defined type.
    • ScopeTypeDeclaration, which represents a scope type declaration.
    • UniverseTypeDeclaration, which represents the universe, where all built-in types, functions and variables are
      declared. This serves as the parent of the global scope.
    • CustomType, which is a class extending from ProcessedType and implementing the functionality for a custom type such as a interface or class.
  • New errors:
    • TypeCanNotBeUsedForTypeCheckingError, which is thrown when a type is used for type checking, but is not a valid type. This is an error indicating an invalid logic that should be fixed.
    • GenericArgumentTypeError, which is thrown when a generic argument is used with an invalid type. This is an error indicating an invalid logic that should be fixed.
    • InvalidAmountOfGenericArgumentsError, which is thrown when an invalid amount of generic arguments is used. This is an error indicating an invalid logic that should be fixed.
    • CanNotUseNonGenericAsGenericTypeError, which is thrown when a non-generic type is used as a generic type. This is an error indicating an invalid logic that should be fixed.
  • New interfaces:
    • InterfaceDeclarationSemantics, which represents the semantics of an interface declaration.
    • InterfaceDeclarationTypeSemantics, which represents the type semantics of an interface declaration.
    • ClassDeclarationSemantics, which represents the semantics of a class declaration.
    • ClassDeclarationTypeSemantics, which represents the type semantics of a class declaration.
    • TypeDeclaration, which represents a type declaration. This is an abstract base class for all type declarations.
    • TypeDeclarationSemantics, which represents the semantics of a type declaration.
    • TypeDeclarationTypKipperTypeChecker.validArrayExpressioneSemantics, which represents the type semantics of a type declaration.
    • CompilableType, which represents a type that can be compiled.
  • New functions:
    • KipperTypeChecker.validArrayExpression, which ensures that an array expression is valid.

Changed

  • Changed type from interface to class:
    • InternalFunction, which represents an internal function.
    • BuiltInFunction, which represents a built-in function.
    • InternalFunctionArgument, which represents an internal function argument.
    • BuiltInVariable, which represents a built-in variable.
  • Renamed:
    • Module analysis to semantics.
    • Class UncheckedType to RawType.
    • Class CheckedType to ProcessedType.
    • Class UndefinedCustomType to UndefinedType.

Does this PR create new warnings?

None.

Linked issues or PRs

Luna-Klatzer and others added 30 commits July 2, 2024 16:54
…a-comments into 524-feature-implement-internal-representation-for-objects-and-object-types-interfaces
…e-property-declaration.ts as AST Nodes, also adjusted the Antler tree to support properties and methods in interfaces
…w ProcessedType structures

This is still WIP!
…ment-internal-representation-for-objects-and-object-types-interfaces
…-internal-representation-for-objects-and-object-types-interfaces
…ts-and-object-types-interfaces' of https://github.com/Kipper-Lang/Kipper into 524-feature-implement-internal-representation-for-objects-and-object-types-interfaces
…generation

Even if the syntax is implemented and basic code generation is present proper type checking will have to wait until #524
@Luna-Klatzer Luna-Klatzer self-assigned this Jul 16, 2024
@Luna-Klatzer Luna-Klatzer added release New release of the Kipper module. skip changelog Do not include in the changelog when a new release is drafted labels Jul 16, 2024
@Luna-Klatzer Luna-Klatzer added this to the v0.12.0 milestone Jul 16, 2024
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 83.39798% with 214 lines in your changes missing coverage. Please review.

Project coverage is 83.15%. Comparing base (7b38fe2) to head (0100595).
Report is 131 commits behind head on next.

Files Patch % Lines
...r/core/src/compiler/semantics/types/custom-type.ts 33.33% 26 Missing ⚠️
...re/src/compiler/semantics/analyser/type-checker.ts 84.68% 9 Missing and 8 partials ⚠️
...declaration/class-declaration/class-declaration.ts 31.81% 15 Missing ⚠️
kipper/target-js/src/code-generator.ts 70.21% 14 Missing ⚠️
...ntics/symbol-table/entry/scope-type-declaration.ts 45.00% 8 Missing and 3 partials ⚠️
...core/src/compiler/semantics/types/built-in/func.ts 40.00% 8 Missing and 1 partial ⚠️
kipper/core/src/compiler/program-ctx.ts 80.95% 5 Missing and 3 partials ⚠️
...ore/src/compiler/semantics/types/built-in/array.ts 66.66% 5 Missing and 3 partials ⚠️
...ion/interface-declaration/interface-declaration.ts 69.56% 6 Missing and 1 partial ⚠️
...method-declaration/interface-method-declaration.ts 80.55% 6 Missing and 1 partial ⚠️
... and 36 more
Additional details and impacted files
@@            Coverage Diff             @@
##             next     #666      +/-   ##
==========================================
- Coverage   83.66%   83.15%   -0.52%     
==========================================
  Files         219      265      +46     
  Lines        3850     4463     +613     
  Branches      428      485      +57     
==========================================
+ Hits         3221     3711     +490     
- Misses        447      602     +155     
+ Partials      182      150      -32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Luna-Klatzer Luna-Klatzer merged commit ebe956a into next Jul 17, 2024
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release New release of the Kipper module. skip changelog Do not include in the changelog when a new release is drafted
Projects
Development

Successfully merging this pull request may close these issues.

2 participants