felix | 1 Oct 21:48 2003

easyffi - continued.

Hello!

The "easy" FFI parser now understands a little C++. Classes are wrapped
into TinyCLOS classes, so you can do things like:

;;; sample.scm

(declare (uses tinyclos))

#>!
class Foo {
 public:
  Foo() {}
  int yo(int n) { return n * 2; }
};
<#

(define f1 (make <Foo>))
(yo f1 123) ==> 246
(destroy f1)          ; alternatively: (set-finalizer! f1 destroy)

Needless to say, the C++ parser has a *lot* of restrictions, but for
simple cases, and hand-tuned C++ headerfiles it might prove useful.

cheers,
felix
felix | 1 Oct 21:46 2003

(CVS commit) Version 1, Build 20

Wed Oct  1 21:47:50 2003

- chicken.h: when compiled with g++, chicken-generated code doesn't use statement expressions [Thanks
to Bruce Hoult]
- easyffi.scm: added support for static member functions and C++ constants
felix | 4 Oct 00:20 2003

(CVS commit) Version 1, Build 20

Sat Oct  4 00:21:43 2003

- easyffi.scm: removed a diagnostic message
- makefile.vc: builds extra libraries in gui mode (so that they don't refer to chicken.dll)
- csc.in: `-windows' option is back (and works properly)
Dirk Pesch | 10 Oct 11:59 2003
Picon

Will chicken scheme compile DEC's EZD

Dear chicken user community,

I am trying to compile DEC's EazyDraw (EZD), a graphics engine on top of X
Windows written in Scheme that was developed by DEC's WRL around 1990/91.
They had there own scheme to C compiler to compile EZD but I have had
serious trouble getting this one to compile under a recent version of LINUX
and therefore thought I might try Chicken Scheme to C as an alternative. As
I am no expert of Scheme I fear that getting DEC's schemeto C running is
beyond my capabilities.
I would really like to revive the EZD tool as I have a simulation class
library with an interface for graphical output through EZD.

I would be grateful for any advice, experience, etc that may help before I
try to get Chicken Scheme going myself.

thanks in advance for the help

best regards
Dirk

------------------------------------------
Dr. Dirk Pesch
Adaptive Wireless Systems Group
Department of Electronic Engineering
Cork Institute of Technology
Rossa Avenue, Cork, Ireland
Tel.  +353 21 432 6377
FAX.  +353 21 432 6625
E-mail: dpesch <at> cit.ie

(Continue reading)

Felix Winkelmann | 10 Oct 13:56 2003
Picon

Re: Will chicken scheme compile DEC's EZD

On Fri, 10 Oct 2003 10:59:40 +0100, Dirk Pesch <dpesch <at> cit.ie> wrote:

> I am trying to compile DEC's EazyDraw (EZD)

Hi, again.

I've finally found EZD (http://www- 
2.cs.cmu.edu/Groups/AI/lang/scheme/gui/ezd/ezd.tgz)
and skimmed the sources (very superficially).
I wonder whether it might perhaps be easier to write a Scheme->C
compatibility layer for Chicken than rewrite the EZD sources.
I'll dive a little bit deeper into it over the weekend (I hope).

cheers,
felix
Felix Winkelmann | 10 Oct 12:53 2003
Picon

Re: Will chicken scheme compile DEC's EZD

On Fri, 10 Oct 2003 10:59:40 +0100, Dirk Pesch <dpesch <at> cit.ie> wrote:

> Dear chicken user community,
>
> I am trying to compile DEC's EazyDraw (EZD), a graphics engine on top of 
> X
> Windows written in Scheme that was developed by DEC's WRL around 1990/91.
> They had there own scheme to C compiler to compile EZD but I have had
> serious trouble getting this one to compile under a recent version of 
> LINUX
> and therefore thought I might try Chicken Scheme to C as an alternative. 
> As
> I am no expert of Scheme I fear that getting DEC's schemeto C running is
> beyond my capabilities.
> I would really like to revive the EZD tool as I have a simulation class
> library with an interface for graphical output through EZD.
>
> I would be grateful for any advice, experience, etc that may help before 
> I
> try to get Chicken Scheme going myself.
>
> thanks in advance for the help
>
> best regards
> Dirk
>

Hi, Dirk!

That sounds interesting. I've never seen EZD, so I can't say much
(Continue reading)

TiM | 10 Oct 18:48 2003

BLAS

greetings,

i need to multiply many exponentially large complex valued matrices as 
part of a solution that so far has been pure scheme.

i was going to write my own matrix multiplier code and compile it with 
chicken, but chicken doesn't support complex numbers, and i probably 
can't write a top performing matrix multiplier in the time i have anyhow.

BLAS (http://www.netlib.org/blas/) appears to be the appropriate tool, 
but i have no experience with it, and no experience in calling external 
libraries from scheme.

has someone already written a chicken interface to BLAS that i could use?

IMHO, built in BLAS support (like LUSH has) would be a pretty cool 
addition to chicken.

thanks for any help,

TiM
felix | 12 Oct 01:14 2003

Re: BLAS

On Fri, 10 Oct 2003 12:48:39 -0400, TiM <salo <at> zooid.org> wrote:

> greetings,
>
> i need to multiply many exponentially large complex valued matrices as 
> part of a solution that so far has been pure scheme.
>
> i was going to write my own matrix multiplier code and compile it with 
> chicken, but chicken doesn't support complex numbers, and i probably 
> can't write a top performing matrix multiplier in the time i have anyhow.
>
> BLAS (http://www.netlib.org/blas/) appears to be the appropriate tool, 
> but i have no experience with it, and no experience in calling external 
> libraries from scheme.
>
> has someone already written a chicken interface to BLAS that i could use?
>
> IMHO, built in BLAS support (like LUSH has) would be a pretty cool 
> addition to chicken.
>
> thanks for any help,
>
> TiM
>

Currently I know of no set of BLAS bindings for Chicken, but I guess
it should be not big problem to write a set of bindings for it.
(Tools like SWIG (http://www.swig.org) can help a lot when trying to
interface to external libraries)
I'm also working on an improved foreign-function interface to Chicken
(Continue reading)

Category 5 | 12 Oct 11:19 2003

Binding identifiers with set!

In <NUeXa.32448$Mc.2577761 <at> newsread1.prod.itd.earthlink.net> on
comp.lang.scheme, Anton van Straaten pointed out that set! can be used
to introduce new bindings in Chicken:

% csi
; This is the CHICKEN interpreter.
; Version 1, Build 17 - netbsd-gnu-ultrasparc
; (c)2000-2003 Felix L. Winkelmann
>>> foo
Error: unbound variable: foo
>>> (set! foo 1)
>>> foo
1
>>>

This clearly doesn't jive with R5RS (5.2.1):

    At the top level of a program, a definition

    (define <variable> <expression>)

    has essentially the same effect as the assignment expression

    (set! <variable> <expression>)

    if <variable> is bound. If <variable> is not bound, however, then
    the definition will bind <variable> to a new location before
    performing the assignment, whereas it would be an error to perform a
    set! on an unbound variable.

(Continue reading)

Bruce Hoult | 12 Oct 22:24 2003

Re: Binding identifiers with set!

On Sun, 2003-10-12 at 22:19, Category 5 wrote:
> In <NUeXa.32448$Mc.2577761 <at> newsread1.prod.itd.earthlink.net> on
> comp.lang.scheme, Anton van Straaten pointed out that set! can be used
> to introduce new bindings in Chicken:
> 
> % csi
> ; This is the CHICKEN interpreter.
> ; Version 1, Build 17 - netbsd-gnu-ultrasparc
> ; (c)2000-2003 Felix L. Winkelmann
> >>> foo
> Error: unbound variable: foo
> >>> (set! foo 1)
> >>> foo
> 1
> >>>
> 
> This clearly doesn't jive with R5RS (5.2.1):

I agree that this increases the chance of accidents.

The thing that I dislike *more* is the (documented) way that Chicken
makes "define", other than at the start of a lambda- or let-body,
exactly equivalent to set!.  i.e. per r5rs a define at the start of a
body is exactly the same as a "let" (and several are the same as a
"letrec") and creates a local lexical binding with the rest of the body
inside the "let", but if you put so much as a debug output statement
before one of the defines then it suddenly modifies (or, per your
complaint, creates!) a toplevel variable instead of a local binding. 
This has caught me out more than once.

(Continue reading)


Gmane