alantech / alan

Autoscalable Programming Language
https://alan-lang.org
MIT License
305 stars 10 forks source link

Array and Buffer (kinda) 'repeat' implemented #808

Closed dfellis closed 1 month ago

dfellis commented 1 month ago

As noted in one of the comments, the type system can't currently handle repeating buffers an arbitrary number of times because the value is a runtime value. The type system needs to be improved to be able to distinguish the literal 3 from a variable three that may or may not have the value 3 inside of it before this can be improved.

Then we can have both the current implementation for runtime variables, which has to convert into an array to have a static type, and a new implementation for static values that can convert into a buffer on the other side, as well.

dfellis commented 1 month ago

I really need to figure out why Windows occasionally errors out with this message:

Error: "Failed to compile Os { code: 33, kind: Uncategorized, message: \"The process cannot access the file because another process has locked a portion of the file.\" }"

A second run succeeds, so I suspect something to do with the hackery to get file locking working on Windows.