unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: John Cowan <cowan@ccil.org>
To: hiphish@posteo.de
Cc: guile-user@gnu.org
Subject: Re: [ANN] guile-msgpack: MessagePack for GNU Guile (+ help needed)
Date: Wed, 19 Sep 2018 10:12:04 -0400	[thread overview]
Message-ID: <CAD2gp_Ta4Pp-sV843b7EctZ=95eOyGwpzGzaJ5O3O8S2MFx8bw@mail.gmail.com> (raw)
In-Reply-To: <3401551.pIYnLFp0Xl@aleksandar-ixtreme-m5740>

On Wed, Sep 19, 2018 at 8:33 AM HiPhish <hiphish@posteo.de> wrote:

Since using MessagePack with
> ports is a frequent task there is also a `pack!` procedure which takes in
> a
> port to pack to as well.
>

By convention, Scheme procedures whose only side effect is on a port
don't use the ! in their names: we write `read`, `write`, `display`, not
`read!`, `write!`, `display!`.

I would suggest calling them pack-and-write and read-and-unpack;
you can leave out the "and-" if you think those are too long.

How much is portability a concern? I know Guile implements *some* or r6rs,
> but
> I wasn't paying much attention to that. Is it something worth considering
> or
> should I just treat Guile as its own language that just so happens to be
> based
> on Scheme?
>

The Scheme community is small enough that doing a little bit to make
libraries
more portable is worthwhile.  I'd use R6RS `library` instead of
Guile-specific
`define-module`, and maybe put the code proper into a separate file from the
module furniture.  (To use `include` or any other Guile-specific procedure
 in an R6RS library, add `(only (guile) include)` to the imports list.)
Using
Guile-specific procedures is not usually a problem, as there are probably
equivalents in other Schemes.


> The extension type `ext` (msgpack/ext.scm) is a pair of a signed 8-bit
> integer
> and a bytevector. The constructor does not enforce this condition, the two
> slots can be really anything. What it the proper way of enforcing this in
> Guile? I know Common Lisp has type declarations and Racket has contracts,
> but
> what does Guile have?
>

Usually there's just using a constructor wrapper that checks the types
before
calling the real constructor (`cons` in this case).


> Is there a way of making it unpack as many as it can?


Returning a list of values is idiomatic.  It is actually possible for a
caller to
receive multiple values without knowing how many it's going to get, but it's
probably more trouble than it's worth in this case.


> if anyone can recommend me a service for one-time donations that would
> be cool. All the services I could find were about fundraising for charity
> and
> stuff, not what I was looking for.
>

GoFundMe seems like the right thing.  They are large and reputable, they
only
take enough of your money to cover credit-card processing costs (for
personal
campaigns like this one), they are okay with small donations.  Although
they are
best known for crowdfunding personal emergencies, they do handle works of
art
as well (software is an art, we have Knuth's word for it).

-- 
John Cowan          http://vrici.lojban.org/~cowan        cowan@ccil.org
First known example of political correctness: After Nurhachi had united
all the other Jurchen tribes under the leadership of the Manchus, his
successor Abahai (1592-1643) issued an order that the name Jurchen should
be banned, and from then on, they were all to be called Manchus.
                --S. Robert Ramsey, The Languages of China


  parent reply	other threads:[~2018-09-19 14:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 12:33 [ANN] guile-msgpack: MessagePack for GNU Guile (+ help needed) HiPhish
2018-09-19 13:29 ` Thompson, David
2018-09-19 14:06   ` HiPhish
2018-09-19 14:12 ` John Cowan [this message]
2018-09-19 23:32   ` HiPhish
2018-09-20  1:44     ` John Cowan
  -- strict thread matches above, loose matches on Subject: below --
2018-09-20 11:15 Aleksandar Sandic
2018-09-20 11:24 Aleksandar Sandic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD2gp_Ta4Pp-sV843b7EctZ=95eOyGwpzGzaJ5O3O8S2MFx8bw@mail.gmail.com' \
    --to=cowan@ccil.org \
    --cc=guile-user@gnu.org \
    --cc=hiphish@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).