Bots in Lisp?

lisp

    Next

  • 1. Calling lisp functions
    I'm using ECL a lot but have yet to see posted a comprehensive example on how to embed CL functions. I see bits and pieces but nothing complete from A to Z. Documentation is not the strongest point of this implementation (but sure everything else is, it's an awesome CL implementation). Say I have this horrible toy lisp function in file toy.lisp: (defun random-10 () (loop repeat 10 collect (random 1.0) into rndtemp finally (return (values (setf rnd rndtemp))))) and I want to refer to it from within this test.c: int main () { ... bla bla bla; ...(random-10)...; bla bla; ... } How to do it and also how to compile it? (what gcc instructions and arguments need to be supplied? against which library it needs to be linked? on what is it dependent etc?) Either Linux or Win32. Thanks
  • 2. Code style question
    I stumbled across the following code (in the regex library by Kenneth Parker) and would, out of curiosity, like to know what people think of it: (defun make-anchored-matcher (matchfn) #'(lambda (*str* *regs* *start* *end* *start-is-anchor* *end-is-anchor* *acceptfn* *hooks*) (declare (special *str* *regs* *start* *end* *start-is-anchor* *end-is-anchor* *acceptfn* *hooks*)) (declare (ftype (function (fixnum) t) matchfn)) (catch 'cease-matching (funcall matchfn *start*)))) and other functions would then also declare *end* and friends special. This leads to a bunch of warnings about unknown variables in SBCL 1.0.22. Any reason not to add a slew of 'defvar's to kill those warnings? ------------------------+----------------------------------------------------- Christian Lynbech | christian #\@ defun #\. dk ------------------------+----------------------------------------------------- Hit the philistines three times over the head with the Elisp reference manual. - XXXX@XXXXX.COM (Michael A. Petonic)

Bots in Lisp?

Postby solo88 » Sat, 14 Aug 2004 11:03:22 GMT

Hi guys,
I have been thinking about writing a bot (probably for IRC), and was
wondering if this could be done fairly easily in Lisp. I know it is
fairly easy to build a KB with Lisp, but what about the advantages a
langauge such as Perl would offer to the speed of extracting key words
from input to give sensible answers. Can Lisp do this as fast as Perl
can?
What other factors are there to desinging a bot?
Thanks.

-- 
May the Source be with you.
neo88 (Philip Haddad)

Re: Bots in Lisp?

Postby Pascal Bourguignon » Sat, 14 Aug 2004 13:27:53 GMT

 XXXX@XXXXX.COM  (neo88) writes:


In which language do you think minion is programmed?
Does it feel fast enough for you?



-- 
__Pascal Bourguignon__                      http://www.**--****.com/ 

Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.

Re: Bots in Lisp?

Postby John Thingstad » Sat, 14 Aug 2004 16:08:08 GMT

regexps in lisp are known to be fatster than in perl due to the fact that
each regexp gets compiled to machine code rahter than run through an  
interpreter.
So yes you can expect better performance in lisp. The question is.. do you  
need it?







-- 
Using M2, Opera's revolutionary e-mail client:  http://www.**--****.com/ 

Re: Bots in Lisp?

Postby Michael Hudson » Sat, 14 Aug 2004 19:44:50 GMT

 XXXX@XXXXX.COM  (neo88) writes:


Say what?  I really can't think of a language where it would be hard
to do this fast enough.  Hell, bash + associated text utility programs
would be fine.


Remember "premature optimization ..."

Cheers,
mwh

-- 
  I'd certainly be shocked to discover a consensus.  ;-)
                                             -- Aahz, comp.lang.python

Re: Bots in Lisp?

Postby solo88 » Sun, 15 Aug 2004 02:59:13 GMT



Let me guess... Lisp. minion is pretty fast, although it seems like
database lookup can be slow from time to time, but maybe that's cause
he's getting to many requests.


-- 
May the Source be with you.
neo88 (Philip Haddad)

Re: Bots in Lisp?

Postby colinthecow2003 » Mon, 16 Aug 2004 10:23:07 GMT

Take a look at what is already available:

www.cliki.net/Lisp%20IRC%20Bots

https://sourceforge.net/projects/claim/

Re: Bots in Lisp?

Postby solo88 » Mon, 16 Aug 2004 21:51:31 GMT



I've looked at both of those links, and I found them to be quite
interesting, espcially the first one. I was looking for a bot's source
to read, one in CMUCL, since that is what I'll be using, and found
WmBot. And after I *finally* got ASDF working, I should be able to
load cl-irc.
Since I've never done any network programming before though, I have to
start with the basics of that :-) I have already read Mario Mommer's
documentation on it in the CMU-User's Guide. But I need some more
references that show more of what is involved. Google doesn't do so
well, returning a lot on C++ networking and such. I am not expecting
to be able to write this thing in just a few short weeks either, since
I'm still a bit new to Lisp, I relieze this could take some time.

