Goal Goal v1.9.0: two years since v1.0.0!
The v1.9.0 version just got out, and it's been two years since I posted on this sub about the first stable release of Goal, so it sounds like a good time for an update.
Goal's been slowly but surely getting new stuff and the last release, in particular, brings interesting things, some of which are a bit unusual for array languages: goroutine-based concurrency with channels, a defer keyword for resource cleanup, general handle-based pipes, portable dial/listen-based networking, and a simple http client and server. I still consider some of those a bit experimental (as indicated in docs) because they're new so minor things about their design could still change, but they're already usable enough, as under the hood it's based on Go's standard library, after all, so the difficulty was mostly about exposing that functionality nicely.
Here's a (somewhat contrived) example showcasing some of the new features: it creates an http server for a static "html" directory on localhost, logging access log to standard error, and then starts the server on a goroutine, while listening on another one for a termination signal (among SIGHUP, SIGINT and SIGTERM) for graceful shutdown.
port:or[ARGS 1;"8080"] / get port from command-line args or default to "8080"
srv:http.server@..[
addr:"127.0.0.1:$port"
handler:http.fs"html" / http.fs produces a simple file system server handler
log:STDERR]
(signal;done):chan.new'0 1; chan.notify signal
and/rt.go..[
{defer[chan.send[done;];1]; srv..serve}:1
{(*chan.select["r";signal;"r";done])or srv..shutdown}:1]Of course, in this example, graceful shutdown is overkill and the last four lines could've been simply srv..serve, without extra handling of signal and done channels. The and/ ensures that the first goroutine error is returned (showing normally http: Server closed here after interrupting the server). The handler could've been more complicated, though, like a dict of pattern:handler pairs for routing. And handlers can be of various kinds (like redirect or timeout), and even be goal functions taking f[responsewriter;request] handle arguments when more flexibility is needed.
BTW, while, unlike for some other k-likes, "state-of-the-art" performance is still not a priority, Goal has now Go assembly simd for most operations where it makes sense, and a decent selection of integer array types (uint8, int16, int32, or int64 elements). Still no bit-booleans, and simd limited to SSE4.2 for portability, but it performs quite well.
https://codeberg.org/anaseto/goal
See CHANGES.md there for the full details about what happened in two years. Hope you enjoy!