From: Edi Weitz
Subject: RDNZL (.NET for Common Lisp) - please test
Date: 
Message-ID: <ud5xjoxx1.fsf@agharta.de>
Hi!

As some of you might know from my Amsterdam talk or from Bill
Clementson's weblog I'm currently working on a .NET bridge for Common
Lisp[1] called RDNZL.  It is now in a quite usable state and before I
release it (it needs some more tweaks and some documentation) I'd like
to test it.  So, if you have a Windows machine it'd be very nice if
you could download and try one or both of the following applications:

1. <http://zappa.agharta.de/RDNZL_Eliza.zip>

   This is a 2.4MB ZIP archive that includes a file called Eliza.exe
   (a Lisp application delivered with Xanalys Lispworks) and two DLLs:
   RDNZL.dll is written in Managed C++ and is the glue needed to
   connect from Lisp to .NET.  ElizaGUI.dll is a Windows Control
   Library (written in C# and created with Visual Studio .NET) which
   is responsible for drawing the graphical user interface.

   If you have the .NET framework[2] installed you should be able to
   launch the application by double-clicking Eliza.exe provided all
   three files are in the same folder.  It's a simple Eliza program
   based on Peter Norvig's code[3] from the PAIP book.  The Lisp
   program loads the GUI DLL and instantiates it.  Whenever you enter
   text into the small text box on the bottom a Lisp function is
   called which generates Eliza's answer and writes it into the large
   text box.  That's it.  Nothing to write home about but it's just a
   test...

2. <http://zappa.agharta.de/RDNZL_Eliza_big.zip>

   This is a 30.6MB (!) ZIP archive which mainly consists of a Windows
   Installer file.  The reason this file is so big is that it includes
   a redistributable version of the .NET framework as well as a
   redistributable version of Microsoft's Text-to-Speech (TTS) engine
   - both of these will be installed if necessary and can be easily
   removed if you wish so.

   The actual Lisp application is the same as above with the added
   "benefit" that Eliza's answers are also spoken through your
   speakers.  For this the Lisp calls into another .NET library called
   SpeechLib.dll which interacts with the TTS engine via COM.
   SpeechLib.dll was written by Pedro Pinto and is distributed as a
   part of the Dot-Scheme[4] project.

If you download and test this stuff please let me know by email (see
the end of this message for my real email address) if it works for you
or if it doesn't.  Please, in both cases, include information about
your Windows version and the version of the .NET framework you have
installed.

Note that this is beta software and I can't guarantee for anything.
You might end up with a dead cat if you try it but you'll have the
warm and fuzzy feeling that you tried to help a Lisp open source
project... :)

Thanks in advance for your time,
Edi.

PS: In case you're curious, the Lisp code for the second application
    (minus Norvig's Eliza code) looks like this:

  (use-package :rdnzl)

  (let ((forms-assembly (load-assembly "System.Windows.Forms")))
    (import-type "System.Windows.Forms.KeyPressEventHandler" forms-assembly)
    (import-type "System.Windows.Forms.Application" forms-assembly)
    (import-type "System.Windows.Forms.Form" forms-assembly)
    (import-type "System.Windows.Forms.TextBox" forms-assembly)
    (import-type "System.Windows.Forms.DockStyle" forms-assembly))

  (let ((eliza-assembly (load-assembly "ElizaGUI")))
    (import-type "ElizaGUI.MainControl" eliza-assembly))

  (import-type "System.Environment")

  (use-namespace "System")
  (use-namespace "System.Windows.Forms")
  (use-namespace "ElizaGUI")

  (let ((speech-assembly (load-assembly "SpeechLib")))
    (import-type "SpeechLib.SpVoiceClass" speech-assembly)
    (import-type "SpeechLib.SpeechVoiceSpeakFlags" speech-assembly))

  (use-namespace "SpeechLib")

  (defun say (what)
    (let ((voice (new "SpVoiceClass")))
      (invoke voice "Speak" (format nil 
                                    "<voice required=\"Gender=Female\">~A</voice>"
                                    what)
              (combine-enums
               (field "SpeechVoiceSpeakFlags" "SVSFIsXML")
               (field "SpeechVoiceSpeakFlags" "SVSFlagsAsync")))))

  (defun run-form ()
    (let* ((user-name (property "Environment" "UserName"))
           (control (new "MainControl"))
           (form (new "Form"))
           (list-box (field control "listBox")))
      (flet ((reply (object event)
               (when (char= (property event "KeyChar") #\Return)
                 (cast object "TextBox")
                 (let ((input-string (property object "Text")))
                   (when (plusp (length input-string))
                     (let ((reply (eliza-reply input-string)))
                       (invoke list-box "AppendText" (format nil "~A: ~A~%Eliza: ~A~%"
                                                             user-name input-string
                                                             reply))
                       (say reply))
                     (setf (property object "Text") ""))))))
        (setf (property control "Dock") (field "DockStyle" "Fill")
              (property form "ClientSize") (property control "ClientSize")
              (property form "Text") "RDNZL Eliza")
        (invoke (field control "textBox")
                "add_KeyPress"
                (new "KeyPressEventHandler" #'reply))
        (invoke (property form "Controls") "Add" control)
        (invoke "Application" "Run" form))))

    The code for the first application is the same except for the SAY
    function and the SpeechLib stuff.  I'll add some reader macrology
    before I release RDNZL so finally calls into .NET will look a
    little bit neater than

  (field control "textBox")

    or 

  (invoke (property form "Controls") "Add" control)

    but I think you get the basic idea from this.

    RDNZL currently works fully with LispWorks.  Corman Lisp is also
    supported but there are some GC issues that I haven't resolved
    yet.  A port to AllegroCL is in the works.


[1] <http://weitz.de/files/RDNZL.pps>
[2] <http://msdn.microsoft.com/netframework/downloads/framework1_1/>
[3] <http://www.norvig.com/paip/eliza.lisp>
[4] <http://www.rivendell.ws/dot-scheme/>


-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")

From: drewc
Subject: Re: RDNZL (.NET for Common Lisp) - please test
Date: 
Message-ID: <NE5ud.473468$%k.165353@pd7tw2no>
Edi Weitz wrote:
> Hi!
> 
> As some of you might know from my Amsterdam talk or from Bill
> Clementson's weblog I'm currently working on a .NET bridge for Common
> Lisp[1] called RDNZL. 

Any idea what it would take to get it working on Mono and 
SBCL/<insert-free-lisp-here> ? After i saw the talk about the IronPython 
project via the LL4 videos, i actually have some hope for IL and the 
.Net framework.

But, of course, i am a non-microsoft shop. So Mono is probably the only 
way i'll get to play with .Net. and since I'm a lisp shop, RDNZL is 
probably my only excuse to play with Mono.

drewc




  It is now in a quite usable state and before I
> release it (it needs some more tweaks and some documentation) I'd like
> to test it.  So, if you have a Windows machine it'd be very nice if
> you could download and try one or both of the following applications:
> 
> 1. <http://zappa.agharta.de/RDNZL_Eliza.zip>
> 
>    This is a 2.4MB ZIP archive that includes a file called Eliza.exe
>    (a Lisp application delivered with Xanalys Lispworks) and two DLLs:
>    RDNZL.dll is written in Managed C++ and is the glue needed to
>    connect from Lisp to .NET.  ElizaGUI.dll is a Windows Control
>    Library (written in C# and created with Visual Studio .NET) which
>    is responsible for drawing the graphical user interface.
> 
>    If you have the .NET framework[2] installed you should be able to
>    launch the application by double-clicking Eliza.exe provided all
>    three files are in the same folder.  It's a simple Eliza program
>    based on Peter Norvig's code[3] from the PAIP book.  The Lisp
>    program loads the GUI DLL and instantiates it.  Whenever you enter
>    text into the small text box on the bottom a Lisp function is
>    called which generates Eliza's answer and writes it into the large
>    text box.  That's it.  Nothing to write home about but it's just a
>    test...
> 
> 2. <http://zappa.agharta.de/RDNZL_Eliza_big.zip>
> 
>    This is a 30.6MB (!) ZIP archive which mainly consists of a Windows
>    Installer file.  The reason this file is so big is that it includes
>    a redistributable version of the .NET framework as well as a
>    redistributable version of Microsoft's Text-to-Speech (TTS) engine
>    - both of these will be installed if necessary and can be easily
>    removed if you wish so.
> 
>    The actual Lisp application is the same as above with the added
>    "benefit" that Eliza's answers are also spoken through your
>    speakers.  For this the Lisp calls into another .NET library called
>    SpeechLib.dll which interacts with the TTS engine via COM.
>    SpeechLib.dll was written by Pedro Pinto and is distributed as a
>    part of the Dot-Scheme[4] project.
> 
> If you download and test this stuff please let me know by email (see
> the end of this message for my real email address) if it works for you
> or if it doesn't.  Please, in both cases, include information about
> your Windows version and the version of the .NET framework you have
> installed.
> 
> Note that this is beta software and I can't guarantee for anything.
> You might end up with a dead cat if you try it but you'll have the
> warm and fuzzy feeling that you tried to help a Lisp open source
> project... :)
> 
> Thanks in advance for your time,
> Edi.
> 
> PS: In case you're curious, the Lisp code for the second application
>     (minus Norvig's Eliza code) looks like this:
> 
>   (use-package :rdnzl)
> 
>   (let ((forms-assembly (load-assembly "System.Windows.Forms")))
>     (import-type "System.Windows.Forms.KeyPressEventHandler" forms-assembly)
>     (import-type "System.Windows.Forms.Application" forms-assembly)
>     (import-type "System.Windows.Forms.Form" forms-assembly)
>     (import-type "System.Windows.Forms.TextBox" forms-assembly)
>     (import-type "System.Windows.Forms.DockStyle" forms-assembly))
> 
>   (let ((eliza-assembly (load-assembly "ElizaGUI")))
>     (import-type "ElizaGUI.MainControl" eliza-assembly))
> 
>   (import-type "System.Environment")
> 
>   (use-namespace "System")
>   (use-namespace "System.Windows.Forms")
>   (use-namespace "ElizaGUI")
> 
>   (let ((speech-assembly (load-assembly "SpeechLib")))
>     (import-type "SpeechLib.SpVoiceClass" speech-assembly)
>     (import-type "SpeechLib.SpeechVoiceSpeakFlags" speech-assembly))
> 
>   (use-namespace "SpeechLib")
> 
>   (defun say (what)
>     (let ((voice (new "SpVoiceClass")))
>       (invoke voice "Speak" (format nil 
>                                     "<voice required=\"Gender=Female\">~A</voice>"
>                                     what)
>               (combine-enums
>                (field "SpeechVoiceSpeakFlags" "SVSFIsXML")
>                (field "SpeechVoiceSpeakFlags" "SVSFlagsAsync")))))
> 
>   (defun run-form ()
>     (let* ((user-name (property "Environment" "UserName"))
>            (control (new "MainControl"))
>            (form (new "Form"))
>            (list-box (field control "listBox")))
>       (flet ((reply (object event)
>                (when (char= (property event "KeyChar") #\Return)
>                  (cast object "TextBox")
>                  (let ((input-string (property object "Text")))
>                    (when (plusp (length input-string))
>                      (let ((reply (eliza-reply input-string)))
>                        (invoke list-box "AppendText" (format nil "~A: ~A~%Eliza: ~A~%"
>                                                              user-name input-string
>                                                              reply))
>                        (say reply))
>                      (setf (property object "Text") ""))))))
>         (setf (property control "Dock") (field "DockStyle" "Fill")
>               (property form "ClientSize") (property control "ClientSize")
>               (property form "Text") "RDNZL Eliza")
>         (invoke (field control "textBox")
>                 "add_KeyPress"
>                 (new "KeyPressEventHandler" #'reply))
>         (invoke (property form "Controls") "Add" control)
>         (invoke "Application" "Run" form))))
> 
>     The code for the first application is the same except for the SAY
>     function and the SpeechLib stuff.  I'll add some reader macrology
>     before I release RDNZL so finally calls into .NET will look a
>     little bit neater than
> 
>   (field control "textBox")
> 
>     or 
> 
>   (invoke (property form "Controls") "Add" control)
> 
>     but I think you get the basic idea from this.
> 
>     RDNZL currently works fully with LispWorks.  Corman Lisp is also
>     supported but there are some GC issues that I haven't resolved
>     yet.  A port to AllegroCL is in the works.
> 
> 
> [1] <http://weitz.de/files/RDNZL.pps>
> [2] <http://msdn.microsoft.com/netframework/downloads/framework1_1/>
> [3] <http://www.norvig.com/paip/eliza.lisp>
> [4] <http://www.rivendell.ws/dot-scheme/>
> 
> 
From: Edi Weitz
Subject: Re: RDNZL (.NET for Common Lisp) - please test
Date: 
Message-ID: <umzwnkofb.fsf@agharta.de>
On Thu, 09 Dec 2004 23:58:37 GMT, drewc <·····@rift.com> wrote:

> Any idea what it would take to get it working on Mono and
> SBCL/<insert-free-lisp-here> ?

I don't know.  Microsoft's "Managed C++" is what enabled me to write
the glue library (based on Pedro Pinto's work).  It can generate
shared libraries that look like C code from Lisp and look like .NET
code from the CLR.  You can't do that with C# or other "native" .NET
languages.  Does something like "Managed C++" exist for Mono?

Cheers,
Edi.
From: drewc
Subject: Re: RDNZL (.NET for Common Lisp) - please test
Date: 
Message-ID: <fT9ud.474426$%k.51084@pd7tw2no>
Edi Weitz wrote:
> On Thu, 09 Dec 2004 23:58:37 GMT, drewc <·····@rift.com> wrote:
> 
> 
>>Any idea what it would take to get it working on Mono and
>>SBCL/<insert-free-lisp-here> ?
> 
> 
> I don't know.  Microsoft's "Managed C++" is what enabled me to write
> the glue library (based on Pedro Pinto's work).  It can generate
> shared libraries that look like C code from Lisp and look like .NET
> code from the CLR.  You can't do that with C# or other "native" .NET
> languages.  Does something like "Managed C++" exist for Mono?

Unfortunately, not at this time. they are working on something similar, 
apparently using GCC as the front end. nothing yet though :(

drewc

> 
> Cheers,
> Edi.
From: Edi Weitz
Subject: Re: RDNZL (.NET for Common Lisp) - please test
Date: 
Message-ID: <upt1fb4v5.fsf@agharta.de>
On Fri, 10 Dec 2004 00:27:06 +0100, Edi Weitz <········@agharta.de> wrote:

> If you download and test this stuff please let me know by email (see
> the end of this message for my real email address) if it works for
> you or if it doesn't.

Hmmm.  Fifty downloads so far but only seven emails until now.  I hope
the other ones didn't email because it just worked for them...

Cheers,
Edi.
From: Tayssir John Gabbour
Subject: Re: RDNZL (.NET for Common Lisp) - please test
Date: 
Message-ID: <1102898102.166957.302700@z14g2000cwz.googlegroups.com>
A bugreport sheet like this might help testers. The "Which?" part is
already filled out.

My head feels like it's in gauze, maybe other hazy minds out there will
find it useful.

-----

* Which?
http://zappa.agharta.de/RDNZL_Eliza.zip

* Works? (If not, what happened? Type into the small text box then
press enter. ELIZA should answer.)

* Windows version?

* .NET version?


-----

* Which?
http://zappa.agharta.de/RDNZL_Eliza_big.zip

* Works? (If not, what happened? Type into the small text box then
press enter. ELIZA should answer.)

* Does sound work? (ELIZA should speak with female/androgynous voice.)

* Windows version?

* .NET version? (If you just used the installer's version, you can just
say "Installed with Eliza-big.")



MfG,
Tayssir

--
Tyranny of the majority is another term for democracy.
Tragedy of the commons is averted by the simplest communication.
Decentralized democracy helps keep rights intact.
From: Kenny Tilton
Subject: Re: RDNZL (.NET for Common Lisp) - please test
Date: 
Message-ID: <Sj7vd.24174$Yh2.10636235@twister.nyc.rr.com>
Edi Weitz wrote:

> On Fri, 10 Dec 2004 00:27:06 +0100, Edi Weitz <········@agharta.de> wrote:
> 
> 
>>If you download and test this stuff please let me know by email (see
>>the end of this message for my real email address) if it works for
>>you or if it doesn't.
> 
> 
> Hmmm.  Fifty downloads so far but only seven emails until now.  I hope
> the other ones didn't email because it just worked for them...

Good news: it worked on my windows xp home system, going from the "big" 
install.

Bad news: Eliza was frickin useless at helping me with callbacks into 
Lispworks.

Go on. Go on. Go on.... :)

kenny

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: David Steuber
Subject: Re: RDNZL (.NET for Common Lisp) - please test
Date: 
Message-ID: <87is76hom8.fsf@david-steuber.com>
Kenny Tilton <·······@nyc.rr.com> writes:

> Bad news: Eliza was frickin useless at helping me with callbacks into
> Lispworks.

So much for Eliza being Turing complete.

-- 
An ideal world is left as an excercise to the reader.
   --- Paul Graham, On Lisp 8.1
From: Pascal Bourguignon
Subject: Re: RDNZL (.NET for Common Lisp) - please test
Date: 
Message-ID: <874qiqq37k.fsf@thalassa.informatimago.com>
David Steuber <·····@david-steuber.com> writes:

> Kenny Tilton <·······@nyc.rr.com> writes:
> 
> > Bad news: Eliza was frickin useless at helping me with callbacks into
> > Lispworks.
> 
> So much for Eliza being Turing complete.

Not a surprize.  Don't you ever use M-x doctor ?


I am the psychotherapist.  Please, describe your problems.  Each time
you are finished talking, type RET twice.

Hello! Are you Turing Complete?

How do you do?  What brings you to see me?

Wanted to know whether you're Turing Complete?

Why do you say wanted to know whether I am turing complete?

Because Kenny said you were frickin useless at helping me with callbacks into Lispworks.

Is it because kenny said I was frickin useless at helping you with
callbacks into lispworks that you came to me?

Yes. I wanted to know your opinion.

Earlier you said kenny said I was frickin useless at helping you with
callbacks into lispworks?

That's the question. Are you?

Maybe your plans have something to do with this.

I have no plans.

Is it because of your life that you say you have no plans?

Good bye.

My secretary will send you a bill.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
The world will now reboot; don't bother saving your artefacts.