Edits to the 'about' webpage

Started by noah, July 09, 2006, 12:35:52 AM

Previous topic - Next topic

noah

Hello, Lutz.



Reading over the 'about' webpage, I noticed a few spelling errors. Putting the webpage content into MS Word made it easy for me to correct those, but then I got carried away.



For what's it's worth, here's what I produced. Let me know if you'd like a version with just spelling errors corrected. I'll gladly produce that for you, without the additional editing.



-Noah



About newLISP

Last updated June 8th, 2006


1. What is newLISP and what can I do with it?

2. Why newLISP, why not one of the other standard LISPs?

3. How do I study newLISP?

4. How does newLISP compare in speed?

5. Does newLISP have matrices?

6. Does newLISP have hash tables?

7. Does newLISP have automatic memory management?

8. Isn't value parameter passing slow for big lists?

9. How does variable scoping work in newLISP?

10. Can I program with threads?

11. How about Object Oriented programming?

12. How about packages and modules?

13. What are some differences between newLISP and other LISPs?

14. Does newLISP run on  XYZ operating system?

15. Can newLISP handle the special characters of my country and language?

16. Can I use newLISP for distributed computing tasks?

17. Can newLISP be embedded in other programs?

1. What is newLISP and what can I do with it?

newLISP is a LISP-like scripting language for doing things you typically do with scripting languages: CGI programming, system administration, text processing, gluing other programs together, etc. newLISP is a scripting LISP for people who are fascinated by LISP's beauty and power of expression, but who need it stripped down to easy-to-learn essentials. newLISP is small on resources like disk space and memory but has a deep, practical API.

2. Why newLISP, why not one of the other standard LISPs?

LISP is an old language born, grown, and standardized in times very different from today, times when programming was for highly educated people who engineered programs. newLISP is LISP reborn as a scripting language: pragmatic and casual, simple to learn without requiring you to know advanced Computer Science concepts. Like any good scripting language, newLISP is quick to get into and gets the job done without fuss. It has all the essential elements which made LISP famous: symbol processing, lists, anonymous functions (lambda expressions) and S-expressions as a simple syntax for both data and program.

newLISP has a modern relevant API (Application Programming Interface) with networking, regular expression, advanced math, simulation, statistics, financial, HTTP, and XML functions built right into it. newLISP modules are available let you connect newLISP to databases, mailservers, and more. newLISP can interface to standard shared libraries on Win32 and Linux/UNIX systems to add even more functionality. The newLISP API is user driven and adapts over time to the ever-changing requirements of tomorrow's applications.

3. How do I study newLISP?

At least in the beginning you don't study newLISP, you use it. If you understand this:

(+ 1 2 3)   ; computes the sum of 1,2,3 => 6

and this:

(define (double x) (+ x x))   ; defines a new function

(double 123)   ; computes the double of 123 => 246

then you have learned enough to start programming in newLISP. There are a few more concepts like anonymous functions, applying functions, name spaces (or contexts), and implicit indexing. You will pick up those later while using newLISP.

Don't read books about LISP to learn newLISP. Most books deal with Common LISP or Scheme, two different older standards of LISP. These books teach you concepts that you don't need to know to learn newLISP. newLISP does things differently than the older standards, in ways that are more applicable to today's programming tasks. If you study other LISPs before trying to understand newLISP, you won't learn to solve problems the newLISP way. But if you want a deeper understanding of newLISP, read the Users Manual section of the newLISP manual, which offers only a little theory but a lot of examples.

Start to write your first program now. Look at the small program snippets throughout the manual and on this web site. If you have questions, go to a discussion group hosted here and ask.

4. How does newLISP compare in speed?

It compares well to popular scripting tools like Perl or Python, not only in general computing speed but even more when it comes to startup time and memory/disk foot print. Have a look at some benchmarks .

5. Does newLISP have arrays?

Yes, it does. For applications with random access in large lists, access can be made faster using newLISP arrays.

6. Does newLISP have hash tables?

newLISP has fast scalable symbol processing using Red-black binary trees . Symbols in newLISP are used to build dictionaries for associative data access, similar to how hash tables are used in other scripting languages. See the newLISP manual for more details.

7. Does newLISP have automatic memory management?

