unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* bytestructures 2.0.0
@ 2022-02-20 19:51 Taylan Kammer
  2022-02-20 23:25 ` Matt Wette
  0 siblings, 1 reply; 5+ messages in thread
From: Taylan Kammer @ 2022-02-20 19:51 UTC (permalink / raw)
  To: Guile User

I'd like to announce the release of bytestructures 2.0.0 for Scheme and
Guile in particular.

Don't be fooled by the major version bump, there's nothing radically new
in this release. :-)

  https://github.com/TaylanUB/scheme-bytestructures


What's new?
-----------

This release bumps the major version number since there is one
API-breaking change:

The indexing semantics of bs:pointer (Guile-specific) have changed
from allowing an arbitrary index to implicitly deref the pointer,
to allowing only an integer index (besides the symbol '*') to deref
with an offset akin to "pointer + offset" in C.

Other news in this release:

- There is now support for anonymous unions within struct definitions.

- The macro API now allows you to define two additional macros via its
  macro-defining-macro define-bytestructure-accessors. The new generated
  macros allow you to provide an initial offset into a bytevector when
  getting or setting values.

See relevant sections of the README for detailed documentation.


What's bytestructures anyway?
-----------------------------

The library offers a system imitating the type system of the C programming
language, to be used on bytevectors. C's type system works on raw memory,
and ours works on bytevectors which are an abstraction over raw memory in
Scheme. The system is in fact more powerful than the C type system,
elevating types to first-class status.

A C type corresponds to a "bytestructure descriptor" object in our system.

  ;; typedef uint8_t uint8_v3_t[3];
  (define uint8-v3 (bs:vector 3 uint8))

  ;; typedef struct { uint16_t x; uint8_v3_t y; } my_struct_t;
  (define my-struct (bs:struct `((x ,uint16) (y ,uint8-v3))))

These can then be bundled with a bytevector, yielding a "bytestructure"
object on which referencing and assignment work in accordance with the
types declared in the descriptor.

  ;; my_struct_t str;
  (define str (bytestructure my-struct))

  ;; my_struct_t str = { 0, 1 };
  (define str (bytestructure my-struct #(0 1)))

  ;; str.y[2]
  (bytestructure-ref str 'y 2)

  ;; str.y[2] = 42;
  (bytestructure-set! str 'y 2 42)

If your Scheme implementation supports syntax-case, then a macro-based API
is available as well, for when the procedural API is too slow.

Full documentation here:

  https://github.com/TaylanUB/scheme-bytestructures

(Apologies for still using GitHub.)

-- 
Taylan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bytestructures 2.0.0
  2022-02-20 19:51 bytestructures 2.0.0 Taylan Kammer
@ 2022-02-20 23:25 ` Matt Wette
  2022-02-21 21:09   ` Taylan Kammer
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Wette @ 2022-02-20 23:25 UTC (permalink / raw)
  To: guile-user


On 2/20/22 11:51 AM, Taylan Kammer wrote:
> I'd like to announce the release of bytestructures 2.0.0 for Scheme and
> Guile in particular.
>
> Don't be fooled by the major version bump, there's nothing radically new
> in this release. :-)
>
>    https://github.com/TaylanUB/scheme-bytestructures
>
>
Thanks for keeping up the support!   This is important component of 
nyacc's ffi-helper.

Matt




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bytestructures 2.0.0
  2022-02-20 23:25 ` Matt Wette
@ 2022-02-21 21:09   ` Taylan Kammer
  2022-02-22 20:50     ` bytestructures 2.0.1 Taylan Kammer
  0 siblings, 1 reply; 5+ messages in thread
From: Taylan Kammer @ 2022-02-21 21:09 UTC (permalink / raw)
  To: Matt Wette, guile-user

On 21.02.2022 00:25, Matt Wette wrote:
> 
> On 2/20/22 11:51 AM, Taylan Kammer wrote:
>> I'd like to announce the release of bytestructures 2.0.0 for Scheme and
>> Guile in particular.
>>
>> Don't be fooled by the major version bump, there's nothing radically new
>> in this release. :-)
>>
>>    https://github.com/TaylanUB/scheme-bytestructures
>>
>>
> Thanks for keeping up the support!   This is important component of nyacc's ffi-helper.
> 
> Matt
> 

And thank you for your inputs to the project. :-)

By the way I've been notified that the test suite of this release doesn't
run on stock SRFI 64.  I absentmindedly put in some code that relies on
my own slightly extended SRFI 64 implementation.

It's already fixed upstream.  Not sure if it's worth releasing 2.0.1.

Maybe I'll find some time soon to work on some of the other issues and
make a 2.1.0 release instead.

-- 
Taylan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* bytestructures 2.0.1
  2022-02-21 21:09   ` Taylan Kammer
@ 2022-02-22 20:50     ` Taylan Kammer
  2022-02-23 21:36       ` Jérémy Korwin-Zmijowski
  0 siblings, 1 reply; 5+ messages in thread
From: Taylan Kammer @ 2022-02-22 20:50 UTC (permalink / raw)
  To: Matt Wette, guile-user

On 21.02.2022 22:09, Taylan Kammer wrote:
> 
> It's already fixed upstream.  Not sure if it's worth releasing 2.0.1.
> 

Decided to release it after all.  Just the test suite fix.

https://github.com/TaylanUB/scheme-bytestructures/releases/tag/v2.0.1

-- 
Taylan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bytestructures 2.0.1
  2022-02-22 20:50     ` bytestructures 2.0.1 Taylan Kammer
@ 2022-02-23 21:36       ` Jérémy Korwin-Zmijowski
  0 siblings, 0 replies; 5+ messages in thread
From: Jérémy Korwin-Zmijowski @ 2022-02-23 21:36 UTC (permalink / raw)
  To: Taylan Kammer, Matt Wette, guile-user


[-- Attachment #1.1.1: Type: text/plain, Size: 56 bytes --]

Yo Taylan !

Thank you for your work !

Jérémy


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2525 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 665 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-23 21:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-20 19:51 bytestructures 2.0.0 Taylan Kammer
2022-02-20 23:25 ` Matt Wette
2022-02-21 21:09   ` Taylan Kammer
2022-02-22 20:50     ` bytestructures 2.0.1 Taylan Kammer
2022-02-23 21:36       ` Jérémy Korwin-Zmijowski

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).