Skip to content

Conversation

@Henrique-zoo
Copy link

@Henrique-zoo Henrique-zoo commented Jul 10, 2025

Alterações

Performance Enhancing

  • All src\type_checker\ functions now receive references instead of moved values, avoiding expensive and unnecessary clone()
  • Constructors in a Algebraic Data Type are represented through HashMaps, which allows search in O(1)
  • The adt's constructors in the stack are now stored in an Arc<> pointer, a thread-safe reference-counting pointer that enables shared ownership of data on the heap. This enhances performance because .clone() in Arc variables is not a deep copy (it does't copy the values on the heap, instead, it increments the Arc reference counter), therefore, it's more efficient for non-static types. This may be exaggerated worry with performance and could be considered an alien in the project since it's only used in this case (if performance is vital, we could try to use this aproach in other cases, otherwise, we can just forget about all this)

Match Statement

  • The match type checker is done and tested
  • The match parser is done and tested

Others

  • Many functions on the type checker were re-written in order to become more idiomatic/understandable (and/or more efficient)
  • Erros messages were enhanced, providing more context

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.

4 participants