[Chicken-users] Open Source Developers' Conference coming up in Oslo in May (osdc.no)
It would be possible to go and present about Chicken or Scheme topics in general if someone feels so inclined. Begin forwarded message: From: Per Henrik Oja p...@oja.no Subject: Communities! Participate! Date: 4 February 2015 11:49:44 GMT+1 To: prog...@osdc.no, organiz...@osdc.no Cc: internatio...@mysociety.org, ha...@mysociety.org, ge...@mysociety.org Hi! OSDC Nordic is an upcoming open-source friendly community-oriented event, held May 8th - 10th in Oslo. Open Source Developers' Conference exists to enable the many Nordic open source communities to come together and share their enthusiasm. Read more about the event on http://osdc.no/cfp.html We want you and your friends to come together to learn, hack and share their enthusiasm! Participate by presenting a talk, hosting a workshop, involving your community, by volunteering, or simply by participating in this awesome and unique event. Register on http://goo.gl/forms/fgUhby8aU9 Feel free to contact us with any questions on organiz...@osdc.no And finally. To build a great community event we need everybody care by sharing. Help us spread the word! Forward this email to any of your friends you think might like this invitation . -- Best regards Per Henrik Oja Program Commitee OSDC Nordic http://osdc.no ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] readline egg v2.0 feedback
On 26 January 2015 at 00:02, Matt Welland mattrwell...@gmail.com wrote: From http://wiki.call-cc.org/man/4/Using%20the%20interpreter the ,commands are called toplevel commands and you can define them with: (toplevel-command SYMBOL PROC [HELPSTRING]) Where does this tradition come from? Is it related somehow to the use of the comma as unquote inside a quasiquote? It always seems unintuitive to me to start anything with a comma. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] [Chicken-hackers] Happy Christmas
God Jul from Oslo! ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Dbus egg crashes in Chicken 4.9
I found that a couple of days ago; try again with the svn trunk. I will have to make a new release soon. It's interesting that you are getting some use out of it; does it work well enough and make sense? What kind of application? On 3 July 2014 20:35, Oleg Kolosov bazur...@gmail.com wrote: Hello. After upgrading to Chicken 4.9 our application started to crash in dbus egg. The culprit was found in changed semantics of the assoc and friends: it now checks that the supplied argument is a list. The attached patch fixes the problem. I've not checked if there are similar problems somewhere else. -- 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] dbus egg crashes when sending message fails
On 6 February 2014 14:48, Yaroslav Tsarko eriktsa...@googlemail.com wrote: Hi guys! I have encountered a crash inside dbus library when sending message to receiver that is absent on the bus. Crash happens because dbus_message_iter_init API is called with NULL for its first argument. The attached patch fixes this crash. Could you please apply it to the main egg repository. Thanks for the patch; I applied it. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken Scheme for mobile devices?
On 15 November 2012 15:11, Arne Eilermann eilerm...@lavabit.com wrote: A few words on the company: The bevuta IT GmbH is a software company based in cologne, Germany. We are like 10 Geeks in an office to which Moritz Heidkamp – you may know him – in 2010 brought chicken. We did a few smaller project in chicken but now the first bigger one knocks on our door. This project involves the development of a framework to create cross platform GUI applications in chicken on Android and iOS. The bindings for JNI to access Android's API is mostly done. The next step will be doing something like that for iOS. With this bindings we want to create an abstraction layer to get a common interface. All of this is part of a bigger commercial and proprietary contract work, but the emerging framework shall be released to the community. We already got some experiences with chicken on mobile devices. In 2011 we did some OpenGL stuff on Android and iOS. Moritz was significantly involved in this. It was mostly experimenting, but it did quite well. If anybody of you is interested to join, feel free. We would be glad. That sounds quite interesting, and similar to what I have tried to do in my spare time, but there's never enough of that. It took me too long to realize that I really needed to use OpenGL, with which I didn't have enough experience yet (and only the last couple of years have I had hardware which could support Linux and ES 2.0, anyway); and it's a big change compared to just painting stuff. The concept of a scene graph is a funny thing in a way, because OpenGL is fundamentally procedural: you make API calls in the right order, and the shaders are procedural code too; but the scene graph is a declarative abstraction for that: it exists statically in memory (except when changes are made to it, during animations and such). (The only items which can exist statically in graphics memory are pixmaps and vertices, or other types of data disguised as those, which can be manipulated in the shaders; so parts of the scene graph can be converted into a form which does not need to be regenerated for each frame, but not the whole thing.) Then you have to write more procedural code to manage the scene graph. And then you probably have another declarative abstraction or collection of some sort of model objects, for the GUI or the game objects or whatever. My gut feeling is that's too many layers, even though I understand why it is that way right now. I don't like the lack of transparency; it takes too long to understand all the layers. And I think OpenGL is still too primitive: the scene graph cannot be transferred wholesale into graphics memory; and there is no way to generate geometry on the GPU from more-compact representations, unless you have geometry shader and tesselation shader suport, which has not trickled down to ES yet. Even rendering text is still a big deal. AFAICT the scene graph concept exists to facilitate fast traversal for the purpose of generating the per-frame OpenGL calls. If a Scheme implementation was fast enough, maybe we could go back to just doing the rendering in an expose callback (like the opengl egg makes possible); but it's not necessarily fast enough, depending on the complexity of what you draw and the frame rates you expect; so having a scene graph encapsulates the optimizations necessary to get good frame rates, at the cost of being limited to the kinds of primitives that the scene graph supports. If you use a per-frame callback then you have to write optimal frame-generating code yourself, and that's hard work, especially if you have to do it for every application. I'm thinking maybe a scene graph could be made of Scheme objects though. Just the code to traverse it and generate the OpenGL calls would need to be optimized. Kristian decided to use Chipmunk, which is a scene graph with an integrated physics engine, right? That's maybe a different optimization than you need for doing basic 2D GUI applications, but I do wonder if it could work for that purpose too. FWIW Qt is in process of getting fully-supported Android and iOS ports. So maybe Chicken could make use of that. At one point I thought maybe the Qt egg was going to be the way to go for GUIs, but nowadays widgets are being deemphasized in favor of QML. Of course the official scripting language for that is Javascript. Personally I'd like Scheme to be an alternative. I like the declarative QML syntax itself, but it has to be augmented with some kind of procedural language. QML is based on a custom scene graph which has been used mostly for 2D purposes (GUIs and 2D games). The text rendering is probably unmatched compared to any other OpenGL implementation: fast, scalable, antialiased and with full Unicode support. So since everybody who uses a scene graph writes his own, I guess that means we don't really have a standard or a known-best all-purpose one. It's hard to see at this time what is the
Re: [Chicken-users] Chicken and Cocos2Dx on Google Play!
That's cool! I tried it on my Galaxy Note (1st gen) and FPS is jumping around a lot, even when nothing is moving, usually between 50 and 60fps, and sometimes hitting peaks of more than 60 and sometimes really low values. What is the top of those 3 numbers in the lower-left? Mine says 48 and stays the same. On 2 November 2012 15:20, Kristian Lein-Mathisen kristianl...@gmail.comwrote: Dear Chickeners, I have been playing around with Chicken, Chipmunk and Cocos2Dx for a while, and I've finally got a demo up and running on Android. I've published it on Google Play in the Libraries and Demos category so you guys can test it! Check it out: Scheme REPL with Cocos2Dxhttps://play.google.com/store/apps/details?id=com.adellica.cocoscheme The demo features a truck which you can drive back and forth, clumb up hills and fall down. Not very exciting, but I do actually catch myself playing it when I don't know what I should be coding on! The cool part is that there's a Chicken REPL behind the scenes. You can connect to the REPL directly from your laptop if your phone is on the same WiFi, or use USB. Try Settings-Wireless Networks-Wifi Settings- [Menu]-Advanced when looking for you phone's IP. With netcat (or Emacs, with nc [ip] [port] as your Scheme interpreter), you could try: $ nc [phone ip] [port] Alternatively, you could use USB with adb and forward: $ adb forward tcp:1234 tcp:1234 $ nc localhost 1234 Once you see the REPL prompt @, you can play around: ;; 'import' chipmunk https://github.com/kristianlm/chickmunk bindings (use chickmunk https://github.com/kristianlm/chickmunk) ;; where is the player? (body-get-pos truck) ;; redefine game-loop to pause game unless you're touching the screen (define (*update*) (if *touch-down* (space-step space (/ 1 120 ;; now let's give the truck a gentle push (body-set-ang-vel wf -20) ;; now touch the screen to watch it drift off ;; restart the app to revert your changes (exit) ;; You can also manipulate the physics-world: ;; Drop a ball from the sky (space-add space `(body ((pos (320 700))) (circle (density 0.001) (friction 1) (radius 10 ;; Add a gentle but slippery slope (space-add space `(body ((static 1)) (segment (friction 0.1) (endpoints ((250 500) (800 550)) ;; type this to see the touch-down state: *touch-down* ;; it should be #f when your finger is off the screen, and touch-coordinates otherwise. evaluate it while holding the screen to try it out! If you have an Android phone, it'd appreciate if you took the time to check it out. I am particularly interested if the app won't start at all, and perhaps what framerate you're getting (very bottom-left). I know there is a memory leak somewhere (thanks Alaric!), but otherwise I hope things should be running fairly smoothly. Cheers! Kris ___ 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 Chicken Scheme for Android
On 1 October 2012 16:15, Alan Post alanp...@sunflowerriver.org wrote: Off topic, but I've played with several mobile devices and none of them have ever really 'stuck.' I wind up back on my laptop happier than I was when I wandered away. After enough of these experiences, I came to realize that not having a C compiler+native development environment was the common denominator in my negative experiences. Now I've been seeing more and more android stuff, and wondering whether one of these devices is going to fall in my lap, so I ask: can you get a C compiler and native development environment on these devices? I was thinking of that too. In fact, tcc (tiny c compiler) now has an arm port, and there is cdroid in the app store which apparently bundles it into some kind of IDE. It's not free so I didn't try it yet. But I've been farting around with android, so maybe could try to build tcc myself. After following the process here http://source.android.com/source/ one not only has a system image (which I didn't actually flash on my phone, since I like cyanogenmod well enough) but also the cross-compiler, includes, set of libraries to link against, etc. So it should be possible to build anything. But what you build will not be terribly portable, since the libs can change between android versions. If you instead build with NDK (native development kit), in theory the result will be portable, but maybe the exposed APIs aren't rich enough for some purposes. Then I was thinking maybe with an Android version of icecream, compiling could even be fast, if you have a bunch of other arm thingies on the same network (phones, raspberry pi's, routers, gumstix, whatever). But the compiler would have to be portable enough. However I think maybe the future is to have a Scheme which uses llvm to implement a compiler that works on multiple platforms. When Java was new, I thought its main value would end up being a common VM, with lots of languages being ported to it. That's true to an extent, but it's even nicer that LLVM seems to cover intermediate form, a portable bytecode format, standardized optimizations, and backends to generate native code for multiple platforms. So whether you want to run portable bytecode, JIT it or pre-compile it, there is a way, and it's not such a black box. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] spock tests
All good on Chrome 21.0.1180.79 and Firefox 14, both on Linux, except for (every-of #t) = #f ; *** wrong ***, desired result: = #t Speed is OK too. On 8 September 2012 00:01, Felix fe...@call-with-current-continuation.org wrote: Hello! There has been a new version of Spock (0.9) (that Scheme-JS compiler thingy) that uses a slightly changed unwinding strategy (return instead of throw), which promises better compatibility with stupid browsers and flaky JS engines. If you have a minute, please point your browser to http://www.call-with-current-continuation.org/spock/test.html and http://www.call-with-current-continuation.org/spock/threads.html The former takes quite a while to run, the latter needs canvas support. I tested with Conkeror 0.9.1 and Firefox 3.6.3, which seem to run both tests OK. I would be very interested to see whether these work or fail for you, and on which browsers (IE in particular). 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] spock tests
And it's the same on Safari 6, OSX 10.7 On 8 September 2012 00:21, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: All good on Chrome 21.0.1180.79 and Firefox 14, both on Linux, except for (every-of #t) = #f ; *** wrong ***, desired result: = #t Speed is OK too. On 8 September 2012 00:01, Felix fe...@call-with-current-continuation.org wrote: Hello! There has been a new version of Spock (0.9) (that Scheme-JS compiler thingy) that uses a slightly changed unwinding strategy (return instead of throw), which promises better compatibility with stupid browsers and flaky JS engines. If you have a minute, please point your browser to http://www.call-with-current-continuation.org/spock/test.html and http://www.call-with-current-continuation.org/spock/threads.html The former takes quite a while to run, the latter needs canvas support. I tested with Conkeror 0.9.1 and Firefox 3.6.3, which seem to run both tests OK. I would be very interested to see whether these work or fail for you, and on which browsers (IE in particular). 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] spock tests
On 8 September 2012 00:26, Mario Domenech Goulart mario.goul...@gmail.com wrote: On Fri, 07 Sep 2012 18:18:05 -0400 Mario Domenech Goulart mario.goul...@gmail.com wrote: I think the wrong example is: (string-symbol #t) == #t BUT EXPECTED #f On all browsers I get a warning like: ReferenceError: 25min is not defined Oops I get those too. After seeing 1 wrong I searched for wrong and stopped there. ;-) Hmmm. Shawn mentioned that he gets (every-of #t) = #f ; *** wrong ***, desired result: = #t I get that too, but since the test reported one wrong result and I saw the string-symbol failure, I stopped there. So, it seems that there are three problems: - (every-of #t) = #f - (string-symbol #t) = #t - the wrong examples counter. :-) Shouldn't (string-symbol #t) raise an error? BTW, I used Chromium and Firefox on Linux. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Building Chicken on OS X Lion
I just built the 4.8.0 rc3 on Lion with xcode 4.3.3, using clang, like this: CC=clang C_COMPILER=clang make PLATFORM=macosx install Will csc remember to use clang then? Doesn't seem to be any trouble to chicken-install extensions, anyway. On 31 August 2012 19:48, Jim Ursetto zbignie...@gmail.com wrote: I hope this is not a problem with XCode 4.4.1. I haven't upgraded from XCode 4.3.2 yet. Anyone else have a successful build with 4.4.1? In the meantime if you have some time to kill, you could try building with C_COMPILER=clang. I doubt this will make a difference though. I will try to upgrade shortly and see if I can reproduce the problem. On Aug 31, 2012, at 11:57 AM, Hans Nowak wrote: On 8/31/12 11:16 AM, Stephen Eilert wrote: Have you got homebrew? It just works for me. == Downloading http://code.call-cc.org/releases/4.7.0/chicken-4.7.0.6.tar.gz 100.0% == make PREFIX=/usr/local/Cellar/chicken/4.7.0.6 http://4.7.0.6 PLATFORM=macosx C_COMPILER=cc ARCH=x86-64 == make install PREFIX=/usr/local/Cellar/chicken/4.7.0.6 http://4.7.0.6 PLATFORM=macosx C_COMPILER=cc ARCH=x86-64 /usr/local/Cellar/chicken/4.7.0.6 http://4.7.0.6: 106 files, 16M, built in 2.8 minutes Thanks for your reply. It sort of works for me... that is, it builds, then refuses to link. I had to link it manually using `brew link -f chicken`, and that seems to work (i.e. csi works, installing eggs works), although I don't know what caused the linking problem in the first place, or if it will bite me in the future. (Still, I am curious why it was hanging on loading import libraries...) -- Hans Nowak ___ 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] [Chicken-hackers] Summer 2012 meetup in the UK?
That sounds like fun! I can't promise to come yet, not sure if I can plan that far in advance, but would like to. On 3 January 2012 16:45, Alaric Snell-Pym ala...@snell-pym.org.uk wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear Chickeners, Having just moved into a much larger house than I previously lived in (one large enough to have an actual guest room, plus a playroom for the kids that we're equipping as a second guest room, and a big lounge!), I hereby offer to host a Chicken meetup sometime this summer! We can easily sleep quite a lot of people here (particularly if they bring sleeping bags). The location is Gloucester, which is about an hour and a half from London by train. As well as having a few days' hacking, we should find time to go and visit some of the lovely attractions of the area, such as the legendary cheese shop in Cheltenham, or peering at GCHQ, which is Europe's largest supercomputer centre (through a barbed-wire fence, while watched suspiciously by armed guards), or going for strolls in the Cotswold countryside. And I must warn everyone that my wife is planning to bake Chicken-themed cakes and biscuits. I am open to suggestions for dates. Should I avoid the Olympics, as travel will presumably be more expensive then? Or should I coincide with the Olympics, as people might want to come over to the UK for them anyway, and sneak in a few days in Gloucester amongst it all? Who would like to come, and when can they get time off? I'd recommend we make it a long weekend, so we can fit in a good mixture of hacking and adventuring! But people are welcome to stay for longer if there's interest :-) ABS - -- Alaric Snell-Pym http://www.snell-pym.org.uk/alaric/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8DIrYACgkQRgz/WHNxCGozlACfXDADEc18ZpvUu92r16BBUptG 9PkAnj9tJUazhx1tSWmqMkED409COcbz =uL0c -END PGP SIGNATURE- ___ Chicken-hackers mailing list chicken-hack...@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] handy inputrc - use chicken as a calculator
It's a little embarrassing that as long as I've been using Linux I haven't made better use of my ~/.inputrc. It can override keymappings in programs which use libreadline, such as bash. So I just added this # Insert command line to quickly eval an empty scheme expression \es:csi -p \()\\C-b\C-b which will not only insert 'csi -p ()' but also move the cursor back between the parentheses, when I press alt-S in a shell. Seems kindof useful; of course I might think of a better way later, but I'm tickled pink so far. ;-) Then again it's only useful in bash, but csi can itself use readline. Maybe there needs to be a push/pop model of some kind - ~/.csirc could somehow override key bindings when csi is started and then restore them on exit, and I could define lots of macros, some for the shell and some for chicken. (And then have a hard time remembering them anyhow) Just a random idea... not urgent enough for me to spend any time on at this point. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Survey results
Oops I wasn't paying attention and missed the survey. I run chicken most often on Linux, 64-bit, looks like I have 4.5.0 at the moment. Also have 4.5.0 on MacOS. I was using chicken on OpenMoko (an ARM platform, really nobody else is running on arm?) and on a Zaurus before that, but that was version 3... I don't think I got around to trying 4 yet, and haven't been doing anything there for a couple years anyway. And I have tried it on Windows XP at some point, but not recently. On Mon, Oct 25, 2010 at 3:48 AM, Christian Kellermann ck...@pestilenz.org wrote: Dear Chicken Fans! Thank you very much for all your replies during the last week(s). I have updated the portability page accordingly. If you miss your operating system in there or are running a newer version or what not please don't be afraid to change it. It's a wiki and you don't need to authenticate to change it. The url is http://wiki.call-cc.org/portability I have received a total of 30 reported chicken installs in use: | # Users | Operating System | |-+--| | 1 | FreeBSD | | 1 | Haiku | | 13 | Linux | | 6 | Mac OS X | | 1 | NetBSD | | 4 | OpenBSD | | 2 | Windows/mingw | | 2 | Windows/cygwin | | # Users | Architecture | |-+--| | 1 | MIPS | | 4 | PPC | | 19 | x86 | | 6 | x64 | | # Users | Chicken Version | |-+-| | 3 | 4.6.3 | | 5 | 4.6.2 | | 1 | 4.6.1 | | 14 | 4.6.0 | | 1 | 4.5.7 | | 5 | 4.5.0 | | 1 | 4.2.0 | Now let's hear some speculations on what this all means. I would also love to hear from some peculiar hardware you are running chicken on. I know some of you do. Kind regards, Christian ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] mathematical oddities
Sorry for resurrecting such an old thread but I also noticed division by zero doesn't return infinity, and I sortof wish it did, or that it could be an option. On Mon, Jun 19, 2006 at 11:53 PM, felix winkelmann bunny...@gmail.com wrote: On 6/20/06, Thomas Chust ch...@web.de wrote: Maybe something like that could be included in the library for completeness' sake. Or we should create an IEEE arithmetic egg (are there more functions than / in CHICKEN that are not IEEE compliant?). But I would really vote against modifying the behaviour of /. Additionally, you can of course do (condition-case (/ 1 0) (exn (exn arithmetic) doh!)) Can you detect the actual divide-by-zero error though as opposed to just a general arithmetic error? I'm messing around with finding the angles between vectors (trying to simplify a sequence of connected line segments when it's possible to replace them with fewer and longer ones, within a tolerance). Fortunately atan takes two numbers so division by zero won't come up in that case. (Otherwise if you try to take the slope of a line segment you'll get infinity sometimes, and that should be normal, not an error.) Then I was testing modulo and found this: #;1 (remainder 7.3 1.2) 0.101 #;2 (quotient 7.3 1.2) 6.0 #;3 (/ 7.3 1.2) 6.08 #;4 (- (/ 7.3 1.2) (quotient 7.3 1.2)) 0.083 #;7 (use numbers) ; loading /usr/lib64/chicken/5/numbers.import.so ... ; loading /usr/lib64/chicken/5/numbers.so ... #;8 (abs (- (/ 7.3 -1.2) (quotient 7.3 -1.2))) Error: (quotient) bad argument type - not an integer: 7.3 Seems like at least a couple of bugs there: why does loading numbers break floating-point stuff that worked before, and, why doesn't modulo return the actual remainder? Or I'm missing some reason why this should be considered correct... There's a nice comparison of scheme impl's with regard to calculations involving infinity here: http://people.csail.mit.edu/jaffer/III/RAWI ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Re: mathematical oddities
#;1 (remainder 7.3 1.2) 0.101 #;2 (quotient 7.3 1.2) 6.0 #;3 (/ 7.3 1.2) 6.08 #;4 (- (/ 7.3 1.2) (quotient 7.3 1.2)) 0.083 Nevermind about that, I'm being an idiot. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] mathematical oddities
(condition-case (/ 1 0) (exn (exn arithmetic) doh!)) Can you detect the actual divide-by-zero error though as opposed to just a general arithmetic error? On Thu, Jul 15, 2010 at 6:26 AM, Felix fe...@call-with-current-continuation.org wrote: Currently this is the only arithmetic error that may be triggered. Do you think it would be good to add a condition type for this? Well if you think it will always be only that arithmetic error, I guess that's good enough for me to write a division operator which returns infinity if I ever need to. But it would be less efficient. Do you have to detect the infinity in order to turn it into a condition? Maybe that behavior could be switched off, or expose a lower-level division operation so that getting the infinite result is just a matter of redefining the operator to make use of the other division operation. On Thu, Jul 15, 2010 at 5:40 AM, John Cowan co...@mercury.ccil.org wrote: The reason to return +0.inf from (/ 3.0 0.0) is that 0.0 is not a mathematical zero: rather, it refers to any number r where -DBL_MIN r DBL_MIN (DBL_MIN is defined in the C header float.h). Dividing by exact 0, on the other hand, clearly should throw an exception. Sounds like a good reason. For integer operations it would still have to throw an exception, because there's no such thing as an exact infinity in the numeric tower right? On Thu, Jul 15, 2010 at 12:38 AM, Peter Bex peter@xs4all.nl wrote: I don't think it's a bug to allow only integers in these operations when bignum support is enabled. It is much more likely to be a mistake than intended behaviour to call these functions with flonum args. I don't think I agree; if you do long division on paper you can get remainders from decimals, after all. I like that it works, and it made possible this: (define π (atan 0 -1)) (define 2π (* 2.0 π)) ;; Return the absolute value of the acute difference between two angles in radians. (define (abs-angle- one other) (min (abs (- one other)) (abs (- (modulo one 2π) (modulo other 2π) (which I'm not sure is the best way, I just wrote it late last night) (and that was before I googled and discovered the Douglas-Peucker line simplification algo, which is what I really want) But flonums continue to exist after you do (use numbers) so why should the behavior change suddenly? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] qt dbus eggs
On Thu, Apr 15, 2010 at 1:54 PM, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: I'm sorry I still didn't get the qt egg ported to chicken 4. It I mean the dbus egg. I didn't have anything to do with the qt egg so far. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] qt dbus eggs
On Wed, Apr 7, 2010 at 10:08 PM, Andrei Barbu and...@0xab.com wrote: I'm working on getting chicken into shape for writing applications on the Nokia N900. I've made a lot of changes to the qt egg over the past That sounds like fun! I would like to go that direction some day too, but not just yet... too much going on. I'm sorry I still didn't get the qt egg ported to chicken 4. It worked pretty well with chicken 3. (You can always downgrade to get all the eggs that haven't been ported yet. I still use chicken 3 for just that reason.) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Is there interest in a new egg (fast-io)?
On Mon, Apr 5, 2010 at 7:18 PM, Jeronimo Pellegrini j...@aleph0.info wrote: Implemented and tested: - write-fixnum, read-fixnum - write-flonum, read-flonum For those I have been making good use of the endian-port egg (not released for chicken 4 yet though); I wonder how the benchmarks would turn out, but the implementation seems like it should be fast. Sounds like you have some unique ideas for strings though. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] endian-port
I'm having trouble reading back a float from a file that I just wrote: (use endian-port) (let ([outp (port-endian-port (open-output-file eptest))]) (endian-port-write-ieee-float32 outp 5.25) (close-endian-port outp)) (let ([inp (port-endian-port (open-input-file eptest))]) (print (endian-port-read-ieee-float32 inp)) (close-endian-port inp)) it returns #f. This was with chicken 3, but I managed to compile that egg for chicken 4 as well, and it acts the same: /usr/bin/csc -feature compiling-extension -setup-mode -O2 -d0 -s -o endian-port.so endian-port.scm endian_lowio_wrap.c endian_lowio_lib.c floatformat.c endian_lowio.scm -lchicken -ldl -lm #;1 (load endian-port.so) ; loading endian-port.so ... ; loading /usr/lib64/chicken/4/iset.so ... so apparently porting that egg is going to be fairly trivial. Maybe I'll give it a shot if someone will create the directory under release/4? Functions like endian_lowio_read_int8 return by value, but endian_lowio_read_ieee_float32 set a value into a passed pointer, so wonder why that is... anyway seems to be where the problem is. Maybe it's done that way because of NaN? But usually NaN is a valid value, and can be tested for with isnan(). ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] endian-port
On Mon, Feb 22, 2010 at 8:52 PM, Ivan Raikov ivan.g.rai...@gmail.com wrote: Actually, the endian-blob egg in Chicken 4 is meant to take over the functionality of endian-port. I saw that, but wrapping a port is pretty useful actually, since endian conversions are usually relevant for I/O. It's mostly a matter of keeping some existing code that I wrote a couple years ago working, but I didn't use floats back then, and have since found a need for them... Your port of endian-port would probably have to rely on the wrappers generated by swig, which are not especially readable or maintainable. Unfortunately, I don't have Chicken 3 installed anymore, so I cannot help with this particular problem, but take a look at endian-blob and let me know if it would be suitable for your needs. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Re: endian-port
On Mon, Feb 22, 2010 at 7:34 PM, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: Functions like endian_lowio_read_int8 return by value, but endian_lowio_read_ieee_float32 set a value into a passed pointer, so wonder why that is... anyway seems to be where the problem is. Maybe it's done that way because of NaN? But usually NaN is a valid value, and can be tested for with isnan(). And indeed it seems to work OK if I make those functions return double, just as the integer ones return ints/longs. I can still store a +nan.0 into a file, and read it back successfully. I regenerated the swig interface too. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] tinyclos
On Tue, May 26, 2009 at 4:04 AM, felix winkelmannbunny...@gmail.com wrote: I have imported an initial try at porting tinyclos to chicken 4 in release/3/tinyclos/trunk. Running tinyclos-examples.scm gives me an error though, so I think something is not working correctly. BTW the module declaration omits the class-name procedure. For my usage of tinyclos in the dscm project, it basically seems to work now (after fixing class-name). The error with tinyclos-examples.scm is still there, but at least I don't run into it in other contexts. :-) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Clojure
On Thu, Jul 2, 2009 at 1:12 PM, billramsa...@comcast.net wrote: I'm curious. Has anyone in the Chicken community looked at Clojure - the new Lisp-like language that ties in to the JVM? I spent some time with it last week and found it not quite ready for prime time. (I think it's more Java than Lisp) It got me thinking, however. Java is a complex abomination, but it does have one thing in it's favor - the JVM and the endless libraries you'll find there. Whenever I tell people how great Chicken Scheme is they always If you want real Scheme (rather than just lisp-like) you could try Kawa. I have not tried either one, though. It's allegedly possible to compile Kawa with gcj. Would be interesting to have the best of all 3 worlds - some compiled code for speed, plus a VM for compatibility with Java class files you might want to re-use, plus a Scheme interpreter. But no idea if it's practical, not having tried it... ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] tinyclos
On Tue, May 26, 2009 at 4:04 AM, felix winkelmann bunny...@gmail.com wrote: I have imported an initial try at porting tinyclos to chicken 4 in release/3/tinyclos/trunk. Running tinyclos-examples.scm gives I think you meant release/4/tinyclos/trunk 2009/5/26 Peter Bex peter@xs4all.nl: I had a quick look, and I'm embarassed to say I ran into this problem before but forgot to report it. The (define-syntax (foo ...) ..) form doesn't work. Change every occurrence of that to (define-syntax foo (lambda (...) ..) and you'll get further. I attached a patch that does exactly that. Look at the generated import.scm file; it looks like er-macro-transformer is renamed. This would be correct, except that er-macro-transformer is treated specially I think? (in that it is treated more like a magic symbol rather than an actual procedure that is named er-macro-transformer) The patch itself doesn't fix the error when running tinyclos-examples.scm, but so far I don't understand what's wrong either. Error: call-next-method: no methods left: #procedure (f_3870 . args725) Making no methods left in call-next-method to be nonfatal (printf instead of throwing an exception), results in something else: add-global-method #unbound value initialize (#class pos #class top) #procedure (? call-next-method pos initargs) initialize call-next-method call-next-method: no methods left initialize call-next-method call-next-method: no methods left call-next-method: no methods left add-global-method #unbound value pos-x (#class #unspecified) #procedure (? call-next-method pos) call-next-method: no methods left call-next-method: no methods left Error: (length) bad argument type - not a proper list: #unspecified Call history: syntax(quote y) eval (vector (quote x)) eval (vector (quote y)) eval (make class (quote name) (quote pos) (quote direct-supers) (list object) (quote direct-slots) ... eval (list object) eval (list x y) eval (tinyclos#add-global-method (##core#global-ref pos-x) (quote pos-x) (#%list pos) (lambda51 (call-n.. eval (#%list pos) -- ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Still having problems with threading
On Sun, Apr 26, 2009 at 7:54 AM, William Ramsay ramsa...@comcast.net wrote: Basically, what I want to do is interrupt the thread with a key stroke. While the thread is doing it's thing - let's say printing a count to standard out - I want to be able to hit a key and stop it. I guess the problem I'm having trouble understanding is how I switch between the primordial thread (t0) and the one I've started (t1). If t1 is in a loop that that checks if it should keep going (i.e. the count example in SRFI-18) how do I insert into that loop a check for what t0 is doing - or better, how do I allow t0 to do anything? It's one thing to say add to counterA and then add to counterB, one of which is in thread 0 and the other of which is in t1. It's another thing to pick up an interrupt (i.e. a key stroke) that may come at any time. A counter is not in a thread. Either thread can write to the same word in memory, and that's a good way to communicate between threads. It's the non-atomic stuff (like larger blocks of memory being updated) that you have to watch out for: have to make it transactional. But reading from the keyboard involves a system call: ask the OS to do it, and then literally sit and wait until the OS gives you a response. The trouble with the Chicken thread implementation is that if one thread does blocking I/O, all threads will be blocked. So you just have to do non-blocking I/O: check to see if there is a keystroke but don't wait for one, in your example. t0 can set! a variable to which t1 has access when the keystroke is detected, and then t1 can stop next time it checks that variable. My way (one of them) was to write a C function to do the polling (all of /dev/input/event*), and call it from a Scheme event loop in the primordial thread. I used select() though, which blocks for a short time. chicken has an internal select() too, and there is a way to add your own file descriptors to the list that select() is waiting for, so in theory you can use blocking I/O on those descriptors, but I didn't do it that way for some reason... forgot why. http://dscm.svn.sourceforge.net/viewvc/dscm/src/dsinp/evdev.c?view=markup There is one loophole for blocking I/O: TCP socket operations do not block threads. So, another alternative is to move your blocking I/O into a separate process, and the main chicken process can start a thread which uses TCP to connect to that process and request the blocking I/O to be done on its behalf. You can use a thread which blocks while waiting for the response from that socket, and it will not block the rest of the threads. So I experimented with handling input events that way (made a sort of input server), but I got some latency, more than I expected, which was tolerable for the keyboard but quite noticeable for touchscreen events. I didn't figure out where exactly the overhead is, seems like it may be taking longer to construct the event objects than to receive them. My goal was to use the same API for reading from local (/dev/input nodes right in the main program), remote input devices (connect via socket to the input server), and X11 or other window-system input devices too. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] egg path?
With Chicken 3, (use egg) can load a compiled egg.so in the cwd. This is especially handy during egg development - you can compile and test repeatedly without having to install. Chicken 4 doesn't seem to do that. Is there some concept of an egg path, where it will look for the library? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] egg path?
On Thu, Apr 16, 2009 at 2:15 AM, felix winkelmann bunny...@gmail.com wrote: On Thu, Apr 16, 2009 at 9:40 AM, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: With Chicken 3, (use egg) can load a compiled egg.so in the cwd. This is especially handy during egg development - you can compile and test repeatedly without having to install. Chicken 4 doesn't seem to do that. Is there some concept of an egg path, where it will look for the library? `use' also does an `import', so you probably should use `require-library' or `require', unless your compiled file also contains a module definition. Loading from the cwd should still work. See also `repository-path' in the manual. You're right, it's the import in that case. As part of the egg porting I should switch to the module system anyway, I guess, since this egg has a dbus: prefix on everything. Currently it has (declare (export ...)) And then (use dbus) will work, right? #;1 (use dbus) Error: (import) during expansion of (import ...) - cannot import from undefined module: dbus Call history: syntax(use dbus) syntax(##core#require-extension (dbus) #t) syntax(begin (begin (##sys#require (quote dbus)) (import dbus)) (##core#undefined)) syntax(begin (##sys#require (quote dbus)) (import dbus)) syntax(##sys#require (quote dbus)) syntax(quote dbus) syntax(import dbus) -- #;1 (require dbus) ; loading ./dbus.so ... Error: unbound variable: dbus:vtable Call history: eval (require dbus) ##sys#peek-c-string dbus.scm: 78 max dbus.scm: 164 make-vector dbus.scm: 165 make-vector dbus.scm: 166 make-vector dbus.scm: 175 gensym dbus.scm: 573 dbus:vtable -- #;1 (require-library dbus) Error: invalid extension specifier: dbus Call history: syntax(require-library dbus) syntax(##core#require-extension (dbus) #f) -- #;1 (require-library dbus) ; loading ./dbus.so ... Segmentation fault (the segfault doesn't occur if I try it from a fresh csi instance though) dbus:vtable is like this: (define-foreign-record (dbus:vtable struct DBusObjectPathVTable) (constructor: dbus:make-vtable-impl) (destructor: dbus:free-vtable) (c-pointer unregister_function) (c-pointer message_function) (c-pointer dbus_internal_pad1) (c-pointer dbus_internal_pad2) (c-pointer dbus_internal_pad3) (c-pointer dbus_internal_pad4)) BTW apparently I still have to ask for my egg dirs to be created in svn under release/4? If so, please create the ones for dbus and gps. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] egg path?
On Thu, Apr 16, 2009 at 11:09 AM, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: #;1 (use dbus) Error: (import) during expansion of (import ...) - cannot import from undefined module: dbus It didn't say ; loading ./dbus.so ... though, which is why I don't think it did. #;1 (use dbus) ... #;1 dbus:send Error: unbound variable: dbus:send #;1 (require-library dbus) ; loading ./dbus.so ... Error: unbound variable: dbus:vtable #;1 dbus:send #procedure (dbus:send context832 name833 . params834) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Dumbass newbie questions. Sorry.
2009/4/16 Neil Baylis neil.bay...@gmail.com: Re processes/pipes, I had found those by looking in the manual, but am not yet sharp enough in scheme to understand them. It looks as though (process...) is what I need, but I'm not sure how to use it. It will give you ports for stdin/stdout. e.g. (example to ssh to a server, start a process and interact with it): (let-values ([(recv-port send-port connppid) (process ssh rutle...@neutron \cd prj/dscm/services; ./x10-wish\)]) ... then you can send and receive stuff, e.g. (display hey there send-port) and (let ([response (read recv-port)]) ... figure out what to do with it ...) This chapter provides a starting overview of I/O in Scheme in general (not Chicken-specific): http://www.scheme.com/tspl3/io.html ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] IPhone
No but I'm interested in trying to do that. The first issue I can think of, is can you distribute shared libraries with an iphone app? Maybe it has to be statically linked. Of course on a jailbroken one you could do anything. :-) 2009/4/9 lowly coder lowlyco...@huoyanjinjing.com: Has anyone managed to write an iphone app using chicken? The closest I can find is: http://chicken.wiki.br/cocoa opengl ... and as a wimp, I thought I'd first see if some courageous coder has already mapped out the territory. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] mac os x and cflags
On Wed, Mar 25, 2009 at 3:25 AM, felix winkelmann bunny...@gmail.com wrote: Alex reported that architecture-specific compiler options don't seem to be passed by csc on Mac OS X. I massages Makefile.macosx a bit, but can not test it right now (and could only try the default ppc build, anyway). So if a Mac OS user would try it out, I'd appreciate it (the order in which settings are overridden in Makefile.PLATFORM is quite subtle). With Chicken 4 I can install eggs (ones that are ported anyway), so it looks like csc is working: [mini][01:31:50 PM] chicken-install apropos retrieving ... connecting to host chicken.kitten-technologies.co.uk, port 80 ... requesting /henrietta.cgi?name=apropos ... reading response ... HTTP/1.1 200 OK Date: Sat, 28 Mar 2009 20:49:44 GMT Server: Apache Connection: close Transfer-Encoding: chunked Content-Type: text/plain reading chunks ... reading files ... ./apropos.setup ./apropos.meta ./apropos.scm apropos located at /var/folders/6Z/6ZjoyFi1EfKyM8-B7h1zSE+++TI/-Tmp-/chicken-install-101.tmp/apropos checking dependencies for `apropos' ... installing apropos: ... changing current directory to /var/folders/6Z/6ZjoyFi1EfKyM8-B7h1zSE+++TI/-Tmp-/chicken-install-101.tmp/apropos /usr/local/bin/csi -bnq -e (require-library setup-api) -e (import setup-api) -e (extension-name-and-version '(\apropos\ \\)) /var/folders/6Z/6ZjoyFi1EfKyM8-B7h1zSE+++TI/-Tmp-/chicken-install-101.tmp/apropos/apropos.setup /usr/local/bin/csc -feature compiling-extension apropos.scm -shared -optimize-level 2 -debug-level 1 -output-file apropos.so -emit-import-library apropos /usr/local/bin/csc -feature compiling-extension apropos.import.scm -shared -optimize-level 3 -debug-level 0 -output-file apropos.import.so rm -fr /usr/local/lib/chicken/4/apropos.so cp -r apropos.so /usr/local/lib/chicken/4/apropos.so chmod a+r /usr/local/lib/chicken/4/apropos.so rm -fr /usr/local/lib/chicken/4/apropos.import.so cp -r apropos.import.so /usr/local/lib/chicken/4/apropos.import.so chmod a+r /usr/local/lib/chicken/4/apropos.import.so * Installing documentation files in /usr/local/share/chicken/doc: Warning: file does not exist: apropos.html chmod a+r /usr/local/lib/chicken/4/apropos.setup-info but maybe you were asking about Chicken 3? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] testing release candidate for 4.0.0
I'm trying it on the Mac (Leopard): /tmp [mini][12:18:32 AM] chicken-setup tinyclos dyld: lazy symbol binding failed: Symbol not found: _C_match_toplevel Referenced from: /usr/local/bin/chicken-setup Expected in: /usr/local/lib/libchicken.dylib dyld: Symbol not found: _C_match_toplevel Referenced from: /usr/local/bin/chicken-setup Expected in: /usr/local/lib/libchicken.dylib Trace/BPT trap csi works OK though. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] testing release candidate for 4.0.0
On Sat, Mar 28, 2009 at 2:02 AM, Jim Ursetto zbignie...@gmail.com wrote: chicken-setup doesn't exist in Chicken 4 (it's called chicken-install now), and tinyclos isn't packaged for Chicken 4 anyway. Oh that would be why then. What's it going to take to get tinyclos on Chicken 4? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Optimal C
I was also thinking of trying to do some Scheme on the iphone some day, but didn't realize they had disallowed GC. Meanwhile you can just jailbreak it and not worry about their GC restrictions. :-) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] handle unbound variable exception for undefined procedures?
On Thu, Jan 8, 2009 at 2:56 AM, felix winkelmann bunny...@gmail.com wrote: ##sys#unbound-in-eval is only for error-reporting - it records unbound variable while preparing s-expression for interpretation, so it has no direct relation to the unbound-variable-value thing. I understand, but as it turns out, it's basically the same question as this old one (which I found when I tried googling): On Sat, Jan 28, 2006 at 2:43 PM, Arto Bendiken arto.bendi...@gmail.com wrote: Hi, Since it seems possible to set the value of `##sys#unbound-variable-value-hook' to a procedure, I was trying to do the following: ;;; dynamic c*r handler (unbound-variable-value (lambda (list) ; how to find out the symbol by which we ended up here? ...)) (cadadar a-list-of-lists) I found a similar question in the mailing list archives, relating to an attempt to use `invalid-procedure-call-handler' for this purpose, followed by a suggestion by Felix to use `unbound-variable-value' instead: http://lists.gnu.org/archive/html/chicken-users/2005-03/msg00044.html However, presumably there must be some way for the hook procedure to decide whether to perform, say, a `cadadar' operation instead of a `cadddar', but I haven't managed to figure it out. I looked at the variables beginning with ##sys... to see if there was some global I could peruse in the handler, and skimmed through the relevant portions of runtime.c for Chicken 2.2, but no luck so far. Suggestions, or a no, not possible, appreciated :-) On Sun, Jan 29, 2006 at 10:11 PM, felix winkelmann bunny...@gmail.com wrote: Unfortunately this is currently not possible. I could come up with a C-based solution, but the retrieval (and check) of a toplevel variable is not done in a context that allows calling a user-supplied Scheme procedure. That said, with some minor modifications it is possible to code this in C, but callbacks into Scheme are not possible, so it's use may be somewhat awkward. I still think this would be a really cool feature to have. It seems natural in such a dynamic language, that when catching an unbound symbol, one should be able to figure out what it ought to have been bound to, bind it and continue as if nothing happened. But in the meantime I'll have to try to architect my code so I can avoid having to ask that question is this unbound variable actually a generic function which is bound to an applicable method on the connected client? In the context in which it comes up, so far the solution is to just pre-define those methods. At least, I can handle setting variables on proxy objects transparently. I have been using = as shorthand for slot-set! (this idea came from MODDS) and so I just defined = as a generic function, so if the object is a proxy it sends an equivalent (= ...) expression across the link, and if the object is a local one it calls slot-set! I just wish I could do the same thing for any kind of method, but I can do it if I pre-define each method that can apply to a proxy object. (And there is still the question of whether using proxy objects is a good idea at all.) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] handle unbound variable exception for undefined procedures?
On 1/6/09, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: Now by reading the source I've discovered ##sys#unbound-in-eval. I guess I can get the unbound variable name from there (and expect it to break some day) unless somebody has a better idea... But ##sys#unbound-in-eval is defined only when eval'ing, not for compiled code, and not even when I put the test code into a file and csi file.scm. (use lolevel) (define (handler . args) (printf something called with ~a; unbound ~a~% args ##sys#unbound-in-eval)) (unbound-variable-value handler) (x 3) (x y 3 6) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] handle unbound variable exception for undefined procedures?
On 12/24/08, Kon Lovett klov...@pacbell.net wrote: Have you looked in Unit lolevel at 'set-invalid-procedure-call-handler!' 'unbound-variable-value'? These, plus perhaps 'object-become', might be useful. #;1 (use lolevel) ; loading library lolevel ... #;2 (unbound-variable-value 'unbound) #(unbound) #;3 (set-invalid-procedure-call-handler! (lambda (p as) (print No Such Procedure: p , Called With: as) 'bar)) #procedure (##sys#invalid-procedure-call-hook . args1208) #;6 (x foo) No Such Procedure: unbound, Called With: (foo) Warning: the following toplevel variables are referenced but unbound: x bar #;7 (enable-warnings #f) #f #;8 (x foo) No Such Procedure: unbound, Called With: (foo) bar Thanks very much, I did not know about these features. However the trouble is that the name of the unbound variable (the name of the function that was to be called) is still lost, even though the warning prints it out. I don't think I'm following what you were thinking about object-become. The unbound warning is a problem. I dislike turning off such a system just for a single annoyance. Yes. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] handle unbound variable exception for undefined procedures?
On 12/24/08, Peter Bex peter@xs4all.nl wrote: On Wed, Dec 24, 2008 at 11:53:15AM +0100, Tobia Conforto wrote: Mind you, this is the simplest implementation possible, without inheritance, polymorphism or anything useful. But if you find (or write) a full-fledged object system that works like this (probably based on table lookup instead of static pattern matching) then you will have no trouble adding a handler for unknown methods that fetches the definitions on the fly. One such object system is Prometheus, for which there's a Chicken egg. It has a message-not-understood message, which is sent to the object when the object nor any of its prototypes know of the message. Thanks for the suggestion, but I'm not feeling too keen on switching object systems just for this. I think I like the generic function concept (put the verb first, just as you always do in an expression to be evaluated). ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] handle unbound variable exception for undefined procedures?
On 1/5/09, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: However the trouble is that the name of the unbound variable (the name of the function that was to be called) is still lost, even though the warning prints it out. Now by reading the source I've discovered ##sys#unbound-in-eval. I guess I can get the unbound variable name from there (and expect it to break some day) unless somebody has a better idea... ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] handle unbound variable exception for undefined procedures?
This is probably a pretty far-out idea but I wonder if it's possible. I'm working on the concept of proxy objects representing remote tinyclos objects. After figuring out how to create the proxy when one side attempts to send an object to the other side, next problem is how to arrange for all relevant generic functions to be implemented for the proxies, to send the remote method invocation. I can have the receiver find out what methods are implemented for a given class, the first time it notices that the class exists, but then methods could still be added later. It would be cool if the proxy method implementations could be defined on an as-needed basis. Suppose r is a proxy object and bangarang is a method defined on the other side of the link: (handle-exceptions exn (begin (display Went wrong: ) (display ((condition-property-accessor 'exn 'message) exn)) (newline)) (bangarang r)) Went wrong: unbound variable Warning: the following toplevel variables are referenced but unbound: bangarang I could catch the unbound variable exception specifically right? but I guess it would involve a string compare (string=? ((condition-property-accessor 'exn 'message) exn) unbound variable) which is not efficient. And then what? All error-exceptions (of the kind exn) are non-continuable. I'd be wanting to do another remote query to confirm that the unbound symbol is really an applicable method, bind it locally to a procedure that will call the remote method, and then call it again with the same arguments. Next time that same method is called, it's already bound, so this exception-catching only happens once, and would be a way to achieve the lazy binding. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] How to compile Chicken 4 from svn?
On Fri, Dec 12, 2008 at 1:11 AM, felix winkelmann bunny...@gmail.com wrote: $ make PLATFORM=linux CHICKEN=chicken-boot Unless . is in your path I think it should be make PLATFORM=linux CHICKEN=./chicken-boot Later I'm getting this: ./chicken-boot setup-download.scm -no-trace -optimize-level 2 -include-path . -include-path ./ -feature chicken-compile-shared -dynamic -emit-import-library setup-download \ -ignore-repository -output-file setup-download.c Warning: extension `setup-api' is currently not installed Syntax error: import can not import from undefined module setup-api Expansion history: eval (##sys#cons (quote23 let-string-start+end) (##sys#cons (quote23 ()) (##sys#cons (##sys#er-transforme.. eval (##sys#cons (quote23 ()) (##sys#cons (##sys#er-transformer (lambda (form r c) (##sys#check-syntax (q.. eval (##sys#cons (##sys#er-transformer (lambda (form r c) (##sys#check-syntax (quote let-string-start+end.. eval (##sys#er-transformer (lambda (form r c) (##sys#check-syntax (quote let-string-start+end) form (quot.. syntax(##sys#register-primitive-module (quote files) (quote (delete-file* file-copy file-move make-pathnam.. syntax(quote files) syntax(quote (delete-file* file-copy file-move make-pathname directory-null? make-absolute-pathname create.. eval (##sys#register-primitive-module (quote files) (quote (delete-file* file-copy file-move make-pathnam.. -- make[1]: *** [setup-download.c] Error 70 make[1]: Leaving directory `/home/rutledge/src/chicken/trunk' make: *** [all] Error 2 ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] replacing the write function
I'm working on Display Scheme some more, trying to get the client/server aspect functional (as opposed to just [EMAIL PROTECTED] around with graphics stuff). So far I have a client which connects via ssh to a server machine and runs a service. The service (a conveniently small test application) enumerates some X10 devices (remote-controlled light switches) and builds up an s-expression to create a group, and inside a button for each switch, then sends this code across to the client. The problem is what the client should send back: each button that it creates is a tinyclos object. The server needs to be able to asynchronously update the state of the button when the light switch is turned on or off from somewhere else. (This is the reason I have probably ruled out using the remote-repl egg: it's a very synchronous implementation, like what they call REST in the web development world.) So the client needs to either send back a widget ID of some sort (which I don't like very much, because a lot of things can come back, and the widget ID would have to be tested for), or what I'm leaning towards is for it to send back code which when eval'd, will create a proxy object on the server side (and the proxy encapsulates the widget ID or whatever, so this concept can evolve without changing the server-side program). Well actually... the (send ...) function will return a promise, which when forced, will yield whatever it was the client sent back. This is how I plan to keep the protocol asynchronous: the result of each evaluation can be pipelined, sent back lazily, and then used later on if/when it is needed. There will have to be request IDs and matching response IDs, I guess. Anyway, I need to detect that we are about to send a tinyclos object, and instead send the s-expression which when eval'd, will create the proxy for it instead. I wish I didn't have to re-invent the write function to do that; I was hoping I could save off a pointer to it, create a new-write function, then (environment-set! env 'write new-write) on an environment in which the display scheme program (either server-side or client-side) is to run, but I'm not having much luck with that. It is supposed to be possible, right? So here's the version of send which works, but is a bit tedious (and missing many more possible object types that will need to be handled specially): (define (make-send write-fn) (lambda (o) (let send ([o o]) (cond [(instance? o) (send 1) ;; todo: code to create the proxy object ] [(string? o) (write-fn (format ~s o))] [(pair? o) (write-fn () (if (list? o) (for-each (lambda (o) (send o) (write-fn )) o) (begin (send (car o)) (write-fn . ) (send (cdr o (write-fn ))] [(eq? o (void)) (write-fn (void))] [else (write-fn o)] (define send (make-send (lambda (o) (logprint (format - send ~s o)) (display o send-port) (flush-output send-port What am I missing here? Could I actually replace write with a slightly customized version, just in the context of an environment, without having to re-create it from scratch? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] s11n and tinyclos
On 10/29/08, felix winkelmann [EMAIL PROTECTED] wrote: This means that no entry is stored in the local procedure table. What's the output of chicken -version? Does it show ptables? Sorry I didn't get back to you sooner... Yes it has ptables. [neutron][12:08:00 AM] chicken -version CHICKEN (c)2008 The Chicken Team (c)2000-2007 Felix L. Winkelmann Version 3.4.0 - linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables applyhook hostpcre ] SVN rev. 11987 compiled 2008-10-23 on neutron (Linux) I get the same result on a 32-bit machine too. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Qt egg
On Sat, Nov 1, 2008 at 5:32 PM, Vincent Manis [EMAIL PROTECTED] wrote: On 2008-Nov-1, at 01:39, Shawn Rutledge wrote: Did you succeed yet? I just got around to trying this. qt.setup only uses QTDIR to find qmake, so you can set QTDIR to /usr. But the next problem is that qmake generates an XCode project rather than a Makefile. Actually, I made no progress with it, as I put that project on the back burner, and if I do go back to it, I'm likely to do it on Linux rather than OSX. However, it would still be nice to have a recipe to give to everyone :-) I just got it to build: 1) export QTDIR=/usr 2) export QMAKESPEC=macx-g++ (to get a Makefile rather than XCode project) 3) tar zxvf qt.egg and modify the last line of qt.pro like this: QT+=opengl xml 4) chicken-setup Felix - I think maybe you don't need to depend on QTDIR at all; it's probably OK to require that qmake be in the user's path. For anyone who's doing Qt development, it would tend to be. There is not always a top level Qt directory - in fact I consider that to be poor system integration, which the Qt install process gives you by default when you build it from source (installing _everything_ to /usr/local/Trolltech does not conform to any system standard... besides what are they going to do, change it to /usr/local/Nokia now? But at least you can change it when you run configure.) When installed via the gentoo ebuild, or when you install the Qt binary package on MacOS, qmake is in /usr/bin, as it should be IMO. Adding xml fixed a bunch of linker errors. The Qt binaries came from here: ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.4.3.dmg I'll make a note on the wiki about the QMAKESPEC. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Qt egg
As for running it, there are some problems too: [mini][11:48:58 PM] ChickenQt.app/Contents/MacOS/ChickenQt Error: unbound variable: qt The hello world app has (use qt utils), and asking for qt isn't necessary... so by taking it out I can get it to run. But if I try to run the egg-browser demo, after changing the (use... ) line to (require 'posix 'regex 'utils) I get this: [mini][11:54:43 PM] ChickenQt.app/Contents/MacOS/ChickenQt Error: unbound variable: Call history: eval [refresh] (map pathname-file (glob (make-pathname (repository-path) *.setup-info))) eval [refresh] (glob (make-pathname (repository-path) *.setup-info)) eval [refresh] (make-pathname (repository-path) *.setup-info) eval [refresh] (repository-path) eval [refresh] (qt:clear *list*) eval [refresh] (qt:clear *props*) eval [refresh] (for-each (cut qt:add *list* ) eggs) eval [refresh] (cut qt:add *list* )-- I assume you had some difficulty getting the qt egg to work like usual, i.e. be able to load it as a shared object? The app bundle approach could have its uses, but being able to mess around on the csi prompt would also be useful. BTW I think this egg is a great start in general. It runs fine on Linux. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Qt egg
On Sun, Nov 2, 2008 at 12:08 AM, Shawn Rutledge [EMAIL PROTECTED] wrote: As for running it, there are some problems too I forgot to mention the default init.scm gives me this error: [mini][11:26:10 PM] ChickenQt.app/Contents/MacOS/ChickenQt QWidget: Must construct a QApplication before a QPaintDevice Abort trap ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Qt egg
Did you succeed yet? I just got around to trying this. qt.setup only uses QTDIR to find qmake, so you can set QTDIR to /usr. But the next problem is that qmake generates an XCode project rather than a Makefile. On Sat, Aug 23, 2008 at 8:09 AM, Vincent Manis [EMAIL PROTECTED] wrote: Can someone walk me through the installation of the qt egg on OS X? I've installed the binary distribution from Trolltech's website (qt-mac-opensource-4.4.1.dmg). My main problem is figuring out what to set QTDIR to, as there doesn't seem to be a `Qt' directory as such. Any help would be appreciated. Thanks! -- v ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] basic Scheme question
On Fri, Oct 24, 2008 at 12:31 PM, John Cowan [EMAIL PROTECTED] wrote: Shawn Rutledge scripsit: [W]hy should I have to re-create functionality which is one of the most basic features of Scheme (being able to look up symbols and get values bound to them) Actually, it isn't: Scheme has no such facility. Symbols in Scheme have no properties except their print names. (In Chicken and Chez, but not in most other Schemes, they also have a p-list which you can exploit for the environment I mentioned in my last posting.) It's true that Scheme binds *identifiers* to values, but there is no requirement that identifiers are represented by symbols, or at all, at run time. Thanks for the explanation. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] s11n and tinyclos
On Wed, Mar 8, 2006 at 8:04 PM, Kon Lovett [EMAIL PROTECTED] wrote: On Mar 7, 2006, at 10:27 PM, felix winkelmann wrote: On 3/2/06, Simon St-Onge [EMAIL PROTECTED] wrote: Hi, I am trying to serialize/deserialize a tinyclos object using s11n: Hi, Simon! Well, looking at the dumped instance with chicken-dump appears to show something sensible, but the problem lies deeper: TinyCLOS instances contain direct references to their class, which gets serialized with the intance itself. But on deserialization, the class loses its identity, and therefore the whole class-hierarchy of a deserialized instance is invalid (we have several class or top classes in the end). TinyCLOS has no notion of a global class table, which could be used to map deserialized classes back to their canonical (i.e. system-wide) identity. So the bottom line is (currently) that instances (and thus classes) can not be reliably deserialized. Or anything that has a global identity, beyond built-in. Need some kind of '(remain object)' to designate existing root objects, i.e. objects that will exist when the de-serialization occurs. How to handle the root dependency is unspecified. That was a long time ago... now I just found myself wanting to try this too. The behavior is different: #;1 (use s11n) ; loading /usr/lib64/chicken/3/s11n.so ... #;2 (use tinyclos) ; loading /usr/lib64/chicken/3/tinyclos.scm ... ; loading /usr/lib64/chicken/3/tinyclos-base.so ... #;3 (define-class thing () (element)) #;4 (define-method (initialize (thing thing) (element top)) (slot-set! thing 'element element)) #;5 (let ((port (open-output-file ~/thing.txt)) (thing (make thing allo))) (serialize thing port) (close-output-port port)) Error: (serialize) unable to serialize object - unable to serialize procedure (no table entry found): #procedure (f_5740) Call history: syntax(serialize thing port) syntax(close-output-port port) syntax(open-output-file ~/thing.txt) syntax(make thing allo) eval (open-output-file ~/thing.txt) eval (make thing allo) eval [initialize] (slot-set! thing (quote element) element) eval (serialize thing port) -- #;5 #procedure (f_5740) Error: unreadable object ... #;5 #procedure C_greaterp which looks like a foreign function I guess. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] basic Scheme question
On Thu, Oct 23, 2008 at 11:44 PM, Peter Bex [EMAIL PROTECTED] wrote: On Thu, Oct 23, 2008 at 10:27:18PM -0700, Shawn Rutledge wrote: #;10 (begin (define update #f) (let ([v 'foo]) (set! update (lambda (d s) (printf ~s was ~s~% d (eval d)) (set! d s) #;11 (update 'v 'bar) Error: unbound variable: v What I'm trying to do is pass the name of a let-bound variable in to a lambda defined within the let context, in order to tell that lambda to access that let-bound variable. eval doesn't work because it looks in the outer environment, right? (in which v is not bound) Eval only sees the top-level environment. It may be possible to use the environments egg to construct your own environment containing v. I thought of that, but also thought there must be a generic Scheme way to do this. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] basic Scheme question
On Fri, Oct 24, 2008 at 1:00 AM, Drake Wilson [EMAIL PROTECTED] wrote: Quoth Shawn Rutledge [EMAIL PROTECTED], on 2008-10-23 23:54:03 -0700: Eval only sees the top-level environment. It may be possible to use the environments egg to construct your own environment containing v. I thought of that, but also thought there must be a generic Scheme way to do this. From someone with admittedly limited Scheme knowledge: The generic Scheme way wouldn't involve passing around quoted names and expecting them to retain their associations to the original lexical symbols at runtime, because they generally don't. The generic Scheme way would probably be to have a function encapsulate the idea of reading and writing the variable inside a location structure of some sort (pair of get+set function, likely) and then have the other function interact with that. Right that's the usual pattern. But I'm trying to call it remotely. A client REPL opens an SSH connection to a server and starts a server REPL. Each of them evaluates what the other sends. So if the server sends (let ([v (make-thing)]) ...) and the client evaluates it, then later the server wants to ask the client to do any operation on the previously-created v, how can the client now access the variable v, which exists only in that environment created by let? Just binding it to a top-level name would pollute the namespace. Having to bind the accessor is not so bad, because the same accessor can be used to modify multiple remote objects. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] basic Scheme question
On Fri, Oct 24, 2008 at 10:48 AM, Drake Wilson [EMAIL PROTECTED] wrote: If you mean later as in after the let, the v doesn't exist anymore. Well it's not going to be garbage-collected if an accessor is created inside the let, which can do destructive operations on it later. Here's a way to make a counter: #;1 (define (make-counter) (let ([v -1]) (lambda () (set! v (+ 1 v)) v ))) #;2 (define c (make-counter)) #;3 (c) 0 #;4 (c) 1 #;5 (c) 2 Now you cannot access v from top-level, but you can simultaneously increment and get its incremented value. The trick is that make-counter returns a function, as you suggested. I'm asking why can't you return a form of the name 'v which is valid only within the context of the let? Making an object system is related: again you have something which encapsulates data, and allows access to the data only through accessors. But often this is done using an alist. I could use an alist too, but it would be less efficient, and why should I have to re-create functionality which is one of the most basic features of Scheme (being able to look up symbols and get values bound to them) just to confine this functionality to a localized context? Oh, maybe you are right though: maybe the symbol 'v doesn't exist anymore, because in the counter example, the accessor only needs to access the number to which 'v was bound. So it can replace the symbol with a reference to the number, and therefore the symbol lookup only occurs when the lambda is eval'd (the s-expression is converted to a procedure). After the binding has been converted to a reference, the symbol 'v cannot be looked up anymore. Does that sound right? I suspect what you're looking for is something to the effect of thunking references between the sides, now; something that would let you do (let ((v (client-do (make-thing ;; Now v contains a token to an object on the other side. The entire let block runs on the other side. The server does not need the object that was created on the client, it just needs a kind of remote reference or name that can be used to refer to that object. But, the concept of requiring the server to make up names in order to be able to access remote objects after having created them may turn out to be cumbersome, so I was thinking about serializable proxy objects. There could be a special writer which converts object references into these proxies. The client's REPL uses this writer for its output, so when the server asks the client for a primitive it is sent across, but when the server asks to eval something which returns a non-immediate, it gets back a proxy instead. That provoked further thought: the direction this is heading is that destructive operations are to be preferred over pure functional operations. So maybe it's the wrong pattern: I was already familiar with the concept of a proxy object, but there must be a more suitable pattern for functional programming, so that one side can ask the other to do functional operations on its behalf without having to always send the results across the link. Maybe the thing which is sent across could be a kind of promise, a way to delay the sending of results, to keep the results encapsulated on the opposite side as long as possible until you actually need them to be returned. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] basic Scheme question
#;10 (begin (define update #f) (let ([v 'foo]) (set! update (lambda (d s) (printf ~s was ~s~% d (eval d)) (set! d s) #;11 (update 'v 'bar) Error: unbound variable: v What I'm trying to do is pass the name of a let-bound variable in to a lambda defined within the let context, in order to tell that lambda to access that let-bound variable. eval doesn't work because it looks in the outer environment, right? (in which v is not bound) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] TCP and threads again
Experience confirms the unit TCP documentation which says that those TCP socket operations do not block SRFI-18 threads, but what about socket operations that occur via C code? It would seem that they do block threads. I just ran into this when I tried to use my gps egg (under development), which uses libgps to connect to gpsd, in an application that has a UI. After the SRFI-18 thread which polls for GPS messages gets started, the UI event loop never even gets a chance to start. Makes me think the Chicken socket implementation must be doing something special, not to block the threads. Am I going to run into the same thing with dbus? I could use gypsy rather than gpsd (because it has a dbus interface), but dbus comms are also done with sockets. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Re: TCP and threads again
Fortunately libgps gives me access to the FD so I was able to get around it with thread-wait-for-i/o! this time. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: An alternative thread system?
I'm inclined to agree with the argument that as long as forking has a low enough overhead, processes are better than threads for general-purpose parallelism. Especially considering that if you are using memory to share state between threads, you will always be limited to a shared-memory architecture - you cannot move the program unmodified onto a cluster. But there is more data-copying involved with message-passing, compared to just accessing the same memory. Safety and portability have their price. However what about the case where there is a UI event loop and the same program also has to poll one or more event sources, such as dbus, or a socket or a pipe, for output from one of those helper processes that you redesigned to be a process rather than a thread? In C your main choices are to use select() to wait for an event from any of those sources (only as long as your program has nothing else to do while it's waiting, and as long as you can gather all the file descriptors into one list to be able to use select), or use non-blocking I/O and poll each source manually, or use threads to pretend that you can poll everything in parallel. In the dbus egg I use a polling thread (a Chicken thread not a native one). This hides the complexity nicely: the user of the egg does not need to care about polling, it appears instead that the appropriate callback function can be called spontaneously when a DBus event occurs. If I wish to preserve that interface, do I really have any choice other than threads? Maybe Chicken could have a higher level abstraction for callbacks. It would then have the choice of using either select() or threads under the covers. A long time ago (when working at my first software job, which happened to be on OS/2) it struck me that it's too bad events which originate from hardware often have to be polled in software. E.g. a UART generates an interrupt when a character is received; the OS handles it and puts the character in a buffer, and the application must poll the buffer to see when there is data available. Maybe the OS could tell the interested application each time a character is received (and still do the buffering, in case the app doesn't want to handle each character one-at-a-time). Of course it works well enough, it's just a philosophical thing. (And maybe in fact when using select(), maybe breaking out of this blocking call is in fact triggered directly by the interrupt?) So I guess I'm thinking along the same lines about callbacks in general: tell me when X happens should not have to mean waste a bunch of cycles polling until X happens and then call me. But as long as polling threads are the only practical way to do callbacks, there is no chance to even try to do an optimization like that. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: An alternative thread system?
On Mon, Aug 11, 2008 at 2:39 PM, Aleksej Saushev [EMAIL PROTECTED] wrote: Your attitude to threads is just a prejudice with no support behind it. I'm not completely afraid of threads, I've used them. (Have experienced some of the usual problems with using them, too.) I'm just trying to justify to myself that maybe it's OK to live without them, since it's allegedly so daunting to get Chicken to support them in a reliable way. Most overhead originates not from fork, it comes from copying and IPC. Passing data between threads may be as simple, as assignment. Note: Of course. no context switch involved. Passing data between processes is almost always two context switches, synchronization in kernel, and copying passed data at least twice, unless you use some very system-specific hack. Sometimes you can avoid redundant copying by mmaping common file, which still brings you to shared-memory and all the stuff connected. I don't have experience with shmget() etc. but what's so terrible about it? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] return a pair of ints from a C function?
On Sat, Aug 2, 2008 at 3:20 AM, felix winkelmann [EMAIL PROTECTED] wrote: You can put a C function that looks like this into a separate file and access it with ##core#primitive: Thanks! ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] return a pair of ints from a C function?
On Thu, Jul 31, 2008 at 3:59 PM, felix winkelmann [EMAIL PROTECTED] wrote: either have to use `foreign-primitive`(to create a CPS function), or Why don't you prefer that approach? Well, the pass-the-box approach appeared simpler, but foreign-primitive is probably the cleaner approach and doesn't require you to create a wrapper function. Thanks for your help. This works: (define g2d_glyphs_baseline (foreign-primitive scheme-object ((g2d-glyph-vector glyphs)) C_word* a = C_alloc(C_SIZEOF_PAIR); return(C_pair (a, C_fix(10), C_fix(256))); )) but is there a way to do it in a C source file rather than having to write C inside quotes? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] return a pair of ints from a C function?
On Thu, Jul 31, 2008 at 12:46 AM, Ivan Raikov [EMAIL PROTECTED] wrote: To return fixnums, you can do: C_word g2d_glyphs_baseline(struct G2dGlyphs* glyphs) { C_word* a = C_alloc(C_SIZEOF_PAIR); C_return(C_pair (a, C_fix(10), C_fix(256))); } Thanks. But it appears there is the problem Felix is referring to, that it's only on the stack (although I thought that was OK for it to be on the stack): when I ran this C function from a Scheme wrapper I got (10 . #procedure) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] return a pair of ints from a C function?
OK dumb question time again: I'm trying to return a pair of fixnums from a C function. C_word g2d_glyphs_baseline(struct G2dGlyphs* glyphs) { C_word* a = C_alloc(C_SIZEOF_PAIR + 8); C_return(C_pair (a, C_int_to_num(a, 10), C_int_to_num(a, 256))); } or maybe C_word g2d_glyphs_baseline(struct G2dGlyphs* glyphs) { C_word* c_ret = C_alloc(C_SIZEOF_PAIR); C_word* a = c_ret; C_int_to_num(a, 10); C_int_to_num(a, 256); C_return(*c_ret); } to be called like this ( (foreign-lambda scheme-object g2d_glyphs_baseline g2d-glyph-vector) glyphs) It compiles and I get weird results at runtime, so obviously am not building the cons cell correctly. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] return a pair of ints from a C function?
On Thu, Jul 31, 2008 at 1:39 PM, felix winkelmann [EMAIL PROTECTED] wrote: The C_alloc is a macro that actually does alloca(), so you are allocating stack data that is not live after returning from the function. You will Hmm, I thought C_return made that OK, because it's normal for objects to live on the stack. But you are saying that's only true if I use foreign-primitive? either have to use `foreign-primitive`(to create a CPS function), or Why don't you prefer that approach? pass a pre-allocated pair (which I recommend): C_word g2d_glyphs_baseline(struct G2dGlyphs* glyphs, C_word p) { C_set_block_item(p, 0, C_fix(10)); C_set_block_item(p, 1, C_fix(256)); return p; } (completely untested) cheers, felix ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Intent To Package chicken for cygwin
On Wed, Jul 30, 2008 at 3:35 PM, Nathan Thern [EMAIL PROTECTED] wrote: I have packaged chicken as a cygwin binary package. Cygwin users can point their setup.exe to http://www.liquid.spod.org/~nthern/cygwin/ to get it. This rocks! It can even compile eggs! C:\tmpchicken-setup tinyclos The extension tinyclos does not exist. Do you want to download it ? (yes/no/abort) [yes] downloading tinyclos.egg from (www.call-with-current-continuation.org eggs/3 80) gzip -d -c /cygdrive/c/DOCUME~1/SRUTLE~1/LOCALS~1/Temp/downloads/tinyclos.egg | tar xf - /usr/bin/csc -feature compiling-extension -s -O2 -d1 tinyclos-base.scm -X private-namespace.scm -check-imports -emit-exports tinyclos.exports tinyclos-base.c:1: warning: -fPIC ignored for target (all code is position independent) chmod a+x /usr/lib/chicken chmod a+x /usr/lib/chicken/3 cp -r tinyclos.scm /usr/lib/chicken/3/tinyclos.scm chmod a+r /usr/lib/chicken/3/tinyclos.scm cp -r tinyclos-base.so /usr/lib/chicken/3/tinyclos-base.so chmod a+r /usr/lib/chicken/3/tinyclos-base.so * Installing documentation files in /usr/lib/chicken/3: cp -r tinyclos.html /usr/lib/chicken/3/tinyclos.html * Installing example files in /usr/share/chicken/examples: chmod a+x /usr/share/chicken/examples cp -r tinyclos-examples.scm /usr/share/chicken/examples/tinyclos-examples.scm chmod a+rx /usr/share/chicken/examples/tinyclos-examples.scm chmod a+r /usr/lib/chicken/3/tinyclos.setup-info rm -fr /cygdrive/c/DOCUME~1/SRUTLE~1/LOCALS~1/Temp/build.5219.tinyclos.egg-dir rm -fr /cygdrive/c/DOCUME~1/SRUTLE~1/LOCALS~1/Temp/downloads/tinyclos.egg ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Chicken packages available for OpenMoko
I managed to write a Bitbake recipe to build Chicken for OpenEmbedded-based Linux distributions. I submitted it for inclusion into the official development tree: http://bugs.openembedded.org/show_bug.cgi?id=4433 and in the meantime you can download the binary packages for the original GTA01 (Neo1973) phone here: http://ecloud.org/openmoko/chicken/ If anyone finds that they don't work on a newer Freerunner, I can probably generate separate packages for that. Next I would like to figure out how to get Bitbake to cross-compile eggs, so that I could generate IPKs for them too, but that's a bit more challenging. (I can do it manually following the wiki instructions, the question is how to get Bitbake to first generate arm-cross-chicken and then use it.) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken packages available for OpenMoko
On Mon, Jul 21, 2008 at 2:15 PM, felix winkelmann [EMAIL PROTECTED] wrote: I never used Bitbake, but are available if you have any questions, of course. I know a bit about ipk's, though (having re-implemented the ipkg tool recently). What is yours called? They are using opkg on openmoko now. It should be pretty easy generating the ipk's without bitbake, provided you have a cross-compiler. Yes I could probably do that, but long-term I think it has to be integrated into openembedded, because then it will get into the feeds for all of the openembedded platforms. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] cross-compiling version of chicken-setup (was Re: chicken-setup)
On Tue, Jul 15, 2008 at 12:11 AM, Peter Bex [EMAIL PROTECTED] wrote: I don't think this can be solved automatically (unless we want to recreate Autotools or CMake) so what is needed is a way to override or add to existing search paths by passing switches to chicken-setup, which it then can pass on to the compiler. Example: chicken-setup foo.egg -I /opt/foo/include -L /opt/foo/lib I just ran into this, so now I agree with you whole-heartedly. :-) While trying to cross-compile endian-port.egg... I found that it has #include ansidecl.h (if it was me I'd have put that in brackets to indicate that it's a system requirement rather than a local include, but anyway...) and my toolchain has ansidecl.h, but chicken-setup doesn't know to pass the extra -I option on to the cross-compiling version of csc. [proton][09:54:30 PM] DESTDIR=/opt/arm-chicken /opt/arm-cross-chicken/bin/arm-chicken-setup endian-port The extension endian-port does not exist. Do you want to download it ? (yes/no/abort) [yes] downloading endian-port.egg from (www.call-with-current-continuation.org eggs/3 80) gzip -d -c /tmp/chicken-setup-3-rutledge/downloads/endian-port.egg | tar xf - swig -chicken endian_lowio.i /opt/arm-cross-chicken/bin/arm-csc -feature compiling-extension -O2 -d0 -s -o endian-port.so -check-imports -emit-exports endian-port.exports endian-port.scm endian_lowio_wrap.c endian_lowio_lib.c floatformat.c endian_lowio.scm -lchicken -ldl -lm some warnings... In file included from endian_lowio_lib.c:41: floatformat.h:24:22: error: ansidecl.h: No such file or directory *** Shell command terminated with exit status 1: arm-angstrom-linux-gnueabi-gcc endian_lowio_lib.c -o endian_lowio_lib.o -c -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -Os -fomit-frame-pointer -fPIC -DPIC -DC_SHARED -I/opt/arm-chicken/include Error: shell invocation failed with non-zero return status /opt/arm-cross-chicken/bin/arm-csc -feature compiling-extension -O2 -d0 -s -o e... I fixed it by going into the temp directory and running arm-csc myself, with the extra -I option. Of course it would be even nicer if when setting up the cross-chicken, you could specify that it should always use the same -I, since in that case it's in the expected subdirectory relative to the toolchain: /usr/local/openmoko/arm/include Now for the next problem with this same egg: it requires eggdoc (the .meta file has (needs eggdoc ...)). I don't really want to install that on my phone. So I guess we need a way to distinguish compile-time requirements from runtime ones. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: getopt, getopt_long?
On Fri, Jul 11, 2008 at 12:24 AM, Peter Bex [EMAIL PROTECTED] wrote: I agree completely. Actually, I tend to view things in the opposite way: WTF would anyone waste time trying to keep all those packages up-to-date, if you can just install it using chicken-setup? Because building them takes time. This has been my motivation for exploring cross-compilation: on my phone it takes several hours to compile chicken, and several more hours to compile the eggs I'm using. So when I'm short on time I spend more of it upgrading than actual development. I'm hoping that when OpenMoko is auto-generating new packages, and all I have to do to make that happen is visit the recipe(s) to increment the version number(s), the packages will indeed be fairly up-to-date, and it will only take a few minutes to install them. But on a real computer maybe it's a wash. An alternative idea: chicken-setup on the target could access a cache of pre-compiled eggs, on a server somewhere. If the server doesn't have it in the cache, then either the server can cross-compile it on behalf of the target machine, or the target could compile and upload it. (that depends on whether the server has the cross-toolchain or not) If the server always compiles, then once again the target does not need to have gcc, binutils, include files, dev libs etc. installed (which takes up more space than I have flash on the phone... which is why I have to run with an SD card to hold all the extra stuff) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] chicken-setup
On Mon, Jul 14, 2008 at 6:01 PM, Ivan Raikov [EMAIL PROTECTED] wrote: The idea is basically to isolate all of the general procedures for e.g. installation and compilation, which once written would probably stay relatively unchanged, and only modify the frontend as chicken-setup policies evolve. We could also think about having different frontends, e.g. for use with different package building tools. This sounds good so far. So an egg could include a custom setup script, or else it would be auto-generated from the .meta file at installation time and therefore the egg is not required to provide it, right? On Tue, Jul 15, 2008 at 12:11 AM, Peter Bex [EMAIL PROTECTED] wrote: I don't think this can be solved automatically (unless we want to recreate Autotools or CMake) so what is needed is a way to override or add to existing search paths by passing switches to chicken-setup, which it then can pass on to the compiler. Example: chicken-setup foo.egg -I /opt/foo/include -L /opt/foo/lib That could be a last-ditch way to solve problems but I would hope most users wouldn't need to do that for most eggs. Is there anything wrong with putting extra -I's and -L's in the meta file, with some possible guesses the egg developer can think of, where a particular library or include might be located? And chicken-setup could append the usual suspects automatically, like /usr/include, /usr/local/include etc. (library foo-wrapper (version 1.4) (make (foo-wrapper.scm) (compile -O2 -d0 -s foo-wrapper.scm -L/usr/lib/foo -L/usr/include/foo -ldl -lfoo -lchicken One problem I could think of is the case where the user has multiple versions of the same library, or is cross-compiling, in which case the default paths, or the paths suggested in the meta file, could be misleading. I guess he'd have to specify the -I and -L somehow, as you suggest. If the user does that, then chicken-setup would not include the default paths, or at least would put the provided paths first. Or somehow the meta file could suggest that libfoo.so might be located in a directory called foo-1.0, somewhere, and chicken-setup could expand that to -L/usr/lib/foo-1.0 -L/usr/local/lib/foo-1.0 etc. But the ability to cross-compile eggs is something I need to test soon; sounds like it's pretty cool already. I'm working on a bitbake recipe for chicken for OpenMoko (I'm still a newbie with that) and am wondering if it's going to be possible to get bitbake to compile all the eggs too, and make ipk's for all of them, hopefully either semi-automatically or I can come up with a way to generate recipes automatically from the meta files, or something. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: Chicken-setup redesign (was: Re: [Chicken-users] Re: getopt, getopt_long?)
On Thu, Jul 10, 2008 at 3:08 PM, Elf [EMAIL PROTECTED] wrote: however, much of the actual compilation is *not* duplication, as extra bits like linked libraries need to be specified. i can draft a proposal for how to Good point (my own eggs even do that). But it still maybe wouldn't have to be a complete, exact, brittle command for compiling, and there are many eggs that don't need to link libraries too. fix things based on my own experiences both with the repo and with chicken-setup, if people are interested. Sounds good. That reminds me of a dumb question I didn't get around to asking yet - you can run chicken-setup in a way to compile an egg in-place in the current directory while you are developing it, right? rather than having to completely package it first, and without having to install it in its final location? I've been writing Makefiles for that, but figured there must be another way. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: getopt, getopt_long?
On Thu, Jul 10, 2008 at 6:26 PM, William Xu [EMAIL PROTECTED] wrote: I don't know if i understand correctly. If that means making each egg a debian package, oh Jesus!! That'll spawn many debian eggs. And considering there are that many linux distributions, it's a big burden.. not to mention non-linux platforms. There are many Debian packages though in general. This is kindof like perl modules: do you expect to have a distro package or do you want to use the perl cpan code to automatically download and install a module? Most distros actually have a bunch of popular perl modules as packages, even though that's some work for them to maintain. (But I've still had to use cpan once in a while too... and I'm not even much of a perl developer, I just have had to download prerequisites for other packages that I wanted to use, occasionally.) Obviously it needs to be automated (the process should be the same for each egg, so that it can be automated), but actually getting it done could be the work of some interested Debian developer, rather than someone who thinks of it as a drudgery (which would be most people, I would think). Worse, on Debian and OpenMoko they like to have, in addition to the main binary package, a separate -dev package which has the headers, static libs and other stuff necessary for developing with the package, and a -doc package. Doing that for each egg seems like a lot of work too. But on a cell phone you don't want to install any more than you must, depending on what your interest is, to save space. I'm not sure if Debian people will mind if an egg also includes its docs though. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Anyone up for porting Termite to Chicken?
On Tue, May 20, 2008 at 5:22 PM, Ivan Raikov [EMAIL PROTECTED] wrote: Well, of course, it is possible to implement anything in a Turing-equivalent language, but I am curious what features of Erlang or Termite are difficult to implement with MPI primitives and Scheme. For example, process migration in Scheme MPI could be simply passing a continuation from one node to another -- something that would take one line of code using the s11n and mpi eggs in Chicken. My I'm curious what one line of code you would write. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] chicken-wrap segfault; GPS egg
On Fri, May 9, 2008 at 5:09 AM, felix winkelmann [EMAIL PROTECTED] wrote: Once again, I'm unable to reproduce this. If you are using the trunk of the gps egg, it's not reproduceable anymore. You'd have to check out the first version of each file in the trunk rather than the latest ones. Can you send me the output of chicken-setup -l ? I can do that tonight if I remember, but I've since upgraded to chicken 3.2 on that machine, so I'll have to check whether I can still reproduce that bug. :-) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken OSless
On Thu, May 8, 2008 at 5:27 PM, Pierre-Alexandre Fournier [EMAIL PROTECTED] wrote: Marc Feeley and Danny Dubé wrote a Scheme for a PIC microcontroller with 2K of RAM a couple years ago (PICBIT). http://w3.ift.ulaval.ca/~dadub100/files/picbit.pdf It's not Chicken, but it may inspire you to make something similar with Chicken. Oh that sounds interesting. I googled some more and also found these http://www.esden.net/blog/2006/07/15/lisp-in-todays-embedded-world-investigation/ http://hedgehog.oliotalo.fi/ ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken OSless
On Thu, May 1, 2008 at 10:00 AM, John Van Enk [EMAIL PROTECTED] wrote: I'm curious whether or not there's been work on running Chicken's binaries on a OSless piece of hardware. I've been trying to convince my boss that it would be worth while investigating dynamic languages for embedded systems. I never tried but wondered about it too. I was thinking it would be very hard to use Scheme on a Harvard-architecture chip like an Atmel. There could be an interpreter, but anything new you define would have to go in SRAM (all 4K of it, in the case of the ATmega's). You cannot execute machine instructions out of SRAM, and you cannot write new instructions to the Flash at runtime, so the only choice would be to interpret some kind of VM instructions that are stored in SRAM, or interpret Scheme directly, or some kind of tokenized representation. And what about having a combined RAM/ROM symbol table? The approach for handling them would be completely different between the two, but you would want them to appear to work the same. But it might just barely be possible if all the libraries you could possibly want are precompiled and stored in Flash, and only a small script is executed out of SRAM at runtime. Seems insane anyway, though. On an ARM with enough RAM it would be OK though. You could start with TinyScheme; it's so small and simple (purely an interpreter) and the code is relatively easy to read. Compiling on a system without an OS would be rather challenging. :-) If you had a direct Scheme-to-Arm compiler (like Chez) it might make more sense. It would probably be faster and save memory to compile first and then throw away the source code, rather than interpreting at all. But I'm thinking of the use case where the embedded system is on a network and you connect and feed it some S-expressions to evaluate. For a standalone fixed-purpose system though, if you can compile the whole program ahead of time, there are big chunks of implementation that you don't need anymore, right? It's just static (unchanging) machine code being executed, like any other microcontroller program except less efficient. :-) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken Logo
On Sat, Apr 19, 2008 at 3:50 PM, Joshua Griffith [EMAIL PROTECTED] wrote: It turns out that gradient meshes are not supported in SVG and that screen blend filters look different. Therefore I greatly simplified the file, replacing the gradient mesh with a simple gradient and replacing the screen blending with normal blending. I took a look at it in Inkscape and it appears to be rendering properly. Makes sense. Anyway I agree, these look really good. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken Logo
On Sat, Apr 19, 2008 at 7:00 AM, Joshua Griffith [EMAIL PROTECTED] wrote: Some SVG viewers do not render the top screen layer properly on the web 2.0-style image (instead, they treat it like a normal blend layer). It looks like Illustrator exported the orange-brownish layer as an image, png, 91x91, with jagged edges. The SVG would look better if it didn't do that. (I'm looking at it with Inkscape.) Anyway the rendered logos look awesome! ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] chicken-wrap segfault; GPS egg
I'm trying to get started with libgps/gpsd again, since the DBus support that gpsd provides is quite minimal (satellite fixes are broadcast, and that's it... nothing about which satellites are in view, and no methods to query anything. And to me the fix messages look incomplete, too.) So I'm attempting to use chicken-wrap to generate the wrapping for the big structs that libgps provides. I had to simplify them to get that far... there is a big union/struct monstrosity right in the middle of one struct, which the easyffi parser can't handle, so I wrote a C program to print out the sizeof that union. In the simplified version of gps.h that I wrote for easyffi, it's now just an array of 900 bytes instead, and fortunately I might not need any of the data from there anyway: it's GPS almanac data, apparently. [proton][12:52:07 AM] make csc -dynamic -X easyffi -o gpsd.so gps.scm -lgps *** Shell command terminated with exit status 1: /usr/bin/chicken gps.scm -output-file gpsd.c -dynamic -feature chicken-compile-shared -quiet -extend easyffi make: *** [gpsd.so] Error 1 OK try it separately: [proton][01:03:29 AM] /usr/bin/chicken gps.scm -output-file gpsd.c -dynamic -feature chicken-compile-shared -extend easyffi compiling `gps.scm' ... Segmentation fault It's happening with Chicken 3.1.0 and 3.1.5, and I tried on two different machines. There is output anyway (it created gpsd.c) but segfaulting is not good, and prevents me from generating and compiling the code in one csc call. If I compile the output gpsd.c, I can generate an .so file, but it didn't load properly with (use gpsd). If I'm able to log in to svn again tonight, I will check in the code so far for the gps egg, but this is the current state of it. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] chicken-wrap segfault; GPS egg
On Fri, Apr 18, 2008 at 6:51 PM, Ivan Raikov [EMAIL PROTECTED] wrote: Where is the source for the gps egg? I only see an empty directory in the SVN repository. Yes it's not checked in yet... I was having trouble authenticating with the svn server. Will try again soon (I'm at work at the moment). Shawn Rutledge [EMAIL PROTECTED] writes: If I'm able to log in to svn again tonight, I will check in the code so far for the gps egg, but this is the current state of it. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] chicken-wrap segfault; GPS egg
On Fri, Apr 18, 2008 at 7:07 PM, Shawn Rutledge [EMAIL PROTECTED] wrote: On Fri, Apr 18, 2008 at 6:51 PM, Ivan Raikov [EMAIL PROTECTED] wrote: Where is the source for the gps egg? I only see an empty directory in the SVN repository. Yes it's not checked in yet... I was having trouble authenticating with the svn server. Will try again soon (I'm at work at the moment). Now it is checked in. (Thanks Mario) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Some reorganization of units extras and utils
On Tue, Apr 15, 2008 at 5:00 PM, Ivan Raikov [EMAIL PROTECTED] wrote: Unit data-structures: Lists (alist-ref, alist-update!, ..., join, shuffle, tail?) Queues (list-queue, queue-...) Sorting (merge, sort, sorted?) Strings (conc, -string, string-...) Combinators (compose, constantly, etc.) Binary searching (binary-search) Sounds good. I have a couple assoc-tree functions that I could contribute to that one. Although, data structures could eventually sound like a catch-all too, if we add enough stuff to it. :-) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Idea: Unofficial eggs
On Sun, Apr 13, 2008 at 3:25 PM, Matthew Welland [EMAIL PROTECTED] wrote: I have some things I'd like to turn into eggs that I don't think belong on the official eggs page. I can make my own egg repository but I think an unofficial eggs page would be really useful. In the .meta file a flag would indicate the egg is unofficial. When the docs are created the pointer to that egg would be added to the unofficial eggs page rather than the official eggs page. If an egg is hidden, it will not show up on the eggs unlimited page but chicken-setup can download and install it. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] callbacks from C into Scheme
This is intended to wrap a given Scheme callback as a C function, and make some C library calls, then under the right conditions, call the wrapped callback. After several sessions of staring at it, I still don't understand why this doesn't work. Probably missing something stupid though. (set! dbus:poll-for-message (lambda (context timeout msg-cb) (let ([conn (get-conn (vector-ref context context-idx-bus))] [iface (vector-ref context context-idx-interface)] ) (define-external (C_msg_cb (message-ptr msg)) void (printf calling msg-cb~%) ;(msg-cb msg) ) ((foreign-safe-lambda* message-ptr ((connection-ptr conn) (int timeout) (c-string iface)) DBusMessage* msg = NULL; dbus_connection_read_write(conn, timeout); msg = dbus_connection_pop_message(conn); if (msg) { printf(\rcv: %s, looking for %s\\n\, dbus_message_get_interface(msg), iface); if (dbus_message_has_interface(msg, iface)) { printf(\calling cb from c\\n\); C_msg_cb(msg); printf(\cb done, from c\\n\); } }) conn timeout iface calling cb from c Warning (#thread: thread0): : bad argument count - received 1 but expected 0: #procedure Call history: ##sys#gc ##sys#make-c-string dbus.scm: 230 thread-sleep! dbus.scm: 231 loop dbus.scm: 229 dbus:poll-for-message dbus.scm: 203 get-conn ##sys#gc ##sys#make-c-string -- Seems like it's dying at C_msg_cb(msg); ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] ditching syntax-case modules for the utf8 egg
On Tue, Mar 18, 2008 at 1:53 PM, John Cowan [EMAIL PROTECTED] wrote: Let's see... ASCII is valid UTF-8, so all ASCII external representations wouldn't need any encoding or decoding work. That is a huge advantage. I think unless there are some insurmountable gotcha's, or it causes major efficiency problems, there are some good arguments for using UTF-8 for strings in Chicken. True. However, pure ASCII is less comment than people believe, as indicated by the 59K Google hits for 8-bit ASCII. Less common you mean? I think ASCII is the most common representation for everything. The popularity of XML goes to show what pains people are taking to make data human-readable. (I disagree with the need for that a lot of the time, but whatever.) Source code written by non-English speakers is usually ASCII nevertheless. (Must be harder to learn a language when you don't know what the keywords mean in English.) My favorite editor, Scite, BTW supports UTF-8 nicely... it preserves the BOM if it is there, assumes ASCII if it is not there, and can be told to switch to UTF8 mode if the file does not have a BOM but actually is UTF8... then when you write the file it prepends the BOM. All exactly as it should be. I am seeing fewer web pages in other 8-bit codepages (like KOI8-R, CP1251 etc.) than there used to be, and/or modern browsers are doing a better job detecting the codepage and making it transparent anyway. On one hand it was nice to pick your language and still have 8-bit strings. OTOH it was really messy having 4 or so code pages to choose from for Cyrillic (2 of which were used a lot); and it's also nice to be able to mix languages, and insert the Euro symbol into any string, etc. MP3ID tags lagged for a long time... Russian MP3s tend to have CP1251 (with no way to declare that's what it is, you just have to know) but now UTF8 can be used there too. Most recent formats and protocols require or strongly recommend UTF-8 (see XML etc.) so those wouldn't need any encoding/decoding either. Well, there's an awful lot of content on the Internet and on local hard disks that is neither true ASCII nor UTF-8. In particular, UTF-16 is the usual representation of Unicode on Windows, and various non-Unicode character sets are the usual representation of text on Windows, and consequently on the Web too. UTF-8 is something of an oddity there. I disagree. Text and HTML files you may find lying about on hard drives and web servers all over the world tend to be either ASCII or UTF-8, as far as I've seen. Windows programs may use UTF-16 for string variables in memory, and maybe for serialization to binary files, but not for files that are meant to be human-readable. I'm fine with using UTF-8 as our internal representation. Sounds good to me. Unicode/UTF8-aware string operations will perform a correct replacement and insert the two extra bytes, if the source string really is plain ASCII. Insertion has a linear cost though, because the string is a contiguous array, right? This is probably the reason Java sidestepped the issue by specifying that strings are immutable. In a fairly pure functional language that policy would make sense too (you can modify a string only by copying it and throwing the old one away - that way you see more clearly what is the cost of the operations you are doing) but we can't go breaking existing programs can we... So char has to be 16 or 32 bits right? (depending on how much of Unicode we wish to support... 16 bits is almost always enough) When you do string-ref on a UTF8 string it will need to return the Unicode character at that character index, not the byte from the bytewise index, right? Then unfortunately you have to iterate the string in order to count characters, can't just do an offset from the beginning. (This is where UTF-16 as an in-memory representation has an advantage.) For Display Scheme I was planning to assume all strings are UTF-8, so this change will make things nice and consistent. But I had to convert on-the-fly to 16-bit Unicode to render characters with FreeType. (Not a big deal because I did the rendering 1 glyph at a time anyway.) http://dscm.svn.sourceforge.net/viewvc/dscm/src/g2d-fb16-impl.c?revision=67view=markup line 761 (sorry that code isn't very presentable yet and needs some modularization) Alternative string representations could be in an egg. (16-bit Unicode, 32-bit Unicode, string-plus-codepage, EBCDIC or whatever. :-) When doing in-place modifications with strings that actually have non-ASCII characters, actual Unicode is more efficient, so it would be nice to be able to switch to that representation when it has advantages. (like Windows does for string variables) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] ditching syntax-case modules for the utf8 egg
On Tue, Mar 18, 2008 at 4:50 PM, John Cowan [EMAIL PROTECTED] wrote: I'm not arguing that point. I'm arguing that there should be two different kinds of strings, one of which is UTF-8 and one of which contains single-byte characters in an unspecified ASCII-compatible encoding, *and that the Scheme core ought to know the difference*. Maybe so. But you would want the usual string operations to work with either kind of string, right? (Alex wrote about Gauche, sounds like they did a good job with that) IMHO, UTF-8 BOMs are a bd idea, but that's another debate. Right, we talked a bit about that last September... not sure I yet see why it is baaad but maybe could be considered unnecessary. It could follow from the general principle of separating metadata from data: Put the encoding in the extended attributes of the file, or resource fork if you've got one. Maybe when Windows is dead, memory buses have attribute bits for every word, thumb drives ship preformatted with ReiserFS v5 (optimized for holographic storage), and tar can archive extended attributes alongside the files, the BOM could be retired completely. :-) That turns out not to be the case. Start Notepad and paste in some random non-ASCII stuff from the Web, do a Save, and see what you get by default (or in earlier versions of Windows, whether you like it or not). You get little-endian UTF-16 with an explicit BOM. Ookie. FWIU, the main reason is so that Strings can be safely passed between threads. Yeah you're probably right. Chicken characters are 24 bits, which is enough to handle the Unicode range of U+ to U+10 (fits in, but does not fill up, 21 bits). Cool. Not really, since in UTF-16 some characters are two code units long. Java made that mistake, now partly rectified. I thought it was still a reasonable assumption most of the time, except for the extra few languages that required extending Unicode beyond 16 bits? There could be a bit somewhere to indicate whether the string has any of those characters... but then you'd have to find out whether it does or not, in order to set the bit. Or have 4 types of strings: byte (restricted strings), UTF-8, and fixed-char-size 16- and 24-bit strings. The latter two can be in a unicode egg. The fixed-16-bit type would be useful often enough, and save memory a lot of the time. That type could be converted to fixed-24-bit type automatically, only when necessary (when setting a larger character into the string, when reading from a UTF-8 string that has the larger characters, etc.) From a user's perspective both of those fixed-char-size types are the same: a string that has O(1) access by index. But converting from UTF-8 to/from the fixed-char-size form would have to be explicit, because UTF-8 is the native chicken type, and only in some cases do you need the O(1) string-ref etc. Nevertheless the usual string operations could still do the right thing with all 4 types, right? (Oh well, it all sounds like too much work to implement, doesn't it?) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] readline blocks threads
On Wed, Mar 5, 2008 at 11:50 PM, Shawn Rutledge [EMAIL PROTECTED] wrote: So they're using Unix sockets. It's already non-blocking, so F_SETFL doesn't change the behavior. But I guess I'm being stupid... readline (or the terminal? as you say) is blocking, not dbus. But it's good to know definitely what dbus is using. On Thu, Mar 6, 2008 at 12:53 AM, Elf [EMAIL PROTECTED] wrote: the problem isnt nonblocking status. the problem is that all the term settings get munged by readline - how else could it interpret arrows, tabs, do paren bouncing, etc. You mean the same settings that can be changed via stty? I don't understand what effect that has. The usual kind of blocking that can be turned on is that when you are sitting at a shell prompt, keystrokes are not sent one-by-one, but rather it can wait until you hit the enter key and send the whole command all at once; this is a feature that can help with slow serial connections or packet networks. But I don't think that mode is in use much these days, and readline would be turning off that feature, right? because it has to see each keystroke in order to do all the tricks. Or you think it's on the output side, that the threads are blocked because output going from csi to the screen does not pass through until it is flushed? Then maybe a thread which does no output would run fine, but one which displays status messages would block? i am working on a pure scheme readlineish lib to compensate with approximately the same feature set as what is presently there. it should be done shortly. OK I'll look forward to it. So you don't have any philosophical problem with the idea that an egg which does polling should automatically start a thread to do that? however, instead of coding right now, im going through the almost 500 eggs to make sure that the licence data is correct (ie, the licence tag and the Doesn't sound like much fun. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] readline blocks threads
On Tue, Mar 4, 2008 at 12:36 PM, Elf [EMAIL PROTECTED] wrote: try putting a (thread-yield!) and it works in readline. Yeah you're right. csi (use srfi-18) ; loading library srfi-18 ... csi (thread-start! (lambda () (let loop () (printf loop~%) (thread-yield!) (loop #thread: thread0 csi (thread-yield!) loop csi (thread-yield!) loop Well I'm working on the dbus egg, and as it turns out there needs to be a polling loop to receive incoming dbus messages. So I was hoping to hide the polling loop inside the egg, but maybe there will be some problems with that. I wanted to make it possible to register a function (assign it to some combination of service/path/interface/method-name) as a callback, so it will be called when the matching message is received, rather than leaving it up to the user of the egg to pull the messages out and dispatch them, or ask them to be dispatched. So if you write a multi-threaded app, or call thread-yield! periodically, the threaded callback model could work, but it's unfortunate to require that kind of design, or else expose the necessity of doing the polling yourself. I sure wish Chicken had real threads. (Yes I know it's next to impossible.) The excuse I tell myself for accepting that limitation is that maybe when SMP gives way to grid-style computing, when each core has its own memory, then a multi-process model for computing makes more sense. Fortunately SRFI-18 threads do not block on TCP sockets, so there you go, parallel computing is possible, and I should just use processes rather than threads, keep it coarse-grained, and eat the cost of doing the messaging (as opposed to sharing memory). But that doesn't help in this case, because the dbus egg is just a nice interface to an IPC mechanism, which doesn't inherently have the need to block as long as it's based on sockets (which it might not always be). Well I guess I'll have to have stuff like dbus:peek-next-message dbus:next-message dbus:dispatch-next-message dbus:dispatch-loop and then the user of the egg has the choice: wrap the dispatch-loop call in a thread and callbacks happen automatically as long as nothing else blocks, poll manually but still have callbacks, or poll manually and examine the messages manually too. Anybody have a better idea? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] readline blocks threads
On Tue, Mar 4, 2008 at 2:45 PM, Jim Ursetto [EMAIL PROTECTED] wrote: Did you try using rlwrap? It works fine here. $ rlwrap csi #;1 (use srfi-18) #;2 (thread-start! (lambda () (let loop () (printf loop~%) (thread-sleep! 1) (loop #thread: thread0 #;3 loop loop loop loop That's interesting. But I figured it's a bad design for the dbus egg to only work under some circumstances, and I found one that will not work if I bury the pollling thread inside the egg. Maybe the answer is that srfi-18 is a toy, don't take it too seriously... or just don't depend on it, because it's up to the user to choose to use it or not. It's a general pattern that I'm looking for: what to do when an egg needs to do polling and/or callbacks... ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] readline blocks threads
On Tue, Mar 4, 2008 at 3:47 PM, Elf [EMAIL PROTECTED] wrote: there is a way to do this. its just very painful. im working on a readline-ng egg with the changes, as the existing readline wont work. OK. I hope I'm not causing too much pain. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: chicken literary spoofs (was: Re: argument against using '() for null values? ([Chicken-users] DBI))
On Mon, Mar 3, 2008 at 2:40 PM, Graham Fawcett [EMAIL PROTECTED] wrote: Fortunately, Chicken Literary and his friends visited the fox, Henry Baker, who reminded them that their stacks are GC'd frequently. All was well again in Chicken Literary Land! But when he added that function-calls never return, Chicken Literary and friends lapsed into an existential stupor. And Henry the Fox ate them. You handled the continuation very well, congratulations. Not a very happy ending though. After (eat ...) I suppose the return value is undefined, isn't it... ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] INI files in Scheme? (or something similar)
On Mon, Mar 3, 2008 at 6:22 PM, Hans Nowak [EMAIL PROTECTED] wrote: Is there a standard way to do INI files (or similar kinds of initialization files, ala .bashrc etc) in Scheme? For example, something like this: My first idea would be put an alist in the conf file: ((developer . dev_id) (application . app_id) ... ) then to get the values, write a function like this: (define conf-or-default #f) (let ([alist #f]) (set! conf-or-default (lambda (key default) (unless alist (... read the file into alist ...)) (let ([ret (assq alist key)]) (if (pair? ret) (cdr ret) default It can read the whole file the first time it is needed, in one swoop, and expect that it has only one s-expression in it. (Sorry if there are any mistakes, I didn't test it) I understand that this could easily be done in Scheme itself, e.g. (define developer INSERT_DEV_ID) (define url api.sandbox.foobar.com) It depends whether you can think of any use cases for the user to write some code in this file as well as just defining values. That can be quite useful: e.g. the user could write callbacks for some events that your app exposes, just like JavaScript allows the web page author to do this; and also dangerous: the user can use set! to redefine variables that your app depends on, and create arbitrary bugs. But you can mitigate that by loading the config file inside a restricted environment, so that some things can be redefined and some not. You are comparing to .bashrc, which can do both (set environment variables and also execute arbitrary code). Either way, it's possible to avoid parsing the conf file line-by-line, at least. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: YADT: yet another documentation thread
For the record, my language trajectory (where I've actually written serious code) is C, Java, Python, Lisp, Scheme. Mine was Pascal, C, C++, Java, Scheme (omitted less-serious stuff: Logo, BASIC and Fortran from high school, Prolog, Perl... I've never spent a lot of time with Perl but use it occasionally) My current job is a C++ one. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Idea feedback
On Thu, Feb 14, 2008 at 2:42 PM, john [EMAIL PROTECTED] wrote: Yes, I remember talk of dbus! Any progress Shawn? No. My first use for it was to interface to avahi, but the stacked dependencies got a bit overwhelming... have to figure out easyffi (or something) so I can interface to dbus so I can interface to avahi so I can discover my Scheme-over-TCP service (when the latter is the interesting part that I'd rather spend my spare time on). I got stuck at some point, I forgot where, but it's easy enough to have another look at it when I get home. I figured it might work better to just interface to the avahi API, but then the total number of libraries that need to be linked in goes up, whereas dbus is useful for more purposes. Your project might be similar to mine, but I planned the main comm channel to be plain sockets or SSH rather than dbus. Doing everything via dbus might be interesting, though. http://sourceforge.net/projects/dscm/ What kind of binary S-expression format are you planning to use? That's very much of interest to me, but I figured there needs to be a new standard for exchanging bse's across different versions of scheme (and even other languages, later). I have an experimental thing I call gtf (generic tree format) which might work: just a kind of tree in which all the symbols have been moved out into a symbol table, and then are referenced by offset. But that is not Scheme-specific at all; I intended it to be a replacement for XML actually. It could be a way of representing Scheme source compactly, but it's not as cool as the Kali idea of sending closures from one Scheme to another. That idea is still voodoo to me, but I wish I understood it better. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Idea feedback
On Thu, Feb 14, 2008 at 5:20 PM, Shawn Rutledge [EMAIL PROTECTED] wrote: On Thu, Feb 14, 2008 at 2:42 PM, john [EMAIL PROTECTED] wrote: Yes, I remember talk of dbus! Any progress Shawn? No. My first use for it was to interface to avahi, but the stacked err I guess I was trying to interface to gpsd first. Felix gave me some help with chicken-wrap in December. So I guess I'd better try to pick up that loose end again... ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Comprehensive documentation rewrite
On Feb 13, 2008 1:18 AM, felix winkelmann [EMAIL PROTECTED] wrote: In my experience separating the documentation from the code leads in the end to more consistent information. I've seen too much doxygen generated documentation heaps with no obvious start or beginning. Well that's not the purpose... it's API documentation, not a tutorial. At my job for example we are required to write specs, but I still like to have the structured comments and the generated documentation from them. The specs tend to be wrong or out-of-date unless you spend extra days updating them. Management thinks in terms of a waterfall process: you do design, then you code. But when you code, you find problems in the design, so it has to evolve. Updating formal specs at the same time makes the whole process slower, but I nearly always manage to keep my in-code comments up-to-date. And when I write Scheme I sometimes write ordinary comments with at least a one-line description of what the function does, and whatever constraints there are on the parameters (if it's not obvious from the name of the parameter). I just wish those comments were parseable. Another effect is that documentation is structured to fit the doc-generating tool, instead of being easy to access for users. It needs to be searchable. Doxygen doesn't give you that because it would involve some back-end code rather than just HTML. I happen to like svnwiki syntax. It's easy to use, non-obstructive and we have all the infrastructure to convert it into other formats. Well the comments could be structured like that and the same parser could be re-used to generate the HTML. (Although personally as wiki's go I'm partial to MediaWiki syntax.) Besides, all these doc overhauls just eat up developer time... I would like to have some method of putting parseable comments in the Scheme code. Doesn't mean it has to replace other forms of documentation... but isn't something like this available? If the PLT Scheme people are thinking about it, maybe we could borrow some code. (OK I should look into it rather than just making suggestions... but I can't promise how soon I will get around to it) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Comprehensive documentation rewrite
On Feb 13, 2008 1:44 AM, Peter Bex [EMAIL PROTECTED] wrote: Another problem of 'rdoc-like' documentation is that you end up having to wade through piles and piles of documentation in the code when you're looking for something. Just look at the Rails code, some classes start with several *pages* of text. Sometimes even functions have pages of text preceding them. It makes reading the code awfully hard. That sounds like something that could be fixed in your editor, in theory... e.g. the emacs mode could elide such comments to one line by default, and then you can unfold it if you want to see the whole thing. I'm not an emacs user though. (Maybe some day...) Besides, all these doc overhauls just eat up developer time... That's why there shouldn't be all these doc overhauls, there should be just one, resulting in proper documentation. It's better to work smart, not hard. That means start by building the tools, to minimize the tedium. A good example (outside the software domain) would be the human genome project... But if you do it the hard way, then you will be even less inclined to ever do it again, even if the result was suboptimal and still needs improvement. Quality results from continuous improvement, not a one-pass get it right and call it done. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Comprehensive documentation rewrite
On Feb 13, 2008 12:04 PM, Elf [EMAIL PROTECTED] wrote: not always true. tex was better before the cycle of 'continuous improvements', The early development was before my time, but I don't think TeX emerged fully-formed. Knuth came up with that version scheme where he adds digits to pi for each new version (expressing the idea that it more accurately conforms to the ideal with each rev), and even pays people to find bugs in his code (which says to me that he believes in continuous improvement). And it was arguably further improved by some of the forks, like LaTeX. Then Knuth invented literate programming. I have some respect for the idea, even though some of the uses and implementations can be unwieldy and the ideals are a bit high-minded - the kernel of the idea seems to me a good one, and has been inspiring for others. I find Doxygen extremely useful, and don't understand why such a large number of developers who write C++ or Java can agree on such a system, while Scheme people seem to think it's weird to put any kind of special comment syntax in the code. Some code could maybe be considered self-documenting, and some not. i dont know where the idea that anyone was proposing a be-all-and-end-all of documentation systems came from, but its getting aggravating. i proposed the following concepts: I agree with all your concepts, and look forward to your proposal. All I'm hoping for as a starting point is a way to write parseable comments that can be converted into API docs. The other stuff can be added later; a be-all documentation system cannot be expected to emerge fully formed either. I will always think of separate documentation files as being fundamentally an adjunct... if you want to write a tutorial, sure it ought to be separate, but that's not where you start; you'd typically write it after the code. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Comprehensive documentation rewrite
On Feb 12, 2008 10:13 AM, Tobia Conforto [EMAIL PROTECTED] wrote: My idea is to devise a smart document format, preferably s-expr based (maybe SSAX-based if nothing better comes to mind) and convert every piece of Chicken API documentation to that format: both for eggs and for the base system. This includes any relevant SRFIs that are part of Chicken or of some eggs. I like the idea of being able to put the documentation into the code; something like Doxygen is needed for Scheme. I think it's not the first time such an idea has been proposed, but I don't know much about what has been tried. The trouble with systems like Doxygen and JavaDoc is having to parse comments, which ordinarily are ignored. And an S-expr method provides some potential for other algorithmic purposes beyond the documentation itself. (Ideas will suggest themselves once the potential is there, no doubt.) There could start to be a coding standard/consensus just as there is with JavaDoc and Doxygen, that you write a comment block for every function, describing what it does, the parameters, etc. The author of an egg is probably often the most qualified to write the documentation; or else a close collaborator could write it (within the code) and commit to Subversion, right? So from one side the editable wiki is handy for random users that see problems with the docs and can quickly contribute the corrections, but from another, how many edits are really being done there? and it doesn't feel right to have the documentation exist separate from the code. Then it's more likely for the two to be out-of-sync. Maybe when someone edits the wiki, diffs could be sent to the author, for later insertion into the next version of the egg. But I think the regular documentation should be inline with the code, because it helps to encourage the good habit of keeping it up-to-date every time one makes a change to the code. (Sorry if I'm just stating the obvious...) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users