Re: Port of msgpack to Chicken 5

2021-03-24 Thread kooda
Théo Cavignac  wrote:
> Hi,
> 
> 
> About two years ago I started a big project using Chicken and msgpack. 
> The msgpack egg being stalled and only in C4, I ported it to C5.
> 
> I tried to contact the original author on Github but he never replied 
> (maybe he will see this mail, in which case I would be happy to hand 
> over my port to him).
> 
> Not having any answer I planned on releasing this myself, but it delayed 
> that for some time waiting for a moment to learn a bit more about eggs 
> publications.
> 
> That day came today.
> 
> I never submitted an egg before so I am not sure everything is alright 
> but this community is very helpful, so I look forward to make it perfect.
> 
> The code is available at https://github.com/Lattay/chicken-msgpack.
> 
> I updated the doc and added a README.svnwiki that could be used as a 
> wiki page I think.
> 
> The release info is there: 
> https://raw.githubusercontent.com/Lattay/chicken-msgpack/master/msgpack.release-info
> 
> There is a test suite from the original author that I find pretty good.
> 
> 
> Cheers,
> 
> Théo

Hi! Looks good to me, I’ve added it to the repository. Thanks for your
contribution!

I also took the liberty to add your documentation to the wiki, but note
that you can edit it yourself, even without an account. :)

Speaking of documentation, tools like chicken-doc and api.call-cc.org are
looking for special tags for their symbol search feature, could you change
your documentation to use them? Here are the relevant bits of information:
https://wiki.call-cc.org/edit-help#extensions-for-chicken-documentation



Re: New egg for SRFI 193: Command line

2020-10-23 Thread kooda
Lassi Kortela  wrote:
> Based on the code posted to chicken-hackers previously, here's an egg 
> for SRFI 193: .
> 
> test-new-egg says:
> 
> < srfi-193 (1 of 1) 
>Fetching[ ok ] 0s
>Reading .egg[ ok ] 0s
>Checking dependencies...[ ok ] 0s
>Checking category...[ ok ] 0s
>Checking license[ ok ] 0s
>Checking author.[ ok ] 0s
>Installing..[ ok ] 1s
>Checking version[ -- ]
>Testing.[ ok ] 12s
>Checking documentation..[fail] 0s
> 
> An attempt at a wiki page is here: 
> .
> 
> Is this enough to go on? Let me know if more work is needed.

Everything seems to be in order, I’ve added the egg to the repository! :)
The wiki page looks fine too, please upload it to the wiki when you have the 
time.


Re: Dead link on matchable documentation

2020-09-28 Thread kooda
Matt Welland  wrote:
> This link to this paper an-introduction-to-lispy-pattern-matching.html,
> from http://wiki.call-cc.org/eggref/5/matchable, is dead. I could not find
> the paper.
> 
> Thanks.

Archive.org to the rescue!
https://web.archive.org/web/20191026060659/http://ceaude.twoticketsplease.de/articles/an-introduction-to-lispy-pattern-matching.html

Moritz, is this intended? You had a lot of nice articles on your blog, it’s a 
shame they aren’t online anymore.


Re: German Umlauts / UTF8 with comparse

2020-02-18 Thread kooda
Christoph Lange  wrote:
> Yes, this helps. Kind of ;-) ... using the character set
> char-set:alphabetic, my umlauts are now parsed. But I don't get them back
> in my result, at least not as printable characters. Instead, the following
> happens, and utterly confuses me:

Hmm, indeed. From what I can see, the result of parse is not encoded in
UTF-8.

I went to see comparse’s code and found that the (as-string) combiner
uses (->string) internally. But since comparse doesn’t use the utf8 egg,
it uses the core version of (->string), which happens to encode #\ä in
latin-1!

The only workaround I can think of right now is to move the conversion
back to a string out of the comparse egg and into your own, utf8 aware,
code.

This would look something like this:


(import comparse utf8 utf8-srfi-14 unicode-char-sets)

(define s "Gänsesäger 2,1")
(define s1 "Rotkehlchen 1,0")

