Trying to learn Scheme/Lisp/NewLisp ....

Started by noah, June 16, 2006, 09:06:53 PM

Previous topic - Next topic

noah

Hello.



I've been comparing Common Lisp, Scheme, and newLisp.



What continues to attract me to newLisp includes the following:



  • * newlisp lexical namespaces.

    * PCRE support.

    * shebang aware.

    * easy to compile, uses standard libraries.

    * small footprint.

    * small specification.

    * great spread of functionality (networking, regex, unification, etc)

    * enthusiastic, newbie-friendly online community.

    * interactive interpreter's readline support.

    * GNU open-source licensed.

    * written in C (I hope to learn C, at some point).



Now for my hesitations. Please don't take these as criticism. If you read them carefully, you'll see that they say more about my particular needs, background, and concerns than anything about drawbacks to using newLisp.



My hesitations include the following:

  • * the documentation is very technical. Without knowing something about recursive function design, symbols, lists, and cells, many of the code samples people trade on-line are opaque to me.  Also, the jargon (for example, in the design patterns document) is meaningless to me, so I know I'm missing things that probably are very useful, and likely what I do anyway with other tools in Linux.

    * both Common Lisp and Scheme are standards. I can't gauge how close or far away newLisp is from either standard. My first approach to newLisp was with the confidence that it would fill a niche for me, but looking at its capability, it can take over a lot of other language's uses. Would that leave me with a bunch of skills I can't transfer to another language, if I need to?



To address my first hesitation, I've decided to learn scheme. Common Lisp was my initial choice, but the scheme spec is much smaller, which means that I won't drown in the TIMTOWDI that turned me off to Perl. Plus scheme is used to teach programming languages. My programming skills don't include formal education in algorithms, data structures, or object-oriented programming, so I'd better start from the beginning, to get this right. I found a good implementation MzScheme, which has #! support, too. But I'd still like to use newLisp.

To address my second hesitation, I'm going to ask you all a question. My question is this. How different is newlisp from scheme? What would it take to "scheme-ize" newlisp? My first book on Scheme will arrive in the mail shortly, and I'm wondering whether I could define an init.lsp that will let me take examples straight out of the Scheme book and run them on newLisp.



I'm also wondering what a continuation is? Can someone make this comparision for me between Scheme continuations and what newLisp would use instead? Can continuations be faked in newLisp? Should they be?



My thanks to Mr. Mueller for providing such a tempting product. I've had to learn a lot about what I don't know about programming just to make sense of what my wished-for uses of newLisp really entail. newLisp is good stuff!



-Noah

m i c h a e l

#1
Quote from: "Noah"Would that leave me with a bunch of skills I can't transfer to another language




Skills are always transferrable :-)


Quote from: "Noah"I've decided to learn scheme.


Not a bad choice, really. I think Lutz considers Scheme one of newLISP's influences.


Quote from: "Noah"I found a good implementation MzScheme


This is a very helpful environment to learn programming in. The step-by-step debugger really allows you to see how the expressions are being evaluated.


Quote from: "Noah"What would it take to "scheme-ize" newlisp? My first book on Scheme will arrive in the mail shortly, and I'm wondering whether I could define an init.lsp that will let me take examples straight out of the Scheme book and run them on newLisp.


I've tried this myself many times. Sometimes it leads to greater understanding. Other times, the two languages become confused, and I learn neither well. Looking back, I would say the former or the latter depended on how well I knew one of the languages beforehand. If you don't know either one yet, you may be getting yourself into trouble.



Not to say that it can't be done, though. It might be a good exercise. I'm sure you will always find eager help here should you decide to do so.


Quote from: "Noah"newLisp is good stuff!


Of course, you know this must be added to the mottos page ;-)



m i c h a e l

pjot

#2
Hi Noah,



As you say you are going to address your first hesitation yourself, let's look at your second hesitation.



As for your second hesitation, let me tell a small story. I started programming in the beginning of the 80's, learning the good old BASIC, and later 6502 assembly. During the years I learned a lot of other sequential languages, and I found that programnming was in fact a kind of trick: it was a way of thinking, a way of looking and analyzing a problem, while the language I was using appeared to be secondary in a sense that they were 'all the same'. No matter the type of problem, when I looked at it in the same (sequential) way, I could solve it quite fast, with C, Pascal, BASIC, C++, even with a language like BrainF*CK.



In this approach there have been 2 (personal) revolutions. First when I started to use Prolog. With Prolog, the way I have to look at a problem is completely different, as the key in Prolog is 'unification'. The 'logic' in a Prolog program is radically different when compared to a sequential language. I felt like starting to learn programming all over again. In a very clumsy way I first started to write sequential programs in Prolog, but this did not work out, of course. For the first time, it was me who had to change, in order to use Prolog successfully.



The second revolution was my encounter with newLISP. The way of thinking which newLISP asks, is different again. It is not sequential, it's not unification (though since 8.8.8 we have a 'unify', but in a lispy way), no, it is more... well... in 'depth'. Officially a lisp-like language is called a 'functional' language. Each statement is in fact a function, which has a return value (when between paranthesis), and the way of thinking and analyzing a problem is different again. :-)  I was amazed about this new way of looking at a problem. With newLISP, when I want to analyze a problem, it seems this can be done in a very 'vertical' way; not like in a sequential language, where you have to write out 'hotizontally' all situations and exceptions, or in a unifying way, where you have to write down all rules and facts in order to get a match. No, with newLISP only one 1 function covers it all, and if embedded in other functions, the solution comes extremely fast!



What I want to say with this story is, that to me it seems that complying to a standard is unimportant, since ultimately, it's all about a way of thinking. Of course, there are statements in newLISP which you will not find in CLisp or Scheme, and the other way around. But this does not matter. You have to decide which language fits your needs best. If you like the functional way of thinking, just see which Lisp fits best. From my personal point of view, CLisp is very theoretical and far away from practice, though it sets a standard. But who cares about a standard, if you are not able to do what you want? If you read the CLisp forums, you'll see many complaints of people criticizing CLisp and leaving the language, as it's too far from reality.



To conclude, newLISP sets it's own standard, by it's powerfull set of functions and it's practical way of dealing with a problem. Compared to other languages, it has everything I need: networking, importing from Shared Objects, multiplatform, implemented in ANSI C, a good readable manual, speed, and last but not least: beautifull code to look at :-)



Peter

m i c h a e l

#3
Quote from: "Peter"beautifull code to look at


Yes, I often catch myself spending time just looking at the code, noticing patterns, delighted by its architectural beauty.



m i c h a e l

Ryon

#4
Quote...the documentation is very technical.

Lutz' documentation is as elegant as his coding. It may be terse, but it's absolutely spot-on. Take the time to understand the terms that he uses to describe newLISP, you'll learn a lot about computer science as well.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

cormullion

#5
It's always difficult to get all the documentation we want. Only some of the more commonly-used software offerings have plenty of books to suit all potential readers, so you're lucky if your chosen language or application has a wide range to select from, including quick references, dummy's guides, books targetted at specific domains, conversion guides (eg Ruby for Cobol programmers:-)), exhaustive reference tomes, structured self-taught courses, and so on, pitched at all levels of user with different backgrounds.



For newLISP, I too felt that a simple introduction was a good addition to the documentation set, which is why I had a go at writing one: http://newlisp.org/introduction-to-newlisp.pdf">//http://newlisp.org/introduction-to-newlisp.pdf (currently being revised for 8.9). I'd be interested to know how you think I could improve it. It's not aimed at the AutoLISPer, Schemer, or Common Lisper, but at someone like me who's not a much of a programmer at all (I see from your other posts that you know about semantic webs and have studied formal logic and XML and stuff, so you may find my approach too simplistic :-)...).



I admit that I haven't yet learnt about macros, continuations, or unifications, so I've been unable to write about them... That may change, one day! ;-)

newBert

#6
I also started (nearly) programming in the beginning of the 80's trying to learn a minimalist good old basic on a Commodore 64. Fortunately there was an excellent MIT-LOGO on this machine and I left Basic for this procedural/functional way of programming. Logo was born out of Lisp, probably before Scheme(r).



Now, after many hesitations and tryings between Lisp and Scheme, I finally choose NewLISP as the better (and the more pragmatic) Lisp/Scheme fusion. NewLISP is the newborn of the Lisp Family... I use it as well as the still alive Logo and sometimes Rebol (quite inferior to NewLISP for various reasons, in my opinion).



Using various languages is interesting but it might be  a risk of dissipation. With NewLISP we can already use Lisp and Tcl-Tk and we have the impression of  sometimes coding in Scheme and even in Rebol (more readably however, in spite of or, rather, thanks to the parenthesis).



All programing languages are of equal merit. The  right choice is a question of preference and purpose and ... of user community too :)
<r><I>>Bertrand<e></e></I> − <COLOR color=\"#808080\">><B>newLISP<e></e></B> v.10.7.6 64-bit <B>>on Linux<e></e></B> (<I>>Linux Mint 20.1<e></e></I>)<e></e></COLOR></r>

rickyboy

#7
Noah,



If you're going to learn Scheme, I recommend the Wizard Book.  Here is the full text on-line:



http://mitpress.mit.edu/sicp/full-text/book/book.html">http://mitpress.mit.edu/sicp/full-text/book/book.html



(If you like it, I recommend buying the book -- books in hand are much easier to read anyway.)



You'll be happy to know that the book starts the reader from the very beginning: the basic ideas and notions of computational processes.  Then they carefully develop the ideas which follow.



The first chapter reads almost too slowly; but don't worry it really takes off (in a good way).  All throughout, the authors infuse the code with good design techniques and, along the way, teach you some mind-blowing things.  Reading this book really changed my life -- changed and enlightened the way I think about programming (again, in a good way).  I'll stop writing about it now, so you can go read the book.  :-)
(λx. x x) (λx. x x)