Re: csi on Windows, Emacs and srfi 18

2020-07-05 Thread Dan Leslie
Parley, wasn't it?

I, too, worked around this issue on windows using parley.

-Dan

 Original Message 
On Jul 5, 2020, 13:29, Kristian Lein-Mathisen wrote:

> Hi George,
>
> I think the problem may also be that your primordial thread is blocking all 
> srfi-18 threads in it's (read) call. Possibly in addition to the missing 
> output-flush calls.
>
> I used to get around this in Chicken 4 by using the 'perley' egg, but it's 
> not available for Chicken 5. You could simply (current-input-port 
> (make-perley-port)) and have a non-srfi18-blocking stdin.
>
> Maybe you could see if http://wiki.call-cc.org/eggref/5/breadline or 
> http://wiki.call-cc.org/eggref/5/linenoise could fix it?
>
> Also, I found an old paste where I was having similar issues for 
> subprocesses. You could see if there are some useful tricks in there: 
> http://paste.call-cc.org/paste?id=dc1ec82557b9ea5846ec976a9987d53d83f401e3
>
> In particular, you could try the last snippet:
>
> ;; don't block while reading anything from port p. port p must have an
>
> ;; associated filedescriptor.
>
> (
>
> define
>
> (
>
> make-nonblocking-input-port p
>
> )
>
> (
>
> make-input-port
>
> (
>
> lambda
>
> (
>
> )
>
> (
>
> thread-wait-for-i/o!
>
> (
>
> port->fileno p
>
> )
>
> )
>
> (
>
> read-char p
>
> )
>
> )
>
> (
>
> lambda
>
> (
>
> )
>
> (
>
> char-ready? p
>
> )
>
> )
>
> (
>
> lambda
>
> (
>
> )
>
> (
>
> close-input-port p
>
> )
>
> )
>
> )
>
> )
>
> And then add:
>
> (current-input-port (make-nonblocking-input-port (current-input-port)))
>
> K.
>
> On Sun, Jul 5, 2020, 21:34 George Oliver  wrote:
>
>> Hello Kristian and thanks for looking into this.
>>
>> On Sun, Jul 5, 2020 at 12:51 AM Kristian Lein-Mathisen
>>  wrote:
>>
>>> The sys##flush-output here is what you're looking for I think. It's 
>>> problably not being called due to tty-input? returning #f. But it might 
>>> work to redefine it to our needs:
>>
>> I think this could possibly work but I couldn't get it working on my
>> system. Example session on my Emacs:
>>
>> ===
>>
>> CHICKEN
>> (c) 2008-2020, The CHICKEN Team
>> (c) 2000-2007, Felix L. Winkelmann
>> Version 5.2.0 (rev 317468e4)
>> mingw32-windows-gnu-x86-64 [ 64bit dload ptables ]
>>
>> Type ,? for help.
>> #;1> ; loading C:/Users/george/AppData/Roaming/chicken/11/srfi-18.import.so 
>> ...
>> ; loading C:/Users/george/AppData/Roaming/chicken/11/srfi-18.so ...
>> #;2>
>> < here I evaluated define foo from the example code in
>> my first email in the thread
>> #;3> ##sys#read-prompt-hook
>> #
>> #;4> (set! ##sys#read-prompt-hook (lambda () (display "test> ") 
>> (flush-output)))
>> test> # <--
>> here I evaluated thread-start!
>> test> foo
>> 10
>> test> foo
>> 10
>> test> foo
>> 10
>> test> ,q
>>
>> Process scheme finished
>>
>> ===
>>
>> Curiously this behavior is different than evaluating the test without
>> redefining the read-prompt-hook; in that first case repeated evals of
>> foo will iterate the loop in the thread-start!.
>>
>> I got the same result running csi from the WIndows console.
>>
>> I say it could possibly work because it seems like output buffering is
>> an issue here, for reference see
>> https://lists.gnu.org/archive/html/help-gnu-emacs/2006-04/msg00250.html.
>>
>> However I got farther with solution 2!
>>
>>>
>>> = possible solution 2 =
>>>
>>> It's possible that using a real socket might be a feasable workaround. 
>>> `chicken-install nrepl` and start a session (outside of emacs) with
>>>
>>> > csi -R nrepl -e '(nrepl 1234)'
>>
>> I actually had tried this earlier, but since Windows doesn't have the
>> nc utility it wasn't straightforward. I found the netcat Windows
>> utility but it took me a couple of tries to realize Windows was
>> disabling it (via Windows Security protection).
>>
>> Example session:
>>
>> ==
>>
>> ;; nrepl on (C:\Users\george\bin\chicken-5.2.0\bin\csi.exe -R nrepl -e
>> (nrepl 1234))
>> #;> <-- here I evaluate the
>> import, not sure why it doesn't print the output
>> #;> <-- here I evaluate define foo
>> #;> # <-- evaluating thread-start!
>> #;> #
>> #
>> #
>> #
>> #
>> #
>> #
>> #
>> #
>> #
>> 0 <--- evaluating foo
>> #;>
>>
>> 
>>
>> So this seems like it could work!
>>
>> One wrinkle is that csi toplevel commands don't seem to pass through
>> netcat correctly (for example ',q' returns 'Error: unbound variable:
>> unquote'). But that doesn't seem like a show stopper.
>>
>> There is also a possibly more robust long-term solution that I just
>> learned about it. In recent Windows 10 updates MS released ConPTY,
>> which is a new pseudo tty API. See
>> https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/.
>> Currently, when Emacs creates an asynchronous subprocess, it assumes
>> Windows has no PTY and defaults to using a pipe. It seems workable to
>> patch Emacs to use 

Re: [Chicken-users] memory monitoring and leak debugging? (should the advice be in a web page?)

2019-08-07 Thread Dan Leslie
Isn't it possible to pin items, and avoid these relocation and garbage 
collection issues, with object-evict?

https://wiki.call-cc.org/eggref/5/object-evict

-Dan

Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐ Original Message ‐‐‐
On Wednesday, August 7, 2019 1:00 PM, Kristian Lein-Mathisen 
 wrote:

> Hi Daniel and welcome to the Chicken mailing list.
>
> Another thing to keep in mind is that the Chicken garbage-collector will move 
> objects around during gc. That can cause a lot of hard-to-find bugs, and is 
> probably one of the reasons for Joerg advice on not calling back into Scheme 
> from your foreign-lambdas.
>
> Another cause of problems with the relocations is that you cannot reference 
> Chicken objects in C long-term, because the gc won't be able to update those 
> pointers.
>
> Having said that, the ffi in Chicken is really nice to use, so much that I 
> often use it to explore new C api's.
>
> And also, I sometimes use valgrind to check for memory leaks.
>
> Best of luck!
> K.
>
> On Tue, Aug 6, 2019, 22:18 Jörg F. Wittenberger 
>  wrote:
>
>> Hello Daniel,
>>
>> welcome here.
>>
>> Since CHICKEN compiles into C, all the tools you are used with C to use
>> are still there.
>>
>> Personally I'm not a fan of fancy debuggers, since most of the things I
>> write tend to depend on external (network) events.  I'd welcome tips
>> how to automate those jobs using better tools than printing log
>> messages.
>>
>> Memory use in code mixing C and CHICKEN Scheme can be hairy.  I tend to
>> recommend to abstain from calling back from C into Scheme until you
>> know what you are doing.
>> http://wiki.call-cc.org/man/5/C%20interface#notes
>>
>> Otherwise I used to run my code under valgrind, which helped me a lot
>> to catch some errors.
>>
>> Best Regards
>>
>> /Jörg
>>
>> Am Tue, 6 Aug 2019 10:37:06 -0500
>> schrieb Daniel Ortmann :
>>
>>> Hello all,
>>> I am new to Chicken Scheme and experimenting with binding scheme to a
>>> C scanner built with Flex.  The results are fast but I feel the need
>>> to monitor memory use and watch for leaks.
>>>
>>> The only relevant thing I find on call-cc.org is this url:
>>> http://wiki.call-cc.org/chicken-for-emacs-lisp-programmers#tooling
>>>
>>> What are your experiences, tools, and practices with debugging mixed
>>> Scheme + C code?
>>
>> ___
>> 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] Auto CompletionProblems

2019-08-07 Thread Dan Leslie
It sounds like the implementation is not set.

Try putting this as the first line in your source file:

;;; -*- mode: scheme; geiser-scheme-implementation: chicken -*-

If that fixes your problems, then you'll probably want to limit Geiser to the 
one implementation, globally, or add that to all your chicken files.

-Dan

Sent from ProtonMail mobile

 Original Message 
On Aug. 7, 2019, 8:40 a.m., wrote:

> Hey, do you use helm by any chance? Then this might be related:
>
> https://gitlab.com/jaor/geiser/issues/271
>
> Also if you haven't done so already, try running emacs with only the
> necessary packages enabled.
>
> On 8/3/19 4:47 PM, EfraimVagner via Chicken-users wrote:
>>
>>> 1. You only ever get auto-completion for the things you have
>>> loaded/imported in the geiser repl.
>>>
>>
>> I know that what should happen, but is isn't what happaning.
>>
>>
>>> 2. Is company mode active?
>>
>> Yes, it works for some things (functions defines with define, for example)
>>
>>
>>> 3. Did you install apropos and chicken-doc, and populated the
>>> documentation database with
>>>
>>>
 $ cd `csi -R chicken.platform -p '(chicken-home)'`
 $ curl https://3e8.org/pub/chicken-doc/chicken-doc-repo-5.tgz | sudo tar zx
>>>
>>
>> No, I didn't do it before, but I tried it now and didn't change anything...
>>
>>
>>> 4. Not sure why you need jedi? That's for python, no?
>>>
>>> On 8/2/19 10:19 AM, EfraimVagner via Chicken-users wrote:
>>>
>> I'm actually not sure, I don't really know what does what, so I just said 
>> what I installed.
>>
>> ___
>> 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 mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Allegro ported to Chicken 5 (Coop update?)

2019-02-11 Thread Dan Leslie
Thanks in large part to a Pull Request from Olivier Matz the Allegro Egg has 
been ported to Chicken 5.

I've attempted to follow the information in the wiki[0] with regards to how to 
port an egg from C4 to C5 in the simple manner, and so Henrietta likely needs 
to track the new allegro.chicken-5.release-info[1] file.

0: 
https://wiki.call-cc.org/chicken-5-roadmap#the-simplest-approach-just-carry-on
1: 
https://raw.githubusercontent.com/dleslie/allegro-egg/master/allegro.chicken-5.release-info

Thanks,
-Dan

Sent with [ProtonMail](https://protonmail.com) Secure Email.___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Geiser now has Chicken 5 Support

2018-11-17 Thread Dan Leslie
It should be fixed as of this AM.

-Dan

Sent with ProtonMail Secure Email.

‐‐‐ Original Message ‐‐‐
On Saturday, November 17, 2018 8:08 AM, Vasilij Schneidermann  
wrote:

> > That'd be a missing elisp method; it's used in the version check.
> > What version of emacs are you using?
>
> `equalp` is from cl.el, so unless you've loaded it up, it won't be
> defined. This is therefore most likely an oversight in the code. That
> being said, `equalp` is very close to `equal`, so if you can, use that
> instead.
>
> Vasilij Schneidermann



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


Re: [Chicken-users] Geiser now has Chicken 5 Support

2018-11-16 Thread Dan Leslie
That'd be a missing elisp method; it's used in the version check.

What version of emacs are you using?

-Dan

Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐ Original Message ‐‐‐
On Friday, November 16, 2018 2:16 PM, David Ireland  
wrote:

> Hi,
>
> Thanks for the update. I am however, getting "Symbol's function definition is 
> void: equalp" on a fresh install of Chicken 5 and emacs
> for both Linux and OpenBSD. apropos,  srfi-1 & srfi-18 are all installed.
>
> Does anyone have any suggestions?
>
> Thank you.
> Regards,
> David
>
> On Tue, Nov 13, 2018 at 5:12 PM Dan Leslie  wrote:
>
>> Fresh on ELPA: Chicken 5 support in Geiser. Geiser is an enhanced Emacs mode 
>> for interacting with various Schemes.
>>
>> Completion suggestions, eldoc support, region and buffer evaluation, and 
>> symbol evaluation all appear to work well; most are considerably faster 
>> thanks to some reworking of their behaviour. Geiser's features with respect 
>> to switching modules and module namespaces are not available to Chicken 5, 
>> yet; I opted to withold porting those forward for now as that behaviour 
>> relied upon ## internal behaviour to operate under Chicken 4, and was rather 
>> brittle.
>>
>> If you use use-package installation is easy:
>> (use-package geiser)
>>
>> You'll need a few additional packages for Chicken:
>> chicken-install srfi-1 srfi-18 apropos
>>
>> I strongly recommend using Geiser in companion with dumb-jump; I added 
>> Scheme support to it some time ago, and so it now provides a reasonably good 
>> jump-to-definition and find-references for Scheme projects of most any size.
>>
>> Happy hacking!
>>
>> -Dan
>>
>> Sent with [ProtonMail](https://protonmail.com) Secure Email.
>>
>> ___
>> 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] Geiser now has Chicken 5 Support

2018-11-12 Thread Dan Leslie
Fresh on ELPA: Chicken 5 support in Geiser. Geiser is an enhanced Emacs mode 
for interacting with various Schemes.

Completion suggestions, eldoc support, region and buffer evaluation, and symbol 
evaluation all appear to work well; most are considerably faster thanks to some 
reworking of their behaviour. Geiser's features with respect to switching 
modules and module namespaces are not available to Chicken 5, yet; I opted to 
withold porting those forward for now as that behaviour relied upon ## internal 
behaviour to operate under Chicken 4, and was rather brittle.

If you use use-package installation is easy:
(use-package geiser)

You'll need a few additional packages for Chicken:
chicken-install srfi-1 srfi-18 apropos

I strongly recommend using Geiser in companion with dumb-jump; I added Scheme 
support to it some time ago, and so it now provides a reasonably good 
jump-to-definition and find-references for Scheme projects of most any size.

Happy hacking!

-Dan

Sent with [ProtonMail](https://protonmail.com) Secure Email.___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Emacs' dumb-jump now supports Scheme

2017-12-13 Thread Dan Leslie
Emacs users can now avail themselves of Scheme support in the
`dumb-jump` package; the support has just been merged into Git.

What's dumb-jump? It's jump-to-definition using Rip-Grep, the Silver
Searcher, Grep and Git Grep as backends; the implementation is small,
zippy, and usually effective.

I recommend using it with Geiser, of course. ;)

Thanks,
-Dan

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


Re: [Chicken-users] Geiser support improved

2017-12-10 Thread Dan Leslie
PS, it could take a while for this to reach ELPA et al, so grab the git
source in the interim.

Thanks,
-Dan

On Sun, 10 Dec 2017 10:16:40 -0800
Dan Leslie <d...@ironoxide.ca> wrote:

> Thanks to some quality bug reporting the Geiser support for Chicken
> has been greatly sped up. Overall typing speed and completion
> response is far superior to the previous state of affairs.
> 
> Please ensure you have the latest apropos and chicken-doc eggs
> installed; which can be done via:
> 
> chicken-install apropos chicken-doc 
> cd `csi -p '(chicken-home)'` && curl
> http://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | tar zx
> 
> If you use the venerable use-package for Emacs then installing Geiser
> is as easy as:
> 
> (use-package geiser)
> 
> Geiser supports multiple scheme implementations, and so you may select
> Chicken for the current buffer via geiser-set-scheme. If you're so
> inclined, Chicken support can be auto-detected by adding the following
> comment to the top of the source file:
> 
> ;; -*- geiser-scheme-implementation: 'chicken
> 
> Have fun!
> -Dan

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


[Chicken-users] Geiser support improved

2017-12-10 Thread Dan Leslie
Thanks to some quality bug reporting the Geiser support for Chicken has
been greatly sped up. Overall typing speed and completion response is
far superior to the previous state of affairs.

Please ensure you have the latest apropos and chicken-doc eggs
installed; which can be done via:

chicken-install apropos chicken-doc 
cd `csi -p '(chicken-home)'` && curl
http://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | tar zx

If you use the venerable use-package for Emacs then installing Geiser
is as easy as:

(use-package geiser)

Geiser supports multiple scheme implementations, and so you may select
Chicken for the current buffer via geiser-set-scheme. If you're so
inclined, Chicken support can be auto-detected by adding the following
comment to the top of the source file:

;; -*- geiser-scheme-implementation: 'chicken

Have fun!
-Dan

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


Re: [Chicken-users] Any suggestions for a project?

2017-11-17 Thread Dan Leslie
Chicken could really use a Language Server Protocol implementation.

Alternatively, making Chicken faster is probably a gold mine of thesis
material.

-Dan

On Fri, 17 Nov 2017 17:20:52 +0100
Daniele  wrote:

> Hello, I need to make my bachelor thesis in CS and was looking for
> ideas for a project to do in Scheme. Do you have any suggestions? Is
> there something that needs to be done in Chicken? I'm actually not
> very experience and I am learning Scheme right now so it shouldn't be
> something too difficult.
> 
> Thanks
> Daniele
> 
> ___
> 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] Parallel procedures in CHICKEN

2016-12-29 Thread Dan Leslie
You could build something with the posix-shm egg, and the posix unit. If you 
need locks, there’s the posix-semaphore egg.

 

-Dan

 

From: Chicken-users [mailto:chicken-users-bounces+dan=ironoxide...@nongnu.org] 
On Behalf Of Arthur Maciel
Sent: December 28, 2016 7:47 AM
To: Kooda 
Cc: chicken-users 
Subject: Re: [Chicken-users] Parallel procedures in CHICKEN

 

Hi Kooda!

 

Em 24 de dez de 2016 07:00, "Kooda"  > 
escreveu:

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.

 

Do you recommend any specific way to create the pool and especially to  
communicate between the processes? 

 

About the speed, I'll  test and report the results.

 

Thanks! 

Arthur 

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


Re: [Chicken-users] set! on unbound variable

2016-09-24 Thread Dan Leslie
Particularly since Chicken is in the minority of Schemes that allow this
behaviour.

I'm not a fan of fast-and-loose binding and typing, personally; it's a
source of too many mistakes.

-Dan


On 2016-09-24 5:14 PM, Derrell Piper wrote:
> I agree that it's allowed but it would an optional warning would be
> very nice.
>
>
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users




signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] set! on unbound variable

2016-09-24 Thread Dan Leslie
It seems that Chicken has a parameter to enforce R5RS strictness:

> -r5rs-syntax disables the Chicken extensions to R5RS syntax

So I gave it a shot with this issue:

> csi -r5rs-syntax
> CHICKEN
> (c) 2008-2014, The Chicken Team
> (c) 2000-2007, Felix L. Winkelmann
> Version 4.9.0.1 (stability/4.9.0) (rev 8b3189b)
> windows-mingw32-x86 [ manyargs dload ptables ]
> bootstrapped 2014-06-07
>
> Disabled the Chicken extensions to R5RS syntax
> #;1> (set! foo 1)
> #;2> foo
> 1

Well, damn. It is a bug.

-Dan

On 2016-09-23 6:45 PM, Kon Lovett wrote:
>
>> On Sep 23, 2016, at 6:31 PM, Dan Leslie <d...@ironoxide.ca
>> <mailto:d...@ironoxide.ca>> wrote:
>>
>> Sounds like a Chicken Bug,
>
> Chicken calls this a “convenience”. Yes, a std violation but handy
> using a REPL.
>
> Should be able to defeat.
>
>> from the docs[‎0]:
>>
>> >  is evaluated, and the resulting value is stored in the
>> location to which  is bound.  must be bound
>> either in some region enclosing the set! expression or at top level.
>> The result of the set! expression is unspecified.
>>
>> 0: https://wiki.call-cc.org/man/4/The%20R5RS%20standard#assignments
>>
>> -Dan
>>
>> Sent from my BlackBerry 10 smartphone.
>> *From: *Jinsong Liang
>> *Sent: *Friday, September 23, 2016 6:27 PM
>> *To: *chicken chicken
>> *Subject: *[Chicken-users] set! on unbound variable
>>
>>
>> Hi,
>>
>> I have been tripped by the following mistake a few times:
>>
>> (let ((hello 0))
>> (set! helo 1))
>>
>> I meant to set! on hello. However, due to a typo, I did set! on helo.
>> This bug is extremely hard to debug to me. Is there a way to make
>> Chicken give warning on this? Or how do you handle this issue?
>>
>> I know probably using set! is not a good programming style. I found
>> that in some situations it is hard to avoid set!.
>>
>> Thank you!
>>
>> Jinsong
>>
>>
>> ___
>> Chicken-users mailing list
>> Chicken-users@nongnu.org <mailto:Chicken-users@nongnu.org>
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
>



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] set! on unbound variable

2016-09-23 Thread Dan Leslie
  Sounds like a Chicken Bug, from the docs[‎0]:> <_expression_> is evaluated, and the resulting value is stored in the location to which  is bound.  must be bound either in some region enclosing the set! _expression_ or at top level. The result of the set! _expression_ is unspecified.0: https://wiki.call-cc.org/man/4/The%20R5RS%20standard#assignments -Dan   Sent from my BlackBerry 10 smartphone.From: Jinsong LiangSent: Friday, September 23, 2016 6:27 PMTo: chicken chickenSubject: [Chicken-users] set! on unbound variableHi,I have been tripped by the following mistake a few times:(let ((hello 0))    (set! helo 1))I meant to set! on hello. However, due to a typo, I did set! on helo. This bug is extremely hard to debug to me. Is there a way to make Chicken give warning on this? Or how do you handle this issue? I know probably using set! is not a good programming style. I found that in some situations it is hard to avoid set!.Thank you!Jinsong    


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


Re: [Chicken-users] Windows 10, mingw-w64, chicken 4.11, "invalid encoded numeric literal"

2016-08-23 Thread Dan Leslie
I think you should raise this bug in chicken-hackers; it sounds like
it's a platform issue not caught by the automated tests.

-Dan

On 2016-08-23 07:25 PM, Claude Marinier wrote:
> On Thu, 18 Aug 2016, Dan Leslie wrote:
>> I have used it successfully with MSys2 and Mingw-w64; the details are
> here:
>>
>> http://wiki.call-cc.org/msys2
> 
> Hi Dan,
> 
> I uninstalled MinGW-W64 & MSYS2, rebooted, and installed MSYS2 according
> to your instructions. The result is similar: the build works but check
> fails line this.
> 
> 
> Note: in toplevel procedure `doloop765':
>   (lolevel-tests.scm:184) in procedure call to `locative?', the
> predicate is called with an argument of type `locative' and will always
> return true
> ""gcc" "a.c" -o "a.o" -c  -fno-strict-aliasing -fwrapv
> -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os
> -IC:/msys64/home/claude/chicken-4.11.0/tests/..
> -IC:\\msys64\\usr\\local\\include\\chicken\\"
> rm a.c
> ""gcc" "a.o" -o "a.out" -Wl,--enable-auto-import
> -LC:/msys64/home/claude/chicken-4.11.0/tests/..
> -LC:\msys64\usr\local\lib\ -lchicken -lm -lws2_32"
> rm a.o
> [panic] invalid encoded numeric literal - execution terminated
> 
> make: *** [rules.make:663: check] Error 1
> 
> 
> I am running Windows 10, 64-bit on an old HP EliteBook.
> 
> Is there a known problem with gcc 6.1.0? Or are HP laptops quirky?
> 
> Thanks.
> 
> -- 
> Claude Marinier
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users
> 



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Windows 10, mingw-w64, chicken 4.11 - check fails with "invalid encoded numeric literal"

2016-08-18 Thread Dan Leslie
  That should be an org, not a com:http://wiki.call-cc.org/msys2Apologies,-DanSent from my BlackBerry 10 smartphone.From: Dan LeslieSent: Thursday, August 18, 2016 6:13 PMTo: Claude Marinier; chicken-usersSubject: Re: [Chicken-users] Windows 10, mingw-w64, chicken 4.11 - check fails with "invalid encoded numeric literal"  I have used it successfully with MSys2 and Mingw-w6s; the details are here:http://wiki.call-cc.com/msys2-DanSent from my BlackBerry 10 smartphone.From: Claude MarinierSent: Thursday, August 18, 2016 5:21 PMTo: chicken-usersSubject: [Chicken-users] Windows 10, mingw-w64, chicken 4.11 - check fails with "invalid encoded numeric literal"Allô,I am built chicken 4.11 on Windows 10 64-bit with mingw-w64 using the following commands. I downloaded and installed a fresh copy of mingw-w64 yesterday.mingw32-make PLATFORM=mingw PREFIX=C:/Chicken ARCH=x86-64...mingw32-make --just-print PLATFORM=mingw PREFIX=C:/Chicken ARCH=x86-64 install > temp.batI then executed the new batch file.All seems well.I can chicken-install the numbers egg but the check fails.mingw32-make PLATFORM=mingw PREFIX=C:/Chicken ARCH=x86-64...Note: in toplevel procedure `doloop765':  (lolevel-tests.scm:184) in procedure call to `locative?', the predicate is called with an argument of type `locative' and will always return true""gcc" "a.c" -o "a.o" -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -IC:\\Users\\claude\\Documents\\Programming\\chicken-4.11.0\\tests/.. -IC:/Chicken/include/chicken"rm a.c""gcc" "a.o" -o "a.out" -Wl,--enable-auto-import -LC:\Users\claude\Documents\Programming\chicken-4.11.0\tests/.. -LC:/Chicken/lib -lchicken -lm -lws2_32"rm a.o[panic] invalid encoded numeric literal - execution terminated.\rules.make:664: recipe for target 'check' failedmingw32-make: *** [check] Error 1I can also build and run a small program.Note that I am not using MSYS.-- Claude Marinier



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


Re: [Chicken-users] Windows 10, mingw-w64, chicken 4.11 - check fails with "invalid encoded numeric literal"

2016-08-18 Thread Dan Leslie
  I have used it successfully with MSys2 and Mingw-w6s; the details are here:http://wiki.call-cc.com/msys2-DanSent from my BlackBerry 10 smartphone.From: Claude MarinierSent: Thursday, August 18, 2016 5:21 PMTo: chicken-usersSubject: [Chicken-users] Windows 10, mingw-w64, chicken 4.11 - check fails with "invalid encoded numeric literal"Allô,I am built chicken 4.11 on Windows 10 64-bit with mingw-w64 using the following commands. I downloaded and installed a fresh copy of mingw-w64 yesterday.mingw32-make PLATFORM=mingw PREFIX=C:/Chicken ARCH=x86-64...mingw32-make --just-print PLATFORM=mingw PREFIX=C:/Chicken ARCH=x86-64 install > temp.batI then executed the new batch file.All seems well.I can chicken-install the numbers egg but the check fails.mingw32-make PLATFORM=mingw PREFIX=C:/Chicken ARCH=x86-64...Note: in toplevel procedure `doloop765':  (lolevel-tests.scm:184) in procedure call to `locative?', the predicate is called with an argument of type `locative' and will always return true""gcc" "a.c" -o "a.o" -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -IC:\\Users\\claude\\Documents\\Programming\\chicken-4.11.0\\tests/.. -IC:/Chicken/include/chicken"rm a.c""gcc" "a.o" -o "a.out" -Wl,--enable-auto-import -LC:\Users\claude\Documents\Programming\chicken-4.11.0\tests/.. -LC:/Chicken/lib -lchicken -lm -lws2_32"rm a.o[panic] invalid encoded numeric literal - execution terminated.\rules.make:664: recipe for target 'check' failedmingw32-make: *** [check] Error 1I can also build and run a small program.Note that I am not using MSYS.-- Claude Marinier



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


Re: [Chicken-users] Installing chicken on windows

2016-07-09 Thread Dan Leslie
Oops, you shouldn't need to install cmake and global. I copy/pasted that
from my Emacs setup readme.

-Dan


On 2016-07-09 5:36 PM, Dan Leslie wrote:
>
> I have just returned from vacation and have access to my Windows 10
> machine again, and so can try out my setup.
>
> Here's what I have done:
>
> Install 64-bit MSYS2, launch bash using the MingW64 shell:
>
> |https://msys2.github.io|
>
> Install the necessary dependencies:
>
> |pacman -Sy pacman -S mingw-w64-cross-toolchain base-devel
> mingw64/mingw-w64-x86_64-cmake global|
>
> Build and install Chicken:
>
> |tar xf chicken-4.11.0.tar.gz; cd chicken-4.11.0 make
> PLATFORM=mingw-msys make PLATFORM=mingw-msys install |
> And now you have a Win64 build of Chicken.
>
> Note that I also install and use Emacs this way, and interface with
> Chicken through Geiser.
>
> -Dan
>
> On 2016-07-09 4:38 PM, Matt Gushee wrote:
>>
>>
>> On Fri, Jul 8, 2016 at 12:01 PM, Matt Welland <mattrwell...@gmail.com
>> <mailto:mattrwell...@gmail.com>> wrote:
>>
>>
>> Oh, as an aside, it would be fantastic to have IUP be just as
>> easy to install on Linux/Unix. Sadly this is not the case. I have
>> not surveyed the GUI toolkit world recently. Is there a better
>> alternative available for Chicken now?
>>
>>
>> ​I haven't looked around *very* recently, but I've been through many
>> cycles of looking for better GUI toolkits. And everytime I've looked,
>> I seem to find the same answer: that IUP is the *only* reasonably
>> modern and full-featured cross-platform GUI toolkit written in plain
>> C. Ah well, GTK is technically written in plain C, but it has its own
>> complex infrastructure. Everything else is C++ - which I suppose
>> would not be impossible to wrap for Chicken, but nobody seems to want
>> to do it.
>>
>> However, I think the IUP situation is getting better. I built the
>> latest versions of IM, CD, and IUP for Arch Linux about a month ago,
>> and I only had to make one minor change to one of the build scripts.
>> Every previous time I've built the packages, I've had to patch
>> Makefiles and other things. So it seems like the IUP team has finally
>> gotten around to addressing some of the problems people have been having.
>>  
>> --
>> ​Matt Gushee​
>>
>>
>>
>> ___
>> Chicken-users mailing list
>> Chicken-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
>



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Installing chicken on windows

2016-07-09 Thread Dan Leslie
I have just returned from vacation and have access to my Windows 10
machine again, and so can try out my setup.

Here's what I have done:

Install 64-bit MSYS2, launch bash using the MingW64 shell:

|https://msys2.github.io|

Install the necessary dependencies:

|pacman -Sy pacman -S mingw-w64-cross-toolchain base-devel
mingw64/mingw-w64-x86_64-cmake global|

Build and install Chicken:

|tar xf chicken-4.11.0.tar.gz; cd chicken-4.11.0 make PLATFORM=mingw-msys
make PLATFORM=mingw-msys install |

And now you have a Win64 build of Chicken.

Note that I also install and use Emacs this way, and interface with
Chicken through Geiser.

-Dan

On 2016-07-09 4:38 PM, Matt Gushee wrote:
>
>
> On Fri, Jul 8, 2016 at 12:01 PM, Matt Welland  > wrote:
>
>
> Oh, as an aside, it would be fantastic to have IUP be just as easy
> to install on Linux/Unix. Sadly this is not the case. I have not
> surveyed the GUI toolkit world recently. Is there a better
> alternative available for Chicken now?
>
>
> ​I haven't looked around *very* recently, but I've been through many
> cycles of looking for better GUI toolkits. And everytime I've looked,
> I seem to find the same answer: that IUP is the *only* reasonably
> modern and full-featured cross-platform GUI toolkit written in plain
> C. Ah well, GTK is technically written in plain C, but it has its own
> complex infrastructure. Everything else is C++ - which I suppose would
> not be impossible to wrap for Chicken, but nobody seems to want to do it.
>
> However, I think the IUP situation is getting better. I built the
> latest versions of IM, CD, and IUP for Arch Linux about a month ago,
> and I only had to make one minor change to one of the build scripts.
> Every previous time I've built the packages, I've had to patch
> Makefiles and other things. So it seems like the IUP team has finally
> gotten around to addressing some of the problems people have been having.
>  
> --
> ​Matt Gushee​
>
>
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Installing chicken on windows

2016-07-08 Thread Dan Leslie
The Haskell Platform is batteries-included; it ships with gcc, binutils, bash 
et al. IIRC, you can opt not to install those if you wish, but they install by 
default.

Alternatively, people can now install Chicken through the Bash package that 
Microsoft ships in the Windows store. It's just Ubuntu without the kernel.

Sent from my BlackBerry 10 smartphone.
  Original Message  
From: John Cowan
Sent: Friday, July 8, 2016 9:53 AM
To: Dan Leslie
Cc: Matt Welland; Oleg Kolosov; chicken-users; C K Kashyap
Subject: Re: [Chicken-users] Installing chicken on windows

Dan Leslie scripsit:

> It reads to me like Chicken needs an automated builder for the Windows
> package.

It's not very clear how beneficial this is, since in order to use the
compiler, you'll need gcc and gmake anyway. (If you just want a Scheme
interpreter, there are probably better choices than Chicken, though it
does have some nice eggs.)

-- 
John Cowan http://www.ccil.org/~cowan co...@ccil.org
Thor Heyerdahl recounts his attempt to prove Rudyard Kipling's theory
that the mongoose first came to India on a raft from Polynesia.
--blurb for Rikki-Kon-Tiki-Tavi

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


Re: [Chicken-users] Installing chicken on windows

2016-07-08 Thread Dan Leslie
  It reads to me like Chicken needs an automated builder for the Windows package.Sent from my BlackBerry 10 smartphone.From: Matt WellandSent: Friday, July 8, 2016 9:18 AMTo: Oleg KolosovCc: chicken-users; C K KashyapSubject: Re: [Chicken-users] Installing chicken on windowsI'd love to bring the chicken-iup installer up to date but I don't have the time to do it on my own. If anyone has the bandwidth and interest to help please let me know. I think the installer is far and above the easiest way to get going on Windows.On Thu, Jul 7, 2016 at 11:06 PM, Oleg Kolosov  wrote:
> On 08 Jul 2016, at 00:48, C K Kashyap  wrote:
>
> Hi all,
>
> I am very new to Chicken. I've been able to get started with it on my mac using homebrew. I am not sure about how to get started on windows though.
>
> What's a good way to install chicken on windows? The binary installer links shown on the web page seems dated.
>
> Can I build chicken using VC?
>
> Is this the right place to download mingw64 - http://mingw-w64.org/doku.php/start
> I could not find a download link.
>
> I'd appreciate your help very much.
>
> Regards,
> Kashyap
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

Hi!

The simplest way is to install pre-packaged CHICKEN, see https://wiki.call-cc.org/platforms#microsoft-windows-

I guess the available binary packages are dated because in 4.10 CHICKEN changed ABI and build requires bootstrapping which is a pain and nobody bothered because Windows is not popular here.

No, you can't build it using VC either. A build system requires GNU make and code has some GCC'isms and UNIX'isms. Core can be fixed with a few relatively trivial patches but supporting utilities (chicken-install and friends) can not, so you wont be able to install eggs. I had the patches in my CMake based CHICKEN fork but abandoned it due to lack of public interest.

--
Regards, Oleg


___
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] big prime number

2016-01-24 Thread Dan Leslie

Peter Bex  writes:

> Now, the good news is that I also ran the program under CHICKEN 5 and
> it took just under 17 seconds to complete.  Most likely this is because
> the whole thing can be done completely inline, without any CPS calls,
> which means a lot less allocation, which in turn means a lot less
> garbage collections need to be performed.  So again many thanks to Felix
> for pushing me to make all operators have inlineable C functions!

I am very much looking forward to Chicken 5.

:D

-Dan


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


Re: [Chicken-users] Scraping the REPL?

2016-01-24 Thread Dan Leslie

Word of warning: Babel seems to be hard-coded for Guile only; there are
several open bugs regarding Babel and Geiser regarding, for instance, it
breaking with Chicken.

-Dan

Alex Charlton  writes:

> Hi James,
>
> The best thing that I've found for creating "living" documents is Org-mode's
> Babel . It allows you to write
> code in a document which is  executed when the document is compiled, with
> the source and/or the results getting inserted into the document (which can
> be transformed to LaTeX). If your code generates images, you can even have
> them inserted, too (likely not what you're looking for, but still a cool
> feature!) However, there is one big caveat: Org-mode is an Emacs mode, so
> not only would you need to use Emacs, but so would anyone compiling the
> document. I could understand if this is too much of a barrier of entry for
> your liking.
>
> Another suggestion which seems a bit more in line with your desires would
> be to use a macro like so:
>
> (define counter (make-parameter 1))
>
> (define-syntax repl-print
>   (syntax-rules ()
> ((_ form)
>  (let ((result form))
>(printf "#;~s> ~s~%" (counter) (quote form))
>(unless (equal? result (void))
>  (print result))
>(counter (add1 (counter)))
>
> Which can then be used like so:
> (repl-print (+ 5 1))
> (repl-print (define (f x)  (+ x 1)))
> (repl-print (f 5))
>
> with e.g. something like  `csi -script foo.scm > foo.out` to produce almost
> the same output as your example. One issue this macro has is that it
> doesn't know about whitespace, so you're kind of limited to one line. You
> could work around that by using a pretty printer with a bit of padding
> magic, but it still won't give you "proper" Scheme indentation. Still, most
> REPL examples should be one-liners, I'd think (and hope for your sake ;) )
>
> Whatever you choose to do, good luck with your project! I look forward to
> seeing the result :)
>
> Alex
>
> On Sat, Jan 23, 2016 at 12:51 PM Hefferon, James S. 
> wrote:
>
>>
>> Thank you for the "script" suggestion.  I apologize but I don't understand
>> it.
>>
>> I'm looking for a way to automatically capture an interactive session, and
>> drop
>> it to a file, without cutting and pasting from a terminal or an editor.
>>  When I use
>> LaTeX to compile the book, I'd like that as part of the compilation it runs
>> Chicken's csi and captures the session, so that session can be
>> brought into the document.  (My past experience with cutting and pasting
>> is that as
>> the document changes the code samples get out of sync.  In addition, I'd
>> like that
>> if a person gets the doc off my github account and they compile the doc
>> then they
>> know their setup matches their doc.)
>>
>> That is, I'd like to feed this to csi, and then grab the transcript.
>>
>> #;1> (+ 5 1)
>> 6
>> #;2> (define (f x)
>> (+ x 1))
>> #;3> (f 5)
>> 6
>>
>> I can get LaTeX to run programs, for example to call "csi -script foo.scm
>> > foo.out".  But
>> I'm not sure if it is possible to grab the REPL without an Expect-type
>> situation.
>>
>> I understand "script" it will give me a single output, and not show the
>> REPL at all.
>> Am I missing the point (probably)?
>>
>> Thank you,
>> Jim
>> ___
>> 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



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


Re: [Chicken-users] functor implementation of bindings egg

2016-01-16 Thread Dan Leslie

Could you perhaps motivate with some sample code?

Thanks,
-Dan

Juergen Lorenz  writes:

> Hi all,
>
> the bindings egg is now implemented with a functor, so that you can
> replace the default dispatch table, which destructures mixed nested
> lists, vectors, strings and additional sequence types. For example,
> you might need lists only. In that case, you simply import list-bindings
> instead of bindings, circumventing dispatch alltogether.
>
> Note also, that I've changed the syntax of the where clause to be in
> sync with the procedural-macros egg: Fenders are now of the form
>   (var ok? ...)
> so that one pattern variable, var, can be checked by zero or more
> predicates, ok?   ...
>
> Cheers
> Juergen



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


Re: [Chicken-users] Need help to figure out where this strange performance impact is coming from

2016-01-13 Thread Dan Leslie
IIRC, there's been ongoing efforts to remove SRFI-1 from core; which may 
explain your observations regarding Master.

Perhaps you should consider asking Chicken Hackers?

-Dan

Sent from my BlackBerry 10 smartphone.
  Original Message  
From: Jörg F. Wittenberger
Sent: Wednesday, January 13, 2016 3:38 AM
To: chicken-users
Subject: [Chicken-users] Need help to figure out where this strange performance 
impact is coming from

Hi Chickeneers,

yesterday I found that simply having a (use mailbox) in some code had a
huge impact (more than a factor of 3) at the performance of the
resulting executable. Without using the mailbox stuff at all.

Meanwhile I figured out that this has nothing at all to do with the
mailbox egg. But _all_ with the use of srfi-1.

But how is this possible?

Attached some test code. As I ran into it from mailbox I prepared a
stripped down version of it to play with. Towards the end of the file
there is a (use srfi-1) which makes all the difference.

So far I found (compiling the code with -O5 but similar things happen
with less aggressive optimization):

a) Using chicken 4.9.1 there is absolutely no difference. Using srfi-1
or not I get roughly 100 messages passed per ms on my machine. (But I
have to include the forced gc; see comment in the code.)

b) A slightly different version which avoids allocations in the queue
runs without the forced gc and yields about 160 ms^-1 on chicken 4.9.1
Again no difference whether or not I (use srfi-1) anywhere.

Now the interesting bits:

c) On master (built almost two weeks ago) I get - when (use srfi-1) is
included - about 180 ms^-1. Those ~5% faster sound about right to me.

d) Comment out the (use srfi-1) at line 163 and it goes down to about
_50_ per millisecond!

e) The same happens for the alternative, allocation free version (not
attached), which uses vectors instead of pairs.


Speculating: The code I wrote has nothing to do with the difference.

But I'm confused. Neither scheduler.scm nor srfi-18 seem to have any
dependency on srfi-1. Also srfi-1 seems not to overwrite any global
bindings.

Should we simply always (use srfi-1) if we also (use srfi-18). Looks
like a workaround, but not like the right thing to do.

How could I boil this down to the real reason?

Best

/Jörg

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


Re: [Chicken-users] Distributed-concurrent computing: If Erlang is a 10. . .

2016-01-08 Thread Dan Leslie

Perhaps you could motivate regarding which Erlang features you find
desirable?

-Dan

Lawrence Bottorff  writes:

> . . . where might Chicken be concerning distributed-concurrent programming?
> How close to Erlang's perfect 10 can you get with Chicken. Of course if
> Chicken is even better than a 10, let me hear about it.
>
> LB
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users



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


Re: [Chicken-users] Any decent web development framework

2015-12-27 Thread Dan Leslie

If you are desiring a monolithic web stack of the Rails sort, then what
you probably are looking for is GNU Artanis:

http://web-artanis.com/index.html

-Dan

机械唯物主义 : linjunhalida  writes:

> Hi scheme users,
>
> I'm a rails programmer, and knows scheme long time ago but don't have
> chance to write scheme code in production level. I want to use scheme
> for website development but it turns out there is no decent framework
> for web development in chicken.
>
> Is there any recommendations? awful is not very useful.
> Any library same as Rails or Sinatra?
>
> Sinatra writes like this:
>
> (get "/" (lambda (request)  "hello")
> (get "/from/:id" (lambda (request) (sprintf "hello ~A" (request 'id
> (get "/page/:id" (lambda (request)
>   (let ((data ($query (from pages) (where (= id (request 'id))
> (render "templates/page" ('data data
>
> Thanks.



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


Re: [Chicken-users] Xmas Greetings

2015-12-24 Thread Dan Leslie

*raises Egg Nog* And to you as well!

Seasons Greatings to all!

-Dan

felix.winkelm...@bevuta.com writes:

> A very happy christmas to all of you!
>
>
> felix
>
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users



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


Re: [Chicken-users] January 2016 Lisp Game Jam

2015-12-21 Thread Dan Leslie

Sly is much higher level than Allegro or SDL; it's probably most
comparable to Doodle or Hypergiant.

-Dan

Josh Barrett  writes:

> Has anybody tried guile's Sly? If so, how does it stack up to chicken's...
> Variety of libraries?
>
> On Mon, Dec 21, 2015, 19:40 John Croisant  wrote:
>
>> Attention CHICKEN game programmers,
>>
>> There is a Lisp Game Jam coming up on January 1. You have 7 days to
>> create a small game using any Lisp dialect, including CHICKEN Scheme.
>> Think of it as a friendly, low-pressure opportunity to practice your
>> game development skills and create something fun. CHICKEN has many game
>> libraries and bindings, such as Allegro, Chipmunk, OpenAL, OpenGL, and
>> SDL. Or you could create a text console game, or even a web browser game
>> using awful and/or spock!
>>
>> I will be participating, using the jam as an excuse to create another
>> example game for the new sdl2 and sdl2-image eggs. I will also be
>> hanging out in the #lispgames and #chicken IRC channels on freenode as
>> much as I can during the jam, to answer anyone's questions about the
>> sdl2 and sdl2-image eggs, and about game development in general. My IRC
>> nickname is jacius.
>>
>> You can find more info and join the jam at
>> http://itch.io/jam/january-2016-lisp-game-jam . Don't forget to
>> introduce yourself in the community forums. :)
>>
>> Happy new year and happy jamming to all!
>>
>> - John Croisant
>>
>> ___
>> 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 mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Emacs Geiser trouble

2015-12-19 Thread Dan Leslie

It probably thinks it's a Guile file and not a Chicken file. When that
happens it is looking for a Guile REPL and ignoring your Chicken
REPL. To see if this is happening look for the word "Guile" or "Chicken"
in the modeline; if you see Guile and not Chicken then things are
misconfigured.

You can do one of two things to fix this:

1. Force Geiser to use only Chicken, as in my custom variables:

(custom-set-variables
 '(geiser-active-implementations (quote (chicken)))
 '(geiser-default-implementation (quote chicken))
 '(safe-local-variable-values (quote ((geiser-scheme-implementation quote 
chicken)

2. Or, and this is a superior method if you intend to work with others, you
could declare to Emacs what Scheme the file is for by placing this
comment at the top of the file:

;; -*- geiser-scheme-implementation: 'chicken -*-

Happy Hacking!
-Dan

Lawrence Bottorff  writes:

> I looked into the archives and found the announcement of Geiser now working
> with Chicken. However, I'm not getting it to work. I open a .scm file, M-x
> geiser, choose Chicken. But with every C-x-e, Emacs says
>
> No Geiser REPL for this buffer (try M-x run-geiser)
>
> Odd because there's the Chicken REPL, open and ready, which I started when
> Geiser asked me which REPL.
>
> LB
> ___
> 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] Building on MSYS2

2015-12-11 Thread Dan Leslie
Damn, I should have RTFM. ;)

‎-Dan

Sent from my BlackBerry 10 smartphone.
  Original Message  
From: Peter Bex
Sent: Friday, December 11, 2015 11:13 AM
To: d...@ironoxide.ca
Cc: chicken-users@nongnu.org
Subject: Re: [Chicken-users] Building on MSYS2

On Fri, Dec 11, 2015 at 11:48:00AM -0500, d...@ironoxide.ca wrote:
> I'm attempting to install Chicken 4.10.1 using MINGW64 via MSYS2;
> and I have managed to have a nearly faultless experience. The final
> install step fails with:
> 
> /usr/local/bin/chicken-install -update-db
> 
> Error: (directory) cannot open directory - No such file or
> directory: "/usr/local/lib/chicken/8"
> rules.make:357: recipe for target 'install-bin' failed
> make: [install-bin] Error 1 (ignored)
> 
> 
> However, /usr/local/lib/chicken/8 does exist. My supposition is that
> Chicken is unaware of MSYS' manipulation of the directory structure.
> 
> The build step was:
> 
> make PLATFORM=mingw-msys install
> 
> Any thoughts?

Did you follow the README's notes?

- When installing under the mingw-msys platform, PREFIX must be an
absolute path name (i.e. it must include the drive letter) and
must use forward slashes (no backward slashes).

Cheers,
Peter

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


Re: [Chicken-users] reducing the size of chicken runtime

2015-11-19 Thread Dan Leslie
Isn't there a significant barrier to determining what to strip due to eval, 
apply and read?

-Dan

Sent from my BlackBerry 10 smartphone.
  Original Message  
From: Peter Bex
Sent: Thursday, November 19, 2015 8:31 AM
To: Victor J
Cc: chicken-users@nongnu.org
Subject: Re: [Chicken-users] reducing the size of chicken runtime

On Thu, Nov 19, 2015 at 03:52:23PM +, Victor J wrote:
> Currently, a statically linked "hello world" executable is 1.7MB (stripped). 
> Is it possible to strip out some unnecessary features (i.e. R5RS stuff, 
> numeric tower, etc) so that the runtime is more suitable for an embedded (low 
> memory) system?

Hi Victor,

It can be done, but it's a little painful. There's some information on
how to do that on the wiki:
http://wiki.call-cc.org/generating%20the%20smallest%20possible,%20self-contained%20executable

Note that there's no "numeric tower" in CHICKEN 4; there's only fixnums
and flonums, and the core needs both. In CHICKEN 5, there's a numeric
tower.

Perhaps it is a nice goal for CHICKEN 5.1 or perhaps 6 to make it easier
to build smaller self-contained binaries. Because CHICKEN 5 is more
explicitly structured as separate modules, it should (theoretically)
be easier to figure out internal dependencies and split it up.

Unfortunately, making the components of CHICKEN more fine-grained also
(currently) means we'll generate more toplevels, which results in a
longer startup time.

If binary size is really your main concern, you might want to take a
look at Chibi Scheme: it is quite modular and has many compilation-time
options for stripping it down to the bare minimum.

Cheers,
Peter

___
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 Dan Leslie
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

Sent from my BlackBerry 10 smartphone.
  Original Message  
From: John Croisant
Sent: Wednesday, November 4, 2015 1:31 PM
To: chicken-users@nongnu.org
Subject: [Chicken-users] New SDL2 eggs; help wanted

Hello everyone,

I am working on new eggs that provide bindings to version 2 of Simple 
DirectMedia Layer (SDL), the popular game development library, and 
related libraries. The eggs will soon be ready for an alpha release, 
with partial functionality. I am looking for people to help with 
testing, documentation, and creating demos and example games.

The APIs are not yet set in stone, so please take a look, try the eggs 
out, and send me your feedback. I am already planning to make procedures 
signal exceptions when an error occurs, instead of returning error codes 
like the C library does.

- sdl2: http://wiki.call-cc.org/eggref/4/sdl2
- sdl2-image: http://wiki.call-cc.org/eggref/4/sdl2-image
- Examples: https://gitlab.com/chicken-sdl2/chicken-sdl2-examples

I am also planning to eventually make eggs for SDL_mixer 2, SDL_ttf 2, 
and (parts of) SDL_gfx 2.

CHICKEN already has eggs for version 1 of SDL and some related 
libraries. These new eggs are for version 2 of SDL, which has many new 
features and improvements. These eggs are new codebases (not updates of 
the earlier eggs), and I am working to create very polished, thorough, 
and maintainable eggs.

Currently the project needs people to help with:

- Manual testing (installing, running examples) on different platforms
- Writing unit tests and semi-automated test programs
- Writing API reference docs, guides, and tutorials
- Creating detailed installation instructions for different platforms
- Creating feature demos and example games/programs

In the longer term, I want to provide good instructions, tooling, and a 
project template for building and distributing self-contained CHICKEN 
games for various operating systems. If you have experience making 
self-contained CHICKEN apps, especially apps using C libraries, and you 
would be willing to answer some questions or help out, please contact me.

If you are interested in helping in any way, please send me an email.

Thanks,

- John Croisant

___
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] Which API to use (llrb)?

2015-10-29 Thread Dan Leslie
Whatever works with the doto macro?

Sent from my BlackBerry 10 smartphone.
  Original Message  
From: Jörg F. Wittenberger
Sent: Thursday, October 29, 2015 12:47 PM
To: chicken-users
Subject: [Chicken-users] Which API to use (llrb)?

Hi all,

I did some more refinements to the LLRB-code I recently posted here.

However I got stuck on the inability to decide which API to use.

The idea is to have a type "binding-set" (is there a better name?) as an
alternative t alists.

However when it comes to `fold` I'm not sure if it is better to follow
the srfi-1 argument order (combiner-initial-set) or the srfi-69 style
order (set-combiner-initial).

At one hand trying to be a "drop-in" for lists it would better not
change the argument order wrt. srfi-1.

However the fold procedure from srfi-1 takes two arguments, the element
(for alists the key-value-pair) and the accumulated value. The fold
operation for "binding-set" is to be called with three arguments, key,
value and result-so-far. Just like srfi-69's hash-table-fold.

Therefore being 100% drop-in is not possible anyway. Therefore it might
be better to follow to srfi-69 order.

So which line of reasoning to follow? Which one of the following is
APIs "better"? Any reasoning I'm not aware of?

Best

/Jörg


A: srfi-69

(binding-set-fold set proc nil)

{{Proc}} must be a procedure of three arguments. It is invoked for
each element with the key, value and the accumulated value (nil for
the first element).

B: srfi-1

(binding-set-fold proc nil set)

{{Proc}} must be a procedure of three arguments. It is invoked for
each element with the key, value and the accumulated value (nil for
the first element).

___
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] strange IUP canvas behavior - mouse clicks returning bad value

2015-10-16 Thread Dan Leslie
  It looks to me like a bad type cast. -DanSent from my BlackBerry 10 smartphone.From: Matt GusheeSent: Friday, October 16, 2015 9:12 AMTo: chicken-usersSubject: Re: [Chicken-users] strange IUP canvas behavior - mouse clicks returning bad valueHi Matt--My brain is not sure, but my finger is spontaneously pointing at the window manager ;-)On Fri, Oct 16, 2015 at 3:40 AM, Matt Welland  wrote:obj: #, pressed 0, status   1   canvas-origin: 0 0 click at -1987635704 48The -1987635704 is the x value returned by this callback:#:button-cb (lambda (obj btn pressed x y status)...this is failing on Ubuntu 15.04 but working ok on sles11.so far as I can tell this is not due to any changes in the code - running an older version exhibits the save behaviour.Any suggestions on what to look at?Thanks,Matt-=-
___
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] ANN: [geiser] Version 0.8

2015-10-12 Thread Dan Leslie

A great many bugs in the Chicken Scheme support have been addressed;
many thanks to the users who reported issues!

Also, completions are, on average, much faster for REPLs with very large
environments. It could be faster, but it would require modifying the
apropos egg to bypass the use of regular expressions, it seems.

Enjoy! And please do keep filing issues.

-Dan

jao <notificati...@github.com> writes:

> Improved features:
>
>   - Lots of improvements to Chicken support, by Dan Leslie.
>   - Better interoperability with xscheme.
>   - Much better performance for long lists of completions or
> evaluated values.
>   - Better highlighting and indentation rules, by Alex Kost and Dan
> Leslie.
>   - Make completion work for quoted symbols.
>
> Bug fixes:
>
>   - geiser-connect-local working again.
>  
>
> ---
> View it on GitHub:
> https://github.com/jaor/geiser/releases/tag/0.8

-- 
-Dan Leslie

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


Re: [Chicken-users] ANN: [geiser] Version 0.8

2015-10-12 Thread Dan Leslie

Kon Lovett <konlov...@gmail.com> writes:

> I was unaware ‘apropos’ was a bottleneck.
>
> So you want an API (& I assume csi command extension) to state literal 
> interpretation of the string, rather than as a pattern.

My apologies; I ought to have reached out earlier. Yes, an API to do
such would be helpful; csi extensions are no longer used in the Chicken
Geiser implementation.

-- 
-Dan Leslie

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


Re: [Chicken-users] performance of bignums

2015-06-25 Thread Dan Leslie

SBCL is Public Domain/MIT/BSD, depending on the component. GMP is dual
licensed as LGPL3 and GPL2.

The licensing issues would impact those who distribute binaries built
with SBCL, but only if they are statically linked to GMP.

-Dan

Stephen Eilert spedr...@gmail.com writes:

 On Thu, Jun 25, 2015 at 4:50 PM, Peter Bex pe...@more-magic.net wrote:

 On Thu, Jun 25, 2015 at 11:39:50AM -0700, Martin DeMello wrote:
  Post to /r/scheme about chicken's bignum performance. (Not my post,
  just figured it could use some eyeballs.)
 
 
 http://www.reddit.com/r/scheme/comments/3b1ujw/performance_of_chicken_scheme_numbers_bignums/

 Hello Martin,

 Thanks for posting this.  We had already been discussing it earlier
 today in #chicken.  I had another look at the code but I can't really
 find any obvious inefficiencies.  It is indeed a bit faster with
 CHICKEN 5, but not by much.

 Of course, Guile is cheating by using GMP.  If I compare it to another
 Scheme which has its own bignum implementation like Gauche, we perform
 about the same.  It's interesting that sbcl is doing so well.  Maybe I'm
 overlooking something seemingly minor but important?

 Cheers,
 Peter



 Not sure about the status of this particular GSOC, but SBCL could also be
 cheating.

 http://www.sbcl.org/gsoc2013/ideas/#sec-1.2

 Now, I thought GMP were GPL'd and SBCL not, so I'm unsure about the legal
 implications, if it does bundle GMP now.


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

-- 
-Dan Leslie

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


[Chicken-users] Some syntax help?

2015-05-02 Thread Dan Leslie

Hi Chickeners!

Around two weeks ago I received a bug report that the monad egg wasn't
working in CSC. This turned out to be the result of a syntax error, and
though I've greatly simplified the syntax and narrowed the issue
considerably, I find myself stuck in a corner while surrounded by wet
paint.

Working branch is here:
https://github.com/dleslie/monad-egg/tree/compiler-import-bug

The issue is thus: the egg does some heavy lifting of syntax transforms,
and there exists a utility such that a user might bind new symbols while
within the quoted syntax of a stack of transformers. It looks like this:

(do state
  (/m! put 99)
  (x - (/m get))
  (return x))

Which would expand to something similar to:

(state-bind
  (state-put 99)
  (state-bind
(state-get)
(lambda (x)
  (state-unit x

I think; it's early. ;)

Anyhow, notice that the /m and /m! transforms occur within the do
syntax; the do syntax transforms through do-using, %unroll-do-using, and
finally to using; where they're defined dynamically within a quoted
syntax block.

Here's the wierdness: this works magnificently in CSI, but fails in CSC.

Moreover, if I replace /m! with a broken variant then /m works great in
both CSI and CSC! I know, it doesn't make much sense to me either. My
best guess is that /m! failing somehow short-circuits a code path in the
compiler and so allows /m to function as I expect.

The correct code that CSC breaks on:
https://github.com/dleslie/monad-egg/blob/compiler-import-bug/monad.scm#L58-L61
And test output:
https://gist.github.com/71cc934fbc9fc7fa2d86

The incorrect code that CSC allows other things to work on:
https://github.com/dleslie/monad-egg/blob/compiler-import-bug/monad.scm#L63-L66
And test output:
https://gist.github.com/d0c276f7ed243d79166b

Any thoughts would be appreciated. :D

Thanks!

-- 
-Dan Leslie

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


Re: [Chicken-users] Some syntax help?

2015-05-02 Thread Dan Leslie

And thanks to your feedback the branch is now passing the available
tests.

Turns out that (syntax) was allowing the two-modules-in-one-file thing
to work. Taking that out caused... Problems. ;)

-- 
-Dan Leslie

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


[Chicken-users] A (somewhat) useful define-syntax example

2015-04-26 Thread Dan Leslie

Earlier last week a bug was reported with the monad egg, and it exposed
a deep flaw in how the syntax was written. In trying to fix it I found
myself spinning my wheels and generally having a frustrating time of
it. Thus, I took it upon myself to strip the concepts to their minimal
and write a small example of the behaviour I wanted.

Namely:
1. Dynamically binding composed symbols at runtime
   (awesome-macro word stuff)
   becomes
   (define awesome-word stuff)

2. Injecting bindings into quoted contexts
   (awesome-macro word (if call-cthulhu (screech) (hum)))
   becomes
   (begin (if call-cthulhu (word) (hum)))

3. Interspersing behaviour into a quoted context
   (awesome-macro splat (method1) (method2))
   becomes
   (begin (method1) splat (method2) splat)

And using those in a library, in csi, in csc, et al; and in composition
with one another. This would cover the needs of a fair number of
domain-specific languages, I think.

Anyhow, without further ado, you can find the example here:
https://github.com/dleslie/funky

PS, can anyone explain the comment here:
https://github.com/dleslie/funky/blob/master/funky.scm#L24

Thanks!
-Dan Leslie

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


Re: [Chicken-users] IDE for Beginners

2015-04-23 Thread Dan Leslie
 line space left on devices; dict - wrapper
 around the 'dict' command. (Depends on bash and dict) diminish -
 shorten or erase modeline presence of minor modes; dir-locals -
 provides directory-wide local variables; edit-env - display,
 edit, delete and add environment variables; egocentric -
 highlight your name inside emacs buffers; eproject - assign files
 to projects, programatically ff-paths - $PATH-like searching in
 C-x C-f; filladapt - enhances Emacs's built-in adaptive fill; 
 floatbg - slowly modify background color; framepop - display
 temporary buffers in a dedicated frame; graphviz-dot-mode.el -
 mode for the dot-language used by graphviz (att). 
 highlight-beyond-fill-column - highlight lines that are too
 long; highlight-completion - highlight completions in the
 minibuffer; highlight-current-line - highlight line where the
 cursor is; home-end - alternative Home and End commands; htmlize
 - HTML-ize font-lock buffers; initsplit - split customizations
 into different files; joc-toggle-buffer - fast switching between
 two buffers; joc-toggle-case - a set of functions to toggle the
 case of characters; keydef - a simpler way to define key
 mappings; keywiz - Emacs key sequence quiz; lcomp -
 list-completion hacks; maplev - major mode for Maple; map-lines -
 map a command over lines matching a regexp; markdown-mode - major
 mode for editing Markdown files; marker-visit - navigate through
 a buffer's marks in order; matlab - major mode for MatLab dot-m
 files; minibuf-electric -  electric minibuffer behavior from
 XEmacs; minibuffer-complete-cycle - cycle through the
 *Completions* buffer; miniedit - enhanced editing for minibuffer
 fields; mutt-alias - lookup and insert the expansion of mutt mail
 aliases; muttrc-mode - major mode for editing Mutt config files; 
 obfusurl - obfuscate an URL; pack-windows - resize all windows to
 display as much info as possible; perldoc - show help for Perl
 functions and modules. (Depends on perl-doc); pod-mode - major
 mode for editing POD files; pp-c-l - display Control-l characters
 in a pretty way; projects - create project-based meaningful
 buffer names; prot-buf - protect buffers from accidental
 killing; protocols - perform lookups in /etc/protocols; quack -
 enhanced support for editing and running Scheme code; rfcview -
 view IETF RFCs with readability-improved formatting; services -
 perform lookups in /etc/services; session - saves settings
 between Emacs invocations and visits to a file; setnu -
 setnu-mode, a vi-style line number mode; shell-command - enables
 tab-completion for shell-command; show-wspace - highlight
 whitespaces of various kinds; silly-mail - generate bozotic mail
 headers; slang-mode.el - a major-mode for editing S-Lang
 scripts; sys-apropos - interface for the *nix apropos command; 
 tabbar - Display a tab bar in the header line; tail - tail -f a
 file or a command from within Emacs; tc - cite text with proper
 filling; thinks - quote texts in cartoon-like think bubbles; tlc
 - major mode for editing Target Language Compiler scripts; tld -
 explain top-level domain names; todoo - major mode for editing
 TODO files; toggle-option - easily toggle frequently toggled
 options; twiddle - mode line hacks to keep you awake; under -
 underline a region with ^ characters; upstart-mode - mode for
 editing upstart files; xrdb-mode - mode for editing X resource
 database files. . See /usr/share/doc/emacs-goodies-
 
 el/README.Debian.gz for a short description of all files, or
 the Info node `emacs-goodies-el' for details.
 
 ___ Chicken-users
 mailing list Chicken-users@nongnu.org 
 https://lists.nongnu.org/mailman/listinfo/chicken-users
 

 - -- 
 Jeremy Steward

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2

 iQIcBAEBAgAGBQJVOHWTAAoJEHVwwAZUeZnZCa0QAJoqQF2xtSXmttuZpssaAxLY
 87D5KP1lcJ9AmyXGCeWGlIvv+mTET6oBwtW9TLJFvMYx7RzBwBQFxmu4Hk94reMN
 9845D7mXQCTWLAVHDfJ0Q8KfWKSgmouWE+tIEOMdliDky+ikcoNtGkD3bCLNBM/G
 wRhj14vrlIx80QbG9uDVLYgoNBs5nkbopTT3nfVXq8TwY8Cc0x+IhOPo1kNCxCfk
 QLdvVfeEw48HvWdKhm/H0MPgx/+iB9uyxkk+XgRMbQJpuRxqe5NcRPgBpaYpx0E9
 cXn38ODRYtE7pWzLCriewsBLSNwFXNdT1bNfl7hjA4fgz3vdUOmp1dVPsyU3trif
 ADEatcee8wWEa0Bsggeb264iYNKEqwrpw18x7z/lvNLlHUeOW8Sud90QOYHyBa18
 qtn0mkHFrTSs4A3f7GpS4nWreGokolkkysFbRmS1aDbIgEDCKVZjhRPMoaPZdjJf
 CpXmMMGKrqwI1G77xkBlbZ3j4bho9QAEqG99QKIqXr156RPEzxE6elaOBruJwW4t
 bozng/LpjHA2RD48+fjT6cjcxHL3rJtLpvbg++PX96iOVnf8Whm5ltWWhTG0B03H
 0DYSd+jHajMhRGsOqCjbvnJkw1OK4+Oj/NrycpmqW5jbWMRAN70OD0LaBlHCFEkT
 rq8YH1M+FgtOzrsdk0uy
 =3Q/3
 -END PGP SIGNATURE-

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

-- 
-Dan Leslie

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


Re: [Chicken-users] [Chicken-hackers] Any thoughts on performance woes?

2015-04-07 Thread Dan Leslie

Peter Bex pe...@more-magic.net writes:
 I have a solution in the works for the particular problem of slow
 numbers.  This is in a CHICKEN 5 branch I've been working on, which
 I will announce in a week or so.

Colour me excited. :)

-Dan

-- 
-Dan Leslie

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


Re: [Chicken-users] [Chicken-hackers] Any thoughts on performance woes?

2015-04-07 Thread Dan Leslie

Felix Winkelmann felix.winkelm...@bevuta.com writes:
 I'm a compiler-writer, my job is to be paranoid about performance.
 But otherwise raw speed is in most cases secondary (try to run large
 real-world programs on Larceny or Stalin and you know what I mean.)

 That there are so many implementors in the Lisp and Scheme community
 probably makes this irrational emphasis on (execution-time)
 performance so apparent in these groups. Or it's the remains of the
 trauma of the AI-Winter, I don't know (and I don't care anymore.)

I agree, Larceny isn't exactly a viable option for development,
for reasons which are evident when one attempts to begin using
it. There's just a whole lot missing from the package, the community,
the documentation et al which other Schemes like Chicken provide.

Perhaps it's because of the industries in which I've worked (gaming,
embedded systems and enterprise SaaS), but I've not really experienced
development where performance wasn't a top or near-top priority. Part of
why I raised this question to the list was to satisfy my curiousity, as
writing performant Chicken code is still somewhat of a hazy endeavour to
me.

It saddens me that you aren't writing so much Scheme/Lisp any more. I
wish that this wasn't the case; you've done such great work.

-Dan

-- 
-Dan Leslie

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


[Chicken-users] Any thoughts on performance woes?

2015-04-06 Thread Dan Leslie
A discussion has been raised on comp.lang.scheme regarding a simple
raytracer and the performance it poses in various schemes. In this,
Gauche an Racket outperform Chicken, and Racket does so
resoundingly. To be frank, it looks rather troubling for Chicken.

I had a go at looking at what Chicken was spending its time on and it
appeared that it becomes mired in a tar pit of garbage collection
tagging. Can someone else with a little more understanding shed some
light on this?

https://groups.google.com/d/msg/comp.lang.scheme/x1YafU5t0B0/M0mzhrl7LxYJ

Thanks!

-- 
-Dan Leslie

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


Re: [Chicken-users] Updating the zmq egg

2015-03-05 Thread Dan Leslie

I'd stick with zmq, particularly considering that you've already begun
updating the egg. It also looks like it has a greater amount of
community and developer support.

-Dan

Matt Gushee m...@gushee.net writes:

 On Thu, Mar 5, 2015 at 6:18 PM, Dan Leslie d...@ironoxide.ca wrote:


 You might want to consider the nanomsg egg, which doesn't appear to have
 a wiki page yet.

 https://github.com/Adellica/chicken-nanomsg


 Oh, great, yet another alternative to consider! :-/  Well, maybe. I've
 never heard of nanomsg before. Any idea how widely-used/well-supported it
 is?

 PS: I still think the future of the zmq egg should be addressed, even if I
 end up not using it. It doesn't seem very useful to have a library binding
 that is two major versions behind. Unless someone is using it in
 production, I'd say it should either be updated or withdrawn.

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

-- 
-Dan Leslie

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


Re: [Chicken-users] Updating the zmq egg

2015-03-05 Thread Dan Leslie

You might want to consider the nanomsg egg, which doesn't appear to have
a wiki page yet.

https://github.com/Adellica/chicken-nanomsg

-Dan

Matt Gushee m...@gushee.net writes:

 Hello, folks--

 I am developing a distributed application for which I would like to use
 ZeroMQ. I've discovered, however, that the zmq egg is unmaintained and very
 out of date (the egg is compatible with libzmq 2.x, while the current
 stable version of the C library is 4.05).

 The good news is that I was able to bring all the foreign type definitions
 and API calls up to date, and the code compiles. I don't know yet if its
 behavior is correct (in fact I know of one thing that is probably incorrect
 - see below). Anyway, I have several questions related to this.

 First of all, shall I take over maintainership of the egg? I'm not really
 the best person to do this kind of thing - I'm not really a C programmer,
 and have no real-world experience with ZeroMQ yet. But if there is no
 better-qualified person available, I'm willing to take on this task. If my
 plans work out, I expect to be using the egg for several years at least.

 Second, the egg documentation mentions that the egg has some known
 problems. Can Moritz or someone tell me what those problems are?

 Next, there are a couple of details of the code I'm wondering about. One of
 the significant API changes is in the 'zmq_send' and 'zmq_recv' functions.
 Both these functions now take a 'len' argument, representing the size of
 the message buffer. Their signatures are as follows:

 *int zmq_recv (void *socket, void *buf, size_t len, int flags);*


 *int zmq_send (void *socket, void *buf, size_t len, int flags);*
 Does a size_t argument require any special handling on the Chicken side? Or
 can I just treat it as a regular integer?

 Another issue with message length is whether there should be a default
 value. There is a Scheme function that generates a buffer for both sending
 and receiving functions. Its signature looks like this:

 *(initialize-message message #!optional data)*

 The DATA argument is provided when the buffer is used for sending, and not
 when it is used for receiving. When there is data, the buffer size - and
 the 'len' argument to 'zmq_send' is derived from the length of the data.
 The problem arises when receiving a message - when there is no data. For
 the time being I set the default value to 0 - but that clearly is not going
 to be a useful value. I suppose the best size for the message buffer would
 vary greatly according to what type of application you are building, but
 there has to be some sort of number. Can anyone suggest a reasonable
 default (the ZeroMQ API doc includes a usage example with a value of 256,
 but I have no idea how arbitrary that is). Or maybe there just shouldn't be
 a default, and INITIALIZE-MESSAGE should require a buffer length argument
 in cases where no data is provided. Any opinions about this?

 Finally, if I am going to maintain this egg I would like it to have a test
 suite. However, I'm somewhat at a loss as to how to test a networking
 library. Simple unit testing is not going to do much good. Any ideas about
 how to approach this?


 Thanks for any feedback,
 Matt Gushee
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users

-- 
-Dan Leslie

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


Re: [Chicken-users] how to unintern a symbol

2015-02-02 Thread Dan Leslie

Is that a function composition function I spy?
I wasn't aware of such a thing in R5RS or R7RS, is it a chicken
extension or a part of one of the Unity libraries?

Thanks!
-Dan

Peter Bex pe...@more-magic.net writes:

 On Mon, Feb 02, 2015 at 10:51:26AM -0700, Alexej Magura wrote:
 Does Chicken have anything comparable to Common Lisp's /unintern/? I
 thought that it might be under /##sys/, since other features present
 in Common Lisp, but absent in Chicken are available under that
 namespace, but it doesn't seem to be provided by that
 module/namespace.

 There's string-uninterned-symbol, which is even documented, right
 below gensym:
 http://wiki.call-cc.org/man/4/Unit%20library#string-uninterned-symbol

 If you have a symbol you want to unintern, you can get its string
 and create an uninterned symbol from that:

 (define unintern (o string-uninterned-symbol symbol-string))

 (eq? (unintern 'foo) 'foo) = #f

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

-- 
-Dan Leslie

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


Re: [Chicken-users] updating eggs

2014-12-17 Thread Dan Leslie
Honestly, I just feed the output of chicken-status into chicken-install 
-reinstall


-Dan

On 14-12-16 11:44 PM, Alexej Magura wrote:
Is there a way to update eggs? I thought it might be chicken-install 
-update-dbbut that seems to have a different effect.  Is there no 
zero-config means of updating eggs aside from manually updating them?

--
Alexej Magura


___
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] Installing combinatorics - cock missing

2014-12-15 Thread Dan Leslie
I can imagine that this is something that might be present on more than 
a few corporate networks.


Perhaps it's best to simply rename the cock egg?

-Dan

On 14-12-15 03:01 PM, Alex Shinn wrote:
On Tue, Dec 16, 2014 at 2:51 AM, Bahman Movaqar bah...@bahmanm.com 
mailto:bah...@bahmanm.com wrote:



Hah!  Great guess on #chicken Mario! It was my ISP...it installed
smoothly after bypassing that stupid filter. Thanks for the help.


There was a porn filter applied to all internet traffic which removed 
the cock egg? Wow.




___
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] Replace an element in a list

