Re: [Chicken-users] Bounty for an egg or two.

2010-04-05 Thread Matthew Welland
Thanks Ivan and Felix for taking a look. 

FastGEO looks promising, I'll dig a little deeper into it. Can you comment 
on how tough creating an interface to gpc would be? I see that it has 
Haskell, Java, Lua, Octave, Perl, Python etc. bindings which might indicate 
it is a bit easier to interface to than cgal.

http://www.cs.man.ac.uk/~toby/alan/software//index.html#gpc

On Sunday 04 April 2010 05:45:16 pm Ivan Raikov wrote:
   I don't know about Ogre3D, but I also found cgal to have an especially
 FFI-unfriendly API.  Speaking of computational geometry libraries, I
 came across a library called FastGEO:

   http://www.partow.net/projects/fastgeo/index.html

 It is written in Object Pascal, but I found its interface to be quite
 simple, and I think it would not be altogether difficult to either port
 it to Scheme, or compile it with cdecl calling convention and use
 Chicken's FFI to call its procedures.

-Ivan

 Felix fe...@call-with-current-continuation.org writes:
  From: Matthew Welland m...@kiatoa.com
  Subject: [Chicken-users] Bounty for an egg or two.
  Date: Thu, 1 Apr 2010 21:53:52 -0700
 
  I'd like some help in getting some eggs made:
 
  1. An interface to cgal
  2. An interface to Ogre3d
 
  Phew - these are heavyweight and it seems that they use templates
  extensively.  I don't think Swig is the right way to go, though: I
  don't know if the chicken backend is actively maintained, and it is not
  ported to chicken 4 yet, AFAIK.
 
 
  cheers,
  felix



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


Re: [Chicken-users] Bounty for an egg or two.

2010-04-05 Thread Ivan Raikov

Hi Matt,

   The URL you have included below points to the home page of the
General Polygon Clipper, a different library unrelated to FastGEO. As
for FastGEO, it can be compiled by the Free Pascal Compiler, which can
compile procedures to use the C calling convention, but beyond that I
don't know if there would be any issues involved. I would think that it
should be fairly straightforward to compile FastGEO with C calling
convention and see if you get any errors. Another thing is that I found
the FastGEO source code to be quite clear and readable, so it might be
easier to port some of its procedures to Scheme, using SRFI-4 vectors
and appropriate record types. This might be simpler than messing around
with the Pascal code.

   -Ivan

Matthew Welland m...@kiatoa.com writes:

 Thanks Ivan and Felix for taking a look. 

 FastGEO looks promising, I'll dig a little deeper into it. Can you comment 
 on how tough creating an interface to gpc would be? I see that it has 
 Haskell, Java, Lua, Octave, Perl, Python etc. bindings which might indicate 
 it is a bit easier to interface to than cgal.

 http://www.cs.man.ac.uk/~toby/alan/software//index.html#gpc

 On Sunday 04 April 2010 05:45:16 pm Ivan Raikov wrote:
   I don't know about Ogre3D, but I also found cgal to have an especially
 FFI-unfriendly API.  Speaking of computational geometry libraries, I
 came across a library called FastGEO:

   http://www.partow.net/projects/fastgeo/index.html

 It is written in Object Pascal, but I found its interface to be quite
 simple, and I think it would not be altogether difficult to either port
 it to Scheme, or compile it with cdecl calling convention and use
 Chicken's FFI to call its procedures.


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


[Chicken-users] objc egg in 4.4.0

2010-04-05 Thread Drew Hess
Hi,

Is the objc egg supposed to work with Chicken 4.4.0, or is it still
unsupported in the 4.x releases? It doesn't compile for me on a
Mac OS X 10.6.3 system; see http://paste.lisp.org/display/97337 for the
output.

thanks
d


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


[Chicken-users] Documentation problem (eggs tutorial and Extensions section from the manual)

2010-04-05 Thread Jeronimo Pellegrini
Hello!

I've tried to follow the instructions on the egg tutorial here:
http://chicken.wiki.br/eggs%20tutorial

and the Extensions part of the manual:
http://chicken.wiki.br/man/4/Extensions

But that didn't work. I compared the instructions and example there
to what's on some eggs in the svn repository, and found some differences.

It looks like the egg now *must* be a module or the -j option to the
compiler won't work (right?). And if I don't use -j so as not to generate
the import file, then I won't be able to load the extension (and the example
in the Extensions chapter won't really work).

#;1 (require-extension hello)

Error: (import) during expansion of (import ...) - cannot import from undefined 
module: hello

Call history:

syntax(##core#require-extension (hello) #t)
syntax(##core#begin (##core#begin (##core#begin (##sys#require 
(quote hello))) (import hello)) (##core#und..
syntax(##core#begin (##core#begin (##sys#require (quote hello))) 
(import hello))
syntax(##core#begin (##sys#require (quote hello)))
syntax(##sys#require (quote hello))
syntax(quote hello)
syntax(##core#quote hello)
syntax(import hello)  --


The eggs tutorial doesn't mention that (neither does chapter Using the
Compiler from the manual).

It seems that the documentation is for Chicken 3; I am not sure if I
understand everything that changed in the compiler since the docs were
written, otherwise I'd be happy to help updating the manual and eggs
tutorial. Are these the only changes?

J.



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


Re: [Chicken-users] Documentation problem (eggs tutorial and Extensions section from the manual)

2010-04-05 Thread Peter Bex
On Mon, Apr 05, 2010 at 09:06:37AM -0300, Jeronimo Pellegrini wrote:
 Hello!
 
 I've tried to follow the instructions on the egg tutorial here:
 http://chicken.wiki.br/eggs%20tutorial
 
 and the Extensions part of the manual:
 http://chicken.wiki.br/man/4/Extensions
 
 But that didn't work. I compared the instructions and example there
 to what's on some eggs in the svn repository, and found some differences.
 
 It looks like the egg now *must* be a module or the -j option to the
 compiler won't work (right?).

This doesn't really have anything to do with eggs.  There was no -j in
Chicken 3, and in Chicken 4 you use -j modulename to create an import
file for the module named modulename.

Since it's good practice (but not required!) to package eggs that
provide modules, you'll have to add a -j modulename in order to make
it work.

Of course, the semantics of (USE foo) changed so it will try to load foo
and also import the module foo, you'll run into trouble unless you either
provide a module or switch to (REQUIRE-LIBRARY foo) which will only load
the .so file without importing anything.

 The eggs tutorial doesn't mention that (neither does chapter Using the
 Compiler from the manual).

The chapter Modules and macros will be more helpful in that area.

 It seems that the documentation is for Chicken 3; I am not sure if I
 understand everything that changed in the compiler since the docs were
 written, otherwise I'd be happy to help updating the manual and eggs
 tutorial.

It might have not been updated properly.  It's a good idea to add some
instructions on providing a module to the tutorial.  Feel free to add it.

 Are these the only changes?

AFAIK nothing really changed, except the difference in how USE works.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music.
-- Donald Knuth


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


[Chicken-users] Is there interest in a new egg (fast-io)?

2010-04-05 Thread Jeronimo Pellegrini
Hello,

I've been working on some unsafe fast I/O procedures for my own use,
and I thought I'd make them an extension, if more people would
like to use them.

The fast-io extension would have these procedures:

Implemented and tested:
- write-fixnum, read-fixnum
- write-flonum, read-flonum
- write-one-char, read-one-char (I don't know if the names
  are OK; I didn't want them to conflict with R5RS procedures)

Implemented, not tested:
- write-complex, read-complex

Planned but not yet implemented:
- write-string
- read-string-n
- read-string-until (reads until a delimiter is found)
- read-string-between (ignores characters until left
  delimiter, then reads until right delimiter)

All of these are implemented using (as little as possible)
foreign-lambda* with some inline calls to fprintf, fscanf,
and fgetc.
The only kind of error checked for is the return from the
C functions (and if, for example, fscanf fails to read,
then a (configurable) scheme error procedure is called).

The two last string-reading procedures will be triple-checked
for security. :-)

Why:
For everyday use, I really think this isn't necessary. But if
you need (as I think I'll need) to read and write very large amounts
of numbers from/to files, several times. Then this becomes useful.

If you *know* that your file only has fixnums or flonums (written
by your program), then you can use these procedures -- so there's
no need to make the program go checking if it looks like an exact or
inexact number, or as a string, or whatever. Just tell it to read
an integer number!)

If there is interest, it's already packaged as an egg (installed on
my machine). 

The speedup I got is on the following table:

schemefast-io   speedup
---
write fixnum14.602  5.3032.7535
read  fixnum58.208 11.7064.9725

write flonum37.003 21.6471.7094
read  flonum   100.367 15.6266.4231
---

These are for reading and writing values from/to large files.
I'll include the benchmarking code with the egg, as well as
tests.

Thanks,
J.



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


Re: [Chicken-users] Documentation problem (eggs tutorial and Extensions section from the manual)

2010-04-05 Thread Jeronimo Pellegrini
Hi,

On Mon, Apr 05, 2010 at 02:16:24PM +0200, Peter Bex wrote:
 This doesn't really have anything to do with eggs.  There was no -j in
 Chicken 3, and in Chicken 4 you use -j modulename to create an import
 file for the module named modulename.
 
 Since it's good practice (but not required!) to package eggs that
 provide modules, you'll have to add a -j modulename in order to make
 it work.
 
 Of course, the semantics of (USE foo) changed so it will try to load foo
 and also import the module foo, you'll run into trouble unless you either
 provide a module or switch to (REQUIRE-LIBRARY foo) which will only load
 the .so file without importing anything.

Ah -- I get it now!

  It seems that the documentation is for Chicken 3; I am not sure if I
  understand everything that changed in the compiler since the docs were
  written, otherwise I'd be happy to help updating the manual and eggs
  tutorial.
 
 It might have not been updated properly.  It's a good idea to add some
 instructions on providing a module to the tutorial.  Feel free to add it.

OK.

Thanks a lot, Peter!

J.


___
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)?

2010-04-05 Thread John Cowan
Jeronimo Pellegrini scripsit:

 - write-fixnum, read-fixnum
 - write-flonum, read-flonum

Does this refer to a textual or a binary format file?

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
In computer science, we stand on each other's feet.
--Brian K. Reid


___
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)?

2010-04-05 Thread Jeronimo Pellegrini
On Mon, Apr 05, 2010 at 10:34:03PM -0400, John Cowan wrote:
 Jeronimo Pellegrini scripsit:
 
  - write-fixnum, read-fixnum
  - write-flonum, read-flonum
 
 Does this refer to a textual or a binary format file?

Textual. I had no intention of using binary files, although
that could be nice too (saves space and could be somewhat faster,
since disk access is the bottleneck).

J.


___
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)?

2010-04-05 Thread Shawn Rutledge
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