[Chicken-users] LevelDB bindings

2014-04-20 Thread Caolan McMahon
Hi all,

I'm new to the list (and CHICKEN) *waves*

I thought I'd have a go at writing an egg and put together some
bindings to Google's LevelDB embedded key/value store. I've published
it at https://github.com/caolan/chicken-leveldb

Can someone please help me with getting it onto the egg index? I'd
also appreciate any advice people have on coding style / egg layout
etc. since I'm still getting the hang of this.

Thanks,

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] LevelDB bindings

2014-04-20 Thread Caolan McMahon
Thanks Evan, I've renamed the directory to 'tests'. Salmonella still
complains about missing docs, not sure how to fix that.

Caolan

On 20 April 2014 14:23, Evan Hanson ev...@foldling.org wrote:
 Hi Caolan, and welcome :)

 Thanks for making this egg -- based on the README it looks very nice to
 use/well thought-out.

 One note: chicken-install expects the tests directory to be named
 tests, but your project has it under test instead. If that's not
 intentional you may want to rename it so your egg will run its tests
 when asked and benefit from salmonella's regular test runs.

 Let us know if you'd like to fix this before it's added to the coop.
 Otherwise, it installs/tests OK here.

 Cheers,

 Evan

 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] LevelDB bindings

2014-04-20 Thread Caolan McMahon
Thanks, I've updated the wiki.

Alex: the output from the conversion seemed a little broken so I ended
up converting by hand. Perhaps try running it on the README.md file
yourself to see what went wrong?

On 20 April 2014 15:25, Alex Charlton alex.n.charl...@gmail.com wrote:

 caolan.mcma...@gmail.com writes:

 Thanks Evan, I've renamed the directory to 'tests'. Salmonella still
 complains about missing docs, not sure how to fix that.

 Hi Caolan,

 As Evan’s already said, you’ll need to create the wiki page for leveldb 
 (http://wiki.call-cc.org/eghttp://wiki.call-cc.org/eggs%20tutorial#documentationgref/4/leveldb).
  Since your readme is written in Markdown, check out my markdown-svnwiki egg. 
 It shouldn’t have any problem converting your readme to the format that the 
 wiki expects. If you have any problems, though, let me know. It’s a very new 
 egg, and as far as I know I’m the only one who has used it, so having some 
 feedback from another user would be appreciated :)

 https://wiki.call-cc.org/eggref/4/markdown-svnwiki

 --
 Alex


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Chicken Spring Gathering in Norway

2014-05-12 Thread Caolan McMahon
I'd gladly host you in Sheffield, UK if that interests any of you ;)

On 11 May 2014 19:48, Moritz Heidkamp mor...@twoticketsplease.de wrote:
 Hey Kristian and Peder,

 Kristian Lein-Mathisen krist...@adellica.com writes:

 I would just like to thank everybody who attended the Viking CHICKEN
 spring event last week for a wonderful time! Thanks to everyone for making
 the event into what it became. Peder and I really enjoyed having such a
 friendly and skilled (and opinionated!) bunch of programmers over. The
 CHICKEN community is truly remarkable!

 one more time from me, as well: Thank you two for being great hosts :-)
 I am glad that I eventually decided to come and hope that we'll meet
 again in Bergen!


 To everyone who couldn't attend, I hope you will be able to join us next
 time! Which, hopefully, won't be in too long. Until then, guys!

 I second that! Perhaps anyone reading this is up for hosting the next
 CHICKEN meeting?

 All the best
 Moritz

 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] fnmatch egg

2014-07-27 Thread Caolan McMahon
I've just written some bindings to fnmatch(3), which provides
shell-style wildcard pattern matching for filenames. Much like `glob`
from the posix module, only it matches two strings, returning a
boolean rather than descending directories and returning a list of
matching filenames.

https://github.com/caolan/chicken-fnmatch

This is fairly trivial, but doesn't appear to be available anywhere
else on the egg index. If someone could add it I'd appreciate it.

Thanks,

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] New leveldb eggs

2014-07-27 Thread Caolan McMahon
I published leveldb bindings a while ago. It turns out the
implementation had some issues with mangled keys in some
circumstances. I've now fixed these issues and created some additional
eggs to compliment leveldb. The new eggs are as follows:

