Email or username:

Password:

Forgot your password?
Andrew Tropin

What should I use for binary ports in scheme?

(scheme base), (ice-9 binary-ports) or something else?

The same question about (rnrs conditions) and (ice-9 exceptions).

#scheme #lisp

8 comments
blake shaw 🇵🇸

@abcdw for ports in general I use (rnrs io ports), but with exceptions you get the weird the r6rs error messages, which while fine on their own & r6rs providing the superior conditional system, they are disjoint from Guile's style which feels a little clunky

Andrew Tropin

@rml That's good, but what should I use and why?)

blake shaw 🇵🇸

@abcdw u should use rnrs io pots and (ice-9 exceptions), sorry if that was unclear.

fwiw the various port implementations are all compatible so its not a big mess if you decide to change later.

Andrew Tropin

@rml why not r7rs? the interface wise it looks more consistent.

blake shaw 🇵🇸

@abcdw tbh I'm just not as familiar with R7RS, and I believe it isn't as fully featured, but I'm being presumptuous here.

Andrew Tropin

I went with (scheme base) aka r7rs for binary port and (ice-9 exceptions) aka guile exceptions, but this fragmentation of ecosystem is not cool at all and raises learning curve to the sky.

git.sr.ht/~abcdw/guile-nrepl/c

#scheme #guile #lisp

Ludovic Courtès

@abcdw I would avoid R7 modules, precisely to avoid adding to the confusion.

If you’re aiming for a widely understood dialect, you can pick SRFIs when they exist and provide the right feature set. SRFI-34/35 for example are mostly equivalent to Guile 3.0’s exceptions, but they’re closer to the “lingua franca” of Scheme, having been around for ages.

Ludovic Courtès

@abcdw My personal preference: (ice-9 binary-ports) if you’re writing Guile-only code, or (rnrs io ports) if you’re aiming for R6 portability. These interfaces are roughly synonyms; the R6 one just pulls in more stuff.

(I’m skeptical of R7, I think it didn’t start on the right foot.)

Go Up