Replies: 4 comments 4 replies
-
|
For deploying (but not developing) your application, the Logtalk pack for SWI-Prolog can be handy. That allows loading Logtalk on demand using the goal An alternative, at least for the final user, would be to embed Logtalk and the Logtalk code in the application. See the embedding guide for details. At the end of the guide, there are links to embedding scripts that should be useful in creating a |
Beta Was this translation helpful? Give feedback.
-
|
P.S. For your use case A), using the swipl_logtalk_qlf.sh shell script to generate a |
Beta Was this translation helpful? Give feedback.
-
|
Hi Paulo, now I've read the embedded tutorial and set up a little Powershell script to do the things suggested in the tutorial: collecting the *.pl files, cat them, take the adapter file, path_core and core, cat them and put them at the end in one pl file. So far so good.
Thats it. The last two lines want to set the working directory. So if I do all the steps and try running the resulting main.pl (as I called it), no error but the server don't run. If I query "server(3000)" it says unknown procedure server/1 ( but this is defined in psm_server.pl and therefore should not be unknown) . If I use Logtalk_load(psm_logic(loader), [clean(off)] to get the loaderlgt.pl, then when running main.pl with SWI the message is "there is now library os". However, in fact I haven't understand some things. When doing that stuff given in the embedding tutorial, where is the entry point in my application if a) a SWI Prolog file ist the "main" or b) if a Logtalk module is the "main"). Do I use the :- initialization/1 or /2 directive... What does a loader file really do? If I do clean(on) then there is no loaderlgtpl, then how the libraries are loaded and the application started? You see, although the tutorial is written well, but I have some missing pieces in understanding about what's happening the way from mixed Logtalk SWI prolog sources, compiling, library loading on runtime up to the point where the first predicate of my application is executed. Cheers Hans |
Beta Was this translation helpful? Give feedback.
-
|
After a nice and productive video-chat, we found that the main issue was the application loader files being included in the embedded application. The |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m bothered with organizing my SWI Prolog/Logtalk sources with respect to the needs of my colleagues. (System is always Win10)
So lets begin the story. We have 3 types of colleagues:
All sources are in some Gitlab.
I know that Logtalk can compile into Prolog sources. Some possible use cases then would be:
A) from the Logtalk programmer: compile all sources into SWI Prolog, check in. The Prolog programmer checks out and runs application with SWI Prolog. Problem: as far as I understand, SWI Prolog need to know where the adapter file swi.pl is or get this somehow, respectively.
B) From the Logtalk programmer: compile all sources into SWI Prolog. Do from this with „saved_state“ od SWI Prolog a stand-alone running *.exe and checks in. The User checks out the *.exe and uses the application.
As far as I understand, in principle all Use Case should not be a problem in principle. But how to tell give the SWI.pl adapter file to the Prolog programmer who has no Logtalk on the machine. Do you think the best would be some batch for compilation which also takes the adapter file to the sources?
Assume the Logtalk app uses all kind of stuff: objects, protocols but also SWI Prolog pure source files.
Any hint for a good organization of code would be very welcomed :)
Cheers
Hans
Beta Was this translation helpful? Give feedback.
All reactions