keeping a good amount of data in memory using Scala data structures
The easiest way to attach Scala data structures to G-WAN servlets is to use the G-WAN persistence pointers, see the persistence.c example.
For the sake of the discussion, G-WAN KV store is not using hash tables (nor any hashing by the way, to avoid large unused memory and entry collisions).
what the process of using a third party C-library with a Scala app on Gwan would be
If you want to call a C function (either from a servlet or from a pre-compiled C library) from a Scala G-WAN script then you can just pick the function pointer (from a handler for example), register it by attaching it to a G-WAN persistent pointer, and then invoke it later (from your Scala scripts).
Or you can dynamically load a pre-compiled C library from your Scala scripts, resolve the function name (only once at startup), and then call it many times.