You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The self-hosted compiler already has a few dynamic arrays, i.e. arrays whose size grows as needed. Many languages have something like this:
Python: list
C++: vector
C: does not come in standard library, but can be implemented (see List in the Jou compiler)
Jou doesn't support these very well. Currently my Jou code has a realloc() whenever another item is added to the list, which works but isn't very efficient.
To implement dynamic arrays in Jou, I think I want something similar to the solution in C, so some kind of combination of macros and anonymous structs, neither of which is currently supported in Jou.
The text was updated successfully, but these errors were encountered:
The self-hosted compiler already has a few dynamic arrays, i.e. arrays whose size grows as needed. Many languages have something like this:
list
vector
List
in the Jou compiler)Jou doesn't support these very well. Currently my Jou code has a
realloc()
whenever another item is added to the list, which works but isn't very efficient.To implement dynamic arrays in Jou, I think I want something similar to the solution in C, so some kind of combination of macros and anonymous structs, neither of which is currently supported in Jou.
The text was updated successfully, but these errors were encountered: