From: dr43058
Subject: How to Get Started?
Date: 
Message-ID: <1ee8647c-070a-4c04-9481-3ad2e1667d08@k36g2000pri.googlegroups.com>
How do you get started? Do I need to download something to get started
with CLOS or CL? Is there a Getting Started page?

Thanks,
Danny R.

From: Tamas K Papp
Subject: Re: How to Get Started?
Date: 
Message-ID: <6mosfdFhu5iiU1@mid.individual.net>
On Tue, 28 Oct 2008 09:17:36 -0700, dr43058 wrote:

> How do you get started? Do I need to download something to get started
> with CLOS or CL? Is there a Getting Started page?
> 
> Thanks,
> Danny R.

You need a good book or tutorial, I recommend Practical Common Lisp by 
Peter Seibel.  Available online at http://gigamonkeys.com/book/.

You also need to install a Common Lisp implementation.  Providing details 
about your setup (eg what OS are you using, are you familiar with Emacs, 
etc) would allow us to help you more.  Seibel's page also has Lispbox, a 
prepackaged Lisp to get you started, I have never used it.

HTH,

Tamas
From: Rainer Joswig
Subject: Re: How to Get Started?
Date: 
Message-ID: <joswig-EC84EC.18094828102008@news-europe.giganews.com>
In article 
<····································@k36g2000pri.googlegroups.com>,
 dr43058 <·······@gmail.com> wrote:

> How do you get started? Do I need to download something to get started
> with CLOS or CL?

You want write software in Lisp? Good!

CLOS (Common Lisp Object System) is a part of Common Lisp.
Every Common Lisp includes CLOS.


> Is there a Getting Started page?

There is a community wiki for free Lisp resources:

http://www.cliki.net/index

Common Lisp also has a bunch of commercial implementations.

One of the first, hard, tasks is to choose an implementation,
since there are more than one and there is no clear favorite.

Dan Weinreb gives an overview of the current implementation
of Common Lisp:   http://common-lisp.net/~dlw/LispSurvey.html



> 
> Thanks,
> Danny R.

-- 
http://lispm.dyndns.org/
From: Kenny
Subject: Re: How to Get Started?
Date: 
Message-ID: <4907b6eb$0$4970$607ed4bc@cv.net>
> <····································@k36g2000pri.googlegroups.com>,
>  dr43058 <·······@gmail.com> wrote:
> 
> 
>>How do you get started? Do I need to download something to get started
>>with CLOS or CL?

That's a bad attitude if you want to do Lisp. Lisp is the lost in the 
sixties language that thinks Emacs is an IDE and some assembly required 
holds any charm anymore when it comes to software tools and yes the FSF 
drones  laboring day and night for king bee stallman would respond 
annoying needless wasted hours? what annoying needless wasted hours but 
this is Lisp and the three of us Actually Writing Software really don't 
need that.

But you asked for the easy way in so you use Windows so run do not walk to:

   http://franz.com/downloads/allegrodownload.lhtml

That is the only grown-up Lisp. If you are not on Lisp you'll have to do 
with Lispworks which at least pretends to have an IDE. Googling left as 
an exercise.

hth, kenny

ps. Then you'll need libraries and for that there is no help so you 
might want to punt now. h,k
From: Javier
Subject: Re: How to Get Started?
Date: 
Message-ID: <ge8ff7$2r9$1@aioe.org>
>>> How do you get started? Do I need to download something to get started
>>> with CLOS or CL?
> 
> That's a bad attitude if you want to do Lisp [...]

Put your fingers in the ears, do not listen to Kenny, and download this:

http://www.bitfauna.com/projects/cusp/

If you start free, you have more chances to remain free for the rest of 
your life. If you start comercial, then it is more difficult to liberate 
yourself.
Be free, my friend.
From: Kenny
Subject: Re: How to Get Started?
Date: 
Message-ID: <4907e7c3$0$4979$607ed4bc@cv.net>
Javier wrote:
>>>> How do you get started? Do I need to download something to get started
>>>> with CLOS or CL?
>>
>>
>> That's a bad attitude if you want to do Lisp [...]
> 
> 
> Put your fingers in the ears, do not listen to Kenny, and download this:

Actually, all fun aside, it is better that someone asking for the easy 
way in know as soon as possible that Lisp is not Java or even Python in 
re the skids being greased, lest they cut and run at the early 
annoyances getting to hello world.

> 
> http://www.bitfauna.com/projects/cusp/
> 
> If you start free, you have more chances to remain free for the rest of 
> your life. If you start comercial, then it is more difficult to liberate 
> yourself.
> Be free, my friend.

Maybe you should put your fingers in your mouth instead of the OP theirs 
in their ears. I have been programming CL for fifteen years including 
everything from OpenGL to OpenAL to RDF and now Web2.0 using Franz tools 
for the last ten and have no code dependent on anything proprietary 
anywhere.

I'll say this for you, the misinformation you post sure prompts others 
to post helpful information. Keep up the good work!

hth, kenny
From: John Thingstad
Subject: Re: How to Get Started?
Date: 
Message-ID: <op.ujr56tzzut4oq5@pandora.alfanett.no>
P� Wed, 29 Oct 2008 05:34:11 +0100, skrev Kenny <·········@gmail.com>:

> Javier wrote:
>>>>> How do you get started? Do I need to download something to get  
>>>>> started
>>>>> with CLOS or CL?
>>>
>>>
>>> That's a bad attitude if you want to do Lisp [...]
>>   Put your fingers in the ears, do not listen to Kenny, and download  
>> this:
>
> Actually, all fun aside, it is better that someone asking for the easy  
> way in know as soon as possible that Lisp is not Java or even Python in  
> re the skids being greased, lest they cut and run at the early  
> annoyances getting to hello world.
>

Yeah.. Tough one. Download LispWorks. At the REPL type: (display-message  
"Hello, World!")
So much worse than Java ;)
If you really go for LispWorks be sure to get Edi Weitz starter pack as  
well. It has gotten to the point where I just can't use it without  
LispWorks addons.

--------------
John Thingstad
From: Kenny
Subject: Re: How to Get Started?
Date: 
Message-ID: <49087eaa$0$4973$607ed4bc@cv.net>
John Thingstad wrote:
> P� Wed, 29 Oct 2008 05:34:11 +0100, skrev Kenny <·········@gmail.com>:
> 
>> Javier wrote:
>>
>>>>>> How do you get started? Do I need to download something to get  
>>>>>> started
>>>>>> with CLOS or CL?
>>>>
>>>>
>>>>
>>>> That's a bad attitude if you want to do Lisp [...]
>>>
>>>   Put your fingers in the ears, do not listen to Kenny, and download  
>>> this:
>>
>>
>> Actually, all fun aside, it is better that someone asking for the 
>> easy  way in know as soon as possible that Lisp is not Java or even 
>> Python in  re the skids being greased, lest they cut and run at the 
>> early  annoyances getting to hello world.
>>
> 
> Yeah.. Tough one. Download LispWorks. At the REPL type: 
> (display-message  "Hello, World!")

Never read K&R, eh?

kt
From: Javier
Subject: Re: How to Get Started?
Date: 
Message-ID: <ge9nq5$grd$1@aioe.org>
Kenny escribi�:
> Javier wrote:
>>>>> How do you get started? Do I need to download something to get started
>>>>> with CLOS or CL?
>>>
>>>
>>> That's a bad attitude if you want to do Lisp [...]
>>
>>
>> Put your fingers in the ears, do not listen to Kenny, and download this:
> 
> Actually, all fun aside, it is better that someone asking for the easy 
> way in know as soon as possible that Lisp is not Java or even Python in 
> re the skids being greased, lest they cut and run at the early 
> annoyances getting to hello world.
> 
>>
>> http://www.bitfauna.com/projects/cusp/
>>
>> If you start free, you have more chances to remain free for the rest 
>> of your life. If you start comercial, then it is more difficult to 
>> liberate yourself.
>> Be free, my friend.
> 
> Maybe you should put your fingers in your mouth instead of the OP theirs 
> in their ears. I have been programming CL for fifteen years including 
> everything from OpenGL to OpenAL to RDF and now Web2.0 using Franz tools 
> for the last ten and have no code dependent on anything proprietary 
> anywhere.
> 
> I'll say this for you, the misinformation you post sure prompts others 
> to post helpful information. Keep up the good work!
> 
> hth, kenny

Apart from saying how good and old you are about using Lisp, you haven't 
said any good reasons on why he should not be using Cusp.
Is Cusp bad? Is SBCL bad?

They both are right, even if Cusp is a pluging for an editor made in 
Java. If you want to be purist and charge against Cusp because it is 
made in Java, remember that the OS you are using is mostly made in C++, 
another language that you hate.

Let him choose free. Don't be afraid of that! Freedom is a good thing.
From: ···············@gmail.com
Subject: Re: How to Get Started?
Date: 
Message-ID: <6cca5dbd-8ea9-4164-9b52-50608fbf12d9@e2g2000hsh.googlegroups.com>
On 29 Oct, 13:17, Javier <······@askmyadress.com> wrote:

> They both are right, even if Cusp is a pluging for an editor made in
> Java. If you want to be purist and charge against Cusp because it is
> made in Java, remember that the OS you are using is mostly made in C++,
> another language that you hate.

He could try ABLE (http://phil.nullable.eu/) which is written both in
and for Common Lisp.

--
Phil
http://phil.nullable.eu/
From: Javier
Subject: Re: How to Get Started?
Date: 
Message-ID: <ge9uib$euj$1@aioe.org>
···············@gmail.com escribi�:
> On 29 Oct, 13:17, Javier <······@askmyadress.com> wrote:
> 
>> They both are right, even if Cusp is a pluging for an editor made in
>> Java. If you want to be purist and charge against Cusp because it is
>> made in Java, remember that the OS you are using is mostly made in C++,
>> another language that you hate.
> 
> He could try ABLE (http://phil.nullable.eu/) which is written both in
> and for Common Lisp.

Very nice!
From: Kenny
Subject: Re: How to Get Started?
Date: 
Message-ID: <4908849a$0$5645$607ed4bc@cv.net>
Javier wrote:
> Kenny escribi�:
> 
>> Javier wrote:
>>
>>>>>> How do you get started? Do I need to download something to get 
>>>>>> started
>>>>>> with CLOS or CL?
>>>>
>>>>
>>>>
>>>> That's a bad attitude if you want to do Lisp [...]
>>>
>>>
>>>
>>> Put your fingers in the ears, do not listen to Kenny, and download this:
>>
>>
>> Actually, all fun aside, it is better that someone asking for the easy 
>> way in know as soon as possible that Lisp is not Java or even Python 
>> in re the skids being greased, lest they cut and run at the early 
>> annoyances getting to hello world.
>>
>>>
>>> http://www.bitfauna.com/projects/cusp/
>>>
>>> If you start free, you have more chances to remain free for the rest 
>>> of your life. If you start comercial, then it is more difficult to 
>>> liberate yourself.
>>> Be free, my friend.
>>
>>
>> Maybe you should put your fingers in your mouth instead of the OP 
>> theirs in their ears. I have been programming CL for fifteen years 
>> including everything from OpenGL to OpenAL to RDF and now Web2.0 using 
>> Franz tools for the last ten and have no code dependent on anything 
>> proprietary anywhere.
>>
>> I'll say this for you, the misinformation you post sure prompts others 
>> to post helpful information. Keep up the good work!
>>
>> hth, kenny
> 
> 
> Apart from saying how good and old you are about using Lisp, you haven't 
> said any good reasons on why he should not be using Cusp.
> Is Cusp bad? Is SBCL bad?

Yeah. Compared to ACL or even the LW free trials, yeah. Super-yeah, as 
in fuggedaboutit. Compared to Emacs+SLIME+SBCL I cannot say.

> 
> They both are right, even if Cusp is a pluging for an editor made in 
> Java. If you want to be purist and charge against Cusp because it is 
> made in Java, ...

No, I do not, so don't bother finishing this sentence.

>....remember that the OS you are using is mostly made in C++, 
> another language that you hate.

You are babbling to yourself. I had no idea how Cusp was implemented, 
and in fact did not even notice you had recommended it.

> 
> Let him choose free. Don't be afraid of that! Freedom is a good thing.

What part of "free trial" do you not understand? Or did you have your 
hands clapped over your eyes when you read the bit about easily using 
propietary Lisps without getting locked into them?

Why don't you FSF dorks stop hiding behind faux rational arguments and 
just say it: you have managed to turn software into a religion, a rather 
fanatical one at that.

What's next? A car-wash religion? A Free Squeegee Foundation?

The OP will find what they are looking for pretty much only in the 
WIndows implementation of the free AllegroCL trial, period.

hth, kt
From: Javier
Subject: Re: How to Get Started?
Date: 
Message-ID: <gea3er$5ha$1@aioe.org>
Kenny escribi�:

> You are babbling to yourself. I had no idea how Cusp was implemented, 
> and in fact did not even notice you had recommended it.

So what are you blaming about?

>> Let him choose free. Don't be afraid of that! Freedom is a good thing.
> 
> What part of "free trial" do you not understand?

The 'trial' one, because you don't obtain the full product, nor the 
right license.
And the 'free' one, because it means 'gratis', not 'libre'. Look at a 
Spanish dictionary to find the differences.


> Or did you have your 
> hands clapped over your eyes when you read the bit about easily using 
> propietary Lisps without getting locked into them?

Oh, really? You admited you've been using Allegro for 15 years. I 
understand for such a thing that you are locked into it.


> Why don't you FSF dorks

I'm not one. And SBCL and Cusp, as long as I know, are not endorsed in 
the FSF.
FSF is just one of the organizations and enterprises that defend free 
software. Each one may have a different opinion about free software.

> stop hiding behind faux rational arguments and 
> just say it: you have managed to turn software into a religion, a rather 
> fanatical one at that.

I don't agree. I don't consider free software a religion. I just prefer 
freedon. What part you do not understand?
Anyway, supposing you're right (and your are NOT), which is better, to 
have free software as a religion, or to have a computer language as the 
one? And 90% of folks here worship Lisp as nothing else in the world.

> What's next? A car-wash religion? A Free Squeegee Foundation?

People is using free software, and they don't feel they have joined a 
sect. They use free software because they consider that it is morally 
correct.
I don't expect you to understand it. It requires a high level of 
sensitivity about human beings and compassion.

> The OP will find what they are looking for pretty much only in the 
> WIndows implementation of the free AllegroCL trial, period.

I hope not.
From: Raffael Cavallaro
Subject: Re: How to Get Started?
Date: 
Message-ID: <geau4n$haj$1@aioe.org>
On 2008-10-29 12:36:37 -0400, Javier <······@askmyadress.com> said:

> I don't expect you to understand it. It requires a high level of 
> sensitivity about human beings and compassion.

My deeply intuitive sensitivity of human beings tells me that many 
prefer free software simply because they cannot resist a product, no 
matter how flawed, that costs zero dollars.

My profound intuition also tells me that after having made this 
reflexive non-choice many immediately start rationalizing about 
freedom...

Simple question for those who haven't subscribed to any software 
religion (free or non-free) and are still capable of somewhat objective 
rational thought:

If the proprietary common lisp implementations only offered *the same 
exact things* that the free implementations do, why would many 
experienced lisp programmers part with money for the proprietary 
implementations? Why would they give up both money and freedom only to 
get identical functionality?

Maybe, just maybe, the proprietary implementations have useful features 
that are not available in the free implementations.

Just a thought...
From: Rob Warnock
Subject: Re: How to Get Started?
Date: 
Message-ID: <KLKdnbRmqsZEhZTUnZ2dnUVZ_gudnZ2d@speakeasy.net>
Raffael Cavallaro  <················@pas-d'espam-s'il-vous-plait-mac.com> wrote:
+---------------
| My deeply intuitive sensitivity of human beings tells me that many 
| prefer free software simply because they cannot resist a product, no 
| matter how flawed, that costs zero dollars.
+---------------

Indeed. See Dan Ariely's book "Predictablly Irrational":

    http://www.predictablyirrational.com/
    http://www.amazon.com/dp/006135323X

especially Chapter 3 "The Cost of Zero Cost", about "free" stuff
and its power to drag in the sucker\\\\\\ highly-valued customer:

    ...
    Have you ever grabbed for a coupon offering a free! package of
    coffee beans even though you don't drink coffee and don't even
    have a machine with which to brew it?
    ...
    It's no secret that getting something free feels very good.
    Zero is not just another price, it turns out. Zero is an
    emotional hot button -- a source of irrational excitement.
    ...


-Rob

p.s. Direct link to above excerpt:

    http://www.amazon.com/gp/redirect.html/ref=amb_link_6358112_3/184-5604368-2950110?location=http://g-ecx.images-amazon.com/images/G/01/books/a-plus/Predictably-Irrational-Excerpt.pdf&token=957BBB0669152D76BE1C614537975585163C1748&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=hero-quick-promo&pf_rd_r=007YVBE1F2DET2WSMP37&pf_rd_t=201&pf_rd_p=364675801&pf_rd_i=006135323X


-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Kenny
Subject: Re: How to Get Started?
Date: 
Message-ID: <49090e29$0$5660$607ed4bc@cv.net>
Javier wrote:
> Kenny escribi�:
> 
>> You are babbling to yourself. I had no idea how Cusp was implemented, 
>> and in fact did not even notice you had recommended it.
> 
> 
> So what are you blaming about?

It wasn't Cusp, if that helps.

> 
>>> Let him choose free. Don't be afraid of that! Freedom is a good thing.
>>
>>
>> What part of "free trial" do you not understand?
> 
> 
> The 'trial' one, because you don't obtain the full product,

Nonsense. It includes everything and has a heap or stack limit, I forget 
which, that you have to go out of your way to hit as a nooby. It is more 
import that the noob have easy entry into the language, meaning we 
should spare them as much Emacs, SLime, ASDF crap ass possible.

They'll need their strength just to /find/ Cells.


>... nor the 
> right license.

I detect a cycle. Do you detect a cycle? I definitely detect a cycle.

> And the 'free' one, because it means 'gratis', not 'libre'. Look at a 
> Spanish dictionary to find the differences.

mucho gracias y mama pinga.

> 
> 
>> Or did you have your hands clapped over your eyes when you read the 
>> bit about easily using propietary Lisps without getting locked into them?
> 
> 
> Oh, really? You admited you've been using Allegro for 15 years. I 
> understand for such a thing that you are locked into it.

Now it's your turn: go look up "locked in" and let us know how many 
definitions involve choice. We'll wait.
> 
> 
>> Why don't you FSF dorks
> 
> 
> I'm not one. And SBCL and Cusp, as long as I know, are not endorsed in 
> the FSF.
> FSF is just one of the organizations and enterprises that defend free 
> software. Each one may have a different opinion about free software.
> 
>> stop hiding behind faux rational arguments and just say it: you have 
>> managed to turn software into a religion, a rather fanatical one at that.
> 
> 
> I don't agree. I don't consider free software a religion. I just prefer 
> freedon. What part you do not understand?
> Anyway, supposing you're right (and your are NOT), which is better, to 
> have free software as a religion, or to have a computer language as the 
> one? And 90% of folks here worship Lisp as nothing else in the world.

What part of Anna Kournikova do you not understand?

When it comes to computer languages which you might notice can be found 
in this NGs prefixes, yep, Lisp is The One. But I think most of us agree 
it is not a matter of religion, rather of alien seeding.

> 
>> What's next? A car-wash religion? A Free Squeegee Foundation?
> 
> 
> People is using free software, and they don't feel they have joined a 
> sect. They use free software because they consider that it is morally 
> correct.

PWUAHAHAHAHAHAHAHAHAAAA! Look again, Javy: the never really explained 
moral clause of the GPL has been de facto rejected: LGPL or MIT are all 
that Stallman accomplished and those do nothing to enforce the idea that 
tools software should never disappear into proprietary software.

The only reason people use open crap is because it is free as in beer 
and people are too stupid to value their time, and the only reason the 
free stuff is produced is because Stallman has turned quality software 
development into a dry hole so folks can't sell it anyway.

> I don't expect you to understand it. It requires a high level of 
> sensitivity about human beings and compassion.

<sob>

Careful, Javy, I am about the only one left still taking to you. Even 
Duane ripped you a new one. I have never seen him quite so worked up. 
You know you are being a twit when Duane goes upside your head.

peace, kt
From: William James
Subject: Re: How to Get Started?
Date: 
Message-ID: <cae731dc-27bf-4a70-84ef-cd3edae34911@d31g2000hsg.googlegroups.com>
On Oct 29, 11:36 am, Javier <······@askmyadress.com> wrote:

>  And 90% of folks here worship Lisp as nothing else in the world.

True.
From: ········@gmail.com
Subject: Re: How to Get Started?
Date: 
Message-ID: <e7273ce1-ee5f-4d7c-b65b-efe753d894af@e2g2000hsh.googlegroups.com>
On 30 Ott, 18:44, William James <·········@yahoo.com> wrote:
> >  And 90% of folks here worship Lisp as nothing else in the world.
> True.

Quite exact.

But "nothing else" has to be intended as "last choice" (or "least
evil").

In the sense of: last option left, *after* trying all the other ones.
And after *discarding* the rest.

The perfect one doesn't exist already (future has still to happen, and
we want to leave some discovery to our beloved grandchildren too,
don't we?

So, Lisp is simply the *least* *evil* (for now).

-PM
From: John Thingstad
Subject: Re: How to Get Started?
Date: 
Message-ID: <op.ujshwmz9ut4oq5@pandora.alfanett.no>
P� Wed, 29 Oct 2008 14:17:51 +0100, skrev Javier <······@askmyadress.com>:

>
> They both are right, even if Cusp is a pluging for an editor made in  
> Java. If you want to be purist and charge against Cusp because it is  
> made in Java, remember that the OS you are using is mostly made in C++,  
> another language that you hate.
>

The core of Windows is written in C actually, not C++. (Intel's C  
compiler.)
ANSI C is actually far nicer than C++ in my mind.

Caetaily a lot better that thal lubering beast of a lanuage called Java.
(I need to fire up the editor now, wanna go for a coffee. No, gotta go to  
the local hardware store to pick up another GB of RAM.)

--------------
John Thingstad
From: Javier
Subject: Re: How to Get Started?
Date: 
Message-ID: <ge9url$euj$2@aioe.org>
John Thingstad escribi�:
> P� Wed, 29 Oct 2008 14:17:51 +0100, skrev Javier <······@askmyadress.com>:
> 
>>
>> They both are right, even if Cusp is a pluging for an editor made in 
>> Java. If you want to be purist and charge against Cusp because it is 
>> made in Java, remember that the OS you are using is mostly made in 
>> C++, another language that you hate.
>>
> 
> The core of Windows is written in C actually, not C++. (Intel's C 
> compiler.)
> ANSI C is actually far nicer than C++ in my mind.
> 
> Caetaily a lot better that thal lubering beast of a lanuage called Java.


Ok, so use Clozure, and we are all happy.
Java might be bad (I don't fully agree), but its VM is not that bad.

> (I need to fire up the editor now, wanna go for a coffee. No, gotta go 
> to the local hardware store to pick up another GB of RAM.)

Have you got a computer from the dinosaur era?
I've got a relatively old one, buyed 3 years ago, and another one, 8 
years old, with only 512Mb of RAM, and Eclipse runs nice.
From: Nick Keighley
Subject: Re: How to Get Started?
Date: 
Message-ID: <6e1c63a3-7716-4661-9dbe-4ad49c2393b2@f77g2000hsf.googlegroups.com>
On 29 Oct, 14:15, "John Thingstad" <·······@online.no> wrote:
> På Wed, 29 Oct 2008 14:17:51 +0100, skrev Javier <······@askmyadress.com>:

> > They both are right, even if Cusp is a pluging for an editor made in  
> > Java. If you want to be purist and charge against Cusp because it is  
> > made in Java, remember that the OS you are using is mostly made in C++,  
> > another language that you hate.
>
> The core of Windows is written in C actually, not C++. (Intel's C  
> compiler.)
> ANSI C is actually far nicer than C++ in my mind.

Windows is compiled with an Intel compiler?

<snip>

--
Nick Keighley
From: John Thingstad
Subject: Re: How to Get Started?
Date: 
Message-ID: <op.ujt7x4dcut4oq5@pandora.alfanett.no>
P� Thu, 30 Oct 2008 12:13:49 +0100, skrev Nick Keighley  
<····················@hotmail.com>:

> On 29 Oct, 14:15, "John Thingstad" <·······@online.no> wrote:
>> P� Wed, 29 Oct 2008 14:17:51 +0100, skrev Javier  
>> <······@askmyadress.com>:
>
>> > They both are right, even if Cusp is a pluging for an editor made in �
>> > Java. If you want to be purist and charge against Cusp because it is �
>> > made in Java, remember that the OS you are using is mostly made in  
>> C++, �
>> > another language that you hate.
>>
>> The core of Windows is written in C actually, not C++. (Intel's C �
>> compiler.)
>> ANSI C is actually far nicer than C++ in my mind.
>
> Windows is compiled with an Intel compiler?
>
> <snip>

Yep, Intels optimising C compiler generally produces the fastest code.

--------------
John Thingstad
From: Duane Rettig
Subject: Re: How to Get Started?
Date: 
Message-ID: <o0tzauqdki.fsf@gemini.franz.com>
"John Thingstad" <·······@online.no> writes:

> P� Thu, 30 Oct 2008 12:13:49 +0100, skrev Nick Keighley
> <····················@hotmail.com>:
>
>> On 29 Oct, 14:15, "John Thingstad" <·······@online.no> wrote:
>>> P� Wed, 29 Oct 2008 14:17:51 +0100, skrev Javier
>>> <······@askmyadress.com>:
>>
>>> > They both are right, even if Cusp is a pluging for an editor made in �
>>> > Java. If you want to be purist and charge against Cusp because it is �
>>> > made in Java, remember that the OS you are using is mostly made
>>> in  C++, �
>>> > another language that you hate.
>>>
>>> The core of Windows is written in C actually, not C++. (Intel's C �
>>> compiler.)
>>> ANSI C is actually far nicer than C++ in my mind.
>>
>> Windows is compiled with an Intel compiler?
>>
>> <snip>
>
> Yep, Intels optimising C compiler generally produces the fastest code.

However, it is not likely that those versions of Windows which are
not on Intel hardware use a compiler from Intel.  I personally don't
know what compiler MS use to compile their system; I suspect that it
is their own C++ compiler (yes, you can easily compile C using a C++
compiler - in fact, it's sometines hard to even find _just_ C
compilers from some vendors - even gcc is not just a C compiler; it
does C, C++, objective-C, ...).  And whether MSVC was built with
Intel's C compiler or not is probably irrelevant.  Back in the day
when DEC were still a company, and they paid us to do a port of
Allegro CL to NT on Alpha, the compiler there was indeed MSVC, and of
course it was Alpha-specific, and there were even DEC developers
working on it in conjunction with MS people.  Does that mean it was a
DEC compiler?  Well, yes, and no.

[Whatever happened to the Allegro CL on Alpha/NT?  Well, we did get
paid for the port, but just as DEC were going under, and I don't thnk
we sold many copys of it]

P.S. We generally stay away from C++ in our own code; the small
portions of code that are written in C-like languages are mostly
written in C, not C++, but on the other hand we don't tend to stay away
from C++ compilers, only C++ code.  Why is that?  In a word... mangling.

-- 
Duane Rettig  ·····@franz.com Franz Inc.  http://www.franz.com/
555 12th St.,   Suite 1450,  Oakland, Ca. 94607
From: Kaz Kylheku
Subject: Re: How to Get Started?
Date: 
Message-ID: <20081030102111.664@gmail.com>
On 2008-10-30, Duane Rettig <·····@franz.com> wrote:
> "John Thingstad" <·······@online.no> writes:
>
>> P� Thu, 30 Oct 2008 12:13:49 +0100, skrev Nick Keighley
>> <····················@hotmail.com>:
>>
>>> On 29 Oct, 14:15, "John Thingstad" <·······@online.no> wrote:
>>>> P� Wed, 29 Oct 2008 14:17:51 +0100, skrev Javier
>>>> <······@askmyadress.com>:
>>>
>>>> > They both are right, even if Cusp is a pluging for an editor made in �
>>>> > Java. If you want to be purist and charge against Cusp because it is �
>>>> > made in Java, remember that the OS you are using is mostly made
>>>> in  C++, �
>>>> > another language that you hate.
>>>>
>>>> The core of Windows is written in C actually, not C++. (Intel's C �
>>>> compiler.)
>>>> ANSI C is actually far nicer than C++ in my mind.
>>>
>>> Windows is compiled with an Intel compiler?
>>>
>>> <snip>
>>
>> Yep, Intels optimising C compiler generally produces the fastest code.
>
> However, it is not likely that those versions of Windows which are
> not on Intel hardware use a compiler from Intel.  I personally don't
> know what compiler MS use to compile their system; I suspect that it
> is their own C++ compiler (yes, you can easily compile C using a C++
> compiler - in fact, it's sometines hard to even find _just_ C
> compilers from some vendors - even gcc is not just a C compiler; it

GCC is not a compiler, but a collection of compilers (and a few other
supporting toolchain components like the linkage helper ``collect2'', and some
run-time library material).

GCC does in fact have something which is just a C compiler.  The C front end in
GCC is a separate implementation from the C++ front end.  Different codebases
in the tree, different executables: cc1 and cc1plus.

You can build GCC without C++ support. Not only that, it's separately packaged
in the source code tarball.  You can obtain a source archive of GCC without C++
called gcc-core-*, and you can obtain the C++ material in a separate add-on
archive called gcc-g++-*.

Microsoft's compiler is C and C++ in one, apparently. It's the same
executable and announces itself as the ``Microsoft C/C++ Compiler''.

Not all C code can be interpreted as syntactically correct C++ with the same
meaning. (Not even C89 code, let alone C99).
From: Duane Rettig
Subject: Re: How to Get Started?
Date: 
Message-ID: <o0prliq76h.fsf@gemini.franz.com>
Kaz Kylheku <········@gmail.com> writes:

> On 2008-10-30, Duane Rettig <·····@franz.com> wrote:
>> "John Thingstad" <·······@online.no> writes:
>>
>>> P� Thu, 30 Oct 2008 12:13:49 +0100, skrev Nick Keighley
>>> <····················@hotmail.com>:
>>>
>>>> On 29 Oct, 14:15, "John Thingstad" <·······@online.no> wrote:
>>>>> P� Wed, 29 Oct 2008 14:17:51 +0100, skrev Javier
>>>>> <······@askmyadress.com>:
>>>>
>>>>> > They both are right, even if Cusp is a pluging for an editor made in �
>>>>> > Java. If you want to be purist and charge against Cusp because it is �
>>>>> > made in Java, remember that the OS you are using is mostly made
>>>>> in  C++, �
>>>>> > another language that you hate.
>>>>>
>>>>> The core of Windows is written in C actually, not C++. (Intel's C �
>>>>> compiler.)
>>>>> ANSI C is actually far nicer than C++ in my mind.
>>>>
>>>> Windows is compiled with an Intel compiler?
>>>>
>>>> <snip>
>>>
>>> Yep, Intels optimising C compiler generally produces the fastest code.
>>
>> However, it is not likely that those versions of Windows which are
>> not on Intel hardware use a compiler from Intel.  I personally don't
>> know what compiler MS use to compile their system; I suspect that it
>> is their own C++ compiler (yes, you can easily compile C using a C++
>> compiler - in fact, it's sometines hard to even find _just_ C
>> compilers from some vendors - even gcc is not just a C compiler; it
>
> GCC is not a compiler, but a collection of compilers (and a few other
> supporting toolchain components like the linkage helper ``collect2'', and some
> run-time library material).
>
> GCC does in fact have something which is just a C compiler.  The C front end in
> GCC is a separate implementation from the C++ front end.  Different codebases
> in the tree, different executables: cc1 and cc1plus.
>
> You can build GCC without C++ support. Not only that, it's separately packaged
> in the source code tarball.  You can obtain a source archive of GCC without C++
> called gcc-core-*, and you can obtain the C++ material in a separate add-on
> archive called gcc-g++-*.

Yes, but how many people do you think actually do that? (note for
people who actually do that: I'm not asking for a vote;  this is a
question of practicality, and comes close to being rhetorical, so
don't pipe up and say "I do, so there", expecting me to be convinced)

> Microsoft's compiler is C and C++ in one, apparently. It's the same
> executable and announces itself as the ``Microsoft C/C++ Compiler''.
>
> Not all C code can be interpreted as syntactically correct C++ with the same
> meaning. (Not even C89 code, let alone C99).

You're correct, of course; for example, HPUX only provides its ansi
C/C++ compiler; for that compiler and for the optins we use we have to
wrap whole files with an "extern C" form.  However, it is still
possible to program purely in C with a C++ compiler.  the original C++
was intended to be only a wrapper around C; in fact, for a while it
was required that C++ be preprocessable to pure C code.

But this is getting very close to being off-topic for this ng, other
than the idea that languages can be programmed against the grain of
their intention.  To bring it back around to Lisp, how about the
question of programming C in lisp?  In that case, it is not a literal
issue, but an issue of style, where the programmer is being accused of
not getting into the lisp style of programming, or of carrying old
programming models with him from C-land.

-- 
Duane Rettig  ·····@franz.com Franz Inc.  http://www.franz.com/
555 12th St.,   Suite 1450,  Oakland, Ca. 94607
From: Rob Warnock
Subject: S-expr form of C
Date: 
Message-ID: <XtOdnQhPqohz7ZfUnZ2dnUVZ_rDinZ2d@speakeasy.net>
[Significantly changing the topic...]

Duane Rettig <·····@franz.com> wrote:
+---------------
| To bring it back around to Lisp, how about the question of
| programming C in lisp?  In that case, it is not a literal
| issue, but an issue of style, where the programmer is being
| accused of not getting into the lisp style of programming,
| or of carrying old programming models with him from C-land.
+---------------

I'd like to ask the inverse of this, namely, is there any
generally-accepted "best style" in the Lisp community for
representing C source code in s-expr form? I know about
Aubrey Jaffer's "Schlep"[1], but it's really more a "translator"
from Scheme to C -- historical versions of it used a kind
of Hungarian mangling of function & variable names (based
on suffixes) to convey type information[2]. I'm more looking
for a more literal "representation" of C source in s-expr form,
with a view towards writing a sort of "LAP" which targets C,
with the ability to wrap CL macros around the "LAP". Anybody
got any pointers to prior art?


-Rob

[1] http://people.csail.mit.edu/jaffer/Docupage/schlep.html
    Schlep is a Scheme to C translator for a subset of Scheme.

[2] The latest version seems to have added additional embedded
    and lookaside type declaration syntax, but it's still based
    on matching prefixes/suffixes (e.g., still quasi-Hungarian).

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Bakul Shah
Subject: Re: S-expr form of C
Date: 
Message-ID: <490A77FC.7090809@bitblocks.com>
Rob Warnock wrote:
> [Significantly changing the topic...]
> 
> Duane Rettig <·····@franz.com> wrote:
> +---------------
> | To bring it back around to Lisp, how about the question of
> | programming C in lisp?  In that case, it is not a literal
> | issue, but an issue of style, where the programmer is being
> | accused of not getting into the lisp style of programming,
> | or of carrying old programming models with him from C-land.
> +---------------
> 
> I'd like to ask the inverse of this, namely, is there any
> generally-accepted "best style" in the Lisp community for
> representing C source code in s-expr form? I know about
> Aubrey Jaffer's "Schlep"[1], but it's really more a "translator"
> from Scheme to C -- historical versions of it used a kind
> of Hungarian mangling of function & variable names (based
> on suffixes) to convey type information[2]. I'm more looking
> for a more literal "representation" of C source in s-expr form,
> with a view towards writing a sort of "LAP" which targets C,
> with the ability to wrap CL macros around the "LAP". Anybody
> got any pointers to prior art?

You mean something like a C->s-expr converter? Why bother?
Anyway this is easy; just have your parser spit out an
abstract syntax tree as an S-expr.
From: Rob Warnock
Subject: Re: S-expr form of C
Date: 
Message-ID: <0rednXhrnKKCFZfUnZ2dnUVZ_uednZ2d@speakeasy.net>
Bakul Shah  <············@bitblocks.com> wrote:
+---------------
| Rob Warnock wrote:
| > ...is there any generally-accepted "best style" in the Lisp
| > community for representing C source code in s-expr form?
| 
| You mean something like a C->s-expr converter? Why bother?
| Anyway this is easy; just have your parser spit out an
| abstract syntax tree as an S-expr.
+---------------

There's no "parser"; I'm writing original C code from scratch,
but want to be able to use DEFMACRO to make it easier [since
a rather large part of the code can be generated with macros].

Note that I have done stuff like this in the past by simply
pasting strings together [e.g., it's *amazing* how neatly
FORMAT can emit large C array initializations!], but I'd like
to be able to write in pure s-expr form, sort of like using
CL-SQL forms for queries instead of bare SQL strings (as with PG).

The canonical example, with one possible syntax:

    (c-defun (main int) ((int count) ((array nil (array nil char)) args))
      (unless (= count 2)
	(warn "~a: argument required" (aref args 0))
	(exit 1))
      (c-let ((((array nil char) p) (aref args 1)))
	(unless (string= p "foo")
	  (error "Try again!"))
      (exit 0))

Another variant would be to stick closer to CL declaration style, e.g.:

    (c-declaim (ftype (function (int (array * (array * char))) int) main))
    (c-defun main (count args)
      ...)

or:

    (c-defun main (count args)
      (c-declare (ftype (function (t t) int) main)
                 (type int count)
		 (type (array * (array * char)) args))
      ...)

or something of that ilk...


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Bakul Shah
Subject: Re: S-expr form of C
Date: 
Message-ID: <490AAD8E.3080101@bitblocks.com>
Rob Warnock wrote:
> There's no "parser"; I'm writing original C code from scratch,
> but want to be able to use DEFMACRO to make it easier [since
> a rather large part of the code can be generated with macros].
> 
> Note that I have done stuff like this in the past by simply
> pasting strings together [e.g., it's *amazing* how neatly
> FORMAT can emit large C array initializations!], but I'd like
> to be able to write in pure s-expr form, sort of like using
> CL-SQL forms for queries instead of bare SQL strings (as with PG).
> 
> The canonical example, with one possible syntax:
> 
>     (c-defun (main int) ((int count) ((array nil (array nil char)) args))
>       (unless (= count 2)
> 	(warn "~a: argument required" (aref args 0))
> 	(exit 1))
>       (c-let ((((array nil char) p) (aref args 1)))
> 	(unless (string= p "foo")
> 	  (error "Try again!"))
>       (exit 0))
> 
> Another variant would be to stick closer to CL declaration style, e.g.:
> 
>     (c-declaim (ftype (function (int (array * (array * char))) int) main))
>     (c-defun main (count args)
>       ...)
> 
> or:
> 
>     (c-defun main (count args)
>       (c-declare (ftype (function (t t) int) main)
>                  (type int count)
> 		 (type (array * (array * char)) args))
>       ...)
> 
> or something of that ilk...

So this is more s-expr->C then.  I tend to write separate tools
that generate C code if there is some pattern to be exploited as
they tend to be less scary to non lispers!

In the past I've used Scheme in this way to generate test code
for a custom network processor (got a kick out of representing
a minimal ethernet packet as a 512 bit bignum!).  It was a lot
more fun than using Perl!

C->s-expr can be useful if some day the interesting compiler bits
get written in Lisp. It's too bad Scott's Zeta-C can't be resurrected
without a lot of work (or a rewrite).
From: Kenny
Subject: Re: S-expr form of C
Date: 
Message-ID: <490a8947$0$4976$607ed4bc@cv.net>
Bakul Shah wrote:

> You mean something like a C->s-expr converter? Why bother?

Either to automatically translate C code to Lisp for ongoing development 
like I did or just to generate bindings.

> Anyway this is easy; just have your parser spit out an
> abstract syntax tree as an S-expr.

http://www.antlr.org/

Un-comment-out the one line of code that writes out the parse in Lisp 
READ-able sexpr form and yer done.

hth,kzo
From: Scott Burson
Subject: Re: S-expr form of C
Date: 
Message-ID: <412aa48f-724d-434f-8738-39ff58f0eed4@x1g2000prh.googlegroups.com>
On Oct 30, 7:43 pm, ····@rpw3.org (Rob Warnock) wrote:
> Anybody got any pointers to prior art?

http://www.bitsavers.org/bits/TI/Explorer/zeta-c/

Doesn't run in CL, alas, but you might still find the s-expression
form of C useful.

-- Scott
From: Rob Warnock
Subject: Re: S-expr form of C
Date: 
Message-ID: <0rednXprnKJ5FZfUnZ2dnUVZ_uednZ2d@speakeasy.net>
Scott Burson  <········@gmail.com> wrote:
+---------------
| ····@rpw3.org (Rob Warnock) wrote:
| > Anybody got any pointers to prior art?
| 
| http://www.bitsavers.org/bits/TI/Explorer/zeta-c/
| 
| Doesn't run in CL, alas, but you might still find the s-expression
| form of C useful.
+---------------

Thanks!! I'll take a look.


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Maciej Katafiasz
Subject: Re: S-expr form of C
Date: 
Message-ID: <gehgge$j3f$1@news.net.uni-c.dk>
Den Thu, 30 Oct 2008 20:20:53 -0700 skrev Scott Burson:

> On Oct 30, 7:43 pm, ····@rpw3.org (Rob Warnock) wrote:
>> Anybody got any pointers to prior art?
> 
> http://www.bitsavers.org/bits/TI/Explorer/zeta-c/
> 
> Doesn't run in CL, alas, but you might still find the s-expression form
> of C useful.

The note in that dir says you'll look into getting a formatter for the 
manual. Did that ever get anywhere? I'm interested in Zeta-C on its own, 
having a readble manual would be very nice.

Cheers,
Maciej
From: Andrew Reilly
Subject: Re: S-expr form of C
Date: 
Message-ID: <6mvbgtFj1s0lU1@mid.individual.net>
On Thu, 30 Oct 2008 21:43:58 -0500, Rob Warnock wrote:

>  I'm more looking
> for a more literal "representation" of C source in s-expr form, with a
> view towards writing a sort of "LAP" which targets C, with the ability
> to wrap CL macros around the "LAP". Anybody got any pointers to prior
> art?

Isn't the GCC RTL kind of an S-expr assembly language? 

Cheers,

-- 
Andrew
From: Rob Warnock
Subject: Re: S-expr form of C
Date: 
Message-ID: <0rednXtrnKIYFZfUnZ2dnUVZ_uednZ2d@speakeasy.net>
Andrew Reilly  <···············@areilly.bpc-users.org> wrote:
+---------------
| Rob Warnock wrote:
| > I'm more looking for a more literal "representation" of C source
| > in s-expr form, with a view towards writing a sort of "LAP" which
| > targets C, with the ability to wrap CL macros around the "LAP".
| > Anybody got any pointers to prior art?
| 
| Isn't the GCC RTL kind of an S-expr assembly language? 
+---------------

Yes, but... it's a representation of *assembly* language, not C.


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Pascal Bourguignon
Subject: Re: S-expr form of C
Date: 
Message-ID: <490bae08$0$27200$426a74cc@news.free.fr>
Rob Warnock wrote:
> I'd like to ask the inverse of this, namely, is there any
> generally-accepted "best style" in the Lisp community for
> representing C source code in s-expr form? I know about
> Aubrey Jaffer's "Schlep"[1], but it's really more a "translator"
> from Scheme to C -- historical versions of it used a kind
> of Hungarian mangling of function & variable names (based
> on suffixes) to convey type information[2]. I'm more looking
> for a more literal "representation" of C source in s-expr form,
> with a view towards writing a sort of "LAP" which targets C,
> with the ability to wrap CL macros around the "LAP". Anybody
> got any pointers to prior art?

In my own S-exp to C system, the objective is to be able to generate 
(almost) all the possible C/C++ syntax from S-exp.  I actually generate 
it from CLOS objects, and have macros defined to build these CLOS 
objects from the corresponding S-exp.

But this is only the lowest level of that system.  (You could call it 
"CLAP", for "C Level Assembler Program").

Right away, I implement a macro system and progressively implement more 
and more of Common Lisp-alike features, generating C code.  Soon enough 
we don't write (for ...) loops, but dotime or dolist loops...


So there's not much point in having a "generally-accepted best style" 
for this kind of things, since with macros you will develop your own DSL 
anyways.


-- 
__Pascal Bourguignon__
http://www.informatimago.com
From: Rob Warnock
Subject: Re: S-expr form of C
Date: 
Message-ID: <A5SdneRY_5LZRpbUnZ2dnUVZ_gCdnZ2d@speakeasy.net>
Pascal Bourguignon  <···@informatimago.com> wrote:
+---------------
| Rob Warnock wrote:
| > I'd like to ask the inverse of this, namely, is there any
| > generally-accepted "best style" in the Lisp community for
| > representing C source code in s-expr form? ... I'm more looking
| > for a more literal "representation" of C source in s-expr form,
| > with a view towards writing a sort of "LAP" which targets C,
| > with the ability to wrap CL macros around the "LAP". Anybody
| > got any pointers to prior art?
| 
| In my own S-exp to C system, the objective is to be able to generate 
| (almost) all the possible C/C++ syntax from S-exp.  I actually generate 
| it from CLOS objects, and have macros defined to build these CLOS 
| objects from the corresponding S-exp.
| 
| But this is only the lowest level of that system.  (You could call it 
| "CLAP", for "C Level Assembler Program").
+---------------

Well, being a networking/datacomms kind of guy myself, I tend to
call it "LAP-C". [There's a bad pun in there for old datacomm types].
But, yes. That's exactly what I'm looking for. Are you willing to
share your surface syntax/notation? Or at least its general shape?
[Wraps everything in type specifiers? Uses CL-style declarations?
Uses lookaside tables of name->type pattern matches? Other?]

+---------------
| Right away, I implement a macro system and progressively implement
| more and more of Common Lisp-alike features, generating C code.
| Soon enough we don't write (for ...) loops, but dotime or dolist loops...
| 
| So there's not much point in having a "generally-accepted best style" 
| for this kind of things, since with macros you will develop your own DSL 
| anyways.
+---------------

I do, in fact, understand your point, but I still believe it's best
to ground such an effort firmly in some concrete syntax which *can*
"generate (almost) all the possible C/C++ syntax from S-exp", rather
than hack around with a quick&dirty syntax (such as the ones I showed
before) for a long time only to find that you have to completely re-do
your whole system because you left out something fundamental from the
concrete syntax. It was for that reason that I asked the question in
the first place -- trying to get a leg up by learning from others'
mistakes without having to re-make all of them myself!  ;-}


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Pascal J. Bourguignon
Subject: Re: S-expr form of C
Date: 
Message-ID: <87fxmbsmet.fsf@hubble.informatimago.com>
····@rpw3.org (Rob Warnock) writes:

> Pascal Bourguignon  <···@informatimago.com> wrote:
> +---------------
> | Rob Warnock wrote:
> | > I'd like to ask the inverse of this, namely, is there any
> | > generally-accepted "best style" in the Lisp community for
> | > representing C source code in s-expr form? ... I'm more looking
> | > for a more literal "representation" of C source in s-expr form,
> | > with a view towards writing a sort of "LAP" which targets C,
> | > with the ability to wrap CL macros around the "LAP". Anybody
> | > got any pointers to prior art?
> | 
> | In my own S-exp to C system, the objective is to be able to generate 
> | (almost) all the possible C/C++ syntax from S-exp.  I actually generate 
> | it from CLOS objects, and have macros defined to build these CLOS 
> | objects from the corresponding S-exp.
> | 
> | But this is only the lowest level of that system.  (You could call it 
> | "CLAP", for "C Level Assembler Program").
> +---------------
>
> Well, being a networking/datacomms kind of guy myself, I tend to
> call it "LAP-C". [There's a bad pun in there for old datacomm types].
> But, yes. That's exactly what I'm looking for. Are you willing to
> share your surface syntax/notation? Or at least its general shape?
> [Wraps everything in type specifiers? Uses CL-style declarations?
> Uses lookaside tables of name->type pattern matches? Other?]
>
> +---------------
> | Right away, I implement a macro system and progressively implement
> | more and more of Common Lisp-alike features, generating C code.
> | Soon enough we don't write (for ...) loops, but dotime or dolist loops...
> | 
> | So there's not much point in having a "generally-accepted best style" 
> | for this kind of things, since with macros you will develop your own DSL 
> | anyways.
> +---------------
>
> I do, in fact, understand your point, but I still believe it's best
> to ground such an effort firmly in some concrete syntax which *can*
> "generate (almost) all the possible C/C++ syntax from S-exp", rather
> than hack around with a quick&dirty syntax (such as the ones I showed
> before) for a long time only to find that you have to completely re-do
> your whole system because you left out something fundamental from the
> concrete syntax. It was for that reason that I asked the question in
> the first place -- trying to get a leg up by learning from others'
> mistakes without having to re-make all of them myself!  ;-}



------------------------------------------------------------------------

(cl:in-package :linc)

(defpackage bc-mem (:use) (:export "COPY" "ALLOCATE" "DEALLOCATE"))
(declare-variable '(c::n-allocation c::n-data c::copy c::n-length))
(declare-function '(bc-mem:allocate bc-mem:deallocate bc-mem:copy))
(declare-macro    '(c::minimum))

(cl:in-package :c)

(comment "Here is a little function")

(define-function string_add ((a string_t) (b string_t)) string_t
  (let ((av int)
        (bv int)
        (res string_t (malloc (+ 2 (max (strlen a) (strlen b))))))
    (sscanf a "%d" (address av))
    (sscanf b "%d" (address bv))
    (sprintf res "%d" (+ a b))
    (return res)))

(comment "Here is another function."
         "Slightly bigger this time."
         (* 42 12))

(define-function test () void
  (if (> n-allocation 1)
    (progn
      (= n-data (bc-mem:allocate (* (sizeof char) n-allocation)))
      (if copy
        (progn
          (= n-length (minimum (- n-allocation 1) (-> this dlength)))
          (bc-mem:copy (-> this data) n-data (* n-length (sizeof char))))
        (= n-length 0)))
    (progn
      (= n-allocation 1)
      (= n-data (bc-mem:allocate (* (sizeof char) n-allocation)))
      (= n-length 0)))
  (= (aref n-data  n-length) (cast 0 char))
  (bc-mem:deallocate (cast (address (-> this data)) (pointer (pointer void))))
  (= (-> this data)       n-data)
  (= (-> this dlength)    n-length)
  (= (-> this allocation) n-allocation)
  (let ((test double
              (* (+ 1 2 3 4) (/ 5 4 3 2) (- 5 4 3 2)
                 (pos a) (neg b) (deref c) (~ d) (! e)
                 (pos (+ 1 a)) (neg (+ 2 b)) (deref (+ c 3))
                 (~ (+ 4 d)) (! (< e 0)))))
    (printf "%d\\n" test))
  (return this))

------------------------------------------------------------------------


gets transformed into:


------------------------------------------------------------------------

/*
  Here is a little function
*/
string_t string_add(string_t a,string_t b){
    {
        int av;
        int bv;
        string_t res=malloc(2+max(strlen(a),strlen(b)));

        sscanf(a,"%d",&av);
        sscanf(b,"%d",&bv);
        sprintf(res,"%d",a+b);
        return(res);
    }
}
/*
  Here is another function.
  Slightly bigger this time.
  (* 42 12)
*/
void test(){
    if(nAllocation>1){
        nData=BcMem_Allocate(sizeof(char)*nAllocation);
        if(copy){
            nLength=MINIMUM(nAllocation-1,this->dlength);
            BcMem_Copy(this->data,nData,nLength*sizeof(char));
        }else
            nLength=0;
    }else{
        nAllocation=1;
        nData=BcMem_Allocate(sizeof(char)*nAllocation);
        nLength=0;
    }
    nData[nLength]=(char)0;
    BcMem_Deallocate((void**)&this->data);
    this->data=nData;
    this->dlength=nLength;
    this->allocation=nAllocation;
    {
        double test=(1+2+3+4)*5/4/3/2*(5-4-3-2)*+a*-b**c*~d*!e*+(1+a)*-(2+b)**(c+3)*~(4+d)*!(e<0);

        printf("%d\n",test);
    }
    return(this);
}

------------------------------------------------------------------------


Unfortunately, my code is not ready for public consumption yet.

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

HEALTH WARNING: Care should be taken when lifting this product,
since its mass, and thus its weight, is dependent on its velocity
relative to the user.
From: Rob Warnock
Subject: Re: S-expr form of C
Date: 
Message-ID: <f82dnQ0m3pUByJHUnZ2dnUVZ_q7inZ2d@speakeasy.net>
Pascal J. Bourguignon <···@informatimago.com> wrote:
+---------------
| ····@rpw3.org (Rob Warnock) writes:
| > Pascal Bourguignon  <···@informatimago.com> wrote:
| > +---------------
| > | But this is only the lowest level of that system.
| > | (You could call it "CLAP", for "C Level Assembler Program").
| > +---------------
| >
| > Well, being a networking/datacomms kind of guy myself, I tend to
| > call it "LAP-C". [There's a bad pun in there for old datacomm types].
| > But, yes. That's exactly what I'm looking for. Are you willing to
| > share your surface syntax/notation? Or at least its general shape?
...
| > ... [just] trying to get a leg up by learning from others'
| > mistakes without having to re-make all of them myself!  ;-}
...
| (cl:in-package :c)
| 
| (comment "Here is a little function")
| 
| (define-function string_add ((a string_t) (b string_t)) string_t
|   (let ((av int)
|         (bv int)
|         (res string_t (malloc (+ 2 (max (strlen a) (strlen b))))))
|     (sscanf a "%d" (address av))
|     (sscanf b "%d" (address bv))
|     (sprintf res "%d" (+ a b))
|     (return res)))
...
| /*
|   Here is a little function
| */
| string_t string_add(string_t a,string_t b){
|     {
|         int av;
|         int bv;
|         string_t res=malloc(2+max(strlen(a),strlen(b)));
| 
|         sscanf(a,"%d",&av);
|         sscanf(b,"%d",&bv);
|         sprintf(res,"%d",a+b);
|         return(res);
|     }
| }
+---------------

Thanks! That helps a lot.

+---------------
| Unfortunately, my code is not ready for public consumption yet.
+---------------

Not a problem. As I said, I was just looking for the general shape
of your s-expr syntax, which your examples handily provided. Your
DEFUN & LET syntax is "flatter" than the one I was considering,
and looks better, that is:

    (let ((var type [initializer])) ...)

instead of:

    (let (((var type) [initializer])) ...)

And:

    (define-function func ((arg type) (arg type)...) result_t
      ...body...)

instead of:

    (c-defun (func result_t) ((arg type) (arg type)...)
      ...body...)

Those were just the sort of suggestions I was looking for, thanks!


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Dimiter "malkia" Stanev
Subject: Re: How to Get Started?
Date: 
Message-ID: <ged3av$pd4$1@registered.motzarella.org>
> Microsoft's compiler is C and C++ in one, apparently. It's the same
> executable and announces itself as the ``Microsoft C/C++ Compiler''.

Going off-topic here, but cl.exe is just a driver that loads "c1.dll" ( 
I guess C only) or "c1xx.dll" (I guess C++ only), later either one of 
them goes through "c2.dll" which is the optimizing part.
From: John Thingstad
Subject: Re: How to Get Started?
Date: 
Message-ID: <op.ujv61cnzut4oq5@pandora.alfanett.no>
P� Thu, 30 Oct 2008 16:59:09 +0100, skrev Duane Rettig <·····@franz.com>:

>
> However, it is not likely that those versions of Windows which are
> not on Intel hardware use a compiler from Intel.

There is a Linux version of the Intel compiler as well. On other harware,  
no.

> I personally don't
> know what compiler MS use to compile their system; I suspect that it
> is their own C++ compiler (yes, you can easily compile C using a C++
> compiler - in fact, it's sometines hard to even find _just_ C
> compilers from some vendors - even gcc is not just a C compiler; it
> does C, C++, objective-C, ...).  And whether MSVC was built with
> Intel's C compiler or not is probably irrelevant.

No they use Intel's compiler, not MSVC, oddly enough.

Of cource Intel's compiler like most (all?) C compilers compile C++ as  
well.
You can use C++ as a typesafe C. However to observe ANSI C compliance you  
need to compile with the -ANSI option (or equivalent).

--------------
John Thingstad
From: George Neuner
Subject: Re: How to Get Started?
Date: 
Message-ID: <i1nmg45q43n6bf4roirflll3pqknck9rjo@4ax.com>
On Thu, 30 Oct 2008 04:13:49 -0700 (PDT), Nick Keighley
<····················@hotmail.com> wrote:

>On 29 Oct, 14:15, "John Thingstad" <·······@online.no> wrote:
>> P� Wed, 29 Oct 2008 14:17:51 +0100, skrev Javier <······@askmyadress.com>:
>
>> > They both are right, even if Cusp is a pluging for an editor made in �
>> > Java. If you want to be purist and charge against Cusp because it is �
>> > made in Java, remember that the OS you are using is mostly made in C++, �
>> > another language that you hate.
>>
>> The core of Windows is written in C actually, not C++. (Intel's C �
>> compiler.)
>> ANSI C is actually far nicer than C++ in my mind.
>
>Windows is compiled with an Intel compiler?

The NT kernels absolutely were compiled with Intel.  Microsoft's 4.0
compiler was the first 32-bit version that was in any way comparable
to Intel's in performance and it was released after NT4.

But AFAIK, Microsoft has not used Intel's compiler other than as a
portability check since NT4.  I'm pretty sure the W2K and later 32-bit
kernels were all done with Microsoft's own compiler.

I am not sure about 64-bit Windows though.


Intel is still the preferred compiler for x86 embedded work because it
does more chip specific optimizations than Microsoft or GCC or Watcom.
But for desktop work where you're typically generating blended code
rather than targeting a specific chip, any of those compilers will get
you there.

George
From: Slobodan Blazeski
Subject: Re: How to Get Started?
Date: 
Message-ID: <545a3da7-3529-4e12-8923-ea26c1eaf071@f63g2000hsf.googlegroups.com>
On Oct 28, 5:17 pm, dr43058 <·······@gmail.com> wrote:
> How do you get started? Do I need to download something to get started
> with CLOS or CL? Is there a Getting Started page?
>
> Thanks,
> Danny R.

http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/a07054d9c0a8f508/755f8071d1392de6?lnk=st&q=#755f8071d1392de6