Yes, it does. But it is not the typical garbage collecting process you find in other interactive languages. Just like traditional garbage collecting languages, newLISP recycles unused memory, but does it in a new, much more efficient way. newLISP's unique automatic memory management is one of the reasons for its speed, small size, and  efficient memory usage.

8. Isn't passing parameters by value slow when passing large lists and strings?

newLISP passes symbols and context objects by reference. Parameter passing is done  simply by wrapping a list or string buffer with a context object.

9. How does variable scoping work in newLISP?

newLISP offers a combination of dynamic and lexical scoping. It is dynamically scoped inside lexically separated contexts or name spaces. Contexts can be dynamically created during runtime. Contexts in newLISP allow lexical closure over more than one lambda function.

10. Can I program with threads?

Since version 8.2.0, Linux/UNIX versions of newLISP programs can have threads. Win32 versions can spawn child processes. Semaphores are used to synchronize threads or processes and shared memory can be used for communications between threads and processes. Semaphores and shared memory are available on all versions of newLISP.

11. How about Object Oriented programming?

newLISP uses contexts as objects for prototype-based object oriented programming. Objects can be created or destroyed during runtime, referred to by variables, and passed by reference to other functions.

12. How about packages and modules?

newLISP uses contexts for building packages and modules. Modules exist for database access to MySQL and SQLite databases and  other databases through ODBC. Additional modules support FTP, POP3, and SMTP internet protocols. Because newLISP contexts are lexically closed, newLISP lets programmers treat modules like black boxes. This is suitable for large application development.

newLISP can also call shared libraries on Linux/UNIX and Win32 operating systems to expand its functionality.

13. What are some differences between newLISP and other LISPs?

newLISP's differences with other LISPs include: differences in the working of lambda expressions; the existence of namespaces (or contexts); differences in parameter passing; and of course the newLISP API (function repertoire). Overall newLISP's new ways of LISP programming make it faster, smaller and easier to understand and learn. For a more detailed discussion, see Differences with Other LISPs .

14. Does newLISP run on XYZ operating system?

It probably does. newLISP has a minimum of dependencies; it only uses standard 'C' libraries to compile. If your system has GNU tools such as the GCC compiler and make utility, then newLISP should compile and link right away using one of the makefiles in its source distribution.

newLISP is built using one of several makefiles, each written for a specific platform. There are no complex make scripts. The makefiles are short and easy to change and adapt if your platform or configuration is not included already.

15. Can newLISP handle the special characters of my country and language?

In most parts of the Western World, you will only need to set your locale using the newLISP function set-locale.

More than half of the countries in the world use a decimal comma instead of a decimal point. newLISP will correctly read and write decimal commas when switched to the correct locale.

Most alphabets in the Western Hemisphere fit in 256-place character code tables and each character needs only one 8 bit byte to be encoded. If the written language of your country uses multibyte characters, then you need the UTF-8 enabled versions of newLISP. Makefiles for Win32 and Linux are included to compile UTF-8 versions of newLISP. In the UTF-8 version many character handling functions are able to handle multibyte characters. See the localization and UTF-8 chapter in the manual for details.

16. Can I use newLISP for distributed computing tasks ?

Some of today's bigger applications run distributed across multiple computers, dividing their complex tasks between multiple CPUs. newLISP can be run as a server for evaluating commands sent by other newLISP client processes connected to it. A net-eval directive encapsulates all network handling required to communicate with other computers on the network, distribute code and computing tasks and collect results in a blocking or event-driven fashion.

17. Can newLISP be embedded in other programs ?

newLISP can be compiled as a UNIX shared library or Win32 DLL (dynamic link library). So the shared library versions of newLISP can be used inside other programs that are able to import shared library functions.

On Win32 systems, newLISP has been used inside MS Excel, MS Visual Basic, and the NeoBook GUI application builder. On UNIX, newLISP has been used inside the GNumeric spreadsheet. On Mac OS X, newLISP has been used as an extension language for the BBEdit editor.

cormullion

#1
Great job! It reads nicely.



A quibble:


Quote17. On Mac OS X, newLISP has been used as an extension language for the BBEdit editor.


