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

feat: type checking refactor #15

Merged
merged 3 commits into from
Sep 19, 2024
Merged

feat: type checking refactor #15

merged 3 commits into from
Sep 19, 2024

Conversation

pablojhl
Copy link
Member

@pablojhl pablojhl commented Sep 19, 2024

Changes

This makes a refactor of types.py. The main changes are the creation of three new abstractions:

  • ScalarType: Base type for all scalar types. It overloads all common functions.
  • NumericType: It overloads the function for the numeric types (Integer, PublicInteger, SecretInteger, UnsignedIntegers, ...)
  • BooleanType: It overloads the logic functions.

In addition, this adds the terms Mode and BaseType (following the terminology defined in nada-model).

Finally, tests for type checking have been added.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Backwards compatability analysis completed (if applicable). "Will this change require recompilation and upload of user programs?"

@pablojhl pablojhl requested a review from lumasepa September 19, 2024 08:37
Copy link

@navasvarela navasvarela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely a great leap forward. I have made some comments though. I think the implementation could be further simplified.

nada_dsl/nada_types/scalar_types.py Outdated Show resolved Hide resolved
nada_dsl/nada_types/scalar_types.py Outdated Show resolved Hide resolved
nada_dsl/nada_types/scalar_types.py Outdated Show resolved Hide resolved
nada_dsl/nada_types/scalar_types.py Show resolved Hide resolved
nada_dsl/nada_types/scalar_types.py Outdated Show resolved Hide resolved
nada_dsl/nada_types/scalar_types.py Show resolved Hide resolved
nada_dsl/nada_types/scalar_types.py Show resolved Hide resolved
nada_dsl/nada_types/scalar_types.py Show resolved Hide resolved
@pablojhl pablojhl requested a review from a team as a code owner September 19, 2024 14:37
@pablojhl pablojhl changed the title feat: types.py refactor and move content to scalar_types.py feat: type checking refactor Sep 19, 2024
@navasvarela navasvarela merged commit 4ee674c into main Sep 19, 2024
2 checks passed
@navasvarela navasvarela deleted the feat/scalar-types branch September 19, 2024 20:34
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.

3 participants