From: robbie carlton
Subject: possible reason for low popularity
Date: 
Message-ID: <32b5ef05.0406040356.223db2ea@posting.google.com>
Hi. I'm trying to get clx running with clisp on linux(debian) and I'm
having no luck. when I try to call open-display i get

"can't open display myhost:0"

I'm pretty sure :0 is the right display (it's the value of the DISPLAY
env variable), and the host is right. I've seen people saying this is
to do with xwindows security, and I've even seen a fix ... for cmucl
(call ext:open-clx-display instead). But I don't know how to make it
work for clisp.

Also, all I'm looking for from clx (at the moment) is a canvas to draw
on. clx is quite an unwieldy tool for this particular task, I was
wondering if there is a simpler library just for this kind of thing
(preferably one that doesn't need clx)

on a broader note (?) I think that part of the reason for lisps low
popularity could be to do with the fact it is hard to get it to /do/
anything. When I first started learning CL I was really excited by it,
and was reading all the hype about macros and first class functions
and increased productivity etc. And that stuff is all very cool. But
I've found it an uphill struggle (and I'm not at the summit yet) to
get it to do any of the things I'd like to be able to do (ie talk to
the OS and make GUIs/even just pretty pictures). Now say what you like
about java (and I do), but it's not long before you're drawing colored
squares, connecting to a network etc, and I think that is what makes
it so popular.
bring a little more of that into lisp and I think a lot more people
would be interested.

disclaimer: I am very new to lisp, and could possibly just be being
dense about making this stuff work but I know a couple of people who
got interested at the same time as me and have given up because of
these problems.

From: Chris Capel
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <10c0rcr3nkdlf16@corp.supernews.com>
robbie carlton wrote:

> on a broader note (?) I think that part of the reason for lisps low
> popularity could be to do with the fact it is hard to get it to /do/
> anything.

Well, I think the case may be more than Lisp's popularity in the past (and
moreso in the recent past) lies with people that aren't really very
interested in graphics, sound, GUI's, or newbie-friendliness. People use
lisp to solve hard problems in math and applied science. Now, in the past
year or to, it seems that more people have been discovering that Lisp is
just as useful in the more mundane (and to most programmers, familiar and
interesting) areas of programming. The problem is, because of the unique
nature of Lisp's userbase, no libraries had been written toward that goal
until the past couple of years (I think...). If people wanted to do those
things, they just hacked up something really quick that wasn't worth
distributing. There just weren't a lot of users demanding those features
who didn't have the ability to do that.

Another reason might be that Lisp is such an extensible language that people
have a hard time saying "Oh, this part of the project is really orthogonal
to the main goals, and could be put into a library". That sort of thing
just doesn't occur to them as often, because the language makes it so easy
to build up from the library into your own application, making it look like
the library was designed for exactly what you're doing.

So, Lisp, while it's really an old language, is acting a pretty new language
because of the immaturity of its libraries. Now, as with any new language,
the best thing to do to get involved is to figure out what needs to change
to get you running these libraries successfully, and submit those changes
to the maintainers of those packages, along with any suggestions for more
general changes that would make the process nicer.

Myself, I haven't had any problems, after a few false starts, with
Linux/SBCL/Emacs/SLIME/ASDF/TBNL*. I'm serving out web pages! Cool. Of
course, there are lots of platforms, lots of implementations, not so many
editors (but still a few), different defsystems, and many different
libraries. And, most importantly, a pretty small user base. Now, none of
these things are surprising, especially considering the age of the
language, but they do make it really easy for incompatibilities to arise.
One thing that is probably a blessing in the end, even though it's really
annoying now, is how the different implementations don't have an obvious,
strong leader. That fact means that the set of implementations any given
library runs on is pretty much random, from your POV. Fortunately, we have
an ANSI standard, without which we would probably all be Scheming. 

Chris Capel

*Edi Weitz's minimal web app lib.
From: Ray Dillinger
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <MrkAc.17419$Fo4.225477@typhoon.sonic.net>
Chris Capel wrote:
> 
> Well, I think the case may be more than Lisp's popularity in the past (and
> moreso in the recent past) lies with people that aren't really very
> interested in graphics, sound, GUI's, or newbie-friendliness. People use
> lisp to solve hard problems in math and applied science. Now, in the past
> year or to, it seems that more people have been discovering that Lisp is
> just as useful in the more mundane (and to most programmers, familiar and
> interesting) areas of programming. The problem is, because of the unique
> nature of Lisp's userbase, no libraries had been written toward that goal
> until the past couple of years (I think...). If people wanted to do those
> things, they just hacked up something really quick that wasn't worth
> distributing. There just weren't a lot of users demanding those features
> who didn't have the ability to do that.


I dunno.  I tend to avoid graphics/windowing code because they
tend to make a program too OS-dependent.  The code to set up a
neural network and run a regression is eternal; the code to
display a pretty picture about it will need work every time
the OS goes through a revision or you try to port it.  I'd
just rather spend my time on stuff that lasts.

				Bear
From: Espen Vestre
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <kw3c5bleco.fsf@merced.netfonds.no>
··············@hotmail.com (robbie carlton) writes:

> I'm pretty sure :0 is the right display 

are you sure it isn't :0.0?

> the OS and make GUIs/even just pretty pictures). Now say what you like
> about java (and I do), but it's not long before you're drawing colored
> squares, connecting to a network etc, and I think that is what makes
> it so popular.
> bring a little more of that into lisp and I think a lot more people
> would be interested.

You might be interested in looking at LispWorks. The free version
is functional enough to play around with, and there are many example
files with "things that go bing".
-- 
  (espen)
From: Alan Shutko
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <87vfi7baiw.fsf@wesley.springies.com>
Espen Vestre <·····@*do-not-spam-me*.vestre.net> writes:

> ··············@hotmail.com (robbie carlton) writes:
>
>> I'm pretty sure :0 is the right display 
>
> are you sure it isn't :0.0?

That's irrelevant, they're the same thing.

-- 
Alan Shutko <···@acm.org> - I am the rocks.
Never, ever, french-kiss a dragon!
From: Julian Stecklina
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <86y8n284or.fsf@web.de>
Espen Vestre <·····@*do-not-spam-me*.vestre.net> writes:

> You might be interested in looking at LispWorks. The free version
> is functional enough to play around with, and there are many example
> files with "things that go bing".

Yeah, Monty Python rules. ;-)

Regards,
-- 
Julian Stecklina 

Signed and encrypted mail welcome.
Key-Server: pgp.mit.edu         Key-ID: 0xD65B2AB5
FA38 DCD3 00EC 97B8 6DD8  D7CC 35D8 8D0E D65B 2AB5

Any sufficiently complicated C or Fortran program
contains an ad hoc informally-specified bug-ridden
slow implementation of half of Common Lisp.
 - Greenspun's Tenth Rule of Programming
From: Ingvar
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <m2pt8f1nhi.fsf@head.cathouse.bofh.se>
··············@hotmail.com (robbie carlton) writes:

> Hi. I'm trying to get clx running with clisp on linux(debian) and I'm
> having no luck. when I try to call open-display i get
> 
> "can't open display myhost:0"

With a probability borderuing on certainty, this is because your X
display requires MIT-MAGIC-COOKIE authentication. At least with the
CLX distributed with CMU CL, the code snippet futhre down works. If
you are using SB-CLX, the function you want is OPEN-DEFAULT-DISPLAY.

Alternatively, "xhost +" may, possibly, work.


(in-package :xrandom)
;; The following function is taken from Reini Urban
;; comp.lang.lisp, <·················@judy.x-ray.local>
;; Wed, 30 Jun 1999 14:12:45 GMT
(defun strtok (s delims)        
  "List of tokenized string parts"
  (let ((len    (length s))
        (s1 "")
        (lst))
    (do ((c)(i (1- len) (decf i)))
        ((< i 0))
      (setq c (aref s i))
      (if (member c delims)
          (setq lst (cons s1 lst)
		s1 "")
	(setq s1 (strcat (string c) s1)
	      )))
    (cons s1 lst)))

(defun strcat (s1 s2)
  (format nil "~a~a" s1 s2))

(defun parse-environment-string (&optional str)
  (let ((segments (strtok (if str str (xlib::getenv "DISPLAY")) '(#\:))))
    (let ((host (if (string= "" (car segments))
		    "localhost"
		  (car segments)))
	  (display1 (cadr segments)))
      (let* ((segments (strtok display1 '(#\.)))
	     (display (car segments)))
	(list host (parse-integer display))))))

(defun new-display (&optional str)
  (let ((args (parse-environment-string str)))
    (let ((new-display)
	  (host (car args))
	  (display (cadr args)))
      (let ((local (string= host "localhost")))
	(ignore-errors
	  (setf new-display (xlib:open-display host :display display)))
	(unless new-display
	  (multiple-value-bind (authname authdata)
	      (xlib::get-best-authorization
	       host display (if local :unix :tcp))
	    (setf new-display
		  (xlib:open-display (if local "unix" host)
				     :display display
				     :protocol (if local :unix :tcp)
				     :authorization-name authname
				     :authorization-data authdata
				     ))))
	new-display))))


-- 
"No. Most Scandiwegians use the same algorithm as you Brits.
 "Ingvar is just a freak."
Stig Morten Valstad, in the Monastery
From: Sergey Kataev
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <a24q9c.s5c.ln@195.171.216.1>
Ingvar wrote:
> ··············@hotmail.com (robbie carlton) writes:
> 
> 
>>Hi. I'm trying to get clx running with clisp on linux(debian) and I'm
>>having no luck. when I try to call open-display i get
>>
>>"can't open display myhost:0"
 >
>>>>>>>snip<<<<<<
> 
> Alternatively, "xhost +" may, possibly, work.

Exactly, I've run into a similar problem running demos on clisp+mit_clx, 
and `xhost +` had done the job.

Also I had to fix input.lisp, look for a line like
   ,@',(mapcar #'macroexpand get-code)
and change it to
   ,@(mapcar #'macroexpand ',get-code)

The recent version of mit_clx distributed with clisp had that line 
changed, but didnt work for me either until a similar change.

Anyway, if your clisp stops execution saying there's no arguments to 
(QUOTE), try to find the line with #'macroexpand in your input.lisp and 
replace it as above.

Best of luck,
   Sergey
From: Joerg Hoehle
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <ullhm9avu.fsf@users.sourceforge.net>
Hi,

Sam Steingold asked me to respond to this thread with the following
information w.r.t. clisp and clx

Sam>could you please ask them to try the latest version of CLISP?
Sam>this problem was a combination of a backquote bug and a broken
Sam>workaround.
Sam>both have been fixed in 2.32.2, I think.
Sam>I do know that they are fixed in the CVS HEAD.

Sergey Kataev <······@spamy.net> writes:
> Also I had to fix input.lisp, look for a line like
>    ,@',(mapcar #'macroexpand get-code)
> and change it to
>    ,@(mapcar #'macroexpand ',get-code)
> 
> The recent version of mit_clx distributed with clisp had that line 
> changed, but didnt work for me either until a similar change.
> 
> Anyway, if your clisp stops execution saying there's no arguments to 
> (QUOTE), try to find the line with #'macroexpand in your input.lisp and 
> replace it as above.

Regards,
	Jorg Hohle
Telekom/T-Systems Technology Center
From: Mario S. Mommer
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <fz1xkvfpw8.fsf@germany.igpm.rwth-aachen.de>
··············@hotmail.com (robbie carlton) writes:
> Hi. I'm trying to get clx running with clisp on linux(debian) and I'm
> having no luck. when I try to call open-display i get
>
> "can't open display myhost:0"
>
> I'm pretty sure :0 is the right display (it's the value of the DISPLAY
> env variable), and the host is right. I've seen people saying this is
> to do with xwindows security, and I've even seen a fix ... for cmucl
> (call ext:open-clx-display instead). But I don't know how to make it
> work for clisp.

CLisp is a strange one. It does a lot of things pretty well, but has a
lot of odd limitations. I prefer cmucl + emacs (without emacs sitting
on top of it, cmucl's top level prompt is a bit unfriendly. But just
run M-x run-lisp after firing up emacs and there is quite a bit you
can do).

> Also, all I'm looking for from clx (at the moment) is a canvas to draw
> on. clx is quite an unwieldy tool for this particular task,

Yes indeed...

> I was wondering if there is a simpler library just for this kind of
> thing (preferably one that doesn't need clx)

Something tells me that in a week or so I could recommend you one :-)

> on a broader note (?) I think that part of the reason for lisps low
> popularity could be to do with the fact it is hard to get it to /do/
> anything. When I first started learning CL I was really excited by it,
> and was reading all the hype about macros and first class functions
> and increased productivity etc. And that stuff is all very cool. But
> I've found it an uphill struggle (and I'm not at the summit yet) to
> get it to do any of the things I'd like to be able to do (ie talk to
> the OS and make GUIs/even just pretty pictures). Now say what you like
> about java (and I do), but it's not long before you're drawing colored
> squares, connecting to a network etc, and I think that is what makes
> it so popular.

Oddly enough, I have never had problems connecting to a network. You
are right that there are a few libs less than would be optimal, but I
don't think this is as bad as you are painting it.

> bring a little more of that into lisp and I think a lot more people
> would be interested.

It is happening by the day. It just takes time.

> disclaimer: I am very new to lisp, and could possibly just be being
> dense about making this stuff work but I know a couple of people who
> got interested at the same time as me and have given up because of
> these problems.

Ask and you will get answers :-)
From: Svein Ove Aas
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <c9ptni$22qa$1@news.dataguard.no>
Mario S. Mommer wrote:

>> Also, all I'm looking for from clx (at the moment) is a canvas to draw
>> on. clx is quite an unwieldy tool for this particular task,
> 
> Yes indeed...
> 
>> I was wondering if there is a simpler library just for this kind of
>> thing (preferably one that doesn't need clx)
> 
> Something tells me that in a week or so I could recommend you one :-)

How about cl-sdl?
From: charlieb
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <2ibjs6FkduorU1@uni-berlin.de>
Svein Ove Aas wrote:

> Mario S. Mommer wrote:
> 
> 
>>>Also, all I'm looking for from clx (at the moment) is a canvas to draw
>>>on. clx is quite an unwieldy tool for this particular task,
>>
>>Yes indeed...
>>
>>
>>>I was wondering if there is a simpler library just for this kind of
>>>thing (preferably one that doesn't need clx)
>>
>>Something tells me that in a week or so I could recommend you one :-)
> 
> 
> How about cl-sdl?
> 
I was also looking for a canvas to play with a while ago and I ended up 
using cl-sdl. It is great, simple but very effective.
From: Joe Marshall
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <8yf3gvtk.fsf@comcast.net>
··············@hotmail.com (robbie carlton) writes:

> on a broader note (?) I think that part of the reason for lisps low
> popularity could be to do with the fact it is hard to get it to /do/
> anything. 

Frankly, I don't care much about how popular the language is.  If I
did, I'd use Visual Basic.

I don't find it difficult to get lisp to do things.  It is true that
I've been hacking lisp since before some of the readers here were
born, but I really do think that lisp is easier to use than any other
language.

> When I first started learning CL I was really excited by it, and was
> reading all the hype about macros and first class functions and
> increased productivity etc.  And that stuff is all very cool.  But
> I've found it an uphill struggle (and I'm not at the summit yet) to
> get it to do any of the things I'd like to be able to do (ie talk to
> the OS and make GUIs/even just pretty pictures).

