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

Feature: Parameters should actually be read-only #65

Open
brendanfh opened this issue Dec 6, 2023 · 0 comments
Open

Feature: Parameters should actually be read-only #65

brendanfh opened this issue Dec 6, 2023 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@brendanfh
Copy link
Collaborator

Currently, parameters are lightly assumed to be read-only by the code generator, and the code generator will make mistakes if parameters are modified. This mostly affects structs and unions passed by value, as they consume stack memory that is not handled correctly. I believe to fix the actual problems with memory corruption would be rather difficult and would not solve all of the problems.

Instead, I think parameters should be enforced as read-only. This is how most other languages operate. It also allows me to implement compiler optimizations in the future, like transparently passing a reference to a structure because I know it cannot be changed.

@brendanfh brendanfh added bug Something isn't working enhancement New feature or request labels Dec 6, 2023
@brendanfh brendanfh added this to the v0.1.9 milestone Dec 6, 2023
@brendanfh brendanfh self-assigned this Dec 6, 2023
@brendanfh brendanfh modified the milestones: v0.1.9, v0.2.x Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant