Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
newLISP is simple, terse, and well documented
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 51 - 75 of 100 - Collapse all  -  Translate all to Translated (View all originals) < Older  Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Majorinc Kazimir  
View profile  
 More options Jan 19 2009, 7:33 pm
Newsgroups: comp.lang.lisp
From: Majorinc Kazimir <fa...@email.address>
Date: Tue, 20 Jan 2009 01:33:55 +0100
Local: Mon, Jan 19 2009 7:33 pm
Subject: Re: newLISP is simple, terse, and well documented

Mark Wooding wrote:
> Majorinc Kazimir <fa...@email.address> writes:

>> (1) Unrestricted eval, i.e. eval can access to local variables. CL and
>>     Scheme evals cannot do that.

> Indeed.  It's a tradeoff between efficient compilation and EVAL: if the
> compiler is given the necessary freedom to arrange a function's
> environment in the most efficient manner, then either EVAL will be
> horrifically complicated or just won't be able to `see' lexically bound
> variables.

So, CL chose an option that leads to speed, and Newlisp
chose the option that leads to expressive power. That is
exactly what I said.

> Emacs Lisp does this, by the way.

>>     Eval is, in my opinion, single most important feature for
>>     code=data.

> Ahh.  I think I'd put efficient and comprehensible macros and ready
> availability of COMPILE rather higher.

So, you value speed more than expressive power. OK. I do not.

>> (2) Fexprs, i.e. "the first class" macros.

> The `F' stands for `funny'.  Interestingly, fexprs were the cause of
> many of the problems that macros were introduced to fix, most notably
> the fact that very existence of fexprs the compiler doesn't have
> built-in knowledge about makes it nearly impossible to compile correct
> code.

So, CL chose the path that leads to speed, Newlisp
chose the path that leads to expressive power.

>> (3) Newlisp has support for dynamic and static scope.  Local variables
>>     are dynamically scoped. The namespaces, called "contexts" are
>>     statically scoped. That allows significantly more expressive
>>     functions than in dialects with statically scoped local variables.