Ah.  Well we here at comp.lang.lisp can help out on this front.

When Common Lisp was developed there were several popular operating
systems.  ITS, TOPS-20, VMS, and Lisp Machine, to name a few.  (PCs
didn't have the horsepower).  There weren't many features in common
between these OSs, so there was no good reason to attempt to design a
common portable API.  If you wanted a GUI, you got a Lisp Machine ---
you can't really put much of a GUI on a VT52 or VT100.

Nowadays, however, most users are probably running a Windows or Unix
variant, so it is reasonable to want some semi-portable calls into the
OS.  Unfortunately, Windows and Unix provide a rather primitive ABI,
and do not provide lisp bindings.  Getting Lisp to behave as if it
were a C program for the sake of talking to the OS can be tricky.
(But it's nowhere *near* as tricky as getting a C program to behave
like Lisp for the sake of talking to the user.)

So the first question to ask is, what implementation of Lisp are you
using?  On Windows, Corman Common Lisp has very nice integration with
the OS, and it only took me a tiny amount of time to get a ball to
bounce around a window and have a paddle track the mouse.  On Unix, it
took me about half a day to get CLisp to monitor the traffic generated
by a distributed game.

> Now say what you like
> about java (and I do), but it's not long before you're drawing colored
> squares, connecting to a network etc, and I think that is what makes
> it so popular.
> bring a little more of that into lisp and I think a lot more people
> would be interested.
>
> disclaimer: I am very new to lisp, and could possibly just be being
> dense about making this stuff work but I know a couple of people who
> got interested at the same time as me and have given up because of
> these problems.

Stick to it.  You'll draw them back in shortly.

-- 
~jrm
From: Alan Crowe
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <86wu2jbdo6.fsf@cawtech.freeserve.co.uk>
robbie carlton wrote:
> Also, all I'm looking for from clx (at the moment) is a
> canvas to draw on. clx is quite an unwieldy tool for this
> particular task, I was wondering if there is a simpler
> library just for this kind of thing (preferably one that
> doesn't need clx)

I think you are right that clx is unwieldy if you just want
a canvas to draw on.

If you decide that you want to play with clx, just for the
hell of it, I was working on a tutorial

http://alan.crowe.name/clx/simple/examples.txt

Work has stopped due to health problems. Nevertheless, I
think that there is enough there to get some-one started
with clx, and I hope to get back to working on it one day.

Alan Crowe
Edinburgh
Scotland
From: robbie carlton
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <32b5ef05.0406080354.779f7096@posting.google.com>
Thanks for all the suggestions. My linux box has just died, so it's
gonna be a little while before I can try anything with clx again.
Using corman common lisp now, and it seems cool (I miss emacs). Just
have to go and learn the windows API. ho humm.
From: Peter Herth
Subject: Re: possible reason for low popularity
Date: 
Message-ID: <caa85d$pde$2@newsreader2.netcologne.de>
robbie carlton wrote:

> Also, all I'm looking for from clx (at the moment) is a canvas to draw
> on. clx is quite an unwieldy tool for this particular task, I was
> wondering if there is a simpler library just for this kind of thing
> (preferably one that doesn't need clx)

I think, Ltk could be of help there. It offers a decent canvas
widget to display graphics on and should be quite easy to use.
You can find it here: http://www.peter-herth.de/ltk/
In the documentation there is a simple example of drawing upon
the canvas.

Peter

-- 
Peter Herth
pet project: http://dawn.netcologne.de
homepage:    http://www.peter-herth.de
lisp stuff:  http://www.peter-herth.de/lisp.html