guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: R7RS On Guile


From: amirouche
Subject: Re: R7RS On Guile
Date: Tue, 23 Apr 2019 22:34:36 +0200
User-agent: Roundcube Webmail/1.3.8

On 2019-04-23 21:55, Brett Gilio wrote:
address@hidden writes:

Hello,


If you like R7RS and also like Guile you might join me
in getting together R7RS libraries as Guile libraries.

I am just getting started not much is done as of yet.
The repository is over the rainbow at source hut:

    https://git.sr.ht/~amz3/guile-r7rs

There is continuous integration that is setup.
Documentation is written in markdown and the project
rely on Guile srfi-64 testing framework.

My plan is to focus on (scheme base) to get tests
and documentation up.

Feel free to reach me if you would like to join the fun.


Happy hacking!

Hey, I would love to help with this! I am on sr.ht as well.

Great!

For each library there three things to do:

- implementation e.g. scheme/base.scm
- documentation e.g. scheme/base.md
- tests e.g. scheme/base-tests.scm

Pick what you are interested to do, leave the rest. Don't feel
obliged to do documentation if you are not interested.

Among the three tasks, documentation is the easiest as you can
almost all the time copy/paste as-is the original documentation
found in the SRFI specification. Look at scheme/base.md to see
how documentation should look like. If you feel inspired you can
add example uses.

Pick one library in that list:

- `(scheme box)` aka. SRFI 111
- `(scheme charset)` aka. SRFI 14
- `(scheme comparator)` aka. SRFI 128
- `(scheme ephemeron)`) aka. SRFI 124
- `(scheme hash-table)` aka. SRFI 125
- `(scheme ideque)`) aka. SRFI 134
- `(scheme ilist)` aka. SRFI 116
- `(scheme list)` aka. SRFI 1
- `(scheme list-queue)` aka. SRFI 117
- `(scheme lseq)` aka. SRFI 127
- `(scheme rlist)` aka SRFI 101
- `(scheme set)` aka. SRFI 113
- `(scheme sort)` aka. SRFI 132
- `(scheme stream)` aka. SRFI 41
- `(scheme text)` aka. SRFI 135
- `(scheme vector)` aka. SRFI 133

Or

- `(scheme mapping)` aka. SRFI 146
- `(scheme mapping hash)` aka. SRFI 146
- `(scheme regex)` aka. SRFI 115
- `(scheme generator)` aka. SRFI 158
- `(scheme division)` aka. SRFI 141
- `(scheme bitwise)` aka. SRFI 151
- `(scheme fixnum)` aka. SRFI 143
- `(scheme flonum)` aka. SRFI 144
- `(scheme bytevector)` aka. `(rnrs bytevectors)` aka. SRFI 4
- `(scheme vector @)` aka. SRFI 160 where @ is any of base, u8, s8, u16, s16, u32, s32, u64, s64, f32, f64, c64, c128.
- `(scheme show)` aka. SRFI 159

First you must check if the SRFI is available in guile 2.2.
If it is the case (like SRFI-1) you can re-export [0]
those forms in that case in scheme/list.scm file.

[0] https://www.gnu.org/software/guile/manual/html_node/Creating-Guile-Modules.html#index-re_002dexport-1

In the case the SRFI is in guile, forget about the tests.

As you can see they are all based on existing SRFI.
You can find the SRFI at https://git.io/fj3HY they
come most of the time with sample implementation and
sometime with tests.

Sometime guile comes with a better implementation,
in that case use guile implementation.  For instance,
I think one can rely on guile-pfds to implement
(scheme mapping hash).

Look at how I started with base.scm [1]

[1] https://git.sr.ht/~amz3/guile-r7rs/tree/master/scheme/base.scm#L25

I define the library with `define-module` and then use
`import` (instead of `use-modules`) with a mixture of
`prefix`, `except` and `only`.

To make a form public use `export` or `re-export` if the
form comes from another guile module (like srfi srfi-1).

When you create a test file you must add it to TEST_FILES
in the Makefile https://git.sr.ht/~amz3/guile-r7rs/tree/master/Makefile#L14
Mind the "\" at the end of the line that marks the continuation
of the list.

Then you can run all tests with 'make check'

Similarly, if you add a documentation file you must add it to
DOCUMENTATION_FILES
https://git.sr.ht/~amz3/guile-r7rs/tree/master/Makefile#L4

To build the documentation, you will need 'pandoc' and 'latex'.
Use 'make doc' to generate the documentation.


If you want it, I can add you as contributor, in that case give
me your sr.ht username.

I almost forgot, when you start something fill a todo item at
https://todo.sr.ht/~amz3/guile-r7rs

Also don't forget to add a license header in the files you create
or contribute to.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]