I have been using SWI Prolog for a while and I am a little unhappy about the interpreted nature of it. When I found the qsave_program/2 I though I was in for a treat. I wasn't. Apparently SWIPL doesn't actually statically compile, even with qsave_program('foo.exe', [stand_alone(true), goal(foo(X))]).
This is what I have done:
From the GUI console, I have loaded the source file *.pl with consult/1,
I do a test and query foo(X) and get the expected result,
I submit the command qsave_program/2 as above (with real input of course),
I attempt to run the program foo.exe,
I receive a system error, outlining the execution error which states that 'libswpl.dll does not
exist' (I am running windows of course),
I rage at SWIPL.
I have noticed that libswipl.dll does exist - in the SWI Prolog program file that is! I can successfully run the program in this location, which is in the same directory as SWIPL-win.exe
I ask you: what am I missing? Do I need to do any other precompiling for SWI Prolog?
Related
I figure it may not be built to do that but I might ask.
I want to run a simple cli application and have it show the backtrace in case of error.
swipl -f test.pl -g test(X)
This runs the goal test in the program.
ERROR: -g test(X): Arguments are not sufficiently instantiated
However, it doesn't show the full backtrace. What I need to do is every time, open the GUI, type guitracer,trace, run it, etc. That shows the program can keep a backtrace.
I figure it may not be built to do that but I might ask.
Can't believe I got lost in debugger pages. As said in comments,
:- use_module(library(prolog_stack)).
is enough.
I've been trying to build a micropython for esp32-camera and I keep getting errors during the make process when building some of the drivers in the mp/ports/esp32/modules directory. The error I get is a syntax error. For example there's a file named ntptime.py in this directory and it contains a single line:
../../esp8266/modules/ntptime.py
and that results in "SyntaxError: invalid syntax"
I've programmed python for a while, but am not familiar with this concept and don't understand how it can work, but maybe it can? I'm not familiar with doing that and since it's not working when I run make, maybe there's something setup-wise that I've missed or whatever. Can anyone shed some light on this practice and explain under what circumstances this works to direct make (or the python compiler) to resolve this statement by loading the source from the directory specified in that single line of code.
Duh, can't believe I missed this: there "files" are symbolic links; I should've remembered that, but alas, I'm getting older by the minute!
Still, it doesn't answer the question as to why they weren't being recognized during make but instead throwing a SyntaxError; but I'll leave that for another day.
I open a SWI-Prolog through terminal with Swipl -s prolog_file . However, each time I add new facts to the Prolog source file and save, I have to restart SWI-Prolog on terminal to make it notice the changes.
I thought using CTRL + s on the Prolog source file is enough to let SWI-Prolog notice the changes but it doesn't.
On windows there is a Prolog editor with compile button, when you compile the file, SWI-Prolog will notice the changes, but I'm using Kali Linux, so I'm writing on text editor.
How can I make SWI-Prolog notice the changes ?
When you get the ?- prompt, type make.
This is a built-in in SWI, it can be simulated in SICStus.
For complex projects including a lot of preprocessing and modules this feature may not work.
I am working on a prolog project and i would like to make it executable.
How can I do this?
I am using swi-prolog
Is it possible to run Google's cpplint.py from within Code::Blocks, so I can jump from one error to the next in the source code?
For those unfamiliar with cpplint.py, it's a python script that flags lines that violate the Google Style Guide. It outputs error messsages in the same format as gcc's compiler errors, so emacs for example has no trouble the error spew correctly to step from one flagged line to the next.