(define (utf8-in cs)
  (satisfies (lambda (c) (char-set-contains? cs c

(define letter
  (utf8-in char-set:alphabetic))

(define letters
  (repeated letter 1 20))

(define (parse-as-string parser input)
  (list->string (parse parser input)))

(define p1 (parse-as-string letters (string->list s1)))
(define p (parse-as-string letters (string->list s)))


PS: a trick I used to check the encoding of the strings was using the ,d
csi command, which prints the contents of the string byte by byte. There
it’s easy to see if non ascii characters indeed take more than one byte
as they should in UTF-8.


Re: German Umlauts / UTF8 with comparse

2020-02-17 Thread kooda
Christoph Lange  wrote:
> meaning, that the ä isn't recognized as being a letter within the
> 'char-set:letter'.

The utf8 egg’s srfi-14 character sets are designed to be compatible with the 
original srfi-14 and only contain ASCII characters, as stated in the 
documentation:
https://wiki.call-cc.org/eggref/5/utf8#unicode-char-sets
“The default SRFI-14 char-sets are defined using ASCII-only characters”

You might want to import the unicode-char-sets module, and use one of its
sets, like char-set:alphabetic.

I hope this helps. :)


Re: [ANN] CHICKEN 5.2.0 release candidate 2 available

2020-02-16 Thread kooda
Thomas Chust  wrote:
> - elliptic-curves installs, but doesn't work. The code uses matchable
> to destructure record instances and none of those statements match any
> of the records, possibly because the record tag symbols are now
> prefixed with the declaring module name. However, simply adding the
> module-prefix#... to each of the match statements doesn't fix the
> problem either.

This should have hit you sooner, but I realised a few weeks ago (thanks to
someone who reported it on IRC) that I forgot to tag a new release for
matchable that makes use of the new way (since 5.0.0) record types are
exposed (in a variable of the record name containing the type tag).

I see that you use srfi-99 in this egg. Has srfi-99 been updated to also
expose the type tag like core does?

If you just want a quick and dirty fix, you can just quote the type tag in
your match causes. Record tags still are (module-prefixed) symbols, but
that could change in the future, so I really suggest you check whether
srfi-99 correctly exposes the record tags.

Sorry for this, this was all meant for 5.0.0 but slipped through to now.



Re: Help porting someone else's macro from 4 to 5.

2020-01-21 Thread kooda
Andrew Mack  wrote:
> Looking through various chicken documentation, my first assumption was
> to wrap the lambda argument to define-syntax in an er-macro-transformer
> call. However this does not recognize append-map (of course defined in
> srfi-1) as bound. I thought that it might also need to be renamed with
> (r 'append-map) but this also did not work. 
> 

Indeed you have to wrap the lambda into `er-macro-transformer`.

For the append-map issue, I’m pretty sure this means the srfi-1 library
is not loaded at macro-expand time, you can do so with
`(import-for-syntax srfi-1)`.
http://wiki.call-cc.org/man/5/Modules#import-for-syntax

Hope this helps. :)


Re: RAM usage of applications?

2019-11-29 Thread kooda
egarrulo  wrote:
> Hello everybody,
> 
> I wonder if I could consider Chicken to write an application for a 
> device with 256 MB of RAM, where the whole RAM may not be available for 
> the application.
> 
> Can anybody give me a *rough* idea of how much RAM a basic program 
> written in Chicken and transpiled to C could require at run-time? Some 
> megabytes, dozens of megabytes, etc.  With all features enabled, if 
> feasible.  Speed is not a concern.
> 
> Thank you.

What exactly do you mean by “all features enabled”?

The RAM usage is mostly determined by the program you need to write and
how you write it.

I have many programs written in CHICKEN Scheme running on a 32bits ARM
machine with only 512 MB of RAM, they all take between a few hundreds of
KB and to a few tenths of MB.


Re: Reading bytes from a TCP port

2019-11-28 Thread kooda
Fredrik Appelberg  wrote:
> 
> Hello all, new chicken schemer here.
> 
> I'm writing an AMPQ client for fun (as One does) and can't figure out
> the correct way to read from a TCP port. I want to block until input is
> available, and then read all buffered data into a byte buffer (I'm using
> bitstring, but it can be anything really). This is what I've come up with:
> 
> (let* ((buf (->bitstring ""))
>(first-byte (read-string 1 in)))
>   (if (eq? #!eof first-byte)
>   ... handle eof
>   (begin 
> (bitstring-append! buf (string->bitstring (string-append first-byte 
> (read-buffered in
> ... do something with buf))
> 
> It works okay, but it seems a bit clunky to me. Is there a more
> idiomatic way of reading a byte buffer from a port?
> 
> Cheers,
> -- Fredrik

The read-u8vector procedure from SRFI-4 might be what you want:

http://wiki.call-cc.org/man/5/Module%20srfi-4#vector-io



Re: [Chicken-users] [Chicken-hackers] Allowing unspecified key arguments in functions

2019-07-26 Thread kooda
Amir Teymuri  wrote:
> I had a question about the objectives and reasons of allowing
> un-specified key arguments in functions as soon as i want to have some
> key arguments.

Any DSSSL style arguments (#!rest, #!optional and #!key) always are
optional arguments to the procedure.

You can think of them as working this way:

(lambda (foo #!key bar qux) your-code)
=>
(lambda (foo . rest)
  (let ((bar (get-keyword-arg #:bar rest))
(qux (get-keyword-arg #:qux rest)))
your-code))

If you want to have a more strict handling of them, you might want to
write your own superset of “lambda” and/or “define”, that check
what you need.

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


Re: [Chicken-users] Port of racket/math to Chicken egg

2019-07-10 Thread kooda
Diego  wrote:
> I'd like to add this to the egg repository, as long as it's ok that it's 
> technically not 'complete' at this point. I'm also wondering wether a more 
> descriptive name than simply 'math' would be better (e.g. racket-math?) so as 
> to avoid ambiguity or confusion.

Done! Thanks for the contribution, this looks cool!

If you want to change the name, that can be done later without problem. :)

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


Re: [Chicken-users] A Thank You to all the chicken-scheme contributors

2019-05-29 Thread kooda
Richard Huxton  wrote:
> I'm unlikely to ever become a scheme guru or even make a living writing 
> it.
> 
> I am however enjoying exploring chicken scheme and have found it to be a 
> clean, practical distribution with well thought out tools and 
> suprisingly good documentation.
> 
> Given all the publicity around recent languages backed by big companies, 
> it is reassuring to find that a small community can still create a 
> modern system for writing practical tools.
> 
> Thank you to all involved.

Thanks a lot for your kind words! It makes me all warm inside. ^_^

I hope you’ll continue enjoying CHICKEN for a long while!

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


Re: [Chicken-users] error when building freetype egg

2019-04-09 Thread kooda
Vasilij Schneidermann  wrote:
> Hey Kristian,
> 
> > When I chicken-install freetype, I get this:
> > 
> > /home/klm/.chicken-install/cache/freetype/freetype.c: In function
> > ‘stub2714’:
> > /home/klm/.chicken-install/cache/freetype/freetype.c:820:6: error:
> > ‘FT_GlyphSlotRec’ {aka ‘struct FT_GlyphSlotRec_’} has no member named
> > ‘reserved’
> >  g2615->reserved = g2616;
> 
> I can reproduce this.  It's a breaking change in freetype.h:
> 
> FT_UInt glyph_index; /* new in 2.10; was reserved previously */
> 
> > Maybe someone can look into a proper fix for this. Thanks,

Fixed in the 0.3 release of the egg.

I just removed the code that generated accessors and setters to that
struct slot. They probably aren’t used by anyone.

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


Re: [Chicken-users] how to compile files, modules, shared libraries, programs

2019-03-29 Thread kooda
Marco Maggi  wrote:
> I already have a too long list of things to learn.  I am used to the GNU
> Autotools and I can recycle this knowledge.  Less things, better life...

You might want to check this project out, which uses autotools. :)
https://github.com/drewt/scmus

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


Re: [Chicken-users] How to I add (not override) compiler options/flags ?

2019-03-24 Thread kooda
Jeronimo Pellegrini  wrote:
> But since C_COMPILER_OPTIONS is defined with ?=, if I set it
> when running make, the default in Makefile.linux, for example,
> would be ignored.
> 
> So if I use a script that wants to *add* flags, how should I do that?
> (I see that CFLAGS is not used).

Hmm, this indeed doesn’t appear to be possible.

Maybe you could use C_COMPILER_OPTIMIZATION_OPTIONS ?

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


Re: [Chicken-users] repository pathname, location and customisation, lib64

2019-03-24 Thread kooda
Marco Maggi  wrote:
>   Under  Slackware 32-bit  the  libraries'  directory is  "$prefix/lib",
> while   underSlackware   64-bit   the   libraries'directory   is
> "$prefix/lib64".  On a  64-bit platform: it is possible  to install both
> 32-bit  and   64-bit  packages  and   their  files  go   into  different
> installation  directories.  It  is  not right  to  put everything  under
> "lib", I would like to use "lib64".

You can change the library directory by passing a LIBDIR variable to make,
like so: `make PLATFORM=linux PREFIX=/usr LIBDIR=/usr/lib64`

Be sure to run `make PLATFORM=linux confclean` before that so the config
file is reset.

In case you need to change other specific directories, you can look for
the list of variables at the beginning of defaults.make.

I hope this helps!

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


[Chicken-users] Announce: Hypergiant and OpenGL eggs are available for CHICKEN 5!

2019-03-23 Thread kooda
Hello CHICKEN users!

Today I finished porting and publishing the last eggs of the OpenGL suite!

I am now the maintainer of the CHICKEN 5 version of the following eggs,
which are, as of today, all available from chicken-install:

- epoxy
- soil
- glfw3
- gl-math
- gl-utils
- gl-type
- glls
- noise
- hyperscene
- hypergiant


Compared to CHICKEN 4, the only opengl binding that remains is a new
egg called `epoxy`.

It’s a drop-in replacement for the old `opengl-glew` egg (except for
the `init` procedure that is no longer required).

Epoxy also provides the OpenGL ES APIs as well as the fixed-pipeline
API that was previously available with the `opengl` egg.

This new egg requires the epoxy library to be installed on the system.


My plans for the near future are to update support for OpenGL ES in the
high level libraries (hypergiant and co.) so that it’s a runtime option
instead of a compile-time one.

I also plan to make a sound library and integrate it into hypergiant.


I hope all of this will be useful! If you experience any problem, feel
free to contact me!

Have a great day! :D

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


Re: [Chicken-users] Page-align allocation

2019-03-16 Thread kooda
 wrote:
> Hello,
> 
> Does CHICKEN align a block of memory to the page boundary when I declare
> a vector of 4096 elements? If not, how to make it aligned to the page
> boundary?
> 

Hi! Sorry for the very late reply!

Are you talking about regular Scheme vectors storing any kind of Scheme
data, or SRFI-4 vectors (only able to store numbers)?

In the first case you might want to know that each slot of the vector is a
machine word in size (32 bits or 64 bits depending on your machine and
operating system).

In both cases you also have to concider that every compound Scheme data is
stored in memory with a little header, so that takes some space in
addition to the data that is effectively stored.

Lastly, you also have to be aware that regular Scheme data is allocated in
garbage collected memory, which in the case of CHICKEN, does not guarantee
any alignment outside of word size alignment, and that the data will move
around when a garbage collection is triggered.


Ways around this exist:

- With SRFI-4 vectors, you can ask for allocation in static memory (non
  garbage collected, effectivelly using malloc) with the NONGC argument to
  make-XXvector: https://wiki.call-cc.org/man/5/Module%20srfi-4#constructors
- With regular Scheme vectors, you can use object-evict to copy your
  object to static memory
  https://wiki.call-cc.org/eggref/5/object-evict#object-evict
- You can also write a custom procedure in C that would allocate some
  static memory directly but that’s a little more involved as you have to
  format the data correctly (putting the right header, etc…)

Also, as a side note, because I don’t know if that fits your use case,
you can allocate memory in C and access it from Scheme with a pointer,
using the pointer related procedures:
https://wiki.call-cc.org/man/5/Module%20(chicken%20memory)#srfi-4-foreign-pointers


I hope everything is clear and that it answers your question!
If not, don’t hesitate to ask!

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


Re: [Chicken-users] trouble installing utf8 egg

2019-03-02 Thread kooda
paul wisehart  wrote:
> Hi,
> 
> When I try to install utf8 i get error:
> /.chicken-install/cache/utf8/utf8.import.so
>   installing utf8
>   install: /usr/local/share/chicken/INS@1vVEM7m4ZP: Permission denied
> 
>   Error: shell command terminated with nonzero exit code
>   256
>   "sh /home/wise/.chicken-install/cache/utf8/utf8.install.sh"

Hi!

The problem is most probably that the utf8 egg tries to install some files
outside of CHICKEN_INSTALL_REPOSITORY, that’s a known issue and it
can’t be fixed with environment variables.

What we usually advise is to have a custom installation of CHICKEN where
it has write access, inside your $HOME for example.

BUT, yesterday evening I updated the utf8 egg so that it doesn’t install
extra files, so if you retry now, it should work.

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


Re: [Chicken-users] I'm trying to use the cairo egg with the sdl2 egg but not making much progress. An

2019-01-27 Thread kooda
Matt Welland  wrote:
> Assuming it is possible, I'd like to use cairo to draw on sdl2
> surfaces. I've read the demos and other available code but I'm not yet
> seeing how to bolt them together. Does anyone have some example code
> they can share to help me get going?

It is absolutly possible! I’ve done it countless times, with surfaces as well 
as textures (in the renderers API).

Here is the code I’ve wrote to use cairo on surfaces:
It’s old code and I’ve not tested it in a whire though.

(define (sdl-colorspace->cairo bytes-per-pixel)
  (case (* 8 bytes-per-pixel)
((8) CAIRO_FORMAT_A8)
((24) CAIRO_FORMAT_RGB24)
((32) CAIRO_FORMAT_ARGB32)
(else CAIRO_FORMAT_ARGB32)))

(define (create-sdl2-cairo-context window)
  (let-values
(((width height) (window-size window))
 ((window-surface) (window-surface window))
 ((cairo-surface)
  (cairo-image-surface-create-for-data
(surface-pixels-raw window-surface)
(sdl-colorspace->cairo
  (pixel-format-bytes-per-pixel (surface-format window-surface)))
width
height
(surface-pitch window-surface
(cairo-create cairo-surface)))

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


Re: [Chicken-users] 'loops' egg for Chicken V5

2019-01-24 Thread Kooda

On 1/23/19 7:50 PM, Zach Davis wrote:

What are the next steps to getting the mainline egg updated for v5?


You should try contacting the maintainer of the egg directly, sending
them your patch! :)

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


Re: [Chicken-users] Break points for feathers

2019-01-24 Thread Kooda

On 1/23/19 11:20 AM, David Ireland wrote:
Might be a silly question, but how do you set breakpoints when debugging 
in feathers?


You should just have to click the line you want the breakpoint on.
Don’t forget to build the code you want to debug with -d3

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


Re: [Chicken-users] new egg: envsubst

2019-01-21 Thread Kooda

On 1/21/19 11:51 PM, Robert Jensen wrote:

Hello,

I cloned envsubst [1] in Chicken 5. You can check it out here [2].

All the best,
Rob

[1] 
https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html

[2] https://github.com/r1b/envsubst


Nice! Thanks for sharing!

I added it to the coop. :)

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


Re: [Chicken-users] Has hypergiant been used on Android?

2019-01-20 Thread Kooda

On 1/21/19 12:15 AM, Matt Welland wrote:
Regarding hypergiant, after many tries it did install in the docker but 
I have not been able to get the demo to work on android. I'll report 
back if I get it working.


Don’t try too hard.

I’m taking over the maintenance of the Hypergiant & cie eggs and making 
it work on OpenGL ES platforms is on my top priority list. For now many 
things are just not designed to work and will require quite a lot of 
changes (for example in glls).


I’ll announce here when new versions are available. :)

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


Re: [Chicken-users] Crash in SRFI-69 eq?-hash

2018-08-27 Thread kooda
Hey! :)

This has been fixed in SRFI-69 0.3, hope it works fine for you now!

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


Re: [Chicken-users] porting eggs experiences and questions

2018-08-25 Thread kooda
Jörg F. Wittenberger  wrote:
> Apparently chicken-install passes the -n switch down to the dependencies it 
> need to install.

I reported the same thing on IRC today. I think it makes sense and would like
to have a switch that instructs chicken-install to *only* build, and install if 
-n is
not present, the egg’s dependencies.

I had to resort to some trickery when making an easy build script for Ensemble,
and would have liked such a command flag.

https://www.upyum.com/cgit.cgi/ensemble/tree/build.sh?id=78d4597062984bcaa81279fe79d1be0c90a8970a
See extract_dependencies() and build_normal_deps()

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


Re: [Chicken-users] Like 'include', but different?

2018-08-25 Thread kooda
Mark Carter  wrote:
> I have code where I 'include' other files. Suppose I compile that file. 
> As part of execution, it will try to load those other files, which isn't 
> what I want.
> 
> Is there a way of telling chicken that during the interpretation or 
> compilation, the file should be loaded, but during execution, don't load 
> the files?
> 

The `include` form should be what you need here. I don’t really understand
the problem you’re having. Could you post a little example of it?

Here is how (include "file.scm") should behave:
- when compiled, the include form will be rewritten with the content of the
  specified file
- when interpreted, it will behave like (load "file.scm")

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


Re: [Chicken-users] Crash in SRFI-69 eq?-hash

2018-08-19 Thread kooda
Thomas Chust  wrote:
> this matters a lot: For one I have an application where it is crucial
> to be able to identify if the exact same object is passed more than
> once into certain functions and to be able to detect cyclic data
> structures – eq? and eq?-hash are supposed to be applicable to
> precisely that situation.

Please calm down, it is indeed a bug and it will be fixed. :)

I checked the code and, for number types, only fixnums and flonums are
explicitely handled, other numeric types trigger an incorrect recursion. 

It seems we forgot to add support for the new numeric types to srfi-69
when we introduced them.

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


Re: [Chicken-users] [ANN] CHICKEN 5.0.0 release candidate 1 available

2018-08-12 Thread kooda
Hi there! Here are some tests results. :D

Operating system: Devuan unstable, glibc 2.27
Hardware platform: x86-64
C Compiler: GCC 8.2.0
Installation works?: yes
Tests work?: yes
Installation of eggs works?: yes (spiffy)

Operating system: Alpine Linux edge, musl-libc 1.1.19
Hardware platform: arm
C Compiler: GCC 6.4.0
Installation works?: yes
Tests work?: yes
Installation of eggs works?: yes (spiffy)


Little cross compilation test:

- Building a toolchain, on the first system (Devuan x86-64), for the
second system (Alpine ARM): works

- Building a static hello world for ARM on x86-64: works

- Building spiffy (and its dependencies) with the cross toolchain: works

- Building a simple static web server binary for ARM on x86-64: works

- Running both static binaries on the target system: works!! \o/

Just got a hint of warning from glibc because it requires the dynamic
library at runtime on the target system for some functions, but it
worked anyways!

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


Re: [Chicken-users] reexport - not working as expected (or I have wrong expectations)

2018-07-21 Thread kooda
Martin Schneeweis  wrote:
> Splitting the whole thing into 3 files does not work - I get a runtime
> exception (when executing "mod-c"): "Error: unbound variable:
> mod-a#test-a".

The one thing that is missing from your example, is that mod-a is never
loaded, this can be acheived by adding `(use mod-a)` in mod-b’s code.

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


Re: [Chicken-users] [Chicken-announce] [ANN] CHICKEN 4.13.0 release candidate available

2017-12-10 Thread Kooda
Operating system: Devuan unstable
Hardware platform: x86-64
C Compiler: GCC 7.2.1
Installation works?: yes
Tests work?: yes
Installation of eggs works?: yes

Operating system: Alpine edge (musl libc)
Hardware platform: ARM 32
C Compiler: GCC 6.4.0
Installation works: yes
Tests work: yes
Installation of eggs work: yes

Operating system: Mac OS X El Capitan (version 10.11.6)
Hardware platform: x86_64-apple-darwin15.6.0
C Compiler: clang 8.0.0
Installation works: yes
Tests work: yes
Installation of eggs work: yes

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


Re: [Chicken-users] How to use bezier function in 2d-primitives?

2017-10-25 Thread Kooda
On Tue, 24 Oct 2017 22:15:47 -0700 Matt Welland
 wrote:
> I tried this:
> 
> (use 2d-primitives)
> (with-output-to-file "test.csv"
>   (lambda ()
> (for-each
>(lambda (v)
>   (print (f32vector-ref v 0)","(f32vector-ref v 1)))
> (bezier->vects (bezier:create (vect:create 0 0)(vect:create 2
> 5)(vect:create 7 5)(vect:create 10 0) 10
> 
> Then load test.csv into gnumeric and graph it and I see two straight
> line segments. Either I'm not correctly understanding how to use
> bezier or there is a bug.
> 
> Thanks,
> 
> Matt
> -=-

Looks like the 2d-primitives egg has a bug indeed! I’ll open a ticket.

Here is a version of bezier->vects that does what you expect. I hope
this will help!

(define (bezier->vects* b n)
  (let ((increment (/ 1 n)))
(let loop ((step 0))
  (if (>= step 1)
  (list (bezier:ref b 1))
  (cons (bezier:ref b step)
(loop (+ step increment)))

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


Re: [Chicken-users] problems string-trimming on UTF8

2017-01-27 Thread Kooda
On Fri, 27 Jan 2017 14:36:55 +0100
Kristian Lein-Mathisen  wrote:

> $ csi -R srfi-13 -p '(string-trim-right "Zazà")'
> Zaz�
> 
> 
> Oh no, what happened?

Please use the utf-8 aware srfi-13, called utf8-srfi-13:

$ csi -R utf8-srfi-13 -p '(string-trim-right "Zazà")'
Zazà


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


Re: [Chicken-users] Newbie alert [subscription test]

2017-01-12 Thread Kooda
On Thu, 12 Jan 2017 09:36:20 +0100
Christian Kellermann  wrote:

> No, just ask here! We are happy to help with any question if we can.
> Also from experience, every new user will step on a new bug noone else
> has seen before, so lowering the bar to get in touch is important to
> us!
> 
> Have fun with CHICKEN!
> 

First of all, welcome!

I hope you’ll enjoy CHICKEN as much as we do. :)

This mailing list is perfectly fine, as Christian said. If you also
like instant messaging, we have a pretty active IRC channel: #chicken
on the freenode network.


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


[Chicken-users] CHICKEN ezd 0.1

2017-01-08 Thread Kooda
Hi there chickeneers!

I’ve been working on a port of the ezd graphics server / GUI
library (for unix-like systems only) from DEC for the past few weeks,
and today I finally tagged a release!

It includes all of the original examples and a variant of the clock
example that uses the ezd-external helper module I created.

You can find the tarball here:
http://www.upyum.com/cgit.cgi/ezd/snapshot/ezd-0.1.tar.bz2

Everything should be explained in the README.md file, just run
chicken-install in the directory to install everything.

If you do anything with it or if you find bugs, please contact me!

Keep in mind that it’s not finished yet and the code still uses a lot
of functionalities from Scheme->C, some of which I reimplemented myself
and some are from the scheme2c-compatibility egg. Also, the xlib
bindings are very low level. As a result, this version of ezd leaks
memory.

If you’re interested in the development, the git repository is
located here: git://upyum.com/ezd

The code is very close to the original, I only changed parts that
wouldn’t work with CHICKEN.

For the next release, I want to remove as much as the Scheme->C
specific code as possible. This includes the system file tasks, that I
crudely implemented with file-select, it would be nice to have this
integrated to CHICKEN’s scheduler.

Later, I want to either make the xlib bindings a tad less low-level or
directly switch to cairo as the drawing backend as it would make it
easier to port EZD to other systems like Windows.

Enjoy!

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


Re: [Chicken-users] Parallel procedures in CHICKEN

2016-12-24 Thread Kooda
On Sat, 24 Dec 2016 02:11:37 -0200
Arthur Maciel  wrote:
> Is there a way to implement map, for-each and other procedures in a
> parallel way so
> 
> (use srfi-1)
> (map (lambda (x) (+ x 1)) (iota 100)
> 
> would automatically split the list into smaller lists according to the
> number of CPU cores and then gather the results back?

I guess you could spawn a process pool and send these processes a thunk
that calculates their part and send back the result. You could use s11n
egg for that, I believe.

I’m not sure it would be faster than the regular functions though.

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


Re: [Chicken-users] Nuremberg Meetup

2016-09-28 Thread Kooda
On Tue, 27 Sep 2016 16:38:19 +0200,
Andy Bennett wrote:
Indeed! Thanks everyone!

It was really nice to meet you all at last!

I hope to be there next time as well. :)

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


Re: [Chicken-users] CHICKEN meetup reminder

2016-07-23 Thread Kooda
On Tue, 12 Jul 2016 11:11:05 +0200,
Christian Kellermann wrote:
> So arrange your travel today!

I just booked my train tickets!

I’ll be arriving at Nürnberg Hbf on thursday 22nd at 17:25
and leaving on sunday 25th at 16:00.

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


Re: [Chicken-users] CHICKEN meetup reminder

2016-07-12 Thread Kooda
On Tue, 12 Jul 2016 11:11:05 +0200,
Christian Kellermann wrote:
> 
> Dear CHICKEN-fans,
> 
> this is a reminder that the CHICKEN Meetup will take place on
> 
> September 23-25th in Nuremberg, Germany
> 
> http://wiki.call-cc.org/event/chicken-summer-2016
> 

Do we try to arrange for a common hotel booking like last year?

I’m still willing to share my room this year, and should be there for
real. ;)

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


[Chicken-users] [PATCH] (low priority) Make locative-ref inlineable (ticket #1260)

2016-05-18 Thread Kooda
Hi,

I was browsing bugs.call-cc.org and found this low hanging bug so I gave it a 
shot.
I hope I didn’t mess up too much.

>From fcba39930dcb56cc16500531fa37cf0fe0a4aaef Mon Sep 17 00:00:00 2001
From: Kooda <ko...@upyum.com>
Date: Wed, 18 May 2016 10:48:58 +0200
Subject: [PATCH] Make locative-ref inlineable (ticket #1260)

- Deprecate C_localtive_ref
- Add C_a_i_locative_ref
- Add a compiler rewrite for locative-ref
- Add a specialization for locative-ref on locatives
---
 c-platform.scm |  2 +-
 chicken.h  |  3 ++-
 lolevel.scm|  3 ++-
 runtime.c  | 27 ++-
 types.db   |  4 +++-
 5 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/c-platform.scm b/c-platform.scm
index b2f6629..3e7548b 100644
--- a/c-platform.scm
+++ b/c-platform.scm
@@ -533,7 +533,6 @@
 (rewrite 'call-with-values 13 2 "C_call_with_values" #t)
 (rewrite '##sys#call-with-values 13 2 "C_u_call_with_values" #f)
 (rewrite '##sys#call-with-values 13 2 "C_call_with_values" #t)
-(rewrite 'locative-ref 13 1 "C_locative_ref" #t)
 (rewrite '##sys#continuation-graft 13 2 "C_continuation_graft" #t)
 
 (rewrite 'caar 2 1 "C_u_i_caar" #f)
@@ -874,6 +873,7 @@
 (rewrite 'address->pointer 16 1 "C_a_i_address_to_pointer" #f 2)
 (rewrite 'pointer->address 16 1 "C_a_i_pointer_to_address" #f words-per-flonum)
 (rewrite 'pointer+ 16 2 "C_a_u_i_pointer_inc" #f 2)
+(rewrite 'locative-ref 16 1 "C_a_i_locative_ref" #t words-per-flonum)
 
 (rewrite 'pointer-u8-ref 2 1 "C_u_i_pointer_u8_ref" #f)
 (rewrite 'pointer-s8-ref 2 1 "C_u_i_pointer_s8_ref" #f)
diff --git a/chicken.h b/chicken.h
index 160d40d..3f00956 100644
--- a/chicken.h
+++ b/chicken.h
@@ -1831,7 +1831,7 @@ C_fctexport C_cpsproc(C_register_finalizer) C_noret;
 C_fctexport C_cpsproc(C_set_dlopen_flags) C_noret;
 C_fctexport C_cpsproc(C_dload) C_noret;
 C_fctexport C_cpsproc(C_become) C_noret;
-C_fctexport C_cpsproc(C_locative_ref) C_noret;
+C_fctexport C_cpsproc(C_locative_ref) C_noret; /* DEPRECATED */
 C_fctexport C_cpsproc(C_call_with_cthulhu) C_noret;
 C_fctexport C_cpsproc(C_copy_closure) C_noret;
 C_fctexport C_cpsproc(C_dump_heap_state) C_noret;
@@ -1923,6 +1923,7 @@ C_fctexport C_word C_fcall C_i_char_greaterp(C_word x, 
C_word y) C_regparm;
 C_fctexport C_word C_fcall C_i_char_lessp(C_word x, C_word y) C_regparm;
 C_fctexport C_word C_fcall C_i_char_greater_or_equal_p(C_word x, C_word y) 
C_regparm;
 C_fctexport C_word C_fcall C_i_char_less_or_equal_p(C_word x, C_word y) 
C_regparm;
+C_fctexport C_word C_fcall C_a_i_locative_ref(C_word **a, int c, C_word loc) 
C_regparm;
 C_fctexport C_word C_fcall C_i_locative_set(C_word loc, C_word x) C_regparm;
 C_fctexport C_word C_fcall C_i_locative_to_object(C_word loc) C_regparm;
 C_fctexport C_word C_fcall C_a_i_make_locative(C_word **a, int c, C_word type, 
C_word object, C_word index, C_word weak) C_regparm;
diff --git a/lolevel.scm b/lolevel.scm
index 7a1724f..1ac2eed 100644
--- a/lolevel.scm
+++ b/lolevel.scm
@@ -298,7 +298,8 @@ EOF
 
 (define locative-ref
   (getter-with-setter 
-   (##core#primitive "C_locative_ref") 
+   (lambda (loc)
+ (##core#inline_allocate ("C_a_i_locative_ref" 4) loc))
locative-set!
"(locative-ref loc)"))
 
diff --git a/runtime.c b/runtime.c
index 113e26d..c61d5d2 100644
--- a/runtime.c
+++ b/runtime.c
@@ -8780,7 +8780,7 @@ C_regparm C_word C_fcall C_a_i_make_locative(C_word **a, 
int c, C_word type, C_w
   return (C_word)loc;
 }
 
-
+/* DEPRECATED */
 void C_ccall C_locative_ref(C_word c, C_word *av)
 {
   C_word
@@ -8816,6 +8816,31 @@ void C_ccall C_locative_ref(C_word c, C_word *av)
   }
 }
 
+C_regparm C_word C_fcall C_a_i_locative_ref(C_word **a, int c, C_word loc)
+{
+  C_word *ptr;
+
+  if(C_immediatep(loc) || C_block_header(loc) != C_LOCATIVE_TAG)
+barf(C_BAD_ARGUMENT_TYPE_ERROR, "locative-ref", loc);
+
+  ptr = (C_word *)C_block_item(loc, 0);
+
+  if(ptr == NULL) barf(C_LOST_LOCATIVE_ERROR, "locative-ref", loc);
+
+  switch(C_unfix(C_block_item(loc, 2))) {
+  case C_SLOT_LOCATIVE: return *ptr;
+  case C_CHAR_LOCATIVE: return C_make_character(*((char *)ptr));
+  case C_U8_LOCATIVE: return C_fix(*((unsigned char *)ptr));
+  case C_S8_LOCATIVE: return C_fix(*((char *)ptr));
+  case C_U16_LOCATIVE: return C_fix(*((unsigned short *)ptr));
+  case C_S16_LOCATIVE: return C_fix(*((short *)ptr));
+  case C_U32_LOCATIVE: return C_unsigned_int_to_num(a, *((C_u32 *)ptr));
+  case C_S32_LOCATIVE: return C_int_to_num(a, *((C_s32 *)ptr));
+  case C_F32_LOCATIVE: return C_flonum(a, *((float *)ptr));
+  case C_F64_LOCATIVE: return C_flonum(a, *((double *)ptr));
+  default: panic(C_text("bad locative type"));
+  }
+}
 
 C_regparm C_word C_fcall C_i_locative_set(C_word loc, C_word x)
 {
diff --git a/types.db b/types.db
index b4a3887..b1165c0 100644
--- a/types.db
+++

Re: [Chicken-users] [Chicken-announce] [ANN] CHICKEN 4.11.0 release candidate 2 available

2016-05-01 Thread Kooda
Operating system: Alpine Linux (musl libc)
Hardware platform: x86-64
C Compiler: gcc 5.3.0
Installation works?: Yes
Tests work?: Yes
Installation of eggs works?: Yes (pastiche)

Operating system: Alpine Linux (musl libc)
Hardware platform: armv7
C Compiler: gcc 5.3.0
Installation works?: Yes
Tests work?: Yes
Installation of eggs works?: Yes (spiffy)

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


Re: [Chicken-users] [ANN] CHICKEN 4.11.0 release candidate 1 available

2016-04-05 Thread Kooda
Thanks a lot for this release candidate! :)

Operating system: AlpineLinux 3.3 (Busybox/Linux with musl libc)
Hardware platform: ARMv7 (32bits)
C Compiler: GCC 5.3.0
Installation works?: Yes
Tests work?: Yes
Installation of eggs works?: Yes (spiffy)


I got some warnings at compilation, but nothing really serious:

In file included from posixunix.c:161:0:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include 
 to  [-Wcpp]
 #warning redirecting incorrect #include  to 
  ^

In file included from debugger-client.c:13:0:
dbg-stub.c: In function 'send_event':
dbg-stub.c:347:29: warning: format '%lu' expects argument of type 'long 
unsigned int *', but argument 4 has type 'int *' [-Wformat=]
   n = sscanf(rw_buffer, "(%d %lu %d)", , , );
 ^
dbg-stub.c:373:25: warning: format '%ld' expects argument of type 'long int *', 
but argument 4 has type 'int *' [-Wformat=]
   sscanf(rw_buffer, "(%d %ld)", , );
 ^
dbg-stub.c:380:28: warning: format '%ld' expects argument of type 'long int', 
but argument 3 has type 'unsigned int' [-Wformat=]
 sprintf(rw_buffer, "(* BLOB %ld", C_header_bits(x) >> 
C_HEADER_BITS_SHIFT);
^
dbg-stub.c:395:28: warning: format '%ld' expects argument of type 'long int', 
but argument 3 has type 'unsigned int' [-Wformat=]
 sprintf(rw_buffer, "(* SPECIAL %ld %lu", C_header_bits(x) >> 
C_HEADER_BITS_SHIFT,
^
dbg-stub.c:395:28: warning: format '%lu' expects argument of type 'long 
unsigned int', but argument 4 has type 'int' [-Wformat=]
dbg-stub.c:399:31: warning: format '%ld' expects argument of type 'long int', 
but argument 3 has type 'unsigned int' [-Wformat=]
   else sprintf(rw_buffer, "(* VECTOR %ld", C_header_bits(x) >> 
C_HEADER_BITS_SHIFT);

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


Re: [Chicken-users] CHICKEN hang / crash / memoize egg

2016-04-01 Thread Kooda
On Fri, 01 Apr 2016 16:28:26 +0200,
Andy Bennett wrote:
> 
> Hi Peeps!
> 
> I'm running CHICKEN 4.9.0rc1 and I'm trying out the memoize egg.
> 
> I saw the tail-call-optimized version of the factorial procedure in the
> memoize documentation at http://api.call-cc.org/doc/memoize and I've
> been trying to modify it so that it memoizes intermediate results such
> that, for example, a call to (fact 10) makes a subsequent call to (fact
> 9) fast.
> 
> In doing so I've managed to get the interpreter into a loop or crash it
> entirely.
> 

This looks like a perfectly legitimate crash. The memoize egg doesn’t
impose a limit on memory usage unless you explicitly tell it so.

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


[Chicken-users] CHICKEN game making-of blog post

2016-01-27 Thread Kooda
Whow, it’s been a while since I released my tiny CHICKEN game.

I finally took the time to finish the postmortem blog post, I hope
you’ll find it interesting. :)

Here it is: https://www.upyum.com/en/post/3.xhtml

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


[Chicken-users] Play with CHICKEN, Crepes-PHYS is out!

2015-12-17 Thread Kooda
Hi fellow schemers!

Crepes-party-hard-yolo-swag 2015 is now out!

You can check it out at http://kooda.itch.io/cphys2015

It’s a tiny game made in a few weeks using CHICKEN.

The main purpose of this project was to teach someone Lisp as well as
teaching me how to deploy CHICKEN projects on multiple platforms in
the form of self-contained binaries. The game is, for these reasons,
pretty narrow in terms of contents.

A post-mortem blog post should follow in the next few days, along with
the projects’s source-code. I will try to explain the different states
the project went in, and how I built the binaries.

Enjoy! :D

-- 
Envoyé depuis ma GameBoy.

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


Re: [Chicken-users] shared library for c

2015-12-10 Thread Kooda
On Thu, Dec 10, 2015 at 11:58:53PM -0500, Joe Python wrote:
> Is it possible write a shared library in Chicken, say, "libfactorial.a"
> which can be called from a C main program?
> 
> IF then where is the documentation?
> 
> Thank you,
> Jo

It is absolutely possible, this manual section should help you:
http://wiki.call-cc.org/man/4/Interface%20to%20external%20functions%20and%20variables

and in particular this page: http://wiki.call-cc.org/man/4/Embedding
which explains the CHICKEN C API.

-- 
Envoyé depuis ma GameBoy.

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


Re: [Chicken-users] New SDL2 eggs; help wanted

2015-11-04 Thread Kooda
On Wed, Nov 04, 2015 at 01:35:13PM -0800, Dan Leslie wrote:
> As a potential user and implementor of similar eggs (Allegro, SOIL, .. 
> nanovg), I would provide fairly lean bindings first, then do any 
> simplification or hand-holding as an additional module. It will save you time 
> in the near term and provide flexibility to the users.
> 
> -Dan

It seems to already be the case. There is a sdl-internals module used by
the public sdl2 module.


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


Re: [Chicken-users] performance of bignums

2015-06-28 Thread Kooda
On Sun, Jun 28, 2015 at 09:47:30PM +0200, Peter Bex wrote:
 So far it seems my implementation of Burnikel/Ziegler division is rather
 unstable, performance-wise.  If I disable burnikel/ziegler so it falls
 back to the traditional gradebook method, the benchmark finishes in
 a quarter of the time it takes to run with BZ enabled.
 
 It's not just that the BZ implementation is really bad: it does improve
 performance on Chudnovsky's digits of pi calculation benchmark by a
 factor of four or so.  I will do further experimentation.  I also noticed
 a bug in the gradebook method, which I will have to address as well.
 

Thanks a lot for putting so much effort in this!

If you need anything please do not hesitate to ask, I’m really excited
about that feature in CHICKEN 5 (and surely I’m not alone). :)

-- 
Envoyé depuis ma GameBoy.

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


[Chicken-users] Coops generic procedures profiling

2015-04-22 Thread Kooda
Hi!

I’ve been playing with coops for the last few days and I wanted to
profile my code to find the hot spots, but was surprised to find that
none of the generic procedures defined with coops define-generic was
showing up in the profile.

Is this a known limitation of the egg? Is there any way to fix this?
It would be nice to have at least the dispatcher procedures in the
profile.


-- 
Envoyé depuis ma GameBoy.

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


Re: [Chicken-users] rest-bind request headers support

2015-03-29 Thread Kooda
On Sun, Mar 29, 2015 at 01:37:00PM +0100, Andy Bennett wrote:
 Hi,
 
 Thanks Kooda!
 
 I seem to have noticed this too but didn't actually push my changes!
 Our patches are very similar but mine respects the entire request object
 if passed by the user.

That’s what I wanted to do as well, but I just made a quick patch so I
could try rest-bind for my project.


 Please can you try it and let me know if it works for you?
 The repository is at ssh://g...@bitbucket.org/knodium/rest-bind.git
 
 If it works then I'll cut a release, if not I'll apply your patch
 instead and cut a release.
 

I should have tried this version right away, it works perfectly. :)

Thanks a lot!

-- 
Envoyé depuis ma GameBoy.

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


[Chicken-users] rest-bind request headers support

2015-03-28 Thread Kooda
Hi,

I’m trying to use rest-bind for a project and need to be able to add
some headers to the http requests, which rest-bind didn’t permit, even
when passing a request object.

Here is a simple patch that fixes this issue:

--- rest-bind.scm.orig  2015-03-29 00:26:49.0 +0100
+++ rest-bind.scm   2015-03-29 00:24:43.0 +0100
@@ -94,7 +94,9 @@
   (else (uri-reference uri/req
(method  (cond ((request? uri/req) (request-method 
uri/req))
   (writer 'POST)
-  (else 'GET
+  (else 'GET)))
+   (headers (cond ((request? uri/req) (request-headers 
uri/req))
+  (else (headers '())
   (lambda ,proc-args
 (let* (,@(if (not (null? uri-args))
  `((uri (update-uri uri path: (append (uri-path 
uri) (map -string (list ,@uri-args)
@@ -109,7 +111,7 @@

 ,param)))

  params))
   '())
-  (req (make-request uri: uri method: method)) ; poke 
the args into query string.
+  (req (make-request uri: uri method: method headers: 
headers)) ; poke the args into query string.
   )
   (receive (reader uri response)
(call-with-input-request req ,(if writer 
'(writer body) #f) ,reader)

-- 
Envoyé depuis ma GameBoy.

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


[Chicken-users] Strange memory leak with lazy-seq

2015-02-23 Thread Kooda
Hi!

I’ve been playing with lazy-seq for the past few days and found a very
strange behaviour:

The heap of the following program keeps growing rapidly in csi, running
the same program after compilation seems to slow down the growth quite a
lot but the heap isn’t constant as I was expecting it to be.

Here is a test case of the problem:


; Start this script with `csi -:D -:hi100k -:hg101` to observe heap resizing

(use lazy-seq)

(define (complex-stream seq)
  (lazy-map identity seq))

; This seems to leak:
(lazy-each void (complex-stream (lazy-numbers)))


; This doesn't:
#;(lazy-each void (lazy-map identity
  (lazy-numbers)))


-- 
Envoyé depuis ma GameBoy.

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


[Chicken-users] New egg: hardwood

2014-10-01 Thread Kooda
Hello fellow CHICKEN users,

I’d like to announce my first egg contribution: the Hardwood egg.

This egg is an attempt at reviving a Termite-like API.
This first release provides the basic constructs for creating processes
and pass messages between them.

I’d like to thanks the #chicken community for providing my some very
useful advices.

You can find the release-info file here for integration in the egg
index:
http://hg.upyum.com/hardwood/raw-file/tip/hardwood.release-info

If you have any comment please feel free to drop me a message, any
contribution is welcome.

-- 
Envoyé depuis ma GameBoy.

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


[Chicken-users] Termite revival

2014-09-22 Thread Kooda
Hello dear users of the fowl,

I’ve been wondering for quite some time now on how to revive the Termite
project.
Looks like I started a new implementation of the API using CHICKEN facilities
instead of trying the (now seemingly dead) original implementation.

I’d like some reviews before going further, because I based my implementation
on the assumption that thread signaling and exceptions handlers are thread
safe.

It’s just a draft for now, and many things are still subject to changes.

I also found a very odd bug here: try sending a message to a dead thread, it
looks like the thunk is called again.

Thank you is advance.


;; Code begins here

(use srfi-18 data-structures matchable)

(define mailbox
  (make-parameter #f))

(define lastmail
  (make-parameter '(#t . #f)))

(define ((handle-signal hdl) s)
  (cond
((and (pair? s) (eqv? (car s) 'message-send))  (queue-add! (mailbox)
   (cdr s)))
((and (symbol? s) (eqv? s 'message-receive))
 (let ((m (mailbox)))
   (if (queue-empty? m)
 (lastmail '(#t . #f))
 (lastmail `(#f . ,(queue-remove! m))
(else  (hdl s

(define (install-signal-handler)
  (current-exception-handler (handle-signal (current-exception-handler

(define (setup-thread)
  (mailbox (make-queue))
  (install-signal-handler))

(define self current-thread)

(define (?)
  (signal 'message-receive)
  (let ((last (lastmail)))
(if (car last)
  (begin
(thread-suspend! (current-thread))
(?))
  (cdr last

(define (! pid msg)
  (thread-signal! pid (cons 'message-send msg))
  msg)

(define (spawn thunk)
  ; FIXME
  ; We need a way to ensure that the custom exception handler is set up
  ; before anybody has the PID of the thread.
  ; One way would be to make a tag in the spawner. The child would send that
  ; tag to its parent, which would receive it with `??` (which is not yet
  ; implemented)
  (let* ((pid (make-thread
(lambda ()
  (setup-thread)
  ; (! parent tag)
  (thunk)
(thread-start! pid)
; (?? (cut eqv? tag ))
pid))

; Primordial thread setup
(setup-thread)


; Tests

; Lots-of-threads-and-messages test
(define primordial (self))
(define message-number 100)
(define thread-number 1000)

(define (spam)
  (let loop ((i message-number))
(unless (zero? i)
  (! primordial i)
  (loop (sub1 i)

(let loop ((i thread-number))
  (unless (zero? i)
(spawn spam)
(loop (sub1 i

(let loop ((i (* thread-number message-number)))
  (unless (zero? i)
(?)
(loop (sub1 i

(assert (zero? (queue-length (mailbox


; Ping-pong test
(define (pong-server)
  (let ((m (?)))
(match m
  ((pid 'ping)  (! pid 'pong)
(pong-server))
  (else  (pong-server)

(define pong (spawn pong-server))
(thread-sleep! 1) ; make sure the pong thread is set up (see note in (spawn))

(! pong `(,(self) ping))
(assert (eqv? (?) 'pong))

-- 
Envoyé depuis ma GameBoy.

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


Re: [Chicken-users] replacement for rlwrap on MS Windows, MinGW

2013-07-21 Thread Kooda
On Fri, Jul 19, 2013 at 02:42:12PM -0400, Claude Marinier wrote:
 Bonjour,
 
 Console2 (see URL below) is a reasonable replacement for 'rlwrap' or 'rlfe'
 when using csi on MS Windows, MinGW. Go to Edit / Settings and change the
 shell to csi.
 
 http://sourceforge.net/projects/console/
 
 Actually, it's not that good. Does anyone have a good replacement for
 'rlwrap' ? or something like Console2 but better suited?
 
 I heard emacs and slime can do this but that is intimidating for an old vi
 user.
 
 Merci.
 
 P.S. I know I could use Cygwin.
 
 -- 
 Claude Marinier

If you are using vim you can try slimv[1] which is pretty much slime
for vim. Although I have no idea if it works under windows.

[1] http://kovisoft.bitbucket.org/tutorial.html

-- 
Envoyé depuis ma GameBoy.

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


[Chicken-users] A couple of questions

2013-05-11 Thread Kooda
Hi,

I’ve been working with Scheme for quite some time now, with various
implementations, and I wanted to thank you for working on this wonderful
one that is Chicken.

I’m still pretty new to functional programming and I recently discovered
the functional reactive programming style. I was wondering if anyone
here had any experience with it in Scheme. I would like to implement a
DSL on top of OpenGL for FRP graphic programming.  If you have any
documentation or existing implementation please tell me.

I also wanted to know if it was possible to statically link a chicken
program with all its libraries in order to have a standalone executable
not depending on anything.

Thanks again,
Kooda.

-- 
Envoyé depuis ma Game Boy.

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


Re: [Chicken-users] A couple of questions

2013-05-11 Thread Kooda
On Sat, May 11, 2013 at 10:24:21PM +0400, Brad Pitt wrote:
 
 Hi 
 
 Clarify please what kind of grapchis programming, games, gui, simulation ?

The main goal is a game engine.


 And what a platform?

Currently it’s only under unix-like OS but it would be nice to
distribute executables this way for windows.


 Maybe interesting for you
 :
 http://lush.sourceforge.net/ 
 http://www.pawfal.org/fluxus/
 

That seems really nice, I will check this out.


-- 
Envoyé depuis ma Game Boy.

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


Re: [Chicken-users] A couple of questions

2013-05-11 Thread Kooda
On Sat, May 11, 2013 at 01:43:01PM -0700, Dan Leslie wrote:
 Bare in mind that both lush and fluxus are FOSS, both GPL, so if
 you're planning on using it in a game engine that you'll be
 monetizing be certain that you're abiding by their licenses. Likely
 this means distributing full source.

That’s pretty much the idea. I’m already aware of licenses issues.


 If that's not desirable to you, might I suggest the SDL egg (LGPL, so
 you can dynamically link proprietary code), or the Allegro egg (BSD).
 I think there's an SFML egg floating around, but I'm not certain where
 it's at these days. Of course, there's also the doodle egg, and
 simple-graphics; and you can always write inline C with the inline,
 bind and foreign eggs.

I already played with these and my idea was to write something like
doodle with a FRP style and OpenGL. That’s my main project these days,
the first goal is to learn FRP and contribute to chicken. If I can use
this later in my games that would just be awesome.


 If you're building binaries with chicken you can opt to statically
 link everything, and you can ship the extension eggs as dynamic
 libraries alongside your binary, if you so wish.

Ok, it seems ok for my needs, but I’m not in a hurry about that so I
have the time to think about it.


 Some wiki pages of interest:
 http://wiki.call-cc.org/man/4/Interface%20to%20external%20functions%20and%20variables
 http://wiki.call-cc.org/eggref/4/bind
 http://wiki.call-cc.org/eggref/4/inline
 http://wiki.call-cc.org/eggref/4/doodle
 http://wiki.call-cc.org/eggref/4/simple-graphics
 http://wiki.call-cc.org/eggref/4/sdl
 http://wiki.call-cc.org/eggref/4/opengl
 http://wiki.call-cc.org/eggref/4/allegro/index
 http://wiki.call-cc.org/eggref/4/soil
 http://wiki.call-cc.org/eggref/4/physicsfs
 
 Disclaimer: I am the author of the soil, allegro and physicsfs eggs.
 Patches are welcome!

Thanks, will do!


 
 -Dan

-- 
Envoyé depuis ma Game Boy.

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


Re: [Chicken-users] Chicken Scheme Doc

2013-03-04 Thread Kooda
On Mon, Mar 04, 2013 at 08:04:09PM -0300, Bruno Arruda wrote:
 Hi,
 
 I was looking for a reference documentation of native procedures in Scheme,
 but I found nothing.
 
 Please, where can I find this?
 
 Thanks!

Perhaps you can read R5RS? There is a copy on the website [1].
There is also the documentation for all supported extensions to R5RS
here[2].

I hope that’s what you’re looking for.

[1] http://wiki.call-cc.org/man/4/The%20R5RS%20standard
[2] http://wiki.call-cc.org/man/4/Supported%20language

-- 
Envoyé depuis ma GameBoy.

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