Release newLISP v.10.1.0

Notices and updates
Post Reply
Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Release newLISP v.10.1.0

Post by Lutz »

• improved concurrency support on multi core CPUs with new messsaging API
• many other changes and additions

for release notes see: http://www.newlisp.org/downloads/newLIS ... lease.html
for downloads see: http://www.newlisp.org/index.cgi?page=Downloads

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

The 10.1.0 Users Manual and Reference in PDF format can now be accessed from here:

http://www.newlisp.org/index.cgi?Documentation

itistoday
Posts: 413
Joined: Sun Dec 02, 2007 5:10 pm
Location: I'm sitting right next to you. :)
Contact:

Post by itistoday »

Awesome, congrats, I can't wait till I get a chance to take a look into the new changes.
Get your Objective newLISP groove on.

Jeff
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

Post by Jeff »

Lutz,

This is wonderful. I love send and receive. Any chance of getting a flag on receive to block for a message?

Couple of bugs:
1) docs - send's docs use (sys-info 4) instead of (sys-info 6) for the parent pid
2) if spawn is called with a single argument (if, for example, I forgot - hypothetically of course; this would *never* happen - to put a symbol in and instead just put an expression to spawn), the interpreter exits with a bus error.

Jeff
Jeff
=====
Old programmers don't die. They just parse on...

Artful code

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Thanks Jeff and Itistoday

- it always says (sys-info -4), which is indexing from the back. This is encouraged to write compatible code for future versions, which insert new system stats after position 5. I looked through the docs, but couldn't find a (sys-info 4), I think I always have put the -4 (minus 4).

- the 'spawn' missing arg. error is already fixed in this morning's 10.1.0 version.
Last edited by Lutz on Mon Jun 22, 2009 8:59 pm, edited 2 times in total.

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

... blocking is easy using 'until', just look into the examples, most of them do blocking send/receive. Using 'until' makes it easy to interleave other code when waiting, and also stands out visually. I want to reserve an optional parameter for a timeout value argument in the future. That would then serve a double purpose, and would be used in both 'send' and 'receive'.

Jeff
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

Post by Jeff »

Re sys-info - my mistake. Regarding blocking, that can easily be accomplished using until and sleep; the only problem is finding the appropriate polling rate.

Are there any plans for asynchronous callbacks?
Jeff
=====
Old programmers don't die. They just parse on...

Artful code

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Are there any plans for asynchronous callbacks?
you can do callbacks now:

Code: Select all

; receiver process pidR listens and evaluates

(define (foo a b c)
...
)

(while true
	(if (receive pidS msg) 
		(eval msg))
)
the sender would send expressions, which then get evaluated in the receivers environment. E.g. you could send:

Code: Select all

; sender process pidS

(send pidR '(foo 1 2 3))
this would then call the function foo in the receiver. The proxy example in the documentation is doing a similar thing (last example).

newdep
Posts: 2019
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

great release Lutz, very nice changes and enhancements..
though I need to catch up again ;-) ... nice nice nice release..
-- (define? (Cornflakes))

newdep
Posts: 2019
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

newlisp makefiles

Post by newdep »

Hi Lutz / Ted,

Below the correct makefiles for linux slackware/utf8 and the N810 Maemo Linux makefile also listed..Sorry im a bit late ;-)


First the linux slackware makefile which included 'readline' + 'termcap' and not 'readline' + 'ncurses' as default..

Code: Select all

# makefile for newLISP v.10.x.x on LINUX with readline support
#
# Note, that readline support may require different libraries on different OSs
#

OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o \
    nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o pcre.o

#CFLAGS = -m32 -Wall -pedantic -Wno-uninitialized -c -O2 -g -DLINUX
CFLAGS = -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DLINUX

CC = gcc


default: $(OBJS)
#   $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -o newlisp # for UBUNTU Debian
    $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -ltermcap -o newlisp # for slackware
#   $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -lncurses -o newlisp
#   $(CC) $(OBJS) -m32 -g -lm -ldl -o newlisp
    strip newlisp

.c.o:
    $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_linux

oke here is the slackware linux_utf makefile:

Code: Select all

# makefile for newLISP v.10.x.x on LINUX with readline and UTF-8 support
#
# Note, that readline support may require different libraries on different OSs
#

OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o \
    nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o

CFLAGS = -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX

CC = gcc


default: $(OBJS)
#   $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -o newlisp
    $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -ltermcap -o newlisp
#   $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -lncurses -o newlisp
#   $(CC) $(OBJS) -m32 -g -lm -ldl -o newlisp
    strip newlisp

.c.o:
    $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_linux_utf8


This is the Nokia n810 Maemo Linux ARMEL makefile plain:
called 'makefile_maemo', no readline support yet but will get there because i need that badly ;-)

Code: Select all

# makefile for newLISP v.10.x.x on LINUX MAEMO ARMEL
#
# Note, that readline support may require different libraries on different OSs
#

OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o \
        nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o pcre.o

#CFLAGS = -Wall -pedantic -Wno-uninitialized -c -O2 -g -DLINUX
CFLAGS =  -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DLINUX

CC = gcc


default: $(OBJS)
#       $(CC) $(OBJS) -g -lm -ldl -lreadline -o newlisp # for UBUNTU Debian
#       $(CC) $(OBJS) -g -lm -ldl -lreadline -ltermcap -o newlisp
#       $(CC) $(OBJS) -g -lm -ldl -lreadline -lncurses -o newlisp # for slackware
        $(CC) $(OBJS) -g -lm -ldl -o newlisp
        strip newlisp

.c.o:
        $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_maemo



here is the Nokia N810 linux maemo utf8 makefile:
called makefile_maemo_utf8

Code: Select all

# makefile for newLISP v.10.x.x on MAEMO ARMEL LINUX with readline and UTF-8 support
#
# Note, that readline support may require different libraries on different OSs
# 

OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o \
     nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o

CFLAGS = -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DSUPPORT_UTF8 -DLINUX

CC = gcc


default: $(OBJS)
#    $(CC) $(OBJS)  -g -lm -ldl -lreadline -o newlisp
#    $(CC) $(OBJS)  -g -lm -ldl -lreadline -lncurses -o newlisp
     $(CC) $(OBJS)  -g -lm -ldl -o newlisp
     strip newlisp

.c.o:
     $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_maemo_utf8


On the Linux ARMEL there is currently only GCC 2.5 running higher
version is in test progress by the Meamo people..

The ./configure script from 10.1.0 runs on the slackware only when
the default makefile_linux is adjusted to use 'termcap' + 'readline'.

The ./configure script doesnt run on Maemo Linux.
As the ./configure script seeks for "linux" which it is. it doesnt support
the -m32 setting. So compilation on the N810 is done manualy by
make clean; make -f makefile_maemo_utf8


the command 'arch' can be used to check your Processor Architecture,
which can then be used in the configure script perhpas...

If you need more info let me know...


PS: Actualy there could also be a makefile_generic which only includes the '$(CC) $(OBJS) -g -lm -ldl -o newlisp' because that almost always
works on any Unix machine...This also saves extras makefiles, specials not included ofcourse..Not to confuse with the makefile_universal ;-)
-- (define? (Cornflakes))

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

This seems to be the story for readline support on Linux/UNIX

- UBUNTU linux, Mac OS X: -libreadline
- Slackware Linux: -libreadline -ltermcap
- Some other Linux UNIX: -libreadline -lncurses

this is just libraries, but you also need the package libreadline5-dev (this is the name on UBUNTU) which contains the headerfiles readline.h and history.h included during the build.

Also, I am replacing now the old configure with Ted's configure, but the old makefile_xxxx's still will be there and can be used. This is how it will work starting 10.1.1:

For the new Ted method (standard GNU sequence):

./configure
make

For the old method using the built-in makefiles, either:

make

or picking a specific makefile:

make -f makefile_xxx

Between builds always: make clean
And after the build (GNU standard): make check
Or the same: make test

Note that Ted's configure script does not require the GNU autoconf tools, and doesn't have any other external dependencies.

TedWalther
Posts: 605
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Post by TedWalther »

Thanks Lutz.

I looked into how GNU autotools figures out libreadline. Somehow they actually search for unresolved symbols in all the libraries until they find a library that has them. Seems like a complicated subsystem, but it does work.

What I have in mind is a little simpler; have a small test program (test-readline), and compile it first with -lreadline, then -lreadline -lncurses, then -lreadline -ltermcap. At each step, if compile succeeds, then we go with the value used.

If there is something out there that uses -lreadline -lterminfo, then I'll add that test in too. But if we can't compile the test program, then we have to bail out with a message saying "Libraries specified are incorrect, or you need to set the -L flag."

Ted

TedWalther
Posts: 605
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Post by TedWalther »

For the -m32 flag not working on older gcc, do we know exactly when that support was added? which version of gcc? Then I can do gcc --version and disable it for older versions.

Ted

m35
Posts: 171
Joined: Wed Feb 14, 2007 12:54 pm
Location: Carifornia

Post by m35 »

Oh I see the problem. You should be using the -m35 flag.

;D

Ok, I'm done, carry on.

Post Reply