level - provides the leveldb interface (put/get etc)
https://github.com/caolan/chicken-level

leveldb - an implementation of the 'level' api, using libleveldb to store data
https://github.com/caolan/chicken-leveldb

sublevel - an implementation of the 'level' api which provides
namespaced access to another implementation
https://github.com/caolan/chicken-sublevel

I'm hoping to write (or encourage someone else to write) a memory-only
implementation of the 'level' API, which would be useful for testing
or other circumstances where you want to use a module written to the
'level' interface without persisting data.

A small backwards compatibility note on the `level` API - the
`db-stream` procedure now returns a lazy-seq instead of requiring a
thunk which accepts a lazy-seq. It uses set-finalizer! to clean up the
iterator after you've finished with the lazy sequence.

If someone could add the new `level` and `sublevel` eggs to the egg
index that would be great!

Thanks,

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] New leveldb eggs

2014-07-27 Thread Caolan McMahon


 I'm hoping to write (or encourage someone else to write) a
memory-only
 implementation of the 'level' API, which would be useful for testing
 or other circumstances where you want to use a module written to the
 'level' interface without persisting data.

Sounds useful.  And perhaps some integration with a relational DB, or
other types of stores (memcached?) could be added.

Yes, that would be great. There are already key value store eggs based on 
sqlite in the egg index, perhaps one of those could be adapted to an egg 
exposing the level api...

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] TOML parser egg

2015-04-20 Thread Caolan McMahon
Hi all,

I've been writing a TOML parser, mostly as an excuse to play with
comparse (with is very nice btw). TOML is a reasonable looking config
file format that's not crazy like YAML ;)

The egg is available at http://github.com/caolan/chicken-toml

More info on TOML: https://github.com/toml-lang/toml

If someone could add this to the egg index I'd appreciate it.

I tried to keep the API close to the medea JSON parser. It's passing
the toml-test suite and should be pretty usable. The encoder produces
'correct' but not necessarily pretty output. Expect the formatting of
the TOML output to change as I make it more human-friendly in future
versions (eg, deciding when to use multi-line strings).

Enjoy!

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Statically Linking Eggs

2015-05-19 Thread Caolan McMahon
I'm also interested in the tooling around statically linked eggs, or
at least finding ways to better document the process. I've had mixed
results, sometimes it's easy, others it's incredibly painful. If
anyone has ideas on how to improve this I'd be willing to help out.

On 19 May 2015 at 06:18, Evan Hanson ev...@foldling.org wrote:
 Hi Nick,

 On 2015-05-18  9:12, Nick Andryshak wrote:
 Would it be feasible to make my own object files for eggs that don't
 include them by using chicken-install -retrieve, and then compiling the
 sources?

 Yes, and it's straightforward to do for most extensions -- I've used
 this approach for a few projects myself -- but it requires manually
 compiling every single dependency in turn so the task balloons very
 quickly unless you consciously avoid using eggs with many dependencies.

 Evan

 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] CommonMark parser (please add to egg index)

2015-08-21 Thread Caolan McMahon
I've written some simple bindings to the cmark C library for parsing
CommonMark (a more highly specified MarkDown):

https://github.com/caolan/chicken-cmark

Please add this to the egg-locations file in SVN, as I don't have the
appropriate permissions :)

(cmark https://raw.github.com/caolan/chicken-cmark/master/cmark.release-info;)

Many thanks! ...more eggs to come soon

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Bencode egg

2015-11-06 Thread Caolan McMahon
Hi all,

I've just written a quick egg to do Bencode parsing / serialization.
Bencode is the encoding used by BitTorrent, and is similar to
tagged-netstrings.

Bencode supports four data types:

* Strings
* Integers
* Lists
* Dictionaries

Bencode uses ASCII characters as delimiters and digits, making it less
space-efficient than something like message-pack but hopefully a bit
easier to read!

Please can someone add this to the egg index?
https://github.com/caolan/chicken-bencode

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] ldap-bind egg

2015-08-28 Thread Caolan McMahon
Please add this to the egg index:
https://github.com/caolan/chicken-ldap-bind

It provides basic bind functionality for authenticating a user with an
LDAP server - it's not a full OpenLDAP binding, but hopefully it's
still useful.

Thanks to Moritz Heidkamp for doing most of the hard work. I was
halfway through my own implementation when I learned Moritz had a more
complete one I could build on.

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] another egg

2016-01-04 Thread Caolan McMahon
Hey Jörg,

Thanks for the updates. I think I probably found things more
complicated writing this module because of wiring-pi calling callbacks
from other threads (hence pulling in concurrent-native-callbacks etc).
I'm currently using this library without hitting the 'case' issue you
pointed out... not the first obviously broken code I've had 'work' in
CHICKEN 4.10. Starting to think I'm losing it!

Caolan

On 4 January 2016 at 13:27, Jörg F. Wittenberger
<joerg.wittenber...@softeyes.net> wrote:
>
>
> Hi all,
>
> yet another egg I put together, which may be interesting to you (and may
> go the coop):
>
> http://askemos.org/chicken-eggs/raspberry-pi-gpio-small.release-info
>
> This is a (supposed to be) API compatible version of the
> raspberry-pi-gpio egg.
>
> Maybe these modifications should simply be folded into the latter.
> That's a matter of choice.  (A choice left to Caolan McMahon, the author
> of the latter.)
>
> Why did I feel the alternative may be good?
>
> * The `-small` suffix was chosen because of the reduced dependency list:
> no dependencies except for CHICKEN core.
>
> * Throwing together those modifications took me about as much wall clock
> time as chicken-install spent on installing the original one including
> those dependencies.
>
> * Roughly half the code size.
>
> * Not jumping through various call should always be faster than doing
> so.  Thus I'd _expect_ less runtime overhead, which may be important
> when controlling sensors.
>
> * Not needing those dependencies should make debugging simpler.
>
> (* Besides: I wonder how the original could ever have worked.  The
> example from the documentation runs into >>Error: uncaught exception:
> "Unknown mode"<< for an obvious misuse of `case`.)
>
> Have fun
>
> /Jörg
>
> ___
> Chicken-hackers mailing list
> chicken-hack...@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-hackers
>
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] another egg

2016-01-05 Thread Caolan McMahon
> Great to learn that you are still around here and caring for the egg.
>
> If you like those changes, please pull them in.  This would have the
> advantage to reduce clutter/pollution of the eggs listing.
>
> Pls. notify the list.  If you pull those changes in Mario should _not_
> include mine into the coop as it would become obsolete soon.  If you
> don't I'd ask for inclusion into the coop anyways.

Sounds good, I'll pull in your changes rather than us adding more gpio
eggs. Reducing the dependencies alone is worth doing since I expect
many people will just compile on the raspberry pi rather than set up a
cross-compiler. Please could you email me a git format-patch?

Just so you know, it may be a few days before I have time to test this
code out, busy week for me. I expect to have some raspberry pi gadgets
arriving though, so I'll have an incentive to try this out :D


>> I'm currently using this library without hitting the 'case' issue you
>> pointed out...
>
> This begs the (academic) how that's possible that this did work for you.

Just to be clear, I'm not implicating CHICKEN 4.10 just yet ;) I'll
look into it when I test your patch.

The other example I alluded to was this issue:
http://bugs.call-cc.org/ticket/1232
In that egg there was an obviously broken cond that passed the tests
just fine in CHICKEN 4.10.0 and (rightfully) failed for the CHICKEN
4.10.1 dev snapshot... very odd.


-Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] New egg: punycode

2016-01-09 Thread Caolan McMahon
Please can someone add this to the egg index?
https://github.com/caolan/chicken-punycode

Its used when working with internationalized domain names and converts
domains in the style of
"www.bücher.de" to "www.xn--bcher-kva.de" and vice-versa. If you're
using domain names in your user-interface this may be of use to you.

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Starting up spiffy for dynamic content

2016-03-08 Thread Caolan McMahon
Peter, for what it's worth I encountered exactly the same confusion
when I first used spiffy (or rather, I arrived with the same
preconceptions?). Perhaps this might be fixed by adding a clearly
signposted example to the wiki which demonstrates the recommended way
to implement this kind of dynamic content.

