newlisp.DLL possible?

Started by HPW, October 13, 2003, 12:30:58 PM

Previous topic - Next topic

HPW

Hello Lutz,



I would like to ask if it is possible to make a newlisp.dll where I can call

a function "eval" and pass a string containing a lisp-code.(cdecl)

This would be similar to newlisp "Direct execution mode".

It would return a string to the calling Programm.

But the DLL could then stay in memory and preserve it's memory with code and data.

Would be another powerfull option.



What do you think?
Hans-Peter

Lutz

#1
This has also been requested by Steve and it is on the list of things to do. Unfortunately it is one of those features, which needs a different treatment on the Windows and UNIX platforms, and I haven't done any Windows specific development in the last two years after moving newLISP to UNIX.



You might also consider talking to newLISP via TCP/IP, this is the way the newlisp-tk frontend is doing it. If you start newLISP in demon mode with the -d option it will stay in memory with all its data, even if the connecting application exits, you can reconnect and all data are still there.



This would also be a platform independent solution and you can have newLISP running on a different computer on the network/internet.



Anyway I will look into a DLL mode when I have a little bit more time.



Lutz

HPW

#2
QuoteIf you start newLISP in demon mode with the -d option it will stay in memory with all its data


Have not thought about that. Also interesting. I will give it a try. But direct call would be also nice.
Hans-Peter

HPW

#3
QuoteNote, that the demon mode only works correctly on LINUX and BSD systems. On Win32 based systems newLISP may not be able to reconnect at all times.


Taken from the doc. Seems not so good for Win32 systems! :-((
Hans-Peter

Lutz

#4
the problem is with exiting, sometimes on Windows when the client application exits, the demon will receive an exception and exit too. On my system it has never occured again since I installed XP, and I check this feature with every build. I suspect it was only true on Windows 2000.



Give it a try! You can quickly check it out with the telnet command under Windows.



But I will look into the DLL stuff anyway.



Lutz

HPW

#5
QuoteBut I will look into the DLL stuff anyway.



QuoteIn December 7.4 will be released and the rest of the year I will just concentrate on bugfixes, a more comprehensive test-suite and review of the manual.


Any idea or date when the DLL-feature could get reality?

Only a question, so no pressure!
Hans-Peter

Lutz

#6
I got it compiled and linked some time ago but cannot get it to work yet,



Lutz

HPW

#7
When you need help with testing, let me know!

Of cource the basic function should be in place.
Hans-Peter

Lutz

#8
Thanks Hans-Peter, I will look into it again the coming week and might post the files which you use to compile as a DLL, to get some help.



Here in USA we have the long Thanksgiving / holyday weekend, which started yesterday on Thursday, so I will be not very active here on the board until Monday.



Lutz

HPW

#9
No problem!

Have a nice Thanksgiving.

We have the 1.Advent. :-)
Hans-Peter

adamss3

#10
I'd be happy to help with the testing also.

Lutz

#11
Thanks Steve, I know you have prpbably the most experience, when it comes to building newLISP on Windows. I'll give it another quick shot tomorrow Monday, because I didn't look at it since I wrote it mid October and sometimes after a while you see some obvious screwup. After that I'll pass it on to you.



Its a .c, .def and a makefile. The .c and .def files just get added to the usual files and the whole thing gets compiled with the new makefile_win32dll.



Lutz

adamss3

#12
Okay.  Just let me know.

Lutz

#13
I (sort of ;-) got the DLL stuff to work. here is a win32dll-001.tgz in the development directory. It is largely untested and has problems, but it is a start. Read the win32dll.readme first.





Lutz

adamss3

#14
Okay.  I'll download it and start to work with it.