Because this is under the heading of "Can newLISP be embedded in other programs?", it might lead to some erroneous conclusions. I think the level of integration of newLISP and NeoBook is of a different order compared with the way you can drive applications such as BBEdit with a Unix scripting language. Similarly, the way Lua is 'inside' Voodoo Pad hasn't yet been done with newLISP on MacOS X. Yet - I hope that someone will do it one day!



So my suggestion would be to split this into two: embedded, and interfaces...

noah

#2
Hi, Cormullion.



I tried to stay true to the basic writing style and FAQ structure that appeared on the original webpage, so changes of the kind you suggest were off my screen.



I actually found some punctuation errors and a couple grammatical errors in my posted edit. This was a quick edit - it was fun! The original author (Lutz, I'm guessing), writes with pizazz. And newLISP is a cool thing to begin with.



Anyway, if Lutz likes the edit as is, I'll be a bit more careful with the next post, which will contain edited HTML from the original page, with the original italics and hyperlinks included. Or I'll just post a spelling, punctuation check.



-Noah

noah

#3
Hello, Lutz.



Here's a second attempt at my edit, with privately-sent patches from Michael. He's very thorough.



Lutz, would you please note that Cormullion's suggestion to divide Question 17 into two question-answer pairs requires me to perform a technical edit rather than a grammar/spelling edit. I'm not knowledgeable enough to pass judgement on his suggestion, so it's not included here.

I recognize that his suggestion is important, though, so I'm mentioning it to you.



-Noah






About newLISP

Last updated June 8th, 2006

1.   What is newLISP and what can I do with it?

2.   Why newLISP, why not one of the other standard LISPs?

3.   How do I study newLISP?

4.   How does newLISP compare in speed?

5.   Does newLISP have matrices?

6.   Does newLISP have hash tables?

7.   Does newLISP have automatic memory management?

8.   Isn't passing parameters by value slow when passing large lists and strings?

9.   How does variable scoping work in newLISP?

10.   Can I program with threads?

11.   How about object-oriented programming?

12.   How about packages and modules?

13.   What are some differences between newLISP and other LISPs?

14.   Does newLISP run on  XYZ operating system?

15.   Can newLISP handle the special characters of my country and language?

16.   Can I use newLISP for distributed computing tasks?

17.   Can newLISP be embedded in other programs?

1. What is newLISP and what can I do with it?

newLISP is a LISP-like scripting language for doing things you typically do with scripting languages: CGI programming, system administration, text processing, gluing other programs together, etc. newLISP is a scripting LISP for people who are fascinated by LISP's beauty and power of expression, but who need it stripped down to easy-to-learn essentials. newLISP is small on resources like disk space and memory but has a deep, practical API.

2. Why newLISP, why not one of the other standard LISPs?

LISP is an old language born, grown, and standardized in times very different from today, times when programming was for highly educated people who engineered programs. newLISP is LISP reborn as a scripting language: pragmatic and casual, simple to learn without requiring you to know advanced computer science concepts. Like any good scripting language, newLISP is quick to get into and gets the job done without fuss. It has all the essential elements which made LISP famous: symbol processing, lists, anonymous functions (lambda expressions), and S-expressions as a simple syntax for both data and program.

newLISP has a modern relevant API (Application Programming Interface) with networking, regular expression, advanced math, simulation, statistics, financial, HTTP, and XML functions built right into it. newLISP modules are available that let you connect newLISP to databases, mail servers, and more. newLISP can interface to standard shared libraries on Win32 and Linux/UNIX systems to add even more functionality. The newLISP API is user-driven and adapts over time to the ever-changing requirements of tomorrow's applications.

3. How do I study newLISP?

At least in the beginning you don't study newLISP, you use it. If you understand this:

(+ 1 2 3)   ; computes the sum of 1,2,3 => 6

and this:

(define (double x) (+ x x))   ; defines a new function

(double 123)   ; computes the double of 123 => 246

then you have learned enough to start programming in newLISP. There are a few more concepts like anonymous functions, applying functions, namespaces (contexts), and implicit indexing. You will pick those up while using newLISP.

Don't read books about LISP to learn newLISP. Most books deal with Common LISP or Scheme, two different, older standards of LISP. These books teach you concepts that you don't need to know to learn newLISP. newLISP does things differently from the older standards, in ways that are more applicable to today's programming tasks. If you study other LISPs before trying to understand newLISP, you won't learn to solve problems the newLISP way. But if you want a deeper understanding of newLISP, read the Users Manual section of the newLISP manual, which offers only a little theory but a lot of examples.

Start to write your first program now. Look at the small program snippets throughout the manual and on this web site. If you have questions, go to a discussion group hosted here and ask.

4. How does newLISP compare in speed?

It compares well to popular scripting tools like Perl or Python, not only in general computing speed but even more when it comes to startup time and memory/disk foot print. Have a look at some benchmarks.

5. Does newLISP have arrays?

Yes, it does. For applications with random access in large lists, access can be made faster using newLISP arrays.

6. Does newLISP have hash tables?

newLISP has fast scalable symbol processing using Red-black binary trees. Symbols in newLISP are used to build dictionaries for associative data access, similar to how hash tables are used in other scripting languages. See the newLISP manual for more details.

7. Does newLISP have automatic memory management?

Yes, it does. But it is not the typical garbage collecting process you find in other interactive languages. Just like traditional garbage collecting languages, newLISP recycles unused memory, but does it in a new, much more efficient way. newLISP's unique automatic memory management is one of the reasons for newLISP's speed, small size, and efficient memory usage.

8. Isn't passing parameters by value slow when passing large lists and strings?

newLISP passes symbols and context objects by reference. Parameter passing is done by simply wrapping a list or string buffer with a context object.

9. How does variable scoping work in newLISP?

newLISP offers a combination of dynamic and lexical scoping. It is dynamically scoped inside lexically separated contexts or namespaces. Contexts can be dynamically created during runtime. Contexts in newLISP allow lexical closure over more than one lambda function.

10. Can I program with threads?

Since version 8.2.0, Linux/UNIX versions of newLISP programs can have threads. Win32 versions can spawn child processes. Semaphores are used to synchronize threads or processes, and shared memory can be used for communications between threads and processes. Semaphores and shared memory are available on all versions of newLISP.

11. How about object-oriented programming?

newLISP uses contexts as objects for prototype-based, object-oriented programming. Objects can be created or destroyed during runtime, referred to by variables, and passed by reference to other functions.

12. How about packages and modules?

newLISP uses contexts for building packages and modules. Modules exist for database access to MySQL and SQLite databases, as well as to other databases through ODBC. Additional modules support FTP, POP3, and SMTP internet protocols. Because newLISP contexts are lexically closed, newLISP lets programmers treat modules like black boxes. This is suitable for large application development.

newLISP can also call shared libraries on Linux/UNIX and Win32 operating systems to expand its functionality.

13. What are some differences between newLISP and other LISPs?

newLISP's differences with other LISPs include: differences in the working of lambda expressions; the existence of namespaces (or contexts); differences in parameter passing; and of course the newLISP API (function repertoire). Overall newLISP's new ways of LISP programming make it faster, smaller, and easier to understand and learn. For a more detailed discussion, see Differences with Other LISPs.

14. Does newLISP run on XYZ operating system?

It probably does. newLISP has a minimum of dependencies; it only uses standard C libraries to compile. If your system has GNU tools such as the GCC compiler and the make utility, then newLISP should compile and link right away using one of the makefiles in its source distribution.

newLISP is built using one of several makefiles, each written for a specific platform. There are no complex make scripts. The makefiles are short and easy to change and adapt if your platform or configuration is not included already.

15. Can newLISP handle the special characters of my country and language?

For most languages of the Western World, all you will need to do is set your locale using the newLISP function set-locale.

More than half of the countries in the world use a decimal comma instead of a decimal point. newLISP will correctly read and write decimal commas when switched to the correct locale.

Most alphabets in the Western Hemisphere fit in 256-place character code tables, and each character needs only one 8 bit byte to be encoded. If the written language of your country uses multi-byte characters, then you need newLISP version with enabled UTF-8 support. Makefiles for Win32 and Linux are included to compile UTF-8 versions of newLISP. In the UTF-8 version, many character handling functions are able to handle multi-byte characters. See the localization and UTF-8 chapter in the manual for details.

16. Can I use newLISP for distributed computing tasks?

Some of today's larger applications run distributed across multiple computers, dividing their complex tasks between multiple CPUs. newLISP can be run as a server for evaluating commands sent by other newLISP client processes connected to it. A net-eval directive encapsulates all network handling required to communicate with other computers on the network, distribute code and computing tasks, and collect results in a blocking or event-driven fashion.

17. Can newLISP be embedded in other programs?

newLISP can be compiled as a UNIX shared library or Win32 DLL (dynamic link library). As a result, the shared library versions of newLISP can be used inside other programs that are able to import shared library functions.

On Win32 systems, newLISP has been used inside MS Excel, MS Visual Basic, and the NeoBook GUI application builder. On UNIX, newLISP has been used inside the GNumeric spreadsheet. On Mac OS X, newLISP has been used as an extension language for the BBEdit editor.


Lutz

#4
Thanks to Noah and Michael for improving the About page. I pretty much copied all of your edits with some minor adjustments


Quote
newLISP can also call shared libraries

changed to:
Quote
newLISP can also call functions in shared libraries


The point is, you cannot call a library only the functions in it.



Following Cormullion's observation I also added some text to the last section 17, so readers do not get the false impression that embedding newLISP functionality into BBedit is done via a shared library interface.



The emphasis of 17. is on embedding, which can be done using different methods (a) shared library interface (b) network ports (Tcp/IP UDP) and (c) UNIX pipe interfaces. Embedding in the sense that the presence of the embedded program is transparent and the new functionality enabled by newLISP appears to be owned by BBEdit.



See my version  of this at: http://newlisp.org/index.cgi?FAQ">http://newlisp.org/index.cgi?FAQ



If this still can be improved, let me know, but try to keep the whole thing under one title.



Lutz

Lutz

#5
.. a question: am I using italic emphasis too much? should it only be used when introducing a CS term for the first time?



I took some of the second occurrences out.



Lutz

m i c h a e l

#6
Quote from: "Lutz"
am I using italic emphasis too much? should it only be used when introducing a CS term for the first time?


Good questions. According to Wikipedia's entry on italics (as well as standard usage in most textbooks we're familiar with), the answers would be yes:


Quote from: "Wikipedia"
Introducing terms, especially technical terms or those used in an unusual or different way.


If you decide to go with this style, we'll plan to update the manual accordingly before next week's upload.



Melissa :-)

Lutz

#7
Quoteaccording to Wikipedia's entry on italics (as well as standard usage in most textbooks we're familiar with), the answers would be yes:


then lets go with it



Lutz

noah

#8
Hello, Lutz.



I'm glad my prior effort was helpful to you.  Here are additional suggestions for grammar/spelling edits to make to the revised 'About' webpage.



-Noah



- It has all of the essential elements that made LISP famous: 'symbol
processing, lists, anonymous functions (lambda expressions), and S-
expressions" as a simple syntax for both data and program.
+ It has all of the essential elements that made LISP famous: symbol processing, lists, anonymous functions (lambda expressions), and S-expressions as a simple syntax for both data and program.


- But if you want a deeper understanding of newLISP, read the Users Manual section of the newLISP manual, which offers only a little theory but a lot of examples.
+ But if you want a deeper understanding of newLISP, read the newLISP User's Manual, which offers only a little theory but a lot of examples.


- Have a look at some benchmarks .
+ Have a look at some benchmarks.


- newLISP has fast scalable symbol processing using red-black binary trees .
+ newLISP has fast and scalable symbol processing using red-black binary trees.


- Just like traditional garbage collecting languages, newLISP recycles unused memory, but does it in a new, much more efficient way.
+ Just like traditional garbage collecting languages, newLISP recycles unused memory. However, newLISP does it in a new, much more efficient way.


- newLISP passes symbols and context objects by reference. newLISP passes symbols and context objects by reference.
+ newLISP passes symbols and context objects by reference.


- This is suitable for large application development.
+ This is suitable for teams of programmers working on large applications.


- For a more detailed discussion, see Differences from Other LISPs .
+ For a more detailed discussion, see Differences from Other LISPs.


- In most parts of the Western world, you will only need to set your
locale using the newLISP function set-locale.
+ In most parts of the Western world, you will only need to set your locale using the newLISP function set-locale.


- If the written language of your country uses multibyte characters, then you need the newLISP version with UTF-8 support enabled.
+ If the written language of your country requires multibyte characters to encode it, then you need the newLISP version with UTF-8 support enabled.


- In the UTF-8 version, many character handling functions are able to handle multi-byte characters.
+ In the UTF-8 version, many character-handling functions are able to handle multibyte characters.


- Other ways of integration with newLISP are I/O pipes and network ports.
+ Other ways to integrate your application with newLISP include I/O pipes and network ports.


- On Mac OS X, newLISP has been used as an extension language for the BBEdit editor communicating via std I/O pipes.
+ On Mac OS X, newLISP has been used as an extension language for the BBEdit editor by having newLISP communicate with BBEdit via standard I/O pipes.

Lutz

#9
Thanks Noah, all taken care of. The extra space of the period after a link is caused by the formatting of the wiki software.



Lutz

noah

#10
Hi, Lutz.



Here are some suggested edits to the homepage. The parenthesis-enclosed + diffs are deeper edits, but they might be technically inaccurate or otherwise unsuitable.



-Noah



-newLISPtm for BSDs, GNU/LINUX, MacOS X, Solaris, Win32
+newLISPtm for BSD, GNU/LINUX, OS X, Solaris, and Win32


-newLISP is a general purpose scripting language for developing web applications and programs in general and in the domain of artificial intelligence (AI) and statistics.
+newLISP is a general-purpose scripting language that is for developing general programs and also for developing programs in the domains of internet, artificial intelligence (AI), and statistical programming.
(+newLISP is a general-purpose scripting language that is well-suited for developing internet, artificial intelligence (AI), and statistical applications.)

-   * Small footprint complete documented modern API
+   * Small footprint and complete, documented, and modern API
(+  * Small memory footprint
    * Complete, documented, and modern API)

-   * Perl compatible regular expressions, PCRE
+   * Perl-compatible regular expressions (PCRE)

-   * Modules for MYSQL, SQLite and ODBC Database access
+   * Modules for MySQL, SQLite, and ODBC Database access

-   * CGI, SMTP, POP3, FTP and XML-RPC Modules
+   * CGI, SMTP, POP3, FTP, and XML-RPC Modules

-   * Matrix, advanced math and Bayesian stat. functions
+   * Matrix, advanced math, and Bayesian statistical functions

-   * Distributed computing support with net-eval
+   * Distributed computing support using net-eval
(+  * Distributed computing support using TCP/IP)

-   * Import 'C' .so .dylib and .dll shared libraries
+   * Import C-language .so, .dylib, and .dll shared libraries
(+  * C .so, .dylib, and .dll import capability)

-   * Extend other programs with the embeddable library version
+   * Extend other programs with embeddable library version of newLISP
(+  * Extend other languages with embedded newLISP)

-   * CGI Examples: Mandelbrot , environment , httpd web server and Bayesian spam tagger
+   * CGI modules including Mandelbrot, environment, web server, and Bayesian spam filter.
(+  * CGI modules including web server, html-embedded newLISP, spam-filtering, server environment, and Mandelbrot graphing applications.)

-   * Unicode / UTF-8 enabled versions available
+   * Unicode/UTF-8 enabled versions available

-   * License: GNU Public License, GPL
+   * Licensed under the GNU Public License (GPL)

noah

#11
Hello, Lutz.



It looks like you've made a round of changes to the homepage.  Here is a second round of suggested edits to the new homepage content.  



The first sentence on the page can be edited for syntax and grammar, and also for writing style.



Here is a suggested edit to its syntax and grammar:



- newLISP is a general purpose scripting language for developing web applications and programs in general and in the domain of artificial intelligence (AI) and statistics.

+ newLISP is a general-purpose scripting language for developing web applications and programs in general and in the domains of artificial intelligence (AI) and statistics.


Here are two alternative suggestions to remove  redundancy of expression in the sentence:



- newLISP is a general purpose scripting language for developing web applications and programs in general and in the domain of artificial intelligence (AI) and statistics.

+ newLISP is a scripting language for developing web applications and programs in general and in the domains of artificial intelligence (AI) and statistics.

+ newLISP is a general-purpose scripting language for developing web, artificial intelligence (AI), statistics, and other applications.


If you leave the sentence as is, I won't pursue it further with you.



Here's one more suggested grammar/syntax edit to another part of the page:



- Matrix, advanced math, and Bayesian statistical function

+ Matrix, advanced math, and Bayesian statistical functions


Thank you, Lutz, for your patience with my (well-intended) efforts.  newLISP is very cool, so thank you for sharing it with the world!



-Noah

noah

#12
Hello.



Here's another suggested edit:

- Tcl/Tk Graphical Frontend
+ Tcl/TK graphical front-end


-Noah

noah

#13
Hello, Lutz.



Here are some suggested edits to the "Differences_to_Other_Lisps" page.



In section 1, you wrote:
Quote
Like Scheme, newLISP evaluates the operator part of an expression before applying it to the arguments.


Is that in contrast with Common Lisp? I'm not sure how you're identifying a difference from other LISP's.



In section 4, you wrote:
Quote
In newLISP macros work like normal functions, but without evaluating their arguments. This way functions can be built, which look like built-in newLISP primitives.

...

Separating evaluation and expansion of parameters offers more detailed control.


How does not evaluating macro arguments let you create a function that looks like a built-in newLISP primitive? Put another way, what do you mean by 'look like built-in newLISP primitives'?



Also, can you give an example on this page that shows when you would not want to use the 'expand' function in a macro?



newLISP compared to Common Lisp and Scheme

Last updated July 12th, 2006


This page clarifies some differences between newLISP and the older standards Common Lisp and Scheme. Read the About page too find out more about newLISP's unique approach to LISP.


   1. Like Scheme, newLISP evaluates the operator part of an expression before applying it to the arguments.


   2. In newLISP, lambda expressions evaluate to themselves. They are a subtype of the list data type, a first-class data object that can be manipulated like any other list.  In Common Lisp and Scheme, lambda functions have their own data type. The lambda list, when evaluated, returns a special 'function' data type with its free variables bound to the current environment and forming a lexical closure.

In newLISP, binding of variables in lambda expressions takes place during application of the lambda expression.  In other LISPs, lambda expressions are used to realize static variables and content via lexical closures.

      Static variables are a precondition for a programming language to allow object-oriented programming in that language.  In newLISP, lexically closed contexts (namespaces) are used for prototype-based object-oriented programming. Like lambda expressions, contexts in newLISP are first-class objects, which can be created or destroyed during runtime, passed as parameters, and referred to by symbols.


   3. In newLISP and Scheme, variables, primitives, and user-defined functions share the same symbol space. In Common Lisp, function symbols and variable symbols each use a dedicated symbol space. This is why Common LISP function symbols  sometimes must be prefixed with the sharp quote #'.


   4. In newLISP, all variables are dynamically scoped by default, but newLISP also provides a lexically closed namespace called a context. By defining a function in its own context, static/lexical scoping can be achieved, and variable capture can be avoided. Several functions and data can share a namespace. Common Lisp and Scheme are lexically scoped by default and use lambda expressions as the closure mechanism. Common Lisp also offers 'special variables' for dynamic scoping.

   5. In newLISP, there are no dotted pairs, because each newLISP cell contains one object and a pointer to the next object if the cell is part of a list. In Common Lisp and Scheme, the 'cdr' part of the lisp cell can be used to contain another data object, in which case we have a dotted pair. As a result, 'cons' behaves differently in newLISP than in other lisps.

       ;; Common Lisp and Scheme
       (cons 'a 'b) => (a . b)   ; a dotted pair

       [a | b]

       ;; newLISP
       (cons 'a 'b) => (a b)     ; a list

       ;; LISP cells in newLISP
       (+ 2 3 (* 4 3))

       [ ]
       
        [+] -> [2] -> [3] -> [ ]
                             
                              [*] -> [4] -> [3]

   6. In newLISP, all arguments to a user-defined function are optional.  Unassigned argument variables will assume the value 'nil' inside their function.

   7. Logically, there are no unbound or non-existing symbols in newLISP.  Any unbound or non-existing symbol is bound to 'nil' in the current namespace when it is first used.

   8. 'nil' and 'true' are Boolean constants in newLISP. In Common Lisp, 'nil' has an additional role as a list terminator:

       ;; Common Lisp
       (cons 'x nil) => (x)

       ;; newLISP
       (cons 'x nil) => (x nil)

      Scheme has the two Boolean constants '#t' and '#f' for true and false.


   9. In newLISP, every object is only referenced once (ORO), with the exception of symbols, contexts, and context objects. newLISP's ORO rule allows automatic, stack-based, 'on the go' memory management, without the traditional garbage collection algorithms used in Common Lisp and Scheme. newLISP passes parameters by value and stores intermediate results on a 'result stack' where their memory gets recycled after function return. Only under error conditions will newLISP employ a classic mark-and-sweep algorithm to reclaim unreferenced memory. newLISP's automatic memory management is fully transparent to the programmer but faster and lighter on resource requirements when compared to classic garbage collection algorithms. Because ORO memory management is synchronous, newLISP code has constant and repeatable execution time.

      The combination of newLISP's value-passing style and unique memory management make it the fastest interactive (non-compiled) LISP available and one of the fastest scripting languages available in general.

  10. Macro evaluation is a single step in newLISP and two steps in Common Lisp. In other LISPs, the macro first expands symbols in its body to their contents and then evaluates the resulting function. In newLISP, macros work like normal functions, but without evaluating their arguments. In this way, functions can be built that look like built-in newLISP primitives. In newLISP, the built-in function 'expand' is used to initiate variable expansion in macros:

       (define (raise-to power)
          (expand (fn (base) (pow base power)) 'power))

       (define square (raise-to 2))
       (define cube (raise-to 3))

       (square 5) => 25
       (cube 5)   => 125

      Separating evaluation and expansion of parameters offers better control than is available from Common Lisp and Scheme.

  11. newLISP only requires the equal sign '=' to test for equality. This is a consequence of newLISP's value-passing style. Common Lisp requires 'eq', 'eql', 'equal', 'equalp', '=', 'string=', 'string-equal', 'char=', and 'char-eq', for equality tests of expressions, data types, identical objects, and referenced objects.

  12. newLISP features implicit indexing. This is a logical extension of LISP evaluation rules overloading lists or numbers with the indexing functionality available from built-in list and string functions like nth, rest or slice, i.e.:

       (set 'myList '(a b c (d e) f g))

       ; using nth
       (nth 2 myList) => c
       (nth 3 1 myList) => e
       (nth -3 0 myList) => d

       ; using implicit indexing
       (myList 2) => c
       (myList 3 1) => e
       (myList -3 0) => d

       ; implicit rest, slice
       (1 myList) => (b c (d e) f g)
       (-3 myList) => ((d e) f g)
       (1 2 myList) => (b c)

      Using implicit indexing is optional but in many instances speeds up coding and increases readability.

Lutz

#14
Thanks for all the good editing work Noah. Before putting in your last edits for the Differences page let me answer your questions, so you can work them into your edits:


QuoteLike Scheme, newLISP evaluates the operator part of an expression before applying it to the arguments.


Yes, this is different to Common LISP, which which will not evaluate the operator/function part before applying it to the arguments.


Quote ... how does not evaluating macro arguments let you create a function that looks like a built-in newLISP primitive?


All user defined functions in newLISP (and all other LISPs) evaluate the arguments first before the operator functor is applied (applicative order of evaluation). But many built-in functions deviate from this with special individual evaluation rules, they are called special forms, i.e. the functions and, or, if stop evaluation when certain conditions are satisfied, and dotimes, dolist do not evaluate the list containing the loop parameters. dolist evaluates the list term in the parameter list but not the loop variable, etc.



Macros in newLISP, because they do not evaluate their arguments until coded for it specifically, let you implement those special forms. That is what I mean with "functions that look like built-ins".



An example for this would be:

(define-macro (my-setq x y) (set x (eval y)))

;; or the same avoiding variable capture

(define-macro (my-setq) (set (args 0) (eval (args 1))))


A special form is created here: evaluating the second arg but not the first.



The difficulty about writing the Differences page is:



(a) I don't want to get too much into details, giving a Computer Science lecture.



(b) The page is more directed at the educated Common LISP and SCHEME users who wants to know quickly what the differences are to their known CL or Scheme tool.



What I want to say is: try to clarify things but don't get too wordy and academic about it. The page should not go too much into detail and then get too overwhelming.



Perhaps we can say:

"This way functions can be built, which look like built-in newLISP primitives which deviate from applicative evaluation order found in userdefined functions with define"



or similar?



Lutz