On 8 March 2016 at 12:40, Peter Bex  wrote:
> On Tue, Mar 08, 2016 at 12:02:29PM +, Norman Gray wrote:
>> It occurred to me that I could/should use the vhost-map to do this
>> dispatching, using something like
>>
>> (vhost-map `((".*" . ,(lambda (continue) ... and ignore (continue)
>>
>> But (a) that would clearly be a hack
>
> Actually, that's how it was designed to be used.  Not a hack at all!
>
>> and (b) it appears that that's designed to be able to re-parameterise
>> a request, rather than handle it itself,
>
> It's intended to be used like that, and you *may* re-parameterise (but
> that's not necessary).  The idea is that you can create "components"
> which can be chained together, influencing their sub-components by
> simply parameterising some options and then passing the flow on to
> continue.  The last component in the sequence would then actually
> serve the request.
>
>> so (c) that would clearly be a hack.
>
> Again, that's not a hack but the design.
>
>> Another possibility is to specify the handle-not-found handler, and
>> make sure to start the spiffy server in a context which has no files
>> at all, so that the handle-not-found handler will always be called.
>> But that also feels like a bit of a hack.
>
> That's a bit awkward, but it's an equally valid option.
>
>> The final possibility is to use intarweb directly, but that's
>> unappealing, since it would require me cut-and-pasting quite a lot
>> of the content of spiffy.scm.
>
> Now *that* would be a hack ;)
>
>> Where this is coming from: I'm pretty familiar with the Racket
>> servlet framework which requires, in serve/servlet
>> , a
>> request->response mapping function.
>>
>> If I'm missing something really obvious, then apologies, and could
>> someone hand me the clue-stick?
>
> I think you're coming at this from a slightly wrong angle with some
> preconceptions that prevent you from using the system as designed,
> because you did figure out how to use it (you came up with two valid
> solutions to the problem) but rejected them offhand.
>
> Cheers,
> Peter
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] New egg: level-sexp

2016-07-05 Thread Caolan McMahon
I've created a new module which allows you to read/write s-expressions
to LevelDB. It's a 'level' implementation and works with the following
eggs:

* level
* leveldb
* sublevel

The source can be found at:
https://github.com/caolan/chicken-level-sexp

Please can someone add this to the coop?

Thanks,

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] New egg: sodium

2017-02-25 Thread Caolan McMahon

Please can someone add my new sodium egg to the coop?
https://github.com/caolan/chicken-sodium.git

It's a binding to the libsodium (https://libsodium.org) crypto library. The egg 
is a work in progress, but it already has a few useful procedures.

Thanks,

-- 
Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] New egg: sodium

2017-02-27 Thread Caolan McMahon

> I tested it here on my machine (x86-64, Debian 8, libsodium 1.0.0-1) and
> got one test failure:
>
>   (generic-hash (string->blob "")) . [ERROR]
>   
>   Error: crypto_generichash returned -1
>
> Do you get this too?

Ah yes, I forgot about this test case. Older versions of libsodium can't hash 
an empty value it seems. I thought I'd disabled this test depending on the 
libsodium version, but perhaps I forgot to commit it...

Thanks for the bug report.

-- 
Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] define-external and abort

2016-09-09 Thread Caolan McMahon
I have been doing some work on the LMDB bindings
(https://github.com/iraikov/chicken-lmdb) and submitted a patch for it's
error-handling. Ivan and I are not 100% sure what I've done is safe, so
I'd appreciate your expertise.

Normally, I have my C bindings return an error code and then in scheme I would 
create a condition and call (abort ...). The LMDB binding, however, does more 
work in C.

Currently, the LMDB error handling looks like this:

```
static void chicken_ThrowException(C_word value) C_noret;
static void chicken_ThrowException(C_word value)
{
  char *aborthook = C_text("\003sysabort");

  C_word *a = C_alloc(C_SIZEOF_STRING(strlen(aborthook)));
  C_word abort = C_intern2(, aborthook);

  abort = C_block_item(abort, 0);
  if (C_immediatep(abort))
Chicken_Panic(C_text("`##sys#abort' is not defined"));

#if defined(C_BINARY_VERSION) && (C_BINARY_VERSION >= 8)
  C_word rval[3] = { abort, C_SCHEME_UNDEFINED, value };
  C_do_apply(3, rval);
#else
  C_save(value);
  C_do_apply(1, abort, C_SCHEME_UNDEFINED);
#endif
}

void chicken_lmdb_exception (int code, int msglen, const char *msg) 
{
  C_word *a;
  C_word scmmsg;
  C_word list;

  a = C_alloc (C_SIZEOF_STRING (msglen) + C_SIZEOF_LIST(2));
  scmmsg = C_string2 (, (char *) msg);
  list = C_list(, 2, C_fix(code), scmmsg);
  chicken_ThrowException(list);
}
```

Where error codes from LMDB functions are passed to `chicken_lmdb_exception` 
from C.

I wanted to update this to create a composite condition that could be used with 
condition-case and friends. I replaced the two functions above with a 
define-external:

```
(define-external (chicken_lmdb_exception (int code)) void
  (abort
   (make-composite-condition
(make-property-condition 'exn 'message (error-code-string code))
(make-property-condition 'lmdb)
(make-property-condition (error-code-symbol code)
```

The rest of the C code still calls `chicken_lmdb_exception` as before.

My question: Is this functionally equivalent to the original C
implementation in terms of calling abort?


-- 
Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] New egg: lmdb-lolevel

2017-01-10 Thread Caolan McMahon

Please can someone add my new lmdb-lolevel egg to the coop:
https://github.com/caolan/lmdb-lolevel

I needed a few low-level things from the LMDB C API (like cursors and custom 
sort functions), so I've written a more low-level binding. I tried to follow 
the C API as closely as possible (without requiring manually memory 
management). This code is not based on the existing 'lmdb' egg - though perhaps 
we could base the higher-level egg on this one if benchmarks look OK...

Thanks,

-- 
Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] New egg LDIF

2017-04-19 Thread Caolan McMahon

Jörg, I think you have a typo in the first line:

  (repo git "git://github.com/0-0-15/{egg-name}.git")

Should that be 0-8-15 to match your username (instead of 0-0-15)?


Caolan


Jörg F. Wittenberger  writes:

> Hi,
>
> there's a new egg:
>
> Read/write LDIF, LDAP search strings and related data formats. (RFCs 2849, 
> 4514, 2254)
>
> https://raw.githubusercontent.com/0-8-15/ldif-sexpr/master/ldif-sexpr.release-info
>
> Best
>
> /Jörg
>
> 
>
>
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


-- 
Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] New egg: gumbo

2018-03-06 Thread Caolan McMahon
Please can someone add this to the egg index?

https://github.com/caolan/chicken-gumbo

It provides bindings to the Gumbo HTML parser from Google
(https://github.com/google/gumbo-parser).

I'm trying this out because html-parser and htmlprag don't support
HTML5 input and I want something up and running quickly. Updating the
pure scheme parsers would be a nice project for another day!

Thanks,

Caolan

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


CHICKEN 5 port of bencode egg

2021-01-23 Thread Caolan McMahon
I recently merged a pull request from fancycade to port the bencode egg from 
CHICKEN 4 to CHICKEN 5. I've updated the release-info file and tagged a new 
release. 

https://github.com/caolan/chicken-bencode/

It's already been picked up by the CHICKEN 4 egg index, what else needs to 
happen for this to be included in the CHICKEN 5 egg index?

Thanks,

Caolan



Re: new egg: cmark

2021-11-04 Thread Caolan McMahon
> Caolan: would you be ok for you if cmark for CHICKEN 5 points to
> Harley's implementation?

Yes, please go ahead - and thanks to Harley for creating a CHICKEN 5 version :)

Caolan



Re: ldap-bind egg

2022-10-03 Thread Caolan McMahon
Hi Sven, Vasilij,

>> If so, is there a chance that it will be ported from Chicken-4 to Chicken-5?
>
> I've Cc'd the current maintainer of the egg. In case it's dormant,
> porting and taking over its maintenance shouldn't be too hard due to the
> low complexity of the code.

I'm afraid I don't have time to port it to Chicken 5 but by all means have a go 
yourself - it should be pretty simple to do.

Caolan