xlisp icon indicating copy to clipboard operation
xlisp copied to clipboard

Doesn't run on 64-bit Linux

Open blakemcbride opened this issue 4 years ago • 9 comments

Greetings,

I am trying to run xlisp on my 64-bit Linux box. What I see is as follows:

blake@i9-tower:~/Backup/xlisp.git$ git pull
Already up to date.
blake@i9-tower:~/Backup/xlisp.git$ make
mkdir bin
mkdir obj
mkdir obj/xlisp
obj/xlisp/xlisp.o
mkdir lib
mkdir obj/lib
obj/lib/unstuff.o
obj/lib/xlansi.o
obj/lib/xlapi.o
obj/lib/xlcobj.o
./src/xlcom.c: In function ‘do_method’:
./src/xlcom.c:381:35: warning: variable ‘body’ set but not used [-Wunused-but-set-variable]
     xlValue object,selector,fargs,body;
                                   ^~~~
./src/xlcom.c:381:29: warning: variable ‘fargs’ set but not used [-Wunused-but-set-variable]
     xlValue object,selector,fargs,body;
                             ^~~~~
./src/xlcom.c:381:20: warning: variable ‘selector’ set but not used [-Wunused-but-set-variable]
     xlValue object,selector,fargs,body;
                    ^~~~~~~~
./src/xlcom.c:381:13: warning: variable ‘object’ set but not used [-Wunused-but-set-variable]
     xlValue object,selector,fargs,body;
             ^~~~~~
obj/lib/xlcom.o
obj/lib/xldbg.o
obj/lib/xldmem.o
obj/lib/xlfasl.o
obj/lib/xlftab.o
obj/lib/xlfun1.o
obj/lib/xlfun2.o
obj/lib/xlfun3.o
obj/lib/xlimage.o
obj/lib/xlinit.o
obj/lib/xlint.o
obj/lib/xlio.o
obj/lib/xlmain.o
obj/lib/xlitersq.o
obj/lib/xlmath.o
obj/lib/xlobj.o
obj/lib/xlosint.o
obj/lib/xlprint.o
./src/xlread.c: In function ‘xrmquote’:
./src/xlread.c:195:13: warning: variable ‘mch’ set but not used [-Wunused-but-set-variable]
     xlValue mch;
             ^~~
./src/xlread.c: In function ‘xrmdquote’:
./src/xlread.c:210:13: warning: variable ‘mch’ set but not used [-Wunused-but-set-variable]
     xlValue mch;
             ^~~
./src/xlread.c: In function ‘xrmbquote’:
./src/xlread.c:225:13: warning: variable ‘mch’ set but not used [-Wunused-but-set-variable]
     xlValue mch;
             ^~~
./src/xlread.c: In function ‘xrmcomma’:
./src/xlread.c:240:13: warning: variable ‘mch’ set but not used [-Wunused-but-set-variable]
     xlValue mch;
             ^~~
./src/xlread.c: In function ‘xrmlparen’:
./src/xlread.c:255:13: warning: variable ‘mch’ set but not used [-Wunused-but-set-variable]
     xlValue mch;
             ^~~
./src/xlread.c: In function ‘xrmrparen’:
./src/xlread.c:270:13: warning: variable ‘mch’ set but not used [-Wunused-but-set-variable]
     xlValue mch;
             ^~~
./src/xlread.c: In function ‘xrmsemi’:
./src/xlread.c:284:13: warning: variable ‘mch’ set but not used [-Wunused-but-set-variable]
     xlValue mch;
             ^~~
In file included from ./src/xlread.c:7:0:
./src/xlread.c: In function ‘read_string’:
./include/xlisp.h:129:26: warning: value computed is not used [-Wunused-value]
 #define xlPop()         (*xlSP++)
                         ~^~~~~~~~
./src/xlread.c:521:31: note: in expansion of macro ‘xlPop’
     return xlTop() == xlNil ? xlPop(), xlMakeString(buf,len) : xlGetStrOutput(xlPop());
                               ^~~~~
obj/lib/xlread.o
obj/lib/xlsym.o
lib/libxlisp.a
bin/xlisp
blake@i9-tower:~/Backup/xlisp.git$ cd bin
blake@i9-tower:~/Backup/xlisp.git/bin$ ./xlisp 
XLISP 3.3, September 6, 2002 Copyright (c) 1984-2002, by David Betz

> abc

Error: unbound variable - abc
happened in: #<Code #x0x7fc1dfc9b838>blake@i9-tower:~/Backup/xlisp.git/bin$ 

So basically I type in an undefined variable name and it crashed. Any help would be appreciated.

Blake McBride

blakemcbride avatar Oct 02 '21 02:10 blakemcbride

I'm not sure what is causing this problem. I build it on the Mac using X Code which is also a 64 bit target and I don't see these errors. I'll have to try it under Linux later. Sorry about the troubles!

dbetz avatar Oct 03 '21 11:10 dbetz

Actually, the reason it crashes when you enter an unbound variable is that you aren't loading all of the .lsp files that should be loaded at start. The debugging code is written in Lisp not in C so it gets loaded along with xlisp.lsp. If you run xlisp from a directory that contains those .lsp files your unbound variable shouldn't cause a crash.

` bin/xlisp dbetz@Davids-Mini-2 xlisp % bin/xlisp XLISP 3.3, September 6, 2002 Copyright (c) 1984-2002, by David Betz [1] abc

error: unbound variable - abc happened in: #<Code #x0x7fb1bdfcb1f8> Entering break loop ('(reset)' to quit) Debug 1> [1] `

dbetz avatar Oct 03 '21 11:10 dbetz

Yes, that fixes the problem. Thanks!

Perhaps it would be good if xlisp detected the missing lisp files on startup, issued a message, and exited gracefully.

Thanks!

Blake

blakemcbride avatar Oct 03 '21 14:10 blakemcbride

It should probably be mentioned in the README.md file that the .lsp files are required for full functionality but XLISP does work without them. Someone could even provide their own support functions and not use the ones I provide.

If I might ask, what are you using XLISP for?

On Oct 3, 2021, at 10:05 AM, Blake McBride @.***> wrote:

Yes, that fixes the problem. Thanks!

Perhaps it would be good if xlisp detected the missing lisp files on startup, issued a message, and exited gracefully.

Thanks!

Blake

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dbetz/xlisp/issues/7#issuecomment-932958280, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFL5VUZ3NVVPSV6JOHSJSDUFBPJXANCNFSM5FF26P3Q. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

dbetz avatar Oct 03 '21 21:10 dbetz

Hi David,

I hadn't used it for anything yet. I have in mind a language that is a cross between Common Lisp and Scheme. I thought your XLISP would be a good starting point. In particular, I am interested in something like Common Lisp with the following differences:

  1. Lisp1 - variables and functions in the same namespace
  2. Handle tail recursion without stack space
  3. Case-sensitive symbols

My answer to "why not just use Scheme" is at Problems with Scheme

It seems to me that XLISP would be relatively easy to do this with. Do you agree?

Also, I'm interested in supporting native threads. Is XLISP a good candidate for that?

Lastly, you may want to take a look at: Lisp1 POS Dynace

Thanks!

Blake [email protected]

blakemcbride avatar Oct 04 '21 02:10 blakemcbride

XLISP already does 1 and 2. It should be pretty easy to make it case sensitive. I think supporting hardware threads would be difficult though.

dbetz avatar Oct 04 '21 10:10 dbetz

I know about 1 and 2. That's why I thought starting with XLISP would be a good idea. I wanted to move it towards Common Lisp in other areas as described in my "Problems with Scheme" paper. I think that will be easy.

In terms of native threads, I figure that's a major architectural change not reasonable with XLISP. Cooperative threads should be doable.

blakemcbride avatar Oct 04 '21 13:10 blakemcbride

I think that Guile handles native threads ... https://www.gnu.org/software/guile/manual/html_node/Threads.html (I haven't used them in anything useful, so can't comment on them in depth) To echo David's comment ... are you sure that you need native threads? Many existing languages have nice ways of handling it.

On Mon, Oct 4, 2021 at 8:41 AM Blake McBride @.***> wrote:

I know about 1 and 2. That's why I thought starting with XLISP would be a good idea. I wanted to move it towards Common Lisp in other areas as described in my "Problems with Scheme" paper. I think that will be easy.

In terms of threads, I figure that's a major architectural change not reasonable with XLISP.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dbetz/xlisp/issues/7#issuecomment-933498898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKL5LYHNHJOPMH3E7AR2JSLUFGVJZANCNFSM5FF26P3Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

cousinitt avatar Oct 08 '21 19:10 cousinitt