From: ········@gmail.com
Subject: basic questions
Date: 
Message-ID: <83d7e7c3-56a4-4a80-a9c4-db1877b50ff0@w73g2000hsf.googlegroups.com>
My apologies in advance. This is the first post in what likely will be
many, so I ask your indulgence.

I've developed in Perl and Java, and have also done some development
in C, Python, and VB. I'm a database manager for a large state
university and have an MS in CS (FWIW). I've slogged my way through
Paul Graham's ANSI Common Lisp, and have read mostly through Peter
Seibel's Practical Common Lisp several times, and have toyed with Lisp
in a box. I have installed CMUCL on a Linux machine and have played
with that. I am using CMU Common Lisp post-18e CVS 2003-04-23

I've decided to do more than just wet my toes, so here goes -- this is
my question.
I can do this:
> gcc -o hello hello.c
> chmod 755 hello
> hello
Hello

I can also do this:
> javac Hello.java
> java Hello
Hello

I can also do this:
> perl hello.plx
Hello

I have a file named hello.lisp that looks like this: (format t "~
%Hello~%")
Why can't I do this:
> lisp hello.lisp
or
> lisp -load hello.lisp
or
> lisp -file hello.lisp

If I can't run a simple Hello World console application, I might as
well give up.

Thanks, CC.

From: Jason
Subject: Re: basic questions
Date: 
Message-ID: <785b00af-1786-403a-be26-61fe4d7fc91d@d21g2000prf.googlegroups.com>
On Nov 19, 6:50 am, ········@gmail.com wrote:
> My apologies in advance. This is the first post in what likely will be
> many, so I ask your indulgence.
>
> I've developed in Perl and Java, and have also done some development
> in C, Python, and VB. I'm a database manager for a large state
> university and have an MS in CS (FWIW). I've slogged my way through
> Paul Graham's ANSI Common Lisp, and have read mostly through Peter
> Seibel's Practical Common Lisp several times, and have toyed with Lisp
> in a box. I have installed CMUCL on a Linux machine and have played
> with that. I am using CMU Common Lisp post-18e CVS 2003-04-23
>
> I've decided to do more than just wet my toes, so here goes -- this is
> my question.
> I can do this:> gcc -o hello hello.c
> > chmod 755 hello
> > hello
>
> Hello
>
> I can also do this:> javac Hello.java
> > java Hello
>
> Hello
>
> I can also do this:> perl hello.plx
>
> Hello
>
> I have a file named hello.lisp that looks like this: (format t "~
> %Hello~%")
> Why can't I do this:
>
> > lisp hello.lisp
> or
> > lisp -load hello.lisp
> or
> > lisp -file hello.lisp
>
> If I can't run a simple Hello World console application, I might as
> well give up.
>
> Thanks, CC.

$ cat hw.lisp
(defun hello-world ()
  (format t "~a~%" "Hello, World!"))

(hello-world)
$ clisp hw.lisp
Hello, World!

$
From: Slobodan Blazeski
Subject: Re: basic questions
Date: 
Message-ID: <37c7edce-5c9d-4734-8311-ab722f4e4f95@e25g2000prg.googlegroups.com>
Hi CC

First you must understand that you stepped into a completely new
world, different from everything you sow before, see below for
illustration
http://www.noulakaz.net/weblog/images/20051230-lisp-is-different.jpg
As someone who is coming from Basic, Pascal,C/C++, C# you're problem
is the first thing I've encountered myself. The strong urge to make an
console application.
Well you CAN do that, for the exact way  you'd have to read the
documentation or get an tip from CMUCL user, as I'm using Allegro
Enterprise  (commercial)  and SBCL (free) .

But Lisp way of development is creating applications dynamically using
the editor and listener.
Just imagine that you're on holiday in Bahamas, congress vote a new
tax and now angry customers calls your company that your application
is miscalculating the tax release for the veterans of the first Gulf
war. So the boss screams at you to get the first flight home. And you
just smile  knowing that you wrote you application in lisp. Start
emacs , connect to your running application in the Virgin Island
server, and while there are 3000 connected users, you type in your
listener :
(defmethod tax-deduction (obj first-gulf-war-veterans)
  (deduct 10% obj))
and everything is good again. Those 3000 connected users didn't
noticed that you we're debugging your code, because you didn't shut
down the server, but tax deduction works as expected.
 For a great video of such example see http://www.beta9.be/svc/lisp-movie-2-reddit.mov
from
http://homepage.mac.com/svc/LispMovies/index.html   or if you have an
hour to spent
http://common-lisp.net/movies/slime.mov http://common-lisp.net/movies/slime.torrent

I suggest  to read this thread
http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/9d0080bd3be9ddea/9e0ab129d28fb21b?lnk=gst&q=shameless+selfquoting+slobodan#9e0ab129d28fb21b
   for a starting with lisp. There's a plenty of learning material and
suggested implementations for learning lisp.

happy lisping
Slobodan
From: Lars Rune Nøstdal
Subject: Re: basic questions
Date: 
Message-ID: <0ffa8a9a-3bce-4ba9-8fb3-bbbac83eea74@c30g2000hsa.googlegroups.com>
On Nov 19, 3:50 pm, ········@gmail.com wrote:
> Why can't I do this:
>
> > lisp hello.lisp
> or
> > lisp -load hello.lisp
> or
> > lisp -file hello.lisp
>
> If I can't run a simple Hello World console application, I might as
> well give up.
>
> Thanks, CC.

So, why do you want to exit your Lisp after printing "Hello World"?
I'd never do that. I'd like to debug, run, code and test my `Hello
World'-application so it would print "Hello World!!!!11!1!!" instead
-- and I'd like to do it all using Lisp itself.

Don't you have an operating system that can start or run multiple
processes -- even processes/servers in the background?

(but ok, others have answered)

--
Lars Rune Nøstdal
http://nostdal.org/
From: ········@gmail.com
Subject: Re: basic questions
Date: 
Message-ID: <c5c3d94f-da05-402a-9821-e282f9b2de92@y43g2000hsy.googlegroups.com>
On Nov 19, 3:29 pm, "Lars Rune Nøstdal" <···········@gmail.com> wrote:
> So, why do you want to exit your Lisp after printing "Hello World"?
> I'd never do that. I'd like to debug, run, code and test my `Hello
> World'-application so it would print "Hello World!!!!11!1!!" instead
> -- and I'd like to do it all using Lisp itself.

I seem to have blundered into a new world.

Part of my job is building database apps. Sometimes these apps run as
cron jobs, sometimes they run because users sitting at a terminal
enter a command, sometimes they run by users invoking an icon that
starts a GUI, and many times they run as a result of users accessing
scripts through a browser.

This is what I'm looking for. (1) Setting a script that runs at 3:00
a.m. every day that downloads a file from one remote database server,
processes that file by filtering it, sorting it, changing the format,
etc., and then uploads several files to other remote database servers.
(2) Constructing a script that a user can access at a command prompt
that asks him for a file name and proceeds to process that file in
particular ways. (3) Building a GUI application that non-expert users
can point and click their way to do a task. (4) Building a web
interface to a database that users can access through a browser to run
select, update, insert, and delete queries on a database in real time.

I've spend some effort in getting up to speed on Lisp and really want
to see if it lives up to the hype. Unfortunately, I can't even run a
'Hello World' scriptlet. I'm sure that it's my ignorance rather than
stupidity, and ignorance is curable. At least, that's what I've been
told.

> Don't you have an operating system that can start or run multiple
> processes -- even processes/servers in the background?

Sure. But right not, I just want to create a source file and run it. I
don't even care about compiling it.

CC
From: Robert Maas, see http://tinyurl.com/uh3t
Subject: Re: basic questions
Date: 
Message-ID: <rem-2007nov19-014@yahoo.com>
> From: ········@gmail.com
> This is what I'm looking for. (1) Setting a script that runs at 3:00
> a.m. every day that downloads a file from one remote database server,
> processes that file by filtering it, sorting it, changing the format,
> etc., and then uploads several files to other remote database servers.

Debug the whole thing in the REPL. Write a toplevel script file
which when loaded causes all the other parts to be loaded and then
runs the toplevel CL script. Then write a one-line shell script
that launches the CL environment with that toplevel script file
loaded and run. Set chron to run that shell script.

> (2) Constructing a script that a user can access at a command prompt
> that asks him for a file name and proceeds to process that file in
> particular ways.

Write a slightly different toplevel CL script, and a shell script
to invoke it. Send your user e-mail telling the name of the shell
script. This is how java and javac work on some platforms, a really
complicated shell script that maps all the jar files into the shell
environment then finally launches the actual JVM. If you don't
believe me, take a look at /usr/local/jdk1.2.2/bin/java and
/usr/local/jdk1.2.2/bin/javac (your directory and filename may
vary, 'whereis java' and 'whereis javac' tell you where they are,
assuming you're on Unix or Linux etc.). CL is simple by comparison,
needing only a single-line shell script to launch an application,
and *not* needing separate compile-source then run-class scripts
just to run a simple program, because you can run interpreted (or
just-in-time compilied) directly from sourcefile.

> (3) Building a GUI application that non-expert users can point
> and click their way to do a task.

Debug the GUI application with the REPL. Write a toplevel CL script
to load everything and launch the GUI application. Write a one-line
shell script to invoke it.

> (4) Building a web interface to a database that users can access
> through a browser to run select, update, insert, and delete queries
> on a database in real time.

Debug the business logic using the REPL. Write a shell script to
launch the CGI interface, which loads all the business logic, and
debug it by alternately editing the source and refreshing the Web
page. Debugging via edit/refresh is more painful than debugging via
the REPL, which is why I recommend debugging the business logic via
the REPL before interfacing it to CGI, so the part you have to
debug the more painful way is relatively trivial.

> I can't even run a 'Hello World' scriptlet.

If you want to run it from CGI, why didn't you look at:
<http://www.rawbw.com/~rem/HelloPlus/hellos.html#lisp0>
If you want to run exactly the same from command line,
it should be obvious what to do, right?
(Note: This is CMUCL. Other CLs might have slightly different
 ways to launch a lisp with loaded file from command line.)

For one possible way to decode the urlencoded CGI/HTML form, see:
<http://www.rawbw.com/~rem/HelloPlus/hellos.html#lisp3>

> But right not [sic], I just want to create a source file and run it. I
> don't even care about compiling it.

Start up the CL program, which puts you in the REPL, (load "nameOfFile"),
and it gets loaded, which means each form in the file is evaluated.
You can include definitions of functions, or outright
do-something-now forms, or define a function then call-it-now, your
choice. Then when you're done running that program, you can run
other CL programs too, all from that one REPL, as if that REPL were
your shell command line.

Think of CL as if it were a Web browser:
You start up the Web browser, then browse the Web, visit a hundred
Web pages, then quit the Web browser eventually. You don't start
the Web browser with the URL on the command line and expect the
browser to show you one Web page then immediately quit, do you?
So why do you expect Lisp to take a single task from the command
line, start up, do that task, then immediately quit??

I was originally going to use this extreme example: You don't
normally put a single-task diskette into the diskette drive, press
your computer's **on** button, watch the operating system start up,
then that single task is loaded and run from the diskette, then the
operating shuts down? Instead you start up the operating system and
let it run all day, executing a large number of tasks during that
single uptime of the operating system, right? Think of treating
Lisp as if it were your operating system, started first thing in
morning and left running all day.

Or think of Lisp as if it were Visual C++, where you start up VC++
in the morning, edit a lot of files, build several of your various
program many times (sure it writes compiled object files and
executables from time to time, but you *never* have to go to the
shell to start the executable, you just start them from the IDE),
right?  So why not think of Lisp as your IDE, which you start once
and just work within all day long?
From: Lars Rune Nøstdal
Subject: Re: basic questions
Date: 
Message-ID: <2bac4660-d2ea-42b1-abf5-7c425d625111@c30g2000hsa.googlegroups.com>
On Nov 19, 10:48 pm, ········@gmail.com wrote:
> On Nov 19, 3:29 pm, "Lars Rune Nøstdal" <···········@gmail.com> wrote:
>
> > So, why do you want to exit your Lisp after printing "Hello World"?
> > I'd never do that. I'd like to debug, run, code and test my `Hello
> > World'-application so it would print "Hello World!!!!11!1!!" instead
> > -- and I'd like to do it all using Lisp itself.
>
> I seem to have blundered into a new world.
>
> Part of my job is building database apps. Sometimes these apps run as
> cron jobs, sometimes they run because users sitting at a terminal
> enter a command, sometimes they run by users invoking an icon that
> starts a GUI, and many times they run as a result of users accessing
> scripts through a browser.
>
> This is what I'm looking for. (1) Setting a script that runs at 3:00
> a.m. every day that downloads a file from one remote database server,
> processes that file by filtering it, sorting it, changing the format,
> etc., and then uploads several files to other remote database servers.

CLISP, but other implementations will work also.

> (2) Constructing a script that a user can access at a command prompt
> that asks him for a file name and proceeds to process that file in
> particular ways.

CLISP, but other implementations will work also.

> (3) Building a GUI application that non-expert users
> can point and click their way to do a task.

..any GUI library: http://www.cliki.net/Graphics%20Toolkit ..
http://www.peter-herth.de/ltk/ is easy.

> (4) Building a web
> interface to a database that users can access through a browser to run
> select, update, insert, and delete queries on a database in real time.

I use:
http://common-lisp.net/project/postmodern/
http://www.weitz.de/hunchentoot/
From: Rainer Joswig
Subject: Re: basic questions
Date: 
Message-ID: <joswig-D6B808.22533219112007@news-europe.giganews.com>
In article 
<····································@y43g2000hsy.googlegroups.com>,
 ········@gmail.com wrote:

> On Nov 19, 3:29 pm, "Lars Rune N�stdal" <···········@gmail.com> wrote:
> > So, why do you want to exit your Lisp after printing "Hello World"?
> > I'd never do that. I'd like to debug, run, code and test my `Hello
> > World'-application so it would print "Hello World!!!!11!1!!" instead
> > -- and I'd like to do it all using Lisp itself.
> 
> I seem to have blundered into a new world.
> 
> Part of my job is building database apps. Sometimes these apps run as
> cron jobs, sometimes they run because users sitting at a terminal
> enter a command, sometimes they run by users invoking an icon that
> starts a GUI, and many times they run as a result of users accessing
> scripts through a browser.
> 
> This is what I'm looking for. (1) Setting a script that runs at 3:00
> a.m. every day that downloads a file from one remote database server,
> processes that file by filtering it, sorting it, changing the format,
> etc., and then uploads several files to other remote database servers.
> (2) Constructing a script that a user can access at a command prompt
> that asks him for a file name and proceeds to process that file in
> particular ways. (3) Building a GUI application that non-expert users
> can point and click their way to do a task. (4) Building a web
> interface to a database that users can access through a browser to run
> select, update, insert, and delete queries on a database in real time.
> 
> I've spend some effort in getting up to speed on Lisp and really want
> to see if it lives up to the hype. Unfortunately, I can't even run a
> 'Hello World' scriptlet. I'm sure that it's my ignorance rather than
> stupidity, and ignorance is curable. At least, that's what I've been
> told.
> 
> > Don't you have an operating system that can start or run multiple
> > processes -- even processes/servers in the background?
> 
> Sure. But right not, I just want to create a source file and run it. I
> don't even care about compiling it.
> 
> CC

Right. There is a difference between development and
deployment. For development the interactive approach is
best.

At the end of the day one may want to deploy the software.
Then you want to run the code from scripts, from demons,
by double-clicking an icon and by other ways.

But you got some answers how to do call CMUCL and
make files executable.

-- 
http://lispm.dyndns.org/
From: ········@gmail.com
Subject: Re: basic questions
Date: 
Message-ID: <641ead4a-fc47-4e78-af87-075f5087e7e2@b36g2000hsa.googlegroups.com>
On Nov 19, 4:53 pm, Rainer Joswig <······@lisp.de> wrote:
> At the end of the day one may want to deploy the software.
> Then you want to run the code from scripts, from demons,
> by double-clicking an icon and by other ways.
>
> But you got some answers how to do call CMUCL and
> make files executable.

Yes, I understand that this may be a case of incongruent paradigms. I
want to create a source file and 'run' it, which is what I call
'development' rather than 'deployment.'

Essentially, I want to write a Lisp script that will do something when
I tell it to. I have not yet been able to do this. I will continue to
work at it and probably pester c.l.l in the future.

The only language that I have used that had an interactive environment
was Python. I am used to writing in Perl and Java, and for Perl doing
the "> perl -cw script.plx; perl script.plx" and for Java doing the
"javac Source.java; java Source" dance. I don't know how to use an
interactive environment, but I guess I'll learn.

CC
From: Robert Maas, see http://tinyurl.com/uh3t
Subject: Re: basic questions
Date: 
Message-ID: <rem-2007nov19-015@yahoo.com>
> From: ········@gmail.com
> I want to create a source file and 'run' it, which is what I call
> 'development' rather than 'deployment.'

Call the source file "foo.lisp".
From lisp, say (load "foo.lisp")
What could be simpler?

(loop (load (format "~A.lisp" (read-line))  :verbose nil))
Now all you have to say is "foo" to execute foo.lisp, bar to
execute bar.lisp, etc. What could be simpler?

cat > q
(loop (load (format nil "~A.lisp" (read-line)) :verbose nil))
^D
Now you won't even have to copy&paste that single line of code to
start up your IDE-for-dummies, you just say:
lisp
(load "q")
What could be simpler?

cat > q
#! /bin/sh
/usr/local/bin/lisp -eval '(progn (load "q" :verbose nil))'
^D
chmod u+x q
mv q ~/bin/
Now to start up your IDE-for-dummies you just say 'q' and press ENTER.
What could be simpler?

vi .cshrc
(edit to include a line that starts up your IDE-for-dummies at login)
:wq
Do you really really want that? You can have it if you want it.
Personally I think remembering to type q<enter> immediately after
login is good enough.

> I want to write a Lisp script that will do something when I tell
> it to. I have not yet been able to do this.

The usual way is to write (defun q () ...ScriptDeJour...)
then whenever you want to run that script you say (q).
Is that really too hard?
If you have more than one toplevel script, call them q1 q2 q3 etc.,
or give them abbreviated names such as qcm for check mail, qbn for
browse newsgroups, q9 for auto-dial 911 on phone, etc.

> I guess I'll learn.

Please demonstrate your progress by copying my CGI CMUCL hello and
CGI CMUCL hello+3 to your Web site and getting them working as-is,
then try your hand at writing your own simple WebServer
applications using CGI CMUCL hello+3 as your base. (But use the
REPL to develop any nontrivial algorithm rather than trying to
develop it directly within CGI.) Be sure to include my scripts for
displaying source and permissions etc., and write a Web page that
links to them all (just like my hellos.html), so that whenever you
have trouble you can post the URL for your Web page and we can look
at your source and try running your program and suggest
improvements, and whenever you fix the source we'll immediately see
both corrected source and fixed application without any mismatch
between them.
From: Kaz Kylheku
Subject: Re: basic questions
Date: 
Message-ID: <68433bfc-8d84-4aa5-a286-faaffcde759f@e6g2000prf.googlegroups.com>
On Nov 19, 8:33 pm, ·······@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t)
wrote:
> vi .cshrc

Figures.
From: Sohail Somani
Subject: Re: basic questions
Date: 
Message-ID: <4no0j.18929$Zn.10264@edtnps90>
On Mon, 19 Nov 2007 14:25:01 -0800, cartercc wrote:

> The only language that I have used that had an interactive environment
> was Python. I am used to writing in Perl and Java, and for Perl doing
> the "> perl -cw script.plx; perl script.plx" and for Java doing the
> "javac Source.java; java Source" dance. I don't know how to use an
> interactive environment, but I guess I'll learn.

My friend, this is your biggest problem. You need to love Slime. Slime is 
the most fun interactive development environment ever, and I've used a 
few.

-- 
Sohail Somani
http://uint32t.blogspot.com
From: Andrew Reilly
Subject: Re: basic questions
Date: 
Message-ID: <5qek3jFvq2olU1@mid.individual.net>
On Mon, 19 Nov 2007 14:25:01 -0800, cartercc wrote:

> The only language that I have used that had an interactive environment
> was Python.

Clearly too young to have turned on an Apple-II, TRS-80, Commodore-64 or 
the like, then...  Sure, that's all Basic, rather than Lisp, but it's 
much the same paradigm.  Never written a function or loop or alias from a 
Bourne shell command line on a Unix box?

[Just out of interest: who reading this group has their PC/workstation/
etc of choice configured to boot into a Lisp session?  Or use something 
like scsh rather than sh or csh (or cmd.com)]

Cheers,

Andrew
From: Rainer Joswig
Subject: Re: basic questions
Date: 
Message-ID: <joswig-28EDED.23373119112007@news-europe.giganews.com>
In article 
<····································@b36g2000hsa.googlegroups.com>,
 ········@gmail.com wrote:

> On Nov 19, 4:53 pm, Rainer Joswig <······@lisp.de> wrote:
> > At the end of the day one may want to deploy the software.
> > Then you want to run the code from scripts, from demons,
> > by double-clicking an icon and by other ways.
> >
> > But you got some answers how to do call CMUCL and
> > make files executable.
> 
> Yes, I understand that this may be a case of incongruent paradigms. I
> want to create a source file and 'run' it, which is what I call
> 'development' rather than 'deployment.'
> 
> Essentially, I want to write a Lisp script that will do something when
> I tell it to. I have not yet been able to do this. I will continue to
> work at it and probably pester c.l.l in the future.
> 
> The only language that I have used that had an interactive environment
> was Python. I am used to writing in Perl and Java, and for Perl doing
> the "> perl -cw script.plx; perl script.plx" and for Java doing the
> "javac Source.java; java Source" dance. I don't know how to use an
> interactive environment, but I guess I'll learn.
> 
> CC


Well, if you use a shell under Unix, you have an interactive
environment. It let's you call scripts and other
executables. These usually don't share state and communicate
via pipes and I/O ports.

The Lisp systems also provide an interactive environment.
The commands are Lisp functions and their parameter are
Lisp objects. A debugger is built in into the
the environment. Lisp commands (functions) share
the object space (symbols, strings, arrays, lists,
objects, ...).

Lisp also has (non-standard) ways to call external executables
and use pipes. So instead developing and running your
code in the shell, you can do it also interactively
from the Lisp environment - with the benefit
that you don't need to pipe text around - you can just
pass objects and call functions.

This interactive development style using a live (possibly
under-specified and incomplete) software systems is
one of the main strengths of Lisp and it has
been optimized over many years to support that
style of development - incremental and interactive
development of software.

Using a batch approach of development for Lisp is possible,
but then you miss a big advantage of Lisp-style development.

-- 
http://lispm.dyndns.org/
From: Raffael Cavallaro
Subject: Re: basic questions
Date: 
Message-ID: <2007112000010816807-raffaelcavallaro@pasdespamsilvousplaitmaccom>
On 2007-11-19 17:25:01 -0500, ········@gmail.com said:

> Yes, I understand that this may be a case of incongruent paradigms. I
> want to create a source file and 'run' it, which is what I call
> 'development' rather than 'deployment.'

In a sense, lisp views a self contained executable style of 
'development' as yet another type of premature optimization - here 
optimizing for delivery before the application is actually ready for 
delivery.

In lisp, 'development' happens inside the running lisp image. The self 
contained executable is generally for deployment only.
From: Ken Tilton
Subject: Re: basic questions
Date: 
Message-ID: <N0w0j.1417$V75.784@newsfe09.lga>
Raffael Cavallaro wrote:
> On 2007-11-19 17:25:01 -0500, ········@gmail.com said:
> 
>> Yes, I understand that this may be a case of incongruent paradigms. I
>> want to create a source file and 'run' it, which is what I call
>> 'development' rather than 'deployment.'
> 
> 
> In a sense, lisp views a self contained executable style of 
> 'development' as yet another type of premature optimization - here 
> optimizing for delivery before the application is actually ready for 
> delivery.
> 
> In lisp, 'development' happens inside the running lisp image. The self 
> contained executable is generally for deployment only.
> 

Frickin excellent. Throw 'em off the scent, well done! Anyone hoping to 
program a computer will read that and conclude Lisp is the last language 
they should use. I tip my hat to the master!

kenny

ps. I'd ask you to translate the above into my native language, but that 
would spoil the effect! k

-- 
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
  in the evening, die content!"
                     -- Confucius
From: Raffael Cavallaro
Subject: Re: basic questions
Date: 
Message-ID: <2007112003054875249-raffaelcavallaro@pasdespamsilvousplaitmaccom>
On 2007-11-20 02:28:42 -0500, Ken Tilton <···········@optonline.net> said:

> ps. I'd ask you to translate the above into my native language, but 
> that would spoil the effect! k

I love spoilers!

Creating a stand-alone executable is unnecessary until you need to do 
user testing. Before that point there's no reason - just refine the app 
inside a lisp image/ide.

When you actually *need* to deploy, you use a tree shaker, some 
implementations remove the compiler, you lose the ide tools, etc, and 
create a self-contained executable. Doing any of this before you 
actually need to deploy is a kind of premature optimization for 
delivery.

Some languages don't give you this choice. Every time you make any 
change and want to see how your app works you are *required* to build a 
stand-alone executable. If there are parts of your app that are 
unfinished or worse still, inconsistent - you lose! - your app won't 
even compile, and you can't even test it. Not so in lisp (or smalltalk, 
etc.).

But you already knew all this, so I can only conclude that you've been 
mixing expresso and ephedra again Kenny ;^)
From: ········@gmail.com
Subject: Re: basic questions
Date: 
Message-ID: <3a8fee7f-f174-4a97-9e88-bd7507f0b3d5@o6g2000hsd.googlegroups.com>
Thanks. Most posts in this thread have been very helpful. I can see
now that I need to tune in to a different style of development as well
as a different style of language. BTW, this isn't a criticism or slam
but just a recognition that this whole Lisp thing is new to me.

On Nov 20, 3:05 am, Raffael Cavallaro <················@pas-d'espam-
s'il-vous-plait-mac.com> wrote:
> Creating a stand-alone executable is unnecessary until you need to do
> user testing. Before that point there's no reason - just refine the app
> inside a lisp image/ide.

If you are using C (which I use to write quick Unix commands) creating
a stand-alone executable is the only way. Same as Perl, which I use
about two-thirds of the time.

> Some languages don't give you this choice. Every time you make any
> change and want to see how your app works you are *required* to build a
> stand-alone executable. If there are parts of your app that are
> unfinished or worse still, inconsistent - you lose! - your app won't
> even compile, and you can't even test it. Not so in lisp (or smalltalk,
> etc.).

True, but in Java (for example) you wouldn't want to. When you use use
Java, you write two files, the test file and the class file. For heavy
duty unit testing, you create a text file with whatever parameters you
want to test, run the test program passing the text file, and go to
lunch.

CC
From: Raffael Cavallaro
Subject: Re: basic questions
Date: 
Message-ID: <2007112011265450073-raffaelcavallaro@pasdespamsilvousplaitmaccom>
On 2007-11-20 08:30:13 -0500, ········@gmail.com said:

> True, but in Java (for example) you wouldn't want to. When you use use
> Java, you write two files, the test file and the class file. For heavy
> duty unit testing, you create a text file with whatever parameters you
> want to test, run the test program passing the text file, and go to
> lunch.

1. What makes you think lisp can't do automated tests?
hint: <http://www.cliki.net/test%20framework>

2. That you cannot compile and run an application that is incomplete or 
inconsistent is a *bug* in java/c/etc., not a feature. It prevents you 
from refining those parts of your application which *do* pass tests and 
function properly unless you stub out the rest of your application.


In short, if you have any real desire to learn lisp you have to accept 
that is not just java with lots of parens. The whole development 
ecosystem is different, the mindset is different, the development 
methodology is different. If you are only comfortable with the separate 
edit, separate compile, separate run, rinse-repeat mode of development 
then much of lisp's advantages are lost on you and you should stick 
with java, etc.

from <http://www.paulgraham.com/desres.html>

"For example, it is a huge win in developing software to have an 
interactive toplevel, what in Lisp is called a read-eval-print loop. 
And when you have one this has real effects on the design of the 
language. It would not work well for a language where you have to 
declare variables before using them, for example. When you're just 
typing expressions into the toplevel, you want to be able to set x to 
some value and then start doing things to x. You don't want to have to 
declare the type of x first. You may dispute either of the premises, 
but if a language has to have a toplevel to be convenient, and 
mandatory type declarations are incompatible with a toplevel, then no 
language that makes type declarations mandatory could be convenient to 
program in."

This philosophy of convenience extends to much of the way common lisp 
works. If it's not your style, or you can't see the advantages of 
making it your style, you probably won't like lisp.
From: ········@gmail.com
Subject: Re: basic questions
Date: 
Message-ID: <6e6ece42-fd8a-47c8-96e7-ee28f2d7aba1@j20g2000hsi.googlegroups.com>
On Nov 20, 11:26 am, Raffael Cavallaro <················@pas-d'espam-
s'il-vous-plait-mac.com> wrote:
> 1. What makes you think lisp can't do automated tests?
> hint: <http://www.cliki.net/test%20framework>

I'm sure you can. That wasn't the point I was trying to make. The
whole point of bottom up development is building your ADTs first,
testing them, and then integrating them. I don't know much about Lisp,
but I know something about Java, and I was responding to your
suggestion that you had to have an app to conduct tests. I may have
read more than you intended into what you said, and don't want to
create an argument, but in fact the typical model for building a Java
app is to build the ADTs first and then app with the dispatch logic.

> 2. That you cannot compile and run an application that is incomplete or
> inconsistent is a *bug* in java/c/etc., not a feature. It prevents you
> from refining those parts of your application which *do* pass tests and
> function properly unless you stub out the rest of your application.

Aside from your comment about stubs (drivers?) Java development
doesn't follow this pattern, or at least the way I do it doesn't
follow. I don't particularly like Java and certainly am not a Java
advocate. I like to think of OO development in Java as just another
way to organize code, that is, you develop a grab bag of thingies that
you combine in various ways, sort of like a software version of Legos.
Of course, you do have to build a top level class to make everything
work.

I totally agree that building drivers to test your classes seems like
a waste, and this is one of my major attractions to Lisp -- at least
according to the claims that people make for Lisp.

> In short, if you have any real desire to learn lisp you have to accept
> that is not just java with lots of parens. The whole development
> ecosystem is different, the mindset is different, the development
> methodology is different.

I can't disagree. Most of the posters have been helpful (Kenny is the
exception). I will admit to abject ignorance of Lisp, which is why I
posted to c.l.l in the first place. Ignorance isn't a crime, is it?
Particularly when you are pursuing a cure. (Tell Kenny that ignorance
is curable but being a first class jerk isn't.)

> If you are only comfortable with the separate
> edit, separate compile, separate run, rinse-repeat mode of development
> then much of lisp's advantages are lost on you and you should stick
> with java, etc.

Granted.

<snip quote>

> This philosophy of convenience extends to much of the way common lisp
> works. If it's not your style, or you can't see the advantages of
> making it your style, you probably won't like lisp.

I am intrigued enough to have committed a significant amount of my
time and energy to learning Lisp. The fact is, I'm starting from
scratch and don't know Lisp. Please don't hold that against me. We all
started from scratch.

CC
From: Ken Tilton
Subject: Re: basic questions
Date: 
Message-ID: <VDz0j.1046$AT7.286@newsfe10.lga>
Raffael Cavallaro wrote:
> On 2007-11-20 02:28:42 -0500, Ken Tilton <···········@optonline.net> said:
> 
>> ps. I'd ask you to translate the above into my native language, but 
>> that would spoil the effect! k
> 
> 
> I love spoilers!
> 
> Creating a stand-alone executable is unnecessary until you need to do 
> user testing. Before that point there's no reason - just refine the app 
> inside a lisp image/ide.
> 
> When you actually *need* to deploy, you use a tree shaker, some 
> implementations remove the compiler, you lose the ide tools, etc, and 
> create a self-contained executable. Doing any of this before you 
> actually need to deploy is a kind of premature optimization for delivery.
> 
> Some languages don't give you this choice. Every time you make any 
> change and want to see how your app works you are *required* to build a 
> stand-alone executable. If there are parts of your app that are 
> unfinished or worse still, inconsistent - you lose! - your app won't 
> even compile, and you can't even test it. Not so in lisp (or smalltalk, 
> etc.).
> 
> But you already knew all this, so I can only conclude that you've been 
> mixing expresso and ephedra again Kenny ;^)
> 

No, I just love the way you make something as simple as delivery sound 
like a black art. And the great news is that with Lisp, it is! I recall 
my first effort, with MCL. First I had to buy an additional module! 
PWUAHHAHAHAHAHHAA! That's something K&R never thought of when pointing 
out "Hello world" is no mean feat. Then I think it took me two days to 
get it to work! Can you say "crash course in compile vs load vs execute 
time"? Sher ya can. Even with AllegroCL it was two days -- they banned 
ephedra! Lisp sucks! I should give up now!

kt

-- 
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
  in the evening, die content!"
                     -- Confucius
From: Raffael Cavallaro
Subject: Re: basic questions
Date: 
Message-ID: <2007112011291343658-raffaelcavallaro@pasdespamsilvousplaitmaccom>
On 2007-11-20 06:35:07 -0500, Ken Tilton <···········@optonline.net> said:

> No, I just love the way you make something as simple as delivery sound 
> like a black art.

Not a black art, just an unecessary waste of time until you're actually 
ready to deliver. Hence the "premature optimization" bit.
From: Sohail Somani
Subject: Re: basic questions
Date: 
Message-ID: <pfw0j.8116$Ji6.2161@edtnps89>
On Tue, 20 Nov 2007 02:28:42 -0500, Ken Tilton wrote:

> Frickin excellent. Throw 'em off the scent, well done! Anyone hoping to
> program a computer will read that and conclude Lisp is the last language
> they should use. I tip my hat to the master!
> 
> kenny

Dude, I have the strongest feeling you need a chill pill.

-- 
Sohail Somani
http://uint32t.blogspot.com
From: Ken Tilton
Subject: Re: basic questions
Date: 
Message-ID: <RJk0j.982$V75.973@newsfe09.lga>
········@gmail.com wrote:
> My apologies in advance. This is the first post in what likely will be
> many, so I ask your indulgence.

Indulgence? You don't need no stinkin indulgence.

> 
> I've developed in Perl and Java, and have also done some development
> in C, Python, and VB. I'm a database manager for a large state
> university and have an MS in CS (FWIW). I've slogged my way through
> Paul Graham's ANSI Common Lisp, and have read mostly through Peter
> Seibel's Practical Common Lisp several times, and have toyed with Lisp
> in a box. I have installed CMUCL on a Linux machine and have played
> with that. I am using CMU Common Lisp post-18e CVS 2003-04-23

All of Pgs ACL and PCL /three times/ and your only question is how to 
build an exe? That is not astonishing, what is astonishing is that so 
many clowns did not realize you were a troll. Don't feel proud of your 
camouflage, the folks here are pretty gullible.

> 
> I've decided to do more than just wet my toes, so here goes -- this is
> my question.
> I can do this:
> 
>>gcc -o hello hello.c
>>chmod 755 hello
>>hello
> 
> Hello
> 
> I can also do this:
> 
>>javac Hello.java
>>java Hello
> 
> Hello
> 
> I can also do this:
> 
>>perl hello.plx
> 
> Hello
> 
> I have a file named hello.lisp that looks like this: (format t "~
> %Hello~%")
> Why can't I do this:
> 
>>lisp hello.lisp
> 
> or
> 
>>lisp -load hello.lisp
> 
> or
> 
>>lisp -file hello.lisp
> 
> 
> If I can't run a simple Hello World console application, I might as
> well give up.

We wish. Hounds on stand-by.

kenny

-- 
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
  in the evening, die content!"
                     -- Confucius
From: ········@gmail.com
Subject: Re: basic questions
Date: 
Message-ID: <b19bd86b-df06-482b-b4c9-3015e8552afd@p69g2000hsa.googlegroups.com>
On Nov 19, 1:38 pm, Ken Tilton
> All of Pgs ACL

To be fair, my comprehension was extremely low. I don't think I picked
up more than 0.5% of it. It just didn't make any sense to me. I'm not
a dumb guy, either, and I've got three graduate degrees to prove it.

> and PCL /three times/

Yes, I've read through most of it three times. You understand that
reading will only get you so far. You don't learn a language merely by
reading about it, but by writing in it. I have not written in Lisp,
and that was the point of my post.

> and your only question is how to
> build an exe?

You must have very low reading comprehension. What I asked was for
help on executing a program I wrote, my very first 'Hello World' Lisp
scriptlet. You've probably never had a programming defect in your
life, but I have. It's frustrating to write a program, even a very
small one, and not know how to execute it.

> That is not astonishing, what is astonishing is that so
> many clowns did not realize you were a troll. Don't feel proud of your
> camouflage, the folks here are pretty gullible.

Which is all beside the point. What amazes me is that you have no idea
of the definition of 'troll.' You might want to look it up. Stupidly
throwing around gratuitous accusations is pretty moronic.

In any case, it doesn't matter whether or not I ~am~ a troll, I still
deserve an honest answer to an honest question, not insults.

> > well give up.
>
> We wish. Hounds on stand-by.

I take this to mean that you want to shut the door on the Lisp
community and lock it, admitting no new users or new learners. If you
typify the Lisp community, I can understand why it's such a small and
ingrown community.

CC
From: Kaz Kylheku
Subject: Re: basic questions
Date: 
Message-ID: <83b88793-355a-4125-b931-3dab96d1b66a@d4g2000prg.googlegroups.com>
On Nov 19, 2:43 pm, ········@gmail.com wrote:
> On Nov 19, 1:38 pm, Ken Tilton
> > We wish. Hounds on stand-by.
>
> I take this to mean that you want to shut the door on the Lisp
> community and lock it, admitting no new users or new learners. If you
> typify the Lisp community, I can understand why it's such a small and
> ingrown community.

The small and ingrown Lisp community can certainly do without people
with master's degrees in CS who can't figure out the right way to pass
a command line argument to a Unix application.

Quality over quantity.
From: Slobodan Blazeski
Subject: Re: basic questions
Date: 
Message-ID: <7d0807c3-0b35-48f5-8c87-1684377bc71c@f3g2000hsg.googlegroups.com>
On Nov 19, 2:43 pm, ········@gmail.com wrote:
> On Nov 19, 1:38 pm, Ken Tilton
>
> > All of Pgs ACL
>
> To be fair, my comprehension was extremely low. I don't think I picked
> up more than 0.5% of it. It just didn't make any sense to me. I'm not
> a dumb guy, either, and I've got three graduate degrees to prove it.
>
> > and PCL /three times/
>
> Yes, I've read through most of it three times. You understand that
> reading will only get you so far. You don't learn a language merely by
> reading about it, but by writing in it. I have not written in Lisp,
> and that was the point of my post.
>
> > and your only question is how to
> > build an exe?
>
> You must have very low reading comprehension. What I asked was for
> help on executing a program I wrote, my very first 'Hello World' Lisp
> scriptlet. You've probably never had a programming defect in your
> life, but I have. It's frustrating to write a program, even a very
> small one, and not know how to execute it.
>
> > That is not astonishing, what is astonishing is that so
> > many clowns did not realize you were a troll. Don't feel proud of your
> > camouflage, the folks here are pretty gullible.
>
> Which is all beside the point. What amazes me is that you have no idea
> of the definition of 'troll.' You might want to look it up. Stupidly
> throwing around gratuitous accusations is pretty moronic.
>
> In any case, it doesn't matter whether or not I ~am~ a troll, I still
> deserve an honest answer to an honest question, not insults.
>
> > > well give up.
>
> > We wish. Hounds on stand-by.
>
> I take this to mean that you want to shut the door on the Lisp
> community and lock it, admitting no new users or new learners. If you
> typify the Lisp community, I can understand why it's such a small and
> ingrown community.
>
> CC

CC You already get an answer to your question. If you came here with
goal to learn lisp you'll get all the help needed.  But if you're
trolling you'll be treated as troll. The choice is all yours.
Show respect and you'll be respected.  Disrespect people and they will
treat you the same.
Kenny thinks you're troll, and after writing my response I checked
your profile and  start to feel the same. But who knows? You're future
behaviour   will clear who you really are.

Slobodan
From: Ken Tilton
Subject: Re: basic questions
Date: 
Message-ID: <LCq0j.1218$V75.783@newsfe09.lga>
········@gmail.com wrote:
> I take this to mean that you want to shut the door on the Lisp
> community and lock it, admitting no new users or new learners.

Yes. In fact, it is not clear how you got under the wire, we're 
interrogating the guards now.

> If you
> typify the Lisp community, I can understand why it's such a small and
> ingrown community.

Boy, we saw that one coming.

Your big mistake was claiming to have read ACL and (* 3 PCL) and then 
being ready to give up on Lisp cuz you could not build an exe.

Computeth not. A non-troll would have read a few chapters of either book 
and finished his application and then come here jumping up and down with 
joy and a small problem, hey, how the hell do I deliver this thing!!!

Your post indicated you were checking on Lisp's hype when you read those 
four books and that you were considering abandoning the language because 
you could not do hello world after five minutes effort, meaning you were 
wondering if it was possible meaning you thought maybe Lisp was never 
used to program a computer. After reading four books on Lisp.

chya!, as the kids would say.

Suggest you get a new email and try again.

kenny

ps. Actually, I am hoping you are a troll, if you are for real...oh my. k


-- 
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
  in the evening, die content!"
                     -- Confucius
From: lin8080
Subject: Re: basic questions
Date: 
Message-ID: <474DB611.ECF5C080@freenet.de>
········@gmail.com schrieb:


> ... I have not written in Lisp,
> and that was the point of my post.

Ja ja. Nice. But...
Lisp-is-different.

The question is: are you ready for that? Do you know what you do?

As I can tell you from my side: Since I know Lisp, I forget Java, I
don't touch Perl, I do not need c, I ... hm? Should I say Lisp is enough
and you will not belive me?

But yes, test it :)

Hint: don't give up, when things become a bit... Lisp-is-different. (see
above)
From: Maciej Katafiasz
Subject: Re: basic questions
Date: 
Message-ID: <fhs8fe$fcc$1@news.net.uni-c.dk>
Den Mon, 19 Nov 2007 06:50:40 -0800 skrev cartercc:

> Why can't I do this:
>> lisp hello.lisp
> or
>> lisp -load hello.lisp
> or
>> lisp -file hello.lisp
> 
> If I can't run a simple Hello World console application, I might as well
> give up.

From SBCL's man page:

 --load <filename>
      This is equivalent to --eval '(load "<filename>")'. The special syn-
      tax is intended to reduce quoting headaches when invoking SBCL from
      shell scripts.

