Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't run on 64-bit Linux #7

Open
blakemcbride opened this issue Oct 2, 2021 · 8 comments
Open

Doesn't run on 64-bit Linux #7

blakemcbride opened this issue Oct 2, 2021 · 8 comments

Comments

@blakemcbride
Copy link

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

@dbetz
Copy link
Owner

dbetz commented Oct 3, 2021

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
Copy link
Owner

dbetz commented Oct 3, 2021

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]
`

@blakemcbride
Copy link
Author

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

@dbetz
Copy link
Owner

dbetz commented Oct 3, 2021 via email

@blakemcbride
Copy link
Author

blakemcbride commented Oct 4, 2021

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]

@dbetz
Copy link
Owner

dbetz commented Oct 4, 2021

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.

@blakemcbride
Copy link
Author

blakemcbride commented Oct 4, 2021

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.

@cousinitt
Copy link
Contributor

cousinitt commented Oct 8, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants