load and large applications

Started by jeremyc, December 07, 2006, 11:18:34 AM

Previous topic - Next topic

jeremyc

I have an app that I will separate into many source files (20 or so). How do you deal with load? I believe this is the only way to include multiple source files in a given program? The problem is complicated further by multiple machines that the code is run on. i.e.



(load "/Users/jeremy/lisp/filea.lsp")


on one machine, but on another it should be:



(load "/Users/ips/development/lisp/filea.lsp")


Now, I can put them in say, /usr/local/share/mycompany/lisp and have that common load but then every time I make a change to filea.lsp, I would have to sudo cp filea.lsp /usr/local/share/mycompany/lisp, etc...



Any thoughts? These included files will be used in many utilities in a few different projects, so it does not make sense to include them in the same dir as the utility.



Jeremy

Lutz

#1
This problem can be solved using /usr/share/newlisp/init.lsp . newLISP looks for this file on startup. In there you define:


; init.lsp - newLISP startup file

(constant 'loadpath "/usr/home/jeremy/development")


On each machine you have a different init.lsp. No in your program:


; myprog.lsp

(load (append loadpath "filea.lsp"))


There is also the following method using the http-mode of 'load' (version 9.0 or later):


(load "http://192.168.0.1:8080/modules/filea.lsp")

This is just an example of course you could put any other URL. You could put all modules on a central server. You don't even need an extra webserver, but could do on the 192.168.0.1 machine when using 9.0 or later.
newlisp -c -d 8080
; or better
nohup newlisp -c -d 8080 &


In this mode the newlisp can receive (load "http://...") requests. Since 9.0.7 you also can specify a working directory.



I assume that you works on UNIX in this case ley newlisp be started by the machines inetd or xinetd service. This has the advantage that the machine canhandle mutiple load requests at the same time.



Read more about distributed computing with newLISP here:

http://newlisp.org/CodePatterns.html#distributed">http://newlisp.org/CodePatterns.html#distributed



Lutz



ps: in the future move this type of questions to the "newLISP for Win" or "newLISP for Unix" topic. We use the "news" topic for news and everything related to documentation.

jeremyc

#2
Quote from: "Lutz"Tps: in the future move this type of questions to the "newLISP for Win" or "newLISP for Unix" topic. We use the "news" topic for news and everything related to documentation.


I was confused about that. The topic description for newLISP newS says: "News, releases, newLISP talk in general." ..  The "newLISP talk in general" was what confused me, thus making me post here.



However, the question I asked applies to both Unix and Win32 development, it's not specific to either. In fact, one of the people who work with me is on Win32 and will be dealing with the same problem. For me, I am on Mac, but really, the software will be put into production on Linux. All three flavors will share the same problem.



It seems that there should be 1 more forum created, "General newLISP programming" or something?



Jeremy

Lutz

#3
Yes, we have renamed topics several times, because many are confused where to post what ;).



I would say in your case post in the last group, or in any of the machine specific groups if it doesn't matter.



But talking about your last topic, this and the last year I was involved in a distributed application running newlisp on several dozens of OpenBSD nodes. During that time many features have been added to newLISP making it easier to program distributed applications and development in programming teams. The current development versions continue this trend, but most of the stuff has already been available in 9.0.



Lutz