How you run it is entirely up to your implementation, it's not really a 
part of the language. And I personally don't think it any worse than, 
say, running Java .jars, which are one of the worst method of 
distributing applications ever thought up.

Cheers,
Maciej

PS. Given that SBCL is derived from CMUCL, I'd expect something 
equivalent to be there in CMUCL as well. Read the man page, at least 
--eval option should be present.
From: Rainer Joswig
Subject: Re: basic questions
Date: 
Message-ID: <joswig-8BA4DD.16044219112007@news-europe.giganews.com>
In article 
<····································@w73g2000hsf.googlegroups.com>,
 ········@gmail.com wrote:

> My apologies in advance. This is the first post in what likely will be
> many, so I ask your indulgence.
> 
> I've developed in Perl and Java, and have also done some development
> in C, Python, and VB. I'm a database manager for a large state
> university and have an MS in CS (FWIW). I've slogged my way through
> Paul Graham's ANSI Common Lisp, and have read mostly through Peter
> Seibel's Practical Common Lisp several times, and have toyed with Lisp
> in a box. I have installed CMUCL on a Linux machine and have played
> with that. I am using CMU Common Lisp post-18e CVS 2003-04-23

There are much newer versions of CMUCL. Currently CMUCL has
monthly snapshots. That would be a good choice.

> I've decided to do more than just wet my toes, so here goes -- this is
> my question.
> I can do this:
> > gcc -o hello hello.c
> > chmod 755 hello
> > hello
> Hello
> 
> I can also do this:
> > javac Hello.java
> > java Hello
> Hello
> 
> I can also do this:
> > perl hello.plx
> Hello
> 
> I have a file named hello.lisp that looks like this: (format t "~
> %Hello~%")
> Why can't I do this:
> > lisp hello.lisp
> or
> > lisp -load hello.lisp
> or
> > lisp -file hello.lisp
> 
> If I can't run a simple Hello World console application, I might as
> well give up.
> 
> Thanks, CC.

You might want to consult the documentation:

http://www.cons.org/cmucl/FAQ.html
http://www.cons.org/cmucl/doc/executable.html
http://users.actrix.co.nz/mycroft/runlisp.html

-- 
http://lispm.dyndns.org/
From: Alex Mizrahi
Subject: Re: basic questions
Date: 
Message-ID: <4741b586$0$90274$14726298@news.sunsite.dk>
 c> If I can't run a simple Hello World console application, I might as
 c> well give up.

····@debetch:~$ lisp
CMU Common Lisp CVS 19d 19d-release (19D), running on debetch

····@debetch:~$ cat helo.lisp
(format t "~%Hello~%")
(quit)

····@debetch:~$ lisp -quiet -load helo.lisp

Hello

····@debetch:~$ lisp -eval '(format t  "lololo~%") (quit)'
lololo
From: Barry Fishman
Subject: Re: basic questions
Date: 
Message-ID: <m3zlx9u7lj.fsf@barry_fishman.acm.org>
········@gmail.com writes:
> I've decided to do more than just wet my toes, so here goes -- this is
> my question.
> I can do this:
>> gcc -o hello hello.c
>> chmod 755 hello
>> hello
> Hello
>
> I can also do this:
>> javac Hello.java
>> java Hello
> Hello
>
> I can also do this:
>> perl hello.plx
> Hello

$ cat >hello
":" ; exec lisp -quiet -noinit -load "`which $0`" ······@"}
(defvar *args* (nthcdr 5 *command-line-strings*))
(format t "Hello ~a!~%" (car *args*))
(quit)
^D
$ chmod 755 hello
$ hello CG
Hello CG!

The first to lines are a CMUCL specific way to build a lisp script, and
get at its argument list.  You need to do a (quit) or you will end up in
the REPL.

> If I can't run a simple Hello World console application, I might as
> well give up.

In this group these are fighting words.  Some people when just beginning
to learn lisp seem to think they have lots of ways to improve it and
feel compelled to post those ideas here.  They are not well received.

Lisp has evolved over a long period of time, and its design trade-offs
are not always obvious to new programmers.  It was designed by very
skilled programmers.  Although Lisp has sometimes not given me exactly
what I wanted, it has given me what I needed, and that is often even
better.

If you don't have the patience to learn new ways of thinking about
programs, then you should probably give up now.

-- 
Barry Fishman
From: Rob Warnock
Subject: Re: basic questions
Date: 
Message-ID: <e86dncxCt-gJSN_anZ2dnUVZ_ualnZ2d@speakeasy.net>
Barry Fishman  <·············@acm.org> wrote:
+---------------
| $ cat >hello
| ":" ; exec lisp -quiet -noinit -load "`which $0`" ······@"}
| (defvar *args* (nthcdr 5 *command-line-strings*))
| (format t "Hello ~a!~%" (car *args*))
| (quit)
| ^D
| $ chmod 755 hello
+---------------

Awww!!! Now you've given away *all* our secrets!!  ;-}

Well, not quite all:

    $ cat ./show-stock-by-season
    #!/usr/local/bin/cmucl -script
    (require :utils)
    (require :pg)
    (use-package :utils)
    (use-package :pg)

    (when (null (first *script-args*))
      (error "Need season arg"))

    (defun sql-sanitize (x)
      (coerce (loop for c across x
		collect c
		when (eql c #\')
		 collect c)
	      'string))

    (with-pg-connection (conn "rpw3" "rpw3")
      (let* ((season (sql-sanitize (first *script-args*)))
	     (query (format nil "select * from stock ·@
				 where c1 = '~a'" season))
	     (result (pg-exec conn query))
	     (cols (mapcar #'car (pg-result result :attributes)))
	     (rows (pg-result result :tuples)))
	(format t "~{~a~%~}" (cons cols rows))))

    $ ./show-stock-by-season fall
    (season format title stock_number)
    (fall tape My Favorite Thanksgiving 16)
    $ ./show-stock-by-season xmas
    (season format title stock_number)
    (xmas book My Favorite Christmas 2)
    (xmas video The Grinch who Stole Christmas 4)
    (xmas video Home Alone 6)
    $ 


-Rob

p.s. How to make that "-script" thingy work *without*
changing the distributed CMUCL executable or core image is
the subject of my next bit of open-sourcing. "Film at 11..."
Hint: It's just a small hack to "site-init.lisp".

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607