-- 
May the Source be with you.
neo88 (Philip Haddad)

Re: Bots in Lisp?

Postby solo88 » Wed, 18 Aug 2004 05:18:33 GMT

> And after I *finally* got ASDF working, I should be able to

Should be able to get cl-irc working is about right. I keep getting
this error when doing:

(asdf:operate 'asdf:load-op :cl-irc)
==>
Unable to display error condition: Error in format: Unknown format
directive.
  ~@<component ~S not found~
             ~@[ or does not match version ~A~]~
             ~@[ in ~A~]~@:>
                            ^
   [Condition of type ASDF:MISSING-COMPONENT]

The full backtrace can be found here:
 http://www.**--****.com/ 
So I guess my question is what are the missing components that asdf is
complaining about? I have all of the cl-irc files symlinked in the
manner described here:  http://www.**--****.com/ 

Can someone please help me? I really want to get this working! Thanks.

-- 
May the Source be with you.
neo88 (Philip Haddad)

Re: Bots in Lisp?

Postby John Thingstad » Wed, 18 Aug 2004 18:15:55 GMT

You seem to have negelected saying with what lisp and os you are working  
with.







-- 
Using M2, Opera's revolutionary e-mail client:  http://www.**--****.com/ 

Re: Bots in Lisp?

Postby solo88 » Wed, 18 Aug 2004 22:24:23 GMT



CMUCL 18e on Mandrake Linux 9.1

-- 
May the Source be with you.
neo88 (Philip Haddad)

Re: Bots in Lisp?

Postby Marco Antoniotti » Thu, 19 Aug 2004 00:23:22 GMT





I bet this is a UNIX/DOS end of line mess.

Check the file encoding and the ~<newline> in the format string.  Maybe 
your lisp on DOS or UNIX does not recognize the proper ~<newline> coming 
from UNIX or DOS.

Cheers

Re: Bots in Lisp?

Postby solo88 » Thu, 19 Aug 2004 10:41:14 GMT

> I bet this is a UNIX/DOS end of line mess.

Well, I got it so that now asdf hangs with the error
"MISSING-DEPENDENCY" instead of "MISSING-COMPONENT" as before. I
actually hangs right after it starts to make the package cl-irc. I
think what I am going to have to do is get all of the files form
viewcvs and make them a tarball myself gzip them, then tar xzfv them
over the older ones. That is my next plan anyways, it'll a wee bit
time-consuming, so I probably won't be able to get to it for the next
24 hours anyways :-(

-- 
May the Source be with you.
neo88 (Philip Haddad)

Similar Threads:

1.Corewars bots

I am learning x86 assembly and want to design corewar bots the thing is
i don't have a clue as to what i should do regarding the imp bot where
in the code has to copy itself ......
any ideas would be much appreciated...
Regards
Deepak

2.Make TCL bots that play Risk.

3.lisp web servers, lisp as a shell, lisp using rdbms or not

1 I saw the webserver huchentoot seems to want to sit behind apache?
araneida seesm to also? Why do they depend on apache?

2 I saw lisp on lines is kinda alpha

3 uncomon web seems cool but also wants to sit behind apache

4 common lisp as a shell is really doible? anyone do this?

5 for large apps is using a rdbms unavoidable?

6 does lisp support or mapping or persisten db conneciton pooling and
cacheing?

4.Are you interested in creation of separate group for common lisp comp.lang.common-lisp

5.Vancouver Lisp Users Group meeting for November 2008 - 0x20 Years of Lisp Systems, a Personal Journey

6. Are you interested in creation of separate group for common lisp comp.lang.common-lisp

7. Vancouver Lisp Users Group meeting for September 2008 - The BKNR Common Lisp web application development environment

8. Vancouver Lisp Users Group meeting for November 2008 - 0x20 Years of Lisp Systems, a Personal Journey



Return to lisp

 

Who is online

Users browsing this forum: No registered users and 89 guest