GNU Guile arrays implementation in Spritely Hoot?

I was writing a forest fire model in GNU Guile, hoping to use it later in a Spritely Hoot demo on my code dabbling page on my site, but dthopson said that Spritely Hoot does not (yet?) support GNU Guile arrays.

So I wrote a layer pretending to be GNU Guile arrays API on top Scheme vectors (same directory as the forest fire model). It is not complete (nor correct?) but maybe I could work on it and contribute it to Spritely Hoot, if so, what are the unmet dependencies necessary to implement such an array API?

I see an issue about bytevectors as the basis of arrays on your gitlab account.

I don’t know if there’s anything missing from Hoot that the array API needs but I suspect it wouldn’t be much. Guile’s array.c says that strings, vectors, bitvectors, bytevectors are considered arrays and we have all of those:

int
scm_is_array (SCM obj)
{
  if (!SCM_HEAP_OBJECT_P (obj))
    return 0;

  switch (SCM_TYP7 (obj))
    {
    case scm_tc7_string:
    case scm_tc7_vector:
    case scm_tc7_bitvector:
    case scm_tc7_bytevector:
    case scm_tc7_array:
      return 1;
    default:
      return 0;
    }
}

The annoying thing that is the array implementation is in C so it has to be ported. I haven’t encountered many programs that use arrays, and nothing at Spritely uses them, so we haven’t prioritized implementing them. We’d be happy if you wanted to take this on. :slight_smile:

The issue you linked is not relevant here. It has the vm label which means it’s an issue related to the Wasm interpreter.