2014-12-13 Thread Dan Leslie

*facepalm*

Yes, my way is the way not to do it; thanks to my reading comprehension 
failure. ;)


-Dan

On 14-12-13 06:44 PM, John Cowan wrote:

Bahman Movaqar scripsit:


What is the idiomatic way of replacing the nth element in a list
*without* mutating the list? Is the combination of take and
take-right the right way to do it?

Yes, that's how I'd do it.

Daniel Leslie scripsit:


There are setters for car and cdr, so let's say you're at a position where
you want to replace the head of a list, you can then just do:

(set! (car some-list) some-value)

That's how you do it when you *do* want to mutate the list, or you can
use list-set! if you have it (as R7RS does).




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


Re: [Chicken-users] IDE for Beginners

2014-12-11 Thread Dan Leslie

Hi Nathan!

I've been following this thread but haven't had a chance to jump in 
until now.


SLIME support is sort of broken, at best, on newer Emacs. I tried 
getting it limping back along but I think you'll find it lacking.


I wrote a package for Emacs that can be installed via MELPA and other 
Emacs package repositories; IIRC, it is installable with a basic Emacs 
installation via running `M-x package-install` and installing the 
`chicken-scheme` package. This provides auto-complete for core chicken 
and any eggs you have installed, as well as chicken-doc documentation 
provided that you have chicken-doc installed and configured.


At present, I am working on Geiser integration for Chicken Scheme that, 
once completed, will be far superior to what is presently available for 
Chicken on newer Emacs. Keep an eye on this list; once it's done I'll 
send an announcement.


-Dan

On 14-12-11 08:05 AM, Nathan Thern wrote:

On 12/4/2014 1:16 PM, Mario Domenech Goulart wrote:

Despite being initially cryptic, I'd strongly recommend learning Emacs.
It's a valuable and flexible tool that can be useful in many situations,
not only for editing CHICKEN code.  If you are familiar with Lisp
languages (and I assume you are), Emacs can be programmed to do
virtually whatever you want (including making it less cryptic to your
taste)!

Best wishes.
Mario


Do you recommend SLIME or Geiser or some other tool/combo? Is there a 
thread or wiki page that one can use to get started?


regards,
NT


___
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] how to Find list of ALL standard procedures available from csi

2014-12-05 Thread Dan Leslie
Not part of the standard distribution; however, the apropos egg will 
allow you to locate defined symbols by regex; you could simply provide a 
regex that matches all strings.


-Dan

On 14-12-05 07:48 PM, Joe Python wrote:
I can check whether an individual procedure is available by just 
typing the name, say map:


#;1 map
#procedure (map fn1843 lst11844 . lsts1845)


Is there a way to list ALLof the procedures available by default from 
the csi interpreter?


- Joe


___
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] Working on Geiser integration

2014-11-23 Thread Dan Leslie
A short update: I've made fairly good progress in the last few days. I 
would say about 3/4 of the features are complete.


A special thanks to the authors of the Apropos and Chicken-Doc eggs!

-Dan


On 14-11-21 03:48 PM, Daniel Leslie wrote:

As a follow-up to my earlier inquiries regarding SLIME, I'd like to
notify those who were interested that I've opted to instead work on
Geiser support. The path to full support seems a little easier and,
IMHO, the integration with Scheme is more natural.

AFAICT, previous efforts to support Chicken in Geiser have been
abandoned and never made it much farther than launching the
interpreter. Please inform me if I am mistaken in this regard.

My efforts are here:
https://github.com/dleslie/geiser

Currently, CAPF is working, so by extension I expect ac-geiser works
as well, though I haven't tried yet. I expect to have the bulk of the
remaining work done in the next few weeks, as I have a whole lot of
free time. At the moment there's a three week old little girl wrapped
to my chest, and I've been taking the long night shifts for bottle
feeding which give me plenty of time to hack.

Take care,
-Dan

PS- I cross-posted to chicken-hackers because I believe this is
relevant to those who may be able to provide some advice in sussing
out the internals.



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


Re: [Chicken-users] Portable installs broken?

2014-04-06 Thread Dan Leslie

*facepalm*

I should have read to the bottom of the help listing for csc.

Thanks Peter!

-Dan

On 14-04-06 09:13 AM, Peter Bex wrote:

On Sun, Apr 06, 2014 at 08:55:31AM -0700, Daniel Leslie wrote:

I'm trying to create a 'portable' distribution of chicken and am running
into a simple issue. Basically, the built-in library search path isn't
always valid, and csc and csi don't appear to pay attention to
LD_LIBRARY_PATH.

Alright, so with csi and csc we can get around this by explicitly providing
a -include-path parameter at the command line. But what of installing eggs?
Chicken-install takes no such parameter, and invocations of csc from setup
scripts are not mutable to accept the parameter.

It seems to me that the easy fix would be to import a path from some
environment variable by default. Does such an environment variable exist
already?

The way I do it is by passing CSC_OPTIONS on the commandline, through an
environment.  There, you can place any options which are appended to the
commandline for every csc invocation.

Cheers,
Peter



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


Re: [Chicken-users] Portable installs broken?

2014-04-06 Thread Dan Leslie

Actually, that doesn't appear to help.

In order to get csi to work I must pass both the -include-path parameter 
as well as -q; and csc has no equivalent option to -q.


What appears to happen with csi is that before -include-path is 
evaluated some chicken code is executed that requires loading of a 
library and so it fails. Disabling the banner appears to solve this issue.


I wonder if doing a STATICBUILD would rectify this?

-Dan

On 14-04-06 09:31 AM, Dan Leslie wrote:

*facepalm*

I should have read to the bottom of the help listing for csc.

Thanks Peter!

-Dan

On 14-04-06 09:13 AM, Peter Bex wrote:

On Sun, Apr 06, 2014 at 08:55:31AM -0700, Daniel Leslie wrote:
I'm trying to create a 'portable' distribution of chicken and am 
running

into a simple issue. Basically, the built-in library search path isn't
always valid, and csc and csi don't appear to pay attention to
LD_LIBRARY_PATH.

Alright, so with csi and csc we can get around this by explicitly 
providing
a -include-path parameter at the command line. But what of 
installing eggs?
Chicken-install takes no such parameter, and invocations of csc from 
setup

scripts are not mutable to accept the parameter.

It seems to me that the easy fix would be to import a path from some
environment variable by default. Does such an environment variable 
exist

already?

The way I do it is by passing CSC_OPTIONS on the commandline, through an
environment.  There, you can place any options which are appended to the
commandline for every csc invocation.

Cheers,
Peter





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


Re: [Chicken-users] Portable installs broken?

2014-04-06 Thread Dan Leslie

Nix that, STATICBUILD would break most everything I need.

Hrm, haven't a clue.

-Dan

On 14-04-06 10:09 AM, Dan Leslie wrote:

Actually, that doesn't appear to help.

In order to get csi to work I must pass both the -include-path 
parameter as well as -q; and csc has no equivalent option to -q.


What appears to happen with csi is that before -include-path is 
evaluated some chicken code is executed that requires loading of a 
library and so it fails. Disabling the banner appears to solve this 
issue.


I wonder if doing a STATICBUILD would rectify this?

-Dan

On 14-04-06 09:31 AM, Dan Leslie wrote:

*facepalm*

I should have read to the bottom of the help listing for csc.

Thanks Peter!

-Dan

On 14-04-06 09:13 AM, Peter Bex wrote:

On Sun, Apr 06, 2014 at 08:55:31AM -0700, Daniel Leslie wrote:
I'm trying to create a 'portable' distribution of chicken and am 
running

into a simple issue. Basically, the built-in library search path isn't
always valid, and csc and csi don't appear to pay attention to
LD_LIBRARY_PATH.

Alright, so with csi and csc we can get around this by explicitly 
providing
a -include-path parameter at the command line. But what of 
installing eggs?
Chicken-install takes no such parameter, and invocations of csc 
from setup

scripts are not mutable to accept the parameter.

It seems to me that the easy fix would be to import a path from some
environment variable by default. Does such an environment variable 
exist

already?
The way I do it is by passing CSC_OPTIONS on the commandline, 
through an
environment.  There, you can place any options which are appended to 
the

commandline for every csc invocation.

Cheers,
Peter







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


Re: [Chicken-users] Portable installs broken?

2014-04-06 Thread Dan Leslie
Analyze and syntax-check only csc invocations appear to work (-A and -P 
options). That implies to me that -include-path is adhered to /very/ 
late in the invocation, if at all.


-Dan


On 14-04-06 10:18 AM, Dan Leslie wrote:

Nix that, STATICBUILD would break most everything I need.

Hrm, haven't a clue.

-Dan

On 14-04-06 10:09 AM, Dan Leslie wrote:

Actually, that doesn't appear to help.

In order to get csi to work I must pass both the -include-path 
parameter as well as -q; and csc has no equivalent option to -q.


What appears to happen with csi is that before -include-path is 
evaluated some chicken code is executed that requires loading of a 
library and so it fails. Disabling the banner appears to solve this 
issue.


I wonder if doing a STATICBUILD would rectify this?

-Dan

On 14-04-06 09:31 AM, Dan Leslie wrote:

*facepalm*

I should have read to the bottom of the help listing for csc.

Thanks Peter!

-Dan

On 14-04-06 09:13 AM, Peter Bex wrote:

On Sun, Apr 06, 2014 at 08:55:31AM -0700, Daniel Leslie wrote:
I'm trying to create a 'portable' distribution of chicken and am 
running
into a simple issue. Basically, the built-in library search path 
isn't

always valid, and csc and csi don't appear to pay attention to
LD_LIBRARY_PATH.

Alright, so with csi and csc we can get around this by explicitly 
providing
a -include-path parameter at the command line. But what of 
installing eggs?
Chicken-install takes no such parameter, and invocations of csc 
from setup

scripts are not mutable to accept the parameter.

It seems to me that the easy fix would be to import a path from some
environment variable by default. Does such an environment variable 
exist

already?
The way I do it is by passing CSC_OPTIONS on the commandline, 
through an
environment.  There, you can place any options which are appended 
to the

commandline for every csc invocation.

Cheers,
Peter








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


Re: [Chicken-users] Portable installs broken?

2014-04-06 Thread Dan Leslie
It turns out that all of the odd issues I was having were resolved by 
ditching SRCDIR. I like to build from a separate directory from source 
as I tend to leave intermediate files in a tmpfs partition, to save my 
SSD some unnecessary thrashing, so I naturally attempted to use SRCDIR. 
Anyhow, building from the same directory as the source resolved all of 
the issues.


Here's hoping Oleg's cmake branch comes together soon. :)

-Dan

On 14-04-06 08:55 AM, Daniel Leslie wrote:
I'm trying to create a 'portable' distribution of chicken and am 
running into a simple issue. Basically, the built-in library search 
path isn't always valid, and csc and csi don't appear to pay attention 
to LD_LIBRARY_PATH.


Thus, the following:

bin $ ./csi -n

CHICKEN

Error: (string-append) bad argument type - not a string: #f

bin $ echo (display \Hello world\) | ./csc - -o foo

Error: (string-append) bad argument type - not a string: #f

Call history:

syntax  (##core#begin (display Hello world))
syntax  (display Hello world) --

Error: shell command terminated with non-zero exit status 17920: 
bin/chicken - -output-file foo.c


Alright, so with csi and csc we can get around this by explicitly 
providing a -include-path parameter at the command line. But what of 
installing eggs? Chicken-install takes no such parameter, and 
invocations of csc from setup scripts are not mutable to accept the 
parameter.


It seems to me that the easy fix would be to import a path from some 
environment variable by default. Does such an environment variable 
exist already?


-Dan



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


Re: [Chicken-users] Multiple concurrent top levels?

2013-08-02 Thread Dan Leslie



On 8/2/2013 1:54 AM, J Altfas wrote:


I've used the embedding API to some extent, but I'm not sure about
multiple toplevels.  It's unclear what toplevel environment(s)
you're referring to.  There's the C_toplevel and I'm pretty sure
there's only one of those.  The Scheme toplevel runs after
CHICKEN_run() is called, and can be stopped and resumed (by
return-to-host and CHICKEN_continue), but that doesn't say anything
about multiple, simultaneous, independent Scheme instances.


Yes, multiple, simultaneous and independent Scheme instances.


Maybe that's not what you're driving at.  What kind of interaction
do you mean, and what would it achieve?  I'm thinking it could be
difficult to get there directly, but perhaps there are other ways to
accomplish your goals.  More info about what you have in mind would
probably be helpful.


Extracting a scheme-object from one Scheme instance and passing it to 
another, for instance.


I've tried doing such things with multiple processes using a mix of 
shared memory objects and pipes, but it was ludicrously cumbersome, 
despite a few eggs I wrote to alleviate the process.


-Dan

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


Re: [Chicken-users] Multiple concurrent top levels?

2013-08-02 Thread Dan Leslie

On 8/2/2013 9:56 AM, John Cowan wrote:

Unless you either (a) are deeply committed to Chicken or (b) need the
fastest possible performance on a single core, then you might want to
consider shifting to Chibi Scheme for this application.


:D

I've already been exploring chibi-scheme for the reasons that you went 
on to mention. It struck me that before I go 'abandoning' Chicken for 
this particular project that perhaps I should inquire if it were as 
versatile as Chibi is in this regard. Sounds like that's a no, but 
thanks for the details about Chibi!


Oh, how much control over the GC does Chibi grant you?

-Dan



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


[Chicken-users] Multiple concurrent top levels?

2013-08-01 Thread Dan Leslie

Regarding:
http://wiki.call-cc.org/embedding

Is it possible to embed chicken in such a way that there exists multiple 
concurrent top levels that do not directly interact unless objects are 
specifically passed by the programmer?


-Dan

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


Re: [Chicken-users] call Chicken Scheme from C and pass a bytevector

2013-06-27 Thread Dan Leslie
There's a section on accessing external objects that covers this sort of 
thing:

http://wiki.call-cc.org/man/4/Accessing%20external%20objects#returning-large-objects-or-chunks-of-memory-to-scheme

It's possible to allocate C structures under the control of the Chicken GC:
http://wiki.call-cc.org/allocating-c-structures-under-control-of-the-chicken-gc

However, you can also leave control up to the user rather than the GC 
and they can use free:

http://api.call-cc.org/doc/lolevel/free

Personally, I like to allocate blobs and  srfi-4 vectors in scheme and 
pass them as parameters to C functions to be mutated.


-Dan

On 6/27/2013 10:07 AM, Claude Marinier wrote:

Hi,

A function in pcap-interface.c calls Chicken Scheme. It builds a 
vector containing a bunch of things, e.g. C_fix(ethtype), and the 
source and destination addresses as vectors. The scheme code converts 
the address vectors to u8vector (u16vector for IPv6). This is a lot of 
work: just under 20% of CPU time is spent in vector-u8vector.


If I could create a blob in C and pass it to scheme, the scheme code 
could use blob-u8vector/shared and blob-u16vector/shared which would 
achieve the same result with much less work.


What is the recommended way to pass a blob to scheme from C?

Is there a way to create a u8vector or u16vector directly in C?

Thank you.




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


Re: [Chicken-users] dynamic scoping

2013-06-26 Thread Dan Leslie

By using parameters; see also:

http://api.call-cc.org/doc/chicken/parameters/make-parameter
http://api.call-cc.org/doc/miscmacros/define-parameter
http://api.call-cc.org/doc/chicken/special-forms/parameterize

-Dan

On 6/26/2013 2:47 PM, Daniel Ajoy wrote:

add binds a to 1 at the moment of definition.

#;48 (define a 1)
#;49 (define (add x) (+ x a) )
#;50 (add 10)
11
#;51 (let ((a 100) ) (add 10) )
11

Is there a way to give a different value of a to add, so that, 
something like this happens:


(let ((a 100) ) (add 10) )
110

Daniel

___
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] dynamic scoping

2013-06-26 Thread Dan Leslie

Oh you just had to be different. ;)

The related SRFI is withdrawn, is it safe to assume that fluid-let will 
be available outside of Chicken?


-Dan

On 6/26/2013 2:56 PM, Kon Lovett wrote:

See http://api.call-cc.org/doc/chicken/special-forms#def:fluid-let

#;1 (define a 1)
#;2 (define (add x) (+ x a) )
#;3 (let ((a 100) ) (add 10) )
11
#;4 (fluid-let ((a 100) ) (add 10) )
110


On Jun 26, 2013, at 2:47 PM, Daniel Ajoy da.a...@gmail.com wrote:


add binds a to 1 at the moment of definition.

#;48 (define a 1)
#;49 (define (add x) (+ x a) )
#;50 (add 10)
11
#;51 (let ((a 100) ) (add 10) )
11

Is there a way to give a different value of a to add, so that, something like 
this happens:

(let ((a 100) ) (add 10) )
110

Daniel

___
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 mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] how to declare foreign variably size structs?

2013-06-20 Thread Dan Leslie
Probably the simplest solution would be to treat it as fixed size and 
use the maximum possible size for the object.


From http://linux.die.net/man/7/inotify

   Specifying a buffer of size

   sizeof(struct inotify_event) + NAME_MAX + 1

   will be sufficient to read at least one event.


-Dan

On 6/20/2013 12:58 PM, Geoffrey wrote:
Hi I am trying to declare of variably sized c struct as a foreign 
declaration.


The one i am after is:
struct inotify_event
{
   int wd;/* Watch descriptor.  */
   uint32_t mask;/* Watch mask.  */
   uint32_t cookie;/* Cookie to synchronize two events.  */
   uint32_t len;/* Length (including NULs) of name.  */
   char name __flexarr;/* Name.  */
};

Note that name field is variably sized. I believe in C you would allocate a 
larger block of memory and then cast it to  (inotify_event*).

By the skills of copy and paste i can do fixed size,and i can do a blob. But 
not a variable struct.

Some help would be appreciated.

Thanks


___
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] Behind the Scenes with CHICKEN Scheme (Part 1)

2013-06-19 Thread Dan Leslie

Hmm, now I want to work with SPOCK a bit more.

-Dan

On 6/19/2013 7:38 AM, Mario Domenech Goulart wrote:

On Thu, 02 May 2013 13:57:58 + Mario Domenech Goulart 
mario.goul...@gmail.com wrote:


An interview with Felix Winkelmann, the author of CHICKEN:
http://spin.atomicobject.com/2013/05/02/chicken-scheme-part-1/

Here's part 2:
http://spin.atomicobject.com/2013/06/19/chicken-scheme-spock-part-2/

Best wishes.
Mario



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


Re: [Chicken-users] Chicken C interface

2013-06-06 Thread Dan Leslie



On 6/6/2013 2:59 AM, Thomas Chust wrote:

Therefore foreign-primitive can do allocation in the nursery, but
foreign-lambda can't. However, foreign-lambda could still allocate
directly in the second generation heap or transfer nursery-allocated
values directly into the heap upon return before the stack context is
destroyed. The question is whether such magic is present for
foreign-safe-lambda, as the documentation may indicate, or whether that
is not the case, as Felix has indicated with his earlier message :-)


I think such magic may exist, or I'm extraordinarily lucky. Objects I 
was constructing inside of a foreign-safe-lambda call were sitting at 
top-level in application instances that were running for quite an 
extended time, and themselves were frequently referenced. (IE, a 
foreign-safe-lambda constructed Color would be referenced as the 
clear-color repeatedly).


-Dan

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


Re: [Chicken-users] help :)

2013-06-05 Thread Dan Leslie

Feel free to ask questions in the IRC channel, #chicken on irc.freenode.net

-Dan

On 6/5/2013 7:07 AM, nehal singhal wrote:

Hi,
I am a newbie to chicken.Can i get some aid as to how to start
coding through chicken. I was recently learning racket and also have
know-how of Python-2.6.
Please guide a little.

regards,
Nehal Singhal.

___
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] Chicken C interface

2013-06-05 Thread Dan Leslie

I do this a fair bit in the Allegro egg.

Here's an example:
https://github.com/dleslie/allegro-egg/blob/985ca2ceef0f5b4028af3f97729f13cba2976fe5/color.scm

Basically, use C_alloc to allocate the memory required to host both the 
List structure and the data it is to contain, then use the C_list macro 
to patch it all together.


-Dan

On 6/5/2013 8:10 AM, pluijzer . wrote:

Hello everybody,

I was planning to use Chicken Scheme in a fashion more similar to 
Guile and Lua. i.e. passing Scheme Data Objects from Chicken to C and 
back using the C interface.


I am a little confused though as how to have a C function return a 
Scheme List that is seen by the garbage collector.


For example, is the code below correct, will the list be seen by the 
garbage collector? And if not, is there correct way to do this.


#
C_word give_12()
{
  C_word *mem  = C_alloc(C_SIZEOF_LIST(2));
  C_word  list = C_list(mem, 2, C_fix(1), C_fix(2));
  return list;
}
#
(print ((foreign-lambda scheme-object give_12)))

Also there doesn't seem to be a C_listp predicate. Is this a concious 
omission?


thank you in advance,
Richard


___
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] Chicken C interface

2013-06-05 Thread Dan Leslie

Oh dear!

Well, it works and I haven't had problems. What's the correct way to go 
about this?


-Dan

On 6/5/2013 2:36 PM, Felix wrote:

From: Dan Leslie d...@ironoxide.ca
Subject: Re: [Chicken-users] Chicken C interface
Date: Wed, 05 Jun 2013 08:47:45 -0700


I do this a fair bit in the Allegro egg.

Here's an example:
https://github.com/dleslie/allegro-egg/blob/985ca2ceef0f5b4028af3f97729f13cba2976fe5/color.scm

Basically, use C_alloc to allocate the memory required to host both
the List structure and the data it is to contain, then use the C_list
macro to patch it all together.

Note that this code is not correct: C_alloc allocates on the C stack and the
data will be invalid once the function returns (Sorry). If this works, then
it is just coincidental!


cheers,
felix



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


Re: [Chicken-users] Chicken C interface

2013-06-05 Thread Dan Leslie

Thanks, I'll get on updating my broken eggs soon.

obvious humpty dumpty joke notwithstanding

-Dan

On 6/5/2013 2:39 PM, Felix wrote:

From: pluijzer . pluij...@gmail.com
Subject: [Chicken-users] Chicken C interface
Date: Wed, 5 Jun 2013 17:10:41 +0200


Hello everybody,

I was planning to use Chicken Scheme in a fashion more similar to Guile and
Lua. i.e. passing Scheme Data Objects from Chicken to C and back using the
C interface.

I am a little confused though as how to have a C function return a Scheme
List that is seen by the garbage collector.

For example, is the code below correct, will the list be seen by the
garbage collector? And if not, is there correct way to do this.

#
C_word give_12()
{
   C_word *mem  = C_alloc(C_SIZEOF_LIST(2));
   C_word  list = C_list(mem, 2, C_fix(1), C_fix(2));
   return list;
}
#
(print ((foreign-lambda scheme-object give_12)))

As written in the other message: C_alloc is just a wrapper around alloca(3),
so returning from the function invalidates or overwrites the data. A later
(minor) garbage collection may actually recover the data, but it is not
certain that it happens. See

   http://api.call-cc.org/doc/foreign/access/foreign-primitive

for a variant that allows stack-allocation.


cheers,
felix

___
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] set! atomic?

2013-06-04 Thread Dan Leslie
Yes, many mutate operations are not srfi-18 threads aware, in my 
(possibly incorrect) experience.


Also, just as an FYI, Chicken's SRFI-18 threads are not system threads, 
and so cannot avail themselves of additional processors. If real 
parallel operations are your goal then you'll want to look at process 
forking. posix, posix-shm, posix-semaphore and lolevel's object-evict 
(or the new protobuf) should be helpful in this regard.


-Dan

On 13-06-04 07:15 PM, Bryan Vicknair wrote:

SRFI-18 states:

   Read and write operations on the store (such as reading and writing a
   variable, an element of a vector or a string) are not required to be atomic.
   It is an error for a thread to write a location in the store while some other
   thread reads or writes that same location.

Is it possible to eval a variable that is in an inconsistent state?  I
understand that if there are a series of set-car! on a list, then a reader may
see the list as it is in between any of the set-car! calls.  But is it possible
that an update to a very large object will ever be interrupted by one thread
such that other threads will see a broken version?

   (use srfi-1)
   (define foo '(1 2 3))
   (thread-start! (make-thread (lambda () (set! foo (iota 1e8)
   (print foo)

In the above code, will the primordial thread ever print a list that
isn't exactly (1 2 3) or (iota 1e8)?

The context of my question is that for a small web app I have a hash table that
all threads read freely, but they coordinate writes with a mutex.  Do I need to
also have a read lock?


Bryan Vicknair

___
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] Protocol Buffers for CHICKEN

2013-05-28 Thread Dan Leslie

This is very welcome!

I wonder if this would be useful for storing data in a posix shared 
memory block...


-Dan

On 5/28/2013 3:15 PM, Thomas Chust wrote:

Hello,

during the CHICKEN spring thing in Cologne I started to work on a new
egg [1] implementing the protocol buffer [2] serialization format, which
is now in a usable and tested state.

If you don't need or want to use a specific schema for your data, you
can use the protobuf egg as a generic serialization solution that
produces platform-independent binary representations of (almost) any
CHICKEN values:

   $ cat source.scm
   (require-library protobuf)
   (import protobuf-generic)
   (serialize (lambda (x) (print (* 2 x
   $ csi -s source.scm lambda.pbf
   $ cat sink.scm
   (require-library protobuf)
   (import protobuf-generic)
   ((deserialize) 42)
   $ csi -s sink.scm lambda.pbf
   84

The serialized data can be read by other protocol buffer enabled
applications, it may not have the most convenient structure, though.

So if you have a need to communicate with other software that uses
protocol buffer definitions, you can use the protoc compiler plugin that
comes with this egg to generate a CHICKEN binding automatically from
existing schema definitions:

   $ cat person.proto
   package person;
   message Person {
 required int32 id = 1;
 required string name = 2;
 optional string email = 3;
   }
   $ protoc --proto_path=. --chicken_out=. person.proto
   $ cat test.scm
   (require-library protobuf)
   (include person.scm)
   (import protobuf person)
   (serialize (make-person id: 42 name: Jane Doe))
   $ csi -s test.scm | \
protoc --proto_path=. person.proto --decode=person.Person
   id: 42
   name: Jane Doe

Deserialization is just as simple with a call to (deserialize person).
The protobuf messages are represented as SRFI-99 records in CHICKEN that
can be manipulated as usual. Enumeration values are represented as symbols.

If you're interested, check the egg documentation for advanced features
and give the library a try :-)

Ciao,
Thomas


--
[1] https://wiki.call-cc.org/eggref/4/protobuf
[2] http://protobuf.googlecode.com/





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


Re: [Chicken-users] Protocol Buffers for CHICKEN

2013-05-28 Thread Dan Leslie

Huh, now that is useful!
https://wiki.call-cc.org/man/4/Unit%20lolevel#object-evict

Still, if I ever have call to use pshm for ipc between chicken and 
not-chicken workers then this egg would probably be useful.


Thanks again,
-Dan

On 5/28/2013 5:24 PM, Thomas Chust wrote:

On 2013-05-29 00:32, Dan Leslie wrote:

[...]
I wonder if this would be useful for storing data in a posix shared
memory block...
[...]

Hello Dan,

that is certainly possible, you would just combine serialize and
call-with-output-string to obtain data you can copy into a shared buffer
and call-with-input-string plus deserialize to extract the stored value
on the receiving side.

However, shared memory between processes or threads on the same machine
has the advantage that one can place data in native formats in there
without having to care about endianness issues etc. So perhaps
object-evict and friends would be more efficient in this case.

The protobuf serialization could be quite useful for distributed
computing applications. Combining serialization of thunks with network
transport and some cryptographic authentication scheme yields you could
quickly construct a secure remote compute job submission server or a
distributed map reduce network, for example.

Ciao,
Thomas





___
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 Dan Leslie
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.


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.


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.


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!


-Dan

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


Re: [Chicken-users] Best way to share memory between C and Chicken

2013-05-06 Thread Dan Leslie

*cringe*

This will certainly expose what is and is not thread-safe within 
Chicken. I've worked with a /team/ in implementing such behaviour in the 
Unreal engine, albeit a frankenengine of sorts, and with three dedicated 
programmers the endeavour required about a month. But we had the benefit 
of knowing the totality of the code's usage, whereas implementing such 
behaviour could break all sorts of applications written for Chicken Scheme.


OTOH, this would be an enormous boon to the flexibility of Chicken 
Scheme. If it were possible to safely run GC on separate threads, or at 
least have a sort of objective-C level of control over GC, it would make 
implementing native threaded applications far less... /hazy/


Just my two cents, but if the Chicken Team were to pursue this I'd like 
to see it as a major revision feature. IE, Chicken 5: now with very 
different GC behaviour!


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


Re: [Chicken-users] Best way to share memory between C and Chicken

2013-05-05 Thread Dan Leslie
I'll probably write the wiki page while taking the bus to work next 
week, but for now I'm unaware of any issues and have a working example.


There's a test.scm file in the repo that gives a quick rundown on how to 
use a (non-shared) semaphore. That is to say, if you're using fork() and 
only wish to synchronize processes in this sub-tree then you should be 
good with the example in test.scm.


If you wish to synchronize unrelated processes then you'll need to use 
posix-shm to store the semaphores. This O'Reilly page gives a good walk 
through:

http://www.linuxdevcenter.com/pub/a/linux/2007/05/24/semaphores-in-linux.html?page=5

-Dan

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


Re: [Chicken-users] Best way to share memory between C and Chicken

2013-05-04 Thread Dan Leslie
With semaphores and shared memory you can basically emulate the 
behaviour you would expect from native threads. Though I'm not certain 
about how comparable it is in performance, I understand it to be quite 
zippy.


Ie, shm_open will give you a file descriptor, which you can then treat 
as a memory buffer by using mmap, and using semaphores you can safely 
signal across processes whether someone is in a critical section or not.


To me, the drawback is in that creating a shared memory object and 
wrapping it in mmap is clunkier than just sharing all in-process memory 
with a bunch of native threads. But the upshot is that it can be a lot 
safer in practice, especially when you have many hands in the pot and 
not much rigor is being taken towards thread safety.


Regarding Chicken threads, as far as I'm aware SRFI-18 threads in 
Chicken are 'green', in that they run on a single native thread and 
cannot avail themselves of additional native threads.


You mention that you've been poking at native threads for a while. Do 
you have a native thread implementation that could be packaged up as an 
egg? I think some people would be eager to try it out, even if its 
incomplete. Maybe this would be a good opportunity to get used to Git 
via a GitHub project? ;)


Thanks,
-Dan

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


Re: [Chicken-users] Best way to share memory between C and Chicken

2013-05-03 Thread Dan Leslie
If it's heterogeneous data I tend to use blobs with helper functions to 
cast segments to records without undertaking a copy.

https://wiki.call-cc.org/man/4/Unit%20library#blobs

If it's homogenous data then the srfi-4 unit provides all sorts of 
vectors that you can use.

https://wiki.call-cc.org/man/4/Unit%20srfi-4

Keep in mind that foreign-lambdas will take blob and srfi-4 vectors as 
parameter types and convert them to their relevant C types without 
undertaking a copy.

https://wiki.call-cc.org/man/4/Accessing%20external%20objects

-Dan

On 5/3/2013 11:04 AM, Pedro Melendez wrote:


Hi all,

Sorry if this question is obvious, but I couldn't find what I were 
looking for in the documentation so maybe you guys can help me.


I am developing a prototype of a server that would serve 3D seismic 
images across the network. This  task requires to process big files 
(~4 GB) with existing C code that is desirable to maintain. I plan to 
write the server itself in Chicken scheme but I would need to maintain 
the existing code in C that opens and process those files.


Giving the size of the file, I want to share the memory space between 
C and Chicken and avoid copying values between areas. Is that even 
possible? Anyone has an idea on how can I address this?


Thanks in advance!

Pedro

--
T: +1 (416) - 357.5356
Skype ID: pmelendezu




___
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] Best way to share memory between C and Chicken

2013-05-03 Thread Dan Leslie
I was just poking through posix, posix-shm, posix-utils, and 
posix-extras and it seems that none of them implement semaphores!


Am I missing something, or is this actually the case?

-Dan

On 5/3/2013 3:26 PM, Ivan Raikov wrote:


Hello,

  I really strongly advise _against_ using SRFI-4 vectors for 4G 
files, as I have experienced serious performance issues even with 
vectors of a few million elements. If  your C code is to be linked 
with your Chicken code, you can pass the pointer to your data from C 
to Scheme and use SRFI-4 foreign pointers to access it (see unit 
lolevel for details). If the C code is running as a separate process, 
you could try using posix-shm to create shared memory between 
processes and then use foreign pointers in the Chicken process.


  Ivan

On May 4, 2013 3:04 AM, Pedro Melendez pmelen...@pevicom.com 
mailto:pmelen...@pevicom.com wrote:



Hi all,

Sorry if this question is obvious, but I couldn't find what I were
looking for in the documentation so maybe you guys can help me.

I am developing a prototype of a server that would serve 3D
seismic images across the network. This  task requires to process
big files (~4 GB) with existing C code that is desirable to
maintain. I plan to write the server itself in Chicken scheme but
I would need to maintain the existing code in C that opens and
process those files.

Giving the size of the file, I want to share the memory space
between C and Chicken and avoid copying values between areas. Is
that even possible? Anyone has an idea on how can I address this?

Thanks in advance!

Pedro

-- 
T: +1 (416) - 357.5356

Skype ID: pmelendezu



___
Chicken-users mailing list
Chicken-users@nongnu.org mailto: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 mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Best way to share memory between C and Chicken

2013-05-03 Thread Dan Leslie

Yah, I meant sem_wait et al.

I was under the impression that synch and mailbox rely on srfi-18 
structures, which would make them 'green' threads-only and not 
particularly suitable for multi process synchronization.


Relatedly, is anyone poking at implementing native threads?
I've been digging around a bit but haven't had much time to progress 
very far.


I'm hesitant to take responsibility for writing a semaphore egg, but 
what the hell. I'll start something on GitHub this weekend.


-Dan

On 5/3/2013 4:22 PM, Ivan Raikov wrote:


Are you talking about POSIX semaphores, sem_wait(3) and friends, or 
just the general semaphor data structure? If the former, then the 
Chicken developers are eagerly awaiting your patches ;-) If the 
latter, take a look at the synch and mailbox eggs. They have 
mutex-like functionality that can be used in place of proper semaphores.


  Ivan

On May 4, 2013 7:59 AM, Dan Leslie d...@ironoxide.ca 
mailto:d...@ironoxide.ca wrote:


I was just poking through posix, posix-shm, posix-utils, and
posix-extras and it seems that none of them implement semaphores!

Am I missing something, or is this actually the case?

-Dan

On 5/3/2013 3:26 PM, Ivan Raikov wrote:


Hello,

  I really strongly advise _against_ using SRFI-4 vectors for 4G
files, as I have experienced serious performance issues even with
vectors of a few million elements. If  your C code is to be
linked with your Chicken code, you can pass the pointer to your
data from C to Scheme and use SRFI-4 foreign pointers to access
it (see unit lolevel for details). If the C code is running as a
separate process, you could try using posix-shm to create shared
memory between processes and then use foreign pointers in the
Chicken process.

  Ivan

On May 4, 2013 3:04 AM, Pedro Melendez pmelen...@pevicom.com
mailto:pmelen...@pevicom.com wrote:


Hi all,

Sorry if this question is obvious, but I couldn't find what I
were looking for in the documentation so maybe you guys can
help me.

I am developing a prototype of a server that would serve 3D
seismic images across the network. This  task requires to
process big files (~4 GB) with existing C code that is
desirable to maintain. I plan to write the server itself in
Chicken scheme but I would need to maintain the existing code
in C that opens and process those files.

Giving the size of the file, I want to share the memory space
between C and Chicken and avoid copying values between areas.
Is that even possible? Anyone has an idea on how can I
address this?

Thanks in advance!

Pedro

-- 
T: +1 (416) - 357.5356

Skype ID: pmelendezu



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



___
Chicken-users mailing list
Chicken-users@nongnu.org  mailto: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] new egg: glm

2013-04-15 Thread Dan Leslie

Wild!

I've looked at binding GLM a few times but shied away from the wall of 
templates. Your solution is a rather elegant hack, IMHO, leaving little 
to the clients of your bindings to fuss about.


What's the license?

-Dan

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


Re: [Chicken-users] egg documentation with subpages

2013-04-15 Thread Dan Leslie
Nice! I didn't realize chicken-doc-admin was even a thing, and this 
ability should make updating docs much easier to do.


When next I get around to updating the allegro egg from 5.06 to 5.09 and 
fixing the library discovery bug I'll see about also switching over to 
using this to manage the documentation.


Thanks!
-Dan

On 4/15/2013 3:41 PM, Jim Ursetto wrote:

Hi,

It is now possible to break up egg documentation into several pages.  This was 
previously possible on the wiki, but is now supported by chicken-doc as well.

Procedure: instead of creating a file, create a directory and populate it with subpage 
files.  To document the main page, call the page index.

Example:
   allegro/color
   allegro/display
   allegro/index

chicken-doc-admin supports directories and will automatically recurse.  It also 
works with the host-installed eggs option.

Notes:

- You should probably create at least a stub index file because otherwise the 
main page will 404.
- It's a good idea to place links to the subpages on the main page.  chickadee 
will automatically pick up subpages and place them in the contents bar, but the 
wiki will not.
- All subpages are considered eggs, which means:
- It may confuse users who expect each doc page to correspond to exactly one egg, 
unit or module -- there is no allegro color egg for example.
- Subpages will show up in a chicken-doc identifier or egg search, which 
may be confusing or annoying.

There may eventually need to be a way to tag a page as something other than an 
egg for chicken-doc, but that doesn't exist yet.

Jim



___
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] Chicken Scheme Doc

2013-03-04 Thread Dan Leslie

I recommend you check out the following eggs:

https://wiki.call-cc.org/eggref/4/inline
https://wiki.call-cc.org/eggref/4/bind
https://wiki.call-cc.org/eggref/4/foreigners

A combination of the following docs will help:

https://wiki.call-cc.org/man/4/Accessing%20external%20objects
https://wiki.call-cc.org/man/4/Unit%20lolevel

-Dan

On 3/4/2013 3:04 PM, 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!


___
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] New string manipulation module

2013-02-21 Thread Dan Leslie
I've proposed a new type of import specifier to go with prefix, 
namely drop-prefix. Rather than prefixing all names, this removes 
the prefix from any names that have it. This would be a Good Thing to 
add to Chicken; Chibi already has it, and it is part of a proposal for 
R7RS-large. 


That would be incredibly handy.

-Dan

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


Re: [Chicken-users] New string manipulation module

2013-02-21 Thread Dan Leslie

Of course it would, and the Perl substitute command would be more general
still.  For that matter, you could allow an arbitrary Scheme procedure to
be provided.  But drop-prefix is dead simple, has precedent, and is
easy to understand and use.


Why not have both?

-Dan

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


Re: [Chicken-users] New string manipulation module

2013-02-20 Thread Dan Leslie

Nice work, contributions are greatly appreciated. :)

Since you're asking for constructive feedback, two things come to mind:

It's a matter of taste, but IMHO it's schemier that 
/descriptive-variable/ is preferable to /desc-var/, so in your case 
/s-foo/ could easily be /string-foo/. However, I would drop the prefix 
altogether, as Chicken supports renaming on import. So /string-foo/ 
would become /foo/ and any prefixing is left up to the user of your library.


I'm not certain what you intended by 'official', but if you meant that 
you'd like to see it packaged with Chicken then perhaps you should 
consider switching the license to Chicken's license. Mind you, GPL3 eggs 
are happily accepted, but note that many folks won't touch them for 
various reasons. However, if this is a port of an elisp library then 
likely re-licensing is not an option.


Anyhow, thanks for the hard work and the contribution! And welcome to 
Chicken-land, come join us on IRC if you get a chance.


Thanks,
-Dan

On 2/20/2013 9:36 AM, Nicholas Van Horn wrote:
I'm new to Chicken (and scheme for that matter), but I'm eager to 
contribute. I've been working on several text processing projects for 
which I've ported an Emacs-lisp string manipulation library to Chicken.


The strings module provides many convenient string manipulation 
procedures (including new procedures not ported from the original 
elisp library). Each procedure is documented with examples. Beyond 
their immediate convenience, (I think) they present the user with a 
consistent API for working with strings.


I am eager to share this as an official egg, but being new to scheme 
I have likely violated common practices. I share the preliminary 
module here in the hopes that someone will find it useful. I welcome 
any feedback with respect to changes in implementation/behavior, as 
well as missing functionality that you would like to see added.


The module is packaged to be distributed as an egg, but it is 
currently only available at:


https://github.com/n3mo/strings

Thanks,
Nicholas Van Horn


___
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