Skip to content

Conversation

@ryanwilsond
Copy link
Owner

@ryanwilsond ryanwilsond commented Sep 21, 2024

Description

This PR does not change language functionality (apart from fixing unintended behavior/bugs) (mostly), hence the Syntax API was not modified (mostly). All this PR aims to do is clean up the codebase as a whole and restructure how certain things work to be cleaner, as over the past few months the code has gotten increasingly messy as many "quick solutions" have been incorporated.

This is in prep for adding class properties (getters, setters, indexers), and the graphics library.

The major refactoring of the Binding and Symbol APIs is due to how the previous system was mishandling nested template arguments.

Reworks:

  • Reworked types/symbols (Largest rework, complete rewrite of the Symbol API)
    • BoundType -> BoundTypeExpression
    • Moved most of the functionality from BoundType to TypeSymbol
    • Added TypeWithAnnotations and TypeOrConstant to replace the current template arguments system
    • Remodeled Symbols API to have wrapped/substituted/constructed/source forms of symbols to keep the API immutable and lazy
  • Relaxed restrictions on allowed operator overloads (looser return and parameter types)
  • Extend checks in constraint clauses now use two keywords:
    • T extends ...: T is or inherits from the given type, not just inherits from
    • T is ...: T is the given constraint, either T is primitive or T is notnull
  • Updated C# transpiler to support all new features added in the recent months (this will be done in another PR)
  • Updated the IL emitter to work with all new features (this will be done in another PR)
  • Added debugging (this will be added in another PR)
  • Rewrote the entire Binder to be cleaner overall, as well as added specific Binders for certain scopes (like loops, methods, etc.)
  • Added more samples to samples/ to demonstrate new features
  • Updated docs where necessary
  • Field initializers can now see other fields
  • Cleaned up overload resolver
  • ref expressions are now invalid expression terms (which they should have already been, so I'm not counting this as a syntax change)
  • Reworked casting system (now called conversions) to more easily support the future user-defined conversions feature
  • Method groups can now have template arguments (in the form of types with annotations)
  • Reworked library system (should be easier to add graphics library now)
    • Replaced BuiltinFunctions and PrimitiveTypeSymbol with CorLibrary
  • Addressed all TODO's, whether by completing them or updating them
  • Added/updated doc strings for all public/internal members
  • Updated tests (both emitters tests, diagnostics tests, etc.)
  • Removed unused diagnostics
  • Updated VSCode extension
  • Addressed bugs in Bugs.txt
  • Updated Buckle.md (specifically outdated syntax in last section)
  • Make overrides sealed when possible and made methods readonly when possible
  • Now using C# CancellationTokens instead of ValueWrapper<T> work around

@ryanwilsond ryanwilsond self-assigned this Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants