Re: [Chicken-users] Problems with the dollar egg.

2014-03-03 Thread Alaric Snell-Pym
On 02/03/14 17:27, John Cowan wrote:
 Daniel Carrera scripsit:
 
 Does that apply to other languages like Python?
 
 Python does not work in the Chicken interpreter either.  :-) (Though in
 principle one could write a Python egg using the Python/C API.)

There's slightly more to it than this, however.

The FFI only works in compiled code, it's true. But you can compile a
module that uses the FFI, then use that module from the interpreter. You
just can't use the FFI *directly* because it works by integrating with
the compiler's generation of C code, which is then compiled by gcc.
Whereas the interpreter interprets directly, rather than going via C, so
the FFI doesn't have a C stage to integrate with.

This is similar to the situation with Python - to wrap a C library in
Python, you compile a stub module that you can then load from the Python
interpreter and away you go. The difference is that the stub module is
written in C, rather than Python; while Chicken FFI stubs are written
in whatever mix of Chicken and C you find convenient.

ABS

-- 
Alaric Snell-Pym
http://www.snell-pym.org.uk/alaric/



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


Re: [Chicken-users] Problems with the dollar egg.

2014-03-03 Thread Daniel Carrera
On 3 March 2014 17:57, Alaric Snell-Pym ala...@snell-pym.org.uk wrote:

  Python does not work in the Chicken interpreter either.  :-) (Though in
  principle one could write a Python egg using the Python/C API.)

 There's slightly more to it than this, however.

 The FFI only works in compiled code, it's true. But you can compile a
 module that uses the FFI, then use that module from the interpreter. You
 just can't use the FFI *directly* because it works by integrating with
 the compiler's generation of C code, which is then compiled by gcc.
 Whereas the interpreter interprets directly, rather than going via C, so
 the FFI doesn't have a C stage to integrate with.

 This is similar to the situation with Python - to wrap a C library in
 Python, you compile a stub module that you can then load from the Python
 interpreter and away you go. The difference is that the stub module is
 written in C, rather than Python; while Chicken FFI stubs are written
 in whatever mix of Chicken and C you find convenient.


Thanks. That's an important distinction. So if I want to call a couple of C
functions, I can make a very small module that just gives me Scheme
wrappers for those and load that in the REPL.

I am currently a bit torn between Chicken and Racket. The thing about
Racket is that DrRacket does have its annoyances (e.g. using tabs, opening
files) to compensate for its cool features (e.g. macro stepper). The Racket
REPL does nice syntax highlighting and indentation, but it doesn't have
history the way CSI+Readline does. I also note that they don't want to be
perceived as a Scheme dialect, and do not currently plan to work on R7RS.

I guess I'll continue playing with both Chicken and Racket until I know
enough to form a preference.

Cheers,
Daniel.
-- 
When an engineer says that something can't be done, it's a code phrase that
means it's not fun to do.
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Problems with the dollar egg.

2014-03-03 Thread Alaric Snell-Pym
On 03/03/14 17:10, Daniel Carrera wrote:

 I guess I'll continue playing with both Chicken and Racket until I know
 enough to form a preference.

Depending on what kind of code you want to write, you can do a lot in
the language they have in common and then run the same code in whatever
environment best suits your current activity...

Might need some ugly mechanism to deal with module export/import
interop, however!

ABS

-- 
Alaric Snell-Pym
http://www.snell-pym.org.uk/alaric/



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


Re: [Chicken-users] Problems with the dollar egg.

2014-03-03 Thread John Cowan
Alaric Snell-Pym scripsit:

 Depending on what kind of code you want to write, you can do a lot in
 the language they have in common and then run the same code in whatever
 environment best suits your current activity...

Indeed.

The Schemer with just one Scheme is not the true Schemer.
That implementation is not the true implementation.

 Might need some ugly mechanism to deal with module export/import
 interop, however!

Alas, yes.  One of the main goals of R7RS is to standardize that.

-- 
John Cowan co...@ccil.org http://www.ccil.org/~cowan
Sir, I quite agree with you, but what are we two against so many?
--George Bernard Shaw,
 to a man booing at the opening of _Arms and the Man_

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


Re: [Chicken-users] Problems with the dollar egg.

2014-03-02 Thread Daniel Carrera
On 2 March 2014 17:34, John Cowan co...@mercury.ccil.org wrote:

 Daniel Carrera scripsit:

  Error: unbound variable: foreign-lambda*

 The Chicken FFI does not work in the interpreter.


Ok. :-(

Does that apply to other languages like Python?



  I have installed the numbers egg. When I run (use numbers) I get a lot of
  warnings to the effect of:

 I can't replicate this.  The procedures are being overridden as explained,
 but you shouldn't see warnings about them unless you are explicitly
 importing the scheme or chicken libraries, which is never necessary
 outside a module.  In a module, just ignore the warnings.


Ok. I'll leave it for now. I don't need the full numeric tower, I'm just
exploring.


Cheers,
Daniel.
-- 
When an engineer says that something can't be done, it's a code phrase that
means it's not fun to do.
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Problems with the dollar egg.

2014-03-02 Thread John Cowan
Daniel Carrera scripsit:

 Does that apply to other languages like Python?

Python does not work in the Chicken interpreter either.  :-) (Though in
principle one could write a Python egg using the Python/C API.)

But Python's FFI is accessible from the CPython interpreter, since there
is no other (commonly used) interface to CPython.

Chicken is primarily a compiled Scheme: the interpreter is slow
and inefficient, and provided mostly for testing, debugging, and
simple scripting.  If you are interested in interpreter-based Schemes
exclusively, I recommend Chibi Scheme.

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
If I have seen farther than others, it is because I was standing on
the shoulders of giants.
--Isaac Newton

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


Re: [Chicken-users] Problems with the dollar egg.

2014-03-02 Thread Daniel Carrera
On 2 March 2014 18:27, John Cowan co...@mercury.ccil.org wrote:


 Chicken is primarily a compiled Scheme: the interpreter is slow
 and inefficient, and provided mostly for testing, debugging, and
 simple scripting.  If you are interested in interpreter-based Schemes
 exclusively, I recommend Chibi Scheme.


Chibi is clearly for embedding... I don't know... and it doesn't seem to
have a module collection or documentation comparable to Chicken.

I just tried Chibi, but even with (chibi repl) I think its REPL is not as
good as CSI with GNU Readline. I guess that in my ideal world I would like
to play with a mature Scheme with many modules, that can be compiled, has
FFI, a nice interpreter, and plans to support R7RS... So, I guess that what
I want doesn't exist.

Cheers,
Daniel.
-- 
When an engineer says that something can't be done, it's a code phrase that
means it's not fun to do.
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Problems with the dollar egg.

2014-03-02 Thread John Cowan
Daniel Carrera scripsit:

 I just tried Chibi, but even with (chibi repl) I think its REPL is
 not as good as CSI with GNU Readline. I guess that in my ideal world I
 would like to play with a mature Scheme with many modules, that can be
 compiled, has FFI, a nice interpreter, and plans to support R7RS... So,
 I guess that what I want doesn't exist.

Racket is probably your best bet in that case.  It doesn't have an AOT
compiler like Chicken's, but its JIT compiler is decent.  Plenty of
modules, FFI, excellent interpreter and debugging tools.  I don't know
what their R7RS story will be yet.

-- 
Newbies always ask: John Cowan
  Elements or attributes?  http://www.ccil.org/~cowan
Which will serve me best?  co...@ccil.org
  Those who know roar like lions;
  Wise hackers smile like tigers.   --a tanka, or extended haiku

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