> Of course, CL has both anyway, with lexical scoping as the (correct)
> default.  Proper lexical scoping is, of course, the right solution to
> the famous historical `funargs' problem.

So, CL chose the path that leads to what? Safety? Newlisp
chose the path that leads to expressive power.

The funarg is however, not the problem is Newlisp practice.

There are few reasons for that. One reason is that people
simply use support for lexical scope existing in language.

Other reason is that funarg problem is not really that
hard - even if one decide to use only dynamic scope.

>> (4) The Functions are lambda-expressions, not results of the
>>     evaluation of lambda expressions. That means, program can analyze
>>     and modify functions during runtime. And the same is the case for
>>     macros.

> Oh, heavens.  Look, if you want Emacs Lisp, you know where to find it.
> But it really isn't very new.

So, where are we now? You gave up from CL and you are trying to
compare Newlisp with Emacs Lisp. Then go back to fexprs vs macros,
Newlisp has fexprs, Emacs has macros.

>> (5) Newlisp is an intepreter. That means, if you want speed, you are
>>     in the same league as Python or Perl.  But, if your code contains
>>     lot of evals - Newlisp is faster than many other Lisps.

> You don't have to be mad to write programs which make heavy use of EVAL
> but, no, wait, you do.

Mad? Yeah right pal, I have to go, good luck to you ... :)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew D Swank  
View profile  
 More options Jan 19 2009, 7:42 pm
Newsgroups: comp.lang.lisp
From: Matthew D Swank <akopa.gmane.pos...@gmail.com>
Date: Tue, 20 Jan 2009 00:42:13 GMT
Local: Mon, Jan 19 2009 7:42 pm
Subject: Re: newLISP is simple, terse, and well documented
On Mon, 19 Jan 2009 10:29:18 -0800, jos...@corporate-world.lisp.de wrote:

...

> * all built-in function (minus primitive type specialized functions)
> functions should be generic functions

> etc etc.

Should funcall _and_ apply both be generic functions?

Matt

--
Communicate!  It can't make things any worse.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Reilly  
View profile  
 More options Jan 19 2009, 7:47 pm
Newsgroups: comp.lang.lisp
From: Andrew Reilly <andrew-newsp...@areilly.bpc-users.org>
Date: 20 Jan 2009 00:47:49 GMT
Local: Mon, Jan 19 2009 7:47 pm
Subject: Re: newLISP is simple, terse, and well documented

On Mon, 19 Jan 2009 14:21:33 +0100, Matthias Buelow wrote:
> Andrew Reilly wrote:

>> Sure, but outside of demonstrations of fibbonaci sequences, and perhaps
>> some crypto libraries (that know deterministically that they'll be
>> using large numbers, and can be coded accordingly), who realistically
>> gets milage from the smooth transition to bignums

> It doesn't matter; if only fixnums are available, then that's a
> (somewhat arbitrarily defined) restriction that doesn't have to be
> there, that's enough reason to hate it.

That's a good answer.  Thanks.  In fact, it was pretty much exactly my
own reaction, during my first encounter with lisp and scheme, and my
first year of coding in scheme.  More recently, though, I've been
thinking about implementation issues (I guess I'm not alone in wanting to
write my own, having read "the art of the interpreter"...) and it just
seems that the cost of that capability is quite high.  Perhaps not in the
grand scheme of things, and not when coding at a high level on file or
GUI-related things, but it's got to hurt when you try to write tight
computational kernels or low-level "bit-bashing" controller code.  Maybe
having a switch to force the issue when you know you want to, and having
a fully flexible and abstract default is the right answer after all...

Cheers,

--
Andrew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tamas K Papp  
View profile  
 More options Jan 19 2009, 7:59 pm
Newsgroups: comp.lang.lisp
From: Tamas K Papp <tkp...@gmail.com>
Date: 20 Jan 2009 00:59:43 GMT
Local: Mon, Jan 19 2009 7:59 pm
Subject: Re: newLISP is simple, terse, and well documented

You keep repeating "expressive power", but that doesn't make it true.
Examples, please?  I would like to see that enormous amount of
expressive power that the modifications buy you.

Expressive power.  Expressive power.  Expressive power.  Wow man, just
saying it makes me feel super-powerful.  Ok, back to work, let's see
those examples of extreme expressive expressive expressive power.

Tamas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kaz Kylheku  
View profile  
 More options Jan 19 2009, 8:56 pm
Newsgroups: comp.lang.lisp
From: Kaz Kylheku <kkylh...@gmail.com>
Date: Tue, 20 Jan 2009 01:56:40 +0000 (UTC)
Local: Mon, Jan 19 2009 8:56 pm
Subject: Re: newLISP is simple, terse, and well documented
On 2009-01-20, Andrew Reilly <andrew-newsp...@areilly.bpc-users.org> wrote:

The cost of that capbility is buried in dynamic typing. A value coming into
your function can already be anything whatsoever: string, symbol, vector,
struct, fixnum, real, etc.

So unless you have the assurance of a declaration, and safety is set to zero,
you /have/ to look at the type.

You /have/ to handle overflow, unless you're designing some unreliable
programming language that allows overflows situations to silently proceed
with wrong answers.

In terms of efficiency, what does it matter that your integer overflow handler
takes the extra step of producing a bignum?

Even you don't make the bignum, you still have to check the type, to make sure
the operands to the arithmetic operation are numbers, still have to handle
overflow, still have to handle combinations of operands that are mixtures of
floating point numbers, etc.

> Perhaps not in the
> grand scheme of things, and not when coding at a high level on file or
> GUI-related things, but it's got to hurt when you try to write tight
> computational kernels or low-level "bit-bashing" controller code.

The question is, what spectacular thing could you do by removing bignums from
the dynamic language, which would eliminate this alleged hurt?

The right tool is not removing the support for the bignum type, but dropping
down to manifest typing over well-defined sections of code.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kaz Kylheku  
View profile  
 More options Jan 19 2009, 10:46 pm
Newsgroups: comp.lang.lisp
From: Kaz Kylheku <kkylh...@gmail.com>
Date: Tue, 20 Jan 2009 03:46:48 +0000 (UTC)
Local: Mon, Jan 19 2009 10:46 pm
Subject: Re: newLISP is simple, terse, and well documented
On 2009-01-20, Majorinc Kazimir <fa...@email.address> wrote:

> Mark Wooding wrote:
>> Majorinc Kazimir <fa...@email.address> writes:

>>> (1) Unrestricted eval, i.e. eval can access to local variables. CL and
>>>     Scheme evals cannot do that.

>> Indeed.  It's a tradeoff between efficient compilation and EVAL: if the
>> compiler is given the necessary freedom to arrange a function's
>> environment in the most efficient manner, then either EVAL will be
>> horrifically complicated or just won't be able to `see' lexically bound
>> variables.

> So, CL chose an option that leads to speed, and Newlisp
> chose the option that leads to expressive power.

s/expressive/excrement/

99% of the time when you think you need eval with lexical access, it's because
you're a Lisp newbie who hasn't figured out APPLY, macros, local functions,
etc.

Recently I used eval-with-access-to-locals in a Bash script.  I did that
because Bash doesn't have macros. Actually no, the problem could have been
solved with a local function. Not having local functions, or macros,
I had to fall back on eval. Take the code that should have been put into
a local function body, as a character string, and evaluate it.

Yeah, bash has excrement power too!

newLISP isn't even a language, just an implementation.

There are Common Lisps that have access to lexical environment as an extension.
E.g. look at environments in Allegro CL.

It's just not specified in the ANSI standard.

newLISP doesn't have an ANSI standard. Its behavior is whatever the current
release of the code does.

Comparing the newLISP to the language described in an ANSI standard is idiotic.
Why don't you compare newLISP to various CL implementations, in turn?

Compare language to language, implementation to implementation.

Man, Lisp /must/ be getting popular now. Two Kazimirs in the newsgroup.
Too bad one of them is drooling dummy, pushing newLISP.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Majorinc Kazimir  
View profile  
 More options Jan 20 2009, 3:34 am
Newsgroups: comp.lang.lisp
From: Majorinc Kazimir <fa...@email.address>
Date: Tue, 20 Jan 2009 09:34:42 +0100
Local: Tues, Jan 20 2009 3:34 am
Subject: Re: newLISP is simple, terse, and well documented

Dan Weinreb wrote:

 > The interesting thing is whether Newlisp makes
 > it easier to solve real-world problems.  Just
 > saying "it's good for code=data" is too abstract
 > a claim without real examples to back it up.
 >
 > They need to be examples of problems that would
 > be hard to solve in Common Lisp but are easier
 > to solve in Newlisp.

 > In short, what problem is it that Newlisp
 > was created to solve?
 >
 > Thank you!

Author, Lutz Mueller wanted simpler Lisp, useful for "small
programming", i.e. what is today called scripting. He does
not market Newlisp as especially powerful language,
quite contrary, he presents it as a language simple and
fun to use and learn, with good "built in" support for
different "real world" needs like web protocols. Majority
of discussions on forum are about such issues - how to use
Newlisp for webserver, creating some graphics etc.

But, although it was not the main intention of the author,
Newlisp has the features I mentioned, partly because modern
computers are much better, so there was far less pressure for
various optimizations.

> I would be interested to see some examples of what
> problems you'd want to solve that work out better
> in Newlisp than they do in, say, Common Lisp.

Example for functions identical to their definitions:
-----------------------------------------------
Once I wanted to "infect" SOME functions with extra
code during runtime, and later to clean that extra
code from functions. Wraping around function was not
enough, code had to be inserted in function definitions.

It had to be done WITHOUT knowledge and cooperation of
infected function, these had to be ordinary,
user defined functions, not purposely prepared to be infected.

It turned to be easy in Newlisp, because functions are
just lambda-expressions, they can be processed like
any list.

Example for unrestricted eval:
-----------------------------

What macros actually do? They behave *like*
functions that produce code and - evaluate that
code in the caller environment once again.

Sure, macros have other specificities, they
are not functions, they are not evaluated but
expanded, etc, but those two things interest me
now: code generation and evaluation in the caller
environment.

Now, what if one wants code transformation, but
macros are not suitable (1) because they are
not the first class, (2) code transformation
is not known in macro expansion time, or especially
interesting (3) because they are just too big
to be used for every small code transformation
one can imagine? People do not define functions
for every expression they evaluate, why should
they define macros for every code transformation
they do?!

OK, in that case, code transformations can be done
without macros, using normal Lisp expressions,
possibly functions - but resulting code has to
be EVALUATED ONCE MORE in the caller environment,
explicitly. And Newlisp has exactly such eval,
eval able to access to local variables.

More specifically, lets say one need macro m
which has to be determined during runtime.
In CL, such macro cannot be defined (without
eval). But it can be replaced with function f
that does exactly the same code transformation.
So, instead of impossible

(m expr1 ... exprn)

it is possible to write

(eval (f 'expr1 ... 'exprn))

Functional version works, because functions
are the first class citizens. Macro version
doesn't. But, eval able to access to local
variables needs to be inserted.

If one takes a look on Newlisp code, it is
full of evals. Some of these evals could
be replaced with macros - but many of those
would be ultrasmall "define once - use once"
macros, it is just more trouble defining
macros than applying eval directly on the
result of some expression. Some evals couldn't
be replaced with macros at all.

Example for dynamic scope:
--------------------------
Define IF as function.

(set 'IF (lambda()
            (eval
              ((args)
                (find (true? (eval (first (args))))
                      '(* true nil))))))

(let ((x 2)(y 3))
      (IF '(< x y)
          '(println  x " is less than " y)
          '(println  x " is not less than " y))

      (IF '(> x y)
          '(println x " is greater than " y)
          '(println x " is not greater than " y)))

It works in Newlisp.

This particular definition of IF is complicated,
because I did it as game - IF is not only function,
but it is defined without built in operators
like IF and COND, and also, without using any variable.

Many other - less extravagant definitions are possible.

More generally, whenever one can define macro,
he can define equivalent function as well.

Example for first-class macros
--------------------------------------------
Experienced Lisper probably noted that he sometimes
write macros only because it is impossible to write
equivalent function. Also, that he sometimes write
functions although macros would be syntactically better,
but he needs the first class citizens.

In Newlisp, macros are fexprs, whenever one can write
the function, he can write macro that does the same
and vice versa. Both have the advantages and
disadvantages resulting from its syntax and semantics.
Because of that, it is possible to define two functions:

function-to-macro
macro-to-function

For example, after

(set 'for-function (macro-to-function for))
(set 'append-macro (function-to-macro append))

are evaluated the expressions

(for-function '(i 1 10) '(println i))
(append-macro (1 2 3) (4 5 6))

are valid and behave just like one might expect.

OK?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal Costanza  
View profile  
 More options Jan 20 2009, 4:36 am
Newsgroups: comp.lang.lisp
From: Pascal Costanza <p...@p-cos.net>
Date: Tue, 20 Jan 2009 10:36:56 +0100
Local: Tues, Jan 20 2009 4:36 am
Subject: Re: newLISP is simple, terse, and well documented

Matthew D Swank wrote:
> On Mon, 19 Jan 2009 10:29:18 -0800, jos...@corporate-world.lisp.de wrote:
> ...

>> * all built-in function (minus primitive type specialized functions)
>> functions should be generic functions

>> etc etc.

> Should funcall _and_ apply both be generic functions?

If a CL implementation supports the CLOS MOP, that's already the case.

Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthias Buelow  
View profile  
 More options Jan 20 2009, 7:51 am
Newsgroups: comp.lang.lisp
From: Matthias Buelow <m...@incubus.de>
Date: Tue, 20 Jan 2009 13:51:53 +0100
Local: Tues, Jan 20 2009 7:51 am
Subject: Re: newLISP is simple, terse, and well documented

jos...@corporate-world.lisp.de wrote:
> * CLOS should be wider used (conditions, pathnames, streams, i/o,
> readtables, ...)
> * get rid of structures, provide a simple DEFCLASS* macro,
>   make SLOT-VALUE as fast as structure access
> * all built-in function (minus primitive type specialized functions)
> functions
>   should be generic functions

Sounds very C++-ish.. I don't think it's a good idea to OO-ize the basic
language. That's a too low abstraction layer.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthias Buelow  
View profile  
 More options Jan 20 2009, 8:00 am
Newsgroups: comp.lang.lisp
From: Matthias Buelow <m...@incubus.de>
Date: Tue, 20 Jan 2009 14:00:39 +0100
Local: Tues, Jan 20 2009 8:00 am
Subject: Re: newLISP is simple, terse, and well documented

Majorinc Kazimir wrote:
> Experienced Lisper probably noted that he sometimes
> write macros only because it is impossible to write
> equivalent function.

I thought that was the only reason to use macros.

> Also, that he sometimes write
> functions although macros would be syntactically better,

When would that be the case?

> In Newlisp, macros are fexprs, whenever one can write
> the function, he can write macro that does the same
> and vice versa.

Fish<->bicycle.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
joswig@corporate-world.li sp.de  
View profile  
 More options Jan 20 2009, 8:57 am
Newsgroups: comp.lang.lisp
From: "jos...@corporate-world.lisp.de" <jos...@corporate-world.lisp.de>
Date: Tue, 20 Jan 2009 05:57:50 -0800 (PST)
Local: Tues, Jan 20 2009 8:57 am
Subject: Re: newLISP is simple, terse, and well documented
On 20 Jan., 13:51, Matthias Buelow <m...@incubus.de> wrote:

> jos...@corporate-world.lisp.de wrote:
> > * CLOS should be wider used (conditions, pathnames, streams, i/o,
> > readtables, ...)
> > * get rid of structures, provide a simple DEFCLASS* macro,
> >   make SLOT-VALUE as fast as structure access
> > * all built-in function (minus primitive type specialized functions)
> > functions
> >   should be generic functions

> Sounds very C++-ish.. I don't think it's a good idea to OO-ize the basic
> language. That's a too low abstraction layer.

No, it's more like the language ZetaLisp from which CL was mostly
derived by simplifying. ZetaLisp and the software written
in it was heavy object-oriented using Flavors. Common Lisp
got designed in version 1 without an object system - just
because there was not a single one that was agreed on
at that time and there were several different ones researched/
implemented.
Some were using Flavors. Xerox was using LOOPS. LMI
was using Object Lisp. HP was proposing Common Objects,
Intellicorp used Units, Coral was using Object Lisp, Germans
had some other proposals, there were systems in France, ...

So we got CLtL1 without an object system, though almost everyone was
already using some quite heavily.

Then CLOS got developed and added to CL. CLOS was designed in such a
way that many projects could move their code to CLOS by extending
CLOS with the necessary facilities.

But unfortunately Common Lisp the language got not redesigned to
a state that would represent 'the reality' - meaning all
major implementations of CL and the languages that CL
was mostly based on, were using objects (Flavors, LOOPS,
Object Lisp, Common Objects, Units, New Flavors, CommonLOOPS, ...).
CLtL1 was mostly an accident. CLtL1 is a dent in time and space.
Unfortunately it shaped ANSI CL too much.

See this message from net.lang.lisp, 1985:
  http://groups.google.com/group/net.lang.lisp/msg/73eab605311fdba2

 Dylan then simplified CL by usind a CLOS
derivative everywhere possible. Most CL implementations have
CLOS-based implementations of important parts - unfortunately
ANSI CL only specifies a non CLOS interface. So I can't subclass
stream in ANSI CL. Most CL implementations use something like
gray streams. Why should I use READ-CHAR when it calls
a generic function anyway? I could either get rid of READ-CHAR
and use the generic function STREAM-READ-CHAR directly

See:
  http://www.sbcl.org/manual/Character-input-stream-methods.html#Charac...

or have READ-CHAR as the generic function.

There is a layer of interface that can be removed without any loss
of functionality. It would make the language more extensible - in a
way that most implementations provide anyway. Implementations
provide extensible streams and applications are using them. Today.

DESCRIBE calls DESCRIBE-OBJECT. Just get rid of DESCRIBE and replace
it with the generic function DESCRIBE-OBJECT renamed.

We have efficient maths in CL so it should possibly not use CLOS,
but we don't have efficient streams anyway, since they are implemented
using CLOS (or with CLOS tacked on some internal implementation
strategy).

The design needs to be understood based on its history. There
are opportunities to simplify CL AND adding flexibility and power.
Many applications already are developed with some kind
of extended CL (non-portable, or via portability libs).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Majorinc Kazimir  
View profile  
 More options Jan 20 2009, 9:17 am
Newsgroups: comp.lang.lisp
From: Majorinc Kazimir <fa...@email.address>
Date: Tue, 20 Jan 2009 15:17:21 +0100
Local: Tues, Jan 20 2009 9:17 am
Subject: Re: newLISP is simple, terse, and well documented

Matthias Buelow wrote:
> Majorinc Kazimir wrote:

>> Experienced Lisper probably noted that he sometimes
>> write macros only because it is impossible to write
>> equivalent function.

> I thought that was the only reason to use macros.

Sometimes there are other reasons, because of prettier
syntax OR some speed up due to macroexpansion. For
example, if you note that you use function calls only
with constant arguments, (f 3), (f 7), but never
(f x) it *could* be useful to rewrite f as macro. Or
(g '(+ x 1)), (g '(- x 1)) but never (g (+ x 2)). Not
always, but typically yes.

OK?

>> Also, that he sometimes write
>> functions although macros would be syntactically better,

> When would that be the case?

Macros are typically syntactically better, because
there are no extra apostrophes. Typically, macros cannot
be used instead of functions in CL. Sometimes they can, g
from previous example.

OK?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Wooding  
View profile  
 More options Jan 20 2009, 11:15 am
Newsgroups: comp.lang.lisp
From: Mark Wooding <m...@distorted.org.uk>
Date: Tue, 20 Jan 2009 16:15:00 +0000
Subject: Re: newLISP is simple, terse, and well documented

Majorinc Kazimir <fa...@email.address> writes:
> So, CL chose an option that leads to speed, and Newlisp chose the
> option that leads to expressive power. That is exactly what I said.

Err..., no, MACLISP chose speed and Common Lisp followed.

I've got an Interlisp manual from 1973 in front of me, and it looks as
if Interlisp would happily compile functions which called fexprs, though
you had to warn it in advance which symbols denoted fexprs.  Since many
fexprs actually want only some of their arguments unevaluated, they'll
call EVAL on the others, and drop back into the interpreter.
Fortunately the compiler had macros as well, so you could write a macro
version of your fexpr for the compiler to chew on.  A 1985 manual for
Interlisp-D explains that the interpreter also honours macros, though
the behaviour differs if a symbol has both function and macro
definitions: the interpreter prefers the symbol's function cell while
the compiler prefers the macro.

I think this demonstrates that the move from fexprs to macros wasn't
just limited to the MACLISP community, and that Common Lisp's loss of
fexprs was probably viewed as leaving behind a historical misstep rather
than sacrificing critical expressiveness.  I stand ready to be corrected
on this by people who were actually there, though.

Besides, briefly comparing the lengths of the trivial programs from your
`benchmark' -- discussion of which you have avoided, I note -- tells me
everything I need to know about the comparative expressive power of
Common Lisp (or even Emacs Lisp) and newLISP.

Besides, you brought up the issue of speed yourself, with your bogus
benchmark.  If you're not interested in speed, why did you bring the
question up in the first place?  Note also that the newLISP website
claims `fast' as an important feature: `Friendly --- fast --- small' is
the entire first bullet point.  `Slower than Emacs Lisp' doesn't sound
quite so good, does it?

(Note the correct capitalization of `newLISP', by the way.  It's strange
that you advocate it, but type its name incorrectly throughout.)

[scoping]

> So, CL chose the path that leads to what? Safety? Newlisp
> chose the path that leads to expressive power.

CL followed Scheme down the path to comprehensible programs which can be
built out of modules understood in isolation (lexical scope allows the
reader to prove to himself that various kinds of side effects are
impossible -- even, by CL rules, if the code invokes EVAL), and which
make use of closures.

> The funarg is however, not the problem is Newlisp practice.

Presumably because newLISP has, for some reason, shied away from the
expressive power of proper functional abstraction.

> So, where are we now? You gave up from CL and you are trying to
> compare Newlisp with Emacs Lisp. Then go back to fexprs vs macros,
> Newlisp has fexprs, Emacs has macros.

I prefer Common Lisp to Emacs Lisp, because CL has proper closures,
lexical scoping, bignums, keyword arguments, CLOS, and many other good
things.  Emacs Lisp is stuck in a timewarp, because it follows the
traditional MACLISP interpreter semantics (rather than the compiler),
but it's tolerable.  If you like those traditional semantics, then I've
shown that Emacs Lisp is quite considerably faster than newLISP -- at
running your own benchmark! -- leaving newLISP without an obvious niche.
After all, it doesn't even have a built-in text editor.

Hmmm.  Extensive use of eval.  Dynamic scoping.  Code as data.
Non-sharing of lists.  Don't care too much about performance.  I've got
the very thing!  comp.lang.tcl is right over there.

-- [mdw]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthias Buelow  
View profile  
 More options Jan 20 2009, 11:58 am
Newsgroups: comp.lang.lisp
From: Matthias Buelow <m...@incubus.de>
Date: Tue, 20 Jan 2009 17:58:29 +0100
Local: Tues, Jan 20 2009 11:58 am
Subject: Re: newLISP is simple, terse, and well documented

Majorinc Kazimir wrote:
> For
> example, if you note that you use function calls only
> with constant arguments, (f 3), (f 7), but never
> (f x) it *could* be useful to rewrite f as macro.

Sorry, I don't understand this example.

> Or
> (g '(+ x 1)), (g '(- x 1)) but never (g (+ x 2)). Not
> always, but typically yes.

> OK?

Nope.

> Macros are typically syntactically better, because
> there are no extra apostrophes.

What's "syntactically better"? Generally, if I see something like (g (+
x 2)) I expect that g is called with the result of evaluating (+ x 2)
and not getting the unevaluated list. Macros should be used sparingly
because of considerations like these.

> Typically, macros cannot
> be used instead of functions in CL. Sometimes they can, g
> from previous example.

(lambda (x) (your-macro x))

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Wooding  
View profile  
 More options Jan 20 2009, 12:12 pm
Newsgroups: comp.lang.lisp
From: Mark Wooding <m...@distorted.org.uk>
Date: Tue, 20 Jan 2009 17:12:10 +0000
Local: Tues, Jan 20 2009 12:12 pm
Subject: Re: newLISP is simple, terse, and well documented

Majorinc Kazimir <fa...@email.address> writes:
> Now, what if one wants code transformation, but macros are not
> suitable (1) because they are not the first class, (2) code
> transformation is not known in macro expansion time, or especially
> interesting (3) because they are just too big to be used for every
> small code transformation one can imagine?

In what possible sense is can a macro be `too big'?

> People do not define functions for every expression they evaluate, why
> should they define macros for every code transformation they do?!

Err...  Is there some problem I don't understand with MACROLET?

> More specifically, lets say one need macro m which has to be
> determined during runtime.

[etc.]

Your `examples' presume that one is in the situation where one needs the
feature in question: it's a circular argument.  I'd like some actual
/examples/ -- practical, and concrete -- which demonstrate /why/ one
might find oneself in this situation in the first place.

> If one takes a look on Newlisp code, it is full of evals. Some of
> these evals could be replaced with macros - but many of those would be
> ultrasmall "define once - use once" macros, it is just more trouble
> defining macros than applying eval directly on the result of some
> expression.

Common Lisp gives you two choices here.  Either MACROLET, which is ideal
for one-shot macros (which replace boring repetitive code), or #.(...)
to hack the right code together at read-time.

> Some evals couldn't be replaced with macros at all.

Again, examples please, not circular arguments or hand-wavy abstract
nonsense.

> Define IF as function.

But why would one want to?

-- [mdw]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xah Lee  
View profile  
 More options Jan 20 2009, 12:36 pm
Newsgroups: comp.lang.lisp
From: Xah Lee <xah...@gmail.com>
Date: Tue, 20 Jan 2009 09:36:47 -0800 (PST)
Local: Tues, Jan 20 2009 12:36 pm
Subject: Re: newLISP is simple, terse, and well documented
On Jan 19, 3:23 pm, simple.language.ya...@gmail.com wrote:

Very well put.

  Xah
http://xahlee.org/



 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Wooding  
View profile  
 More options Jan 20 2009, 12:50 pm
Newsgroups: comp.lang.lisp
From: Mark Wooding <m...@distorted.org.uk>
Date: Tue, 20 Jan 2009 17:50:19 +0000
Local: Tues, Jan 20 2009 12:50 pm
Subject: Re: newLISP is simple, terse, and well documented

Majorinc Kazimir <fa...@email.address> writes:
> Matthias Buelow wrote:
>> Majorinc Kazimir wrote:

>>> Experienced Lisper probably noted that he sometimes write macros
>>> only because it is impossible to write equivalent function.

>> I thought that was the only reason to use macros.

The reason to use a macro is to make use of syntactic abstraction.
Maybe that's a restatement of what Majorinc Kazimir said, but I just
can't tell.

> Sometimes there are other reasons, because of prettier syntax

Isn't this covered by `impossible to write equivalent function'?

> OR some speed up due to macroexpansion.

Use DECLAIM INLINE for this.

-- [mdw]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexander Schreiber  
View profile  
 More options Jan 20 2009, 3:24 pm
Newsgroups: comp.lang.lisp
From: Alexander Schreiber <a...@usenet.thangorodrim.de>
Date: Tue, 20 Jan 2009 21:24:25 +0100
Local: Tues, Jan 20 2009 3:24 pm
Subject: Re: newLISP is simple, terse, and well documented
Pascal J. Bourguignon <p...@informatimago.com> wrote:

For instance people who need to do very, very precise calculations?
Finance is not the only candidate for that. And I've seen enough people
using float for that *shudder*

Regards,
       Alex.
--
"Opportunity is missed by most people because it is dressed in overalls and
 looks like work."                                      -- Thomas A. Edison


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Mizrahi  
View profile  
 More options Jan 21 2009, 12:16 pm
Newsgroups: comp.lang.lisp
From: "Alex Mizrahi" <udode...@users.sourceforge.net>
Date: Wed, 21 Jan 2009 19:16:54 +0200
Local: Wed, Jan 21 2009 12:16 pm
Subject: Re: newLISP is simple, terse, and well documented
 MK> It is easy to get around it, really.
 MK> My favorite way is - using symbols.

 MK> (set 'x (list 1 'x))
 MK> (set 'y (list 1 'y))
 MK> (set 'z (list 3 'z))

you mean

  (set 'x (list 1 'y))

maybe?

this is pretty ugly, as for me.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Mizrahi  
View profile  
 More options Jan 21 2009, 12:34 pm
Newsgroups: comp.lang.lisp
From: "Alex Mizrahi" <udode...@users.sourceforge.net>
Date: Wed, 21 Jan 2009 19:34:44 +0200
Local: Wed, Jan 21 2009 12:34 pm
Subject: Re: newLISP is simple, terse, and well documented
 sly> obsolete Unix computers (for computer professionals)... Common Lisp
 sly> can do the work efficiently, but is too complex  for part-time
 sly> programmers.

what is complex about Common Lisp and how exactly does newLISP fix this?
i find CL being quite simple in it's core. there are lots of functions in
standard
library, some of them being weird, but you do not need to learn them all.

on the other hand, newLISP is quite complicated due to ORO restrictions,
as one needs workarounds like symbols and contexts to implement even
basic stuff. and this stuff is actually pretty complex and not good for
"part-time"
programmers you worry about.

here's an example from newLISP documentation

-----
To avoid passing data objects by value copy, they can be enclosed in context
objects and passed by reference. The following code snippet shows reference
passing using a namespace default functor:

   (define (modify data value)
      (push value data))

   (set 'reflist:reflist '(b c d e f g))

   (modify reflist 'a)

   reflist:reflist => (a b c d e f g)
-----
wtf is "namespace default functor" and why one has to use them to implement
a relatively simple function?

it looks like newLISP features were structured around its interpreter
implementation -- whatever
was easier to implement was included. this might be simplier for ones who
write interpreters,
but it is not good for ones who are trying to learn it.

you should be ashamed for supporting this shit, i suggest you doing a
sepukku
to defend your reputation.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
joswig@corporate-world.li sp.de  
View profile  
 More options Jan 21 2009, 12:50 pm
Newsgroups: comp.lang.lisp
From: "jos...@corporate-world.lisp.de" <jos...@corporate-world.lisp.de>
Date: Wed, 21 Jan 2009 09:50:31 -0800 (PST)
Local: Wed, Jan 21 2009 12:50 pm
Subject: Re: newLISP is simple, terse, and well documented
On 21 Jan., 18:34, "Alex Mizrahi" <udode...@users.sourceforge.net>
wrote:

ROTFL

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Majorinc Kazimir  
View profile  
 More options Jan 21 2009, 10:01 pm
Newsgroups: comp.lang.lisp
From: Majorinc Kazimir <fa...@email.address>
Date: Thu, 22 Jan 2009 04:01:41 +0100
Local: Wed, Jan 21 2009 10:01 pm
Subject: Re: newLISP is simple, terse, and well documented

Alex Mizrahi wrote:

> what is complex about Common Lisp and how exactly does newLISP fix this?
> i find CL being quite simple in it's core. there are lots of functions in
> standard
> library, some of them being weird, but you do not need to learn them all.

It is code=data, eval and macros. CL/Scheme macros are
complex. Some CL users repeat all the time "if you use
eval, that means that you're n00b that didn't l3arn3d
h0w to use macros!"

Newlisp users use eval if it solves their problem. Their
eval understands local variables, so it is far more
frequently used.

And what if one WANTS macros? Newlisp macros are easier to
understand, more powerful (CL-ers claim no use
of additional power) and easier to write in practice.

> it looks like newLISP features were structured around

 > its interpreter > implementation -- whatever
> was easier to implement was included. this might be

 > simplier for ones who write interpreters,

> but it is not good for ones who are trying to learn it.

Method might be true, but not the result. This is why:

CL tries to serve two masters, to give programmers almost
as much power as interpreted Lisps, at almost as much
speed as Pascal (if he does not use eval.) It is complicated
  - complicated to design, implement, use.

Newlisp is designed to be simple. Like Perl, Python, Ruby,
Basic, it doesn't try to compete with C. It allowed
significant simplifications, and some of these also increase
expressive power. But Newlisp is primarily advertised as
simple to learn and use and good enough for many
'scripting' purposes."

> you should be ashamed for supporting this shit, i suggest you doing a
> sepukku
> to defend your reputation.

Yeah right ...

In many areas CL and Scheme standards and implementations
are equal or better than Newlisp. In many areas, they are
just different. But, if one puts *easy to learn and use*
and powerful *code=data* on top of his priorities, Newlisp
is excelent choice.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raffael Cavallaro  
View profile  
 More options Jan 22 2009, 12:47 am
Newsgroups: comp.lang.lisp
From: Raffael Cavallaro <raffaelcavall...@pas.espam.s.il.vous.plait.mac.com>
Date: Thu, 22 Jan 2009 00:47:46 -0500
Local: Thurs, Jan 22 2009 12:47 am
Subject: Re: newLISP is simple, terse, and well documented
On 2009-01-21 22:01:41 -0500, Majorinc Kazimir <fa...@email.address> said:

> Newlisp is designed to be simple

...minded?

;^)
--
Raffael Cavallaro, Ph.D.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
joswig@corporate-world.li sp.de  
View profile  
 More options Jan 22 2009, 1:53 am
Newsgroups: comp.lang.lisp
From: "jos...@corporate-world.lisp.de" <jos...@corporate-world.lisp.de>
Date: Wed, 21 Jan 2009 22:53:02 -0800 (PST)
Local: Thurs, Jan 22 2009 1:53 am
Subject: Re: newLISP is simple, terse, and well documented
On Jan 22, 4:01 am, Majorinc Kazimir <fa...@email.address> wrote:

> Alex Mizrahi wrote:

> > what is complex about Common Lisp and how exactly does newLISP fix this?
> > i find CL being quite simple in it's core. there are lots of functions in
> > standard
> > library, some of them being weird, but you do not need to learn them all.

> It is code=data, eval and macros. CL/Scheme macros are
> complex. Some CL users repeat all the time "if you use
> eval, that means that you're n00b that didn't l3arn3d
> h0w to use macros!"

One says that EVAL is often just not needed and that it makes the code
slower than it needs to be. In many cases it is better
to generate code at compile-time and have it compiled than generate
code at runtime. Using EVAL where not needed is
like driving and not shifting into a higher gear.

> Newlisp users use eval if it solves their problem.

Which problem? Any practical problem? What kind
of problems are solved by Newlisp users this
way?

> Their
> eval understands local variables, so it is far more
> frequently used.

Stuff like that has been removed earlier in the history of Lisp,
because it makes the understanding of code harder - for
the human and the compiler.

Reason:

In a lexical Lisp I can see what code uses (reads/writes/binds) the
variables.
In a Lisp that provides unrestricted EVAL with access
to local variables, many pieces of code can set the local variables
and it is
not obvious when and where it happens. It provides more
flexibility at the cost of rendering any non-trivial
amount of code to be much harder to understand.

> And what if one WANTS macros? Newlisp macros are easier to
> understand, more powerful (CL-ers claim no use
> of additional power) and easier to write in practice.

Because they are easier to use? Do you have a more specific reason?

For example I can take a piece of code in Common Lisp
and have it macro expanded and look at it. I can trace/debug
the macro expansion in isolation. Sounds easier
than a FEXPR which at runtime does code generation, where
code generation is mixed with execution.

> > it looks like newLISP features were structured around

>  > its interpreter > implementation -- whatever> was easier to implement was included. this might be

>  > simplier for ones who write interpreters,

> > but it is not good for ones who are trying to learn it.

> Method might be true, but not the result. This is why:

> CL tries to serve two masters, to give programmers almost
> as much power as interpreted Lisps, at almost as much
> speed as Pascal (if he does not use eval.) It is complicated
>   - complicated to design, implement, use.

Common Lisp provides support for interpretation and compilation.
What it did was removing the semantic differences
between those. For example before Common Lisp it was often the case
that the Lisp implementation was using dynamic binding
in the interpreter and lexical binding for compiled code.
Common Lisp demands that the interpreter also uses
lexical binding. It makes Lisp follow a simpler execution
model (more in line with lambda calculus).

> Newlisp is designed to be simple.

I was using some Lisps like early Scheme implementations that
look quite a bit simpler to me.

> Like Perl, Python, Ruby,
> Basic, it doesn't try to compete with C. It allowed
> significant simplifications, and some of these also increase
> expressive power. But Newlisp is primarily advertised as
> simple to learn and use and good enough for many
> 'scripting' purposes."

I think a simple Lisp in the Scheme tradition is just
as easy to use for scripting and better understandable.
Actually a former co-worker used scsh (the scheme shell)
for a while and then moved on to use GNU CLISP for
scripting purposes and liked CLISP a lot.

> > you should be ashamed for supporting this shit, i suggest you doing a
> > sepukku
> > to defend your reputation.

> Yeah right ...

> In many areas CL and Scheme standards and implementations
> are equal or better than Newlisp. In many areas, they are
> just different. But, if one puts *easy to learn and use*
> and powerful *code=data* on top of his priorities, Newlisp
> is excelent choice.

I would think that real newbies are much better starting with
Scheme (R5RS), since it has clearer semantics and is
more powerful at the same time.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kaz Kylheku  
View profile  
 More options Jan 22 2009, 2:11 am
Newsgroups: comp.lang.lisp
From: Kaz Kylheku <kkylh...@gmail.com>
Date: Thu, 22 Jan 2009 07:11:08 +0000 (UTC)
Local: Thurs, Jan 22 2009 2:11 am
Subject: Re: newLISP is simple, terse, and well documented
On 2009-01-22, Majorinc Kazimir <fa...@email.address> wrote:

> Alex Mizrahi wrote:

>> what is complex about Common Lisp and how exactly does newLISP fix this?
>> i find CL being quite simple in it's core. there are lots of functions in
>> standard
>> library, some of them being weird, but you do not need to learn them all.

> It is code=data, eval and macros. CL/Scheme macros are
> complex. Some CL users repeat all the time "if you use
> eval, that means that you're n00b that didn't l3arn3d
> h0w to use macros!"

You've evidently chosen to suffer a language just because in it, eval behaves
in a particular way. No matter what anyone says, you just keep harping about
``code=data'' and ``eval that understands locals''.

You don't seem to realize, that you can write an interpreter in Common Lisp for
a dialect which has the eval that you want.  Writing a Lisp interpreter
in Lisp is a student exercise. You have things like reading, printing,
representation of symbols and memory management taken care of already.

Bad technology like some crummy evaluator can easily be hacked with the good
technology in a few evenings. In a week, you could cob together something
that blows newLISP out of the water.

And, lastly, note that Lisp has dynamic variables. If you want eval to
understand local variables, use those!

We could say that just like Common Lisp, newLISP has an eval which doesn't
give you access to lexical variables. But Common Lisp /has/ lexical variables.

newLISP's access to local variables is easy to implement because they are
dynamic.

If newLISP had real lexical variables, the author of newLISP would probably
work out some excuse why his eval cannot access them. Put a newbie
perspective on it, like it's for ease of use or something. Or he'd point
to real Lisps and claim that they don't do it either.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 51 - 75 of 100 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »