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

Constants tracking issue #19

Open
1 of 6 tasks
VonTum opened this issue Nov 2, 2024 · 0 comments
Open
1 of 6 tasks

Constants tracking issue #19

VonTum opened this issue Nov 2, 2024 · 0 comments
Labels
enhancement New feature or request Request Input These are issues about the design of the language, and thus should be discussed

Comments

@VonTum
Copy link
Collaborator

VonTum commented Nov 2, 2024

Constants are SUS's way of building compile-time functions.

// Basic builtin constants
__builtin__ const bool false {}
__builtin__ const bool true {}
const bool hundred_pi {HUNDRED_PI = 314}

// But also, compiletime functions, and builtins like
__builtin__ const int sizeof #(T) {}
const int factorial #(int num) {
  factorial = 1
  for i in 1..num {
    factorial = factorial * i
  }
}
  • Parser
  • Initialization
  • Flattened
  • Typecheck
  • Get constant value in execute
  • Expand to support functions like factorial too
@VonTum VonTum added enhancement New feature or request Request Input These are issues about the design of the language, and thus should be discussed labels Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Request Input These are issues about the design of the language, and thus should be discussed
Projects
None yet
Development

No branches or pull requests

1 participant