Programming 

Been thinking about Futhark's lists and how their length is parameterized at the type level and wondering how useful that would be in something like Haskell

Programming 

Because like, this works great for stuff like map, but as soon as you wanna filter or reduce or something like that, suddenly you have lists of unknown sizes all over the place

So. It would definitely need to be optional

re: Programming 

@socks well, C's gotten by all these years with fixed-length arrays (including fixed-length strings)
-F

re: Programming 

@Felthry @socks C strings aren't fixed-length

re: Programming 

@noiob @socks They take up the full length in memory, though a premature 0 can end them early
-F

re: Programming 

@Felthry @socks that's how all variable-length strings work, it'd be extremely impractical to allocate memory each time you change the string

Follow

re: Programming 

@noiob @socks not in all languages, matlab for instance will reallocate memory every time the length of an array is changed, which is why it warns you not to change the length of arrays in loops
-F

Sign in to participate in the conversation
Awoo Space

Awoo.space is a Mastodon instance where members can rely on a team of moderators to help resolve conflict, and limits federation with other instances using a specific access list to minimize abuse.

While mature content is allowed here, we strongly believe in being able to choose to engage with content on your own terms, so please make sure to put mature and potentially sensitive content behind the CW feature with enough description that people know what it's about.

Before signing up, please read our community guidelines. While it's a very broad swath of topics it covers, please do your best! We believe that as long as you're putting forth genuine effort to limit harm you might cause – even if you haven't read the document – you'll be okay!