Did you know ... | Search Documentation: |
Pack logtalk -- logtalk-3.85.0/QUICK_START.md |
This file is part of Logtalk https://logtalk.org/ SPDX-FileCopyrightText: 1998-2024 Paulo Moura <pmoura@logtalk.org> SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Install Logtalk by using either the installer provided for your operating-system or by following the manual installation instructions in the INSTALL.md file. An alternative to installing Logtalk (and backend and tools dependencies) locally in your system is to use one of the Docker images available from the Docker Hub.
On POSIX operating-systems, the following shell scripts are installed by default for running Logtalk with the supported backend Prolog compilers (which must be installed and up-to-date before running these scripts):
bplgt
(experimental)ciaolgt
(experimental; first run may require sudo
)cxlgt
eclipselgt
gplgt
jiplgt
(first run may require sudo
)quintuslgt
(experimental)sicstuslgt
swilgt
taulgt
tplgt
xsblgt
(first run may require sudo
)xvmlgt
yaplgt
Man pages for all scripts are also provided on POSIX systems. HTML versions
of the man pages are available in the Logtalk website.
On macOS systems, `/opt/local/bin` must be in your PATH to run the scripts when using the provided installer. Terminal command files for running Logtalk with selected backend Prolog compilers are also available on the Logtalk installation folder (by default, `/opt/local/share/logtalk/scripts/macos/command_files`). For easy access, the installer creates an alias to the Logtalk folder in the Applications folder.
On Windows systems, shortcuts for running Logtalk with selected backend
Prolog compilers are created on the `Start Menu/Programs/Logtalk menu.
The first run of the JIProlog and XSB integration shortcuts may require
administrator privileges depending on the JIProlog and XSB installation
(right-click on the shortcut and select the "Run as administrator" option).
PowerShell versions of the scripts listed above are also available (e.g.
gplgt.ps1`). PowerShell 7.3 or later version is required for running
these scripts.
If you get an unexpected failure when using one of the Prolog integration
scripts or shortcuts, consult the adapters/NOTES.md
file in the Logtalk installation folder for compatibility notes. For the
integration scripts, see also the integration script man
page.
For a quick overview of some of the main Logtalk concepts, see the at Learn X in Y minutes Where X=Logtalk tutorial. See also the bundled Handbook by opening the `~/logtalk/manuals/index.html` file with a web browser (the `~/logtalk` directory is created when you run Logtalk for the first time). The Installing Logtalk and Writing and running applications sections in the User Manual will provide you with a basic understanding of how to start Logtalk as well as how to compile and load Logtalk code.
Start Logtalk and call the goal {help(loader)}
followed by `help::help`.
This will provide you with an overview on how to get help and how to load
and debug your code.
Start Logtalk and call the goal {tutor(loader)}
. The tutor
tool will
augment compiler errors and warnings with explanations and suggestions on
how to solve the reported problems.
From within a source file, use the goal `logtalk_load(<name>(loader))`. For
example, logtalk_load(optionals(loader))
. At the top-level interpreter, a
`{<name>(loader)} shortcut is available. For example,
{debugger(loader)
}`.
You may now try some examples. The examples/NOTES.md file contains a brief description of each example. The learning guide includes a suggested walkthrough.
NOTES.md
file for a description of the example.SCRIPT.txt
file for instructions on how to load the example
and for sample queries that you may try by copying-and-pasting them to
your Prolog interpreter top-level.Ready to start writing your own programs?
coding
](coding) directory. There you will find
syntax support files for popular text editors which enable syntax coloring
and other text services when editing Logtalk source files. There's also
support for syntax highlighters used for publishing source code and for
source code versioning systems.tools
](tools) directory contains a comprehensive set of developer
tools to help you test, debug, analyze, and document your applications.settings-sample.lgt
](settings-sample.lgt) file to
settings.lgt
, and modify it to preload developer tools (e.g. the help
and debugger
tools), to define library aliases for your applications, to
define default compiler flags, and more (see the comments in the file itself
and the CUSTOMIZE.md file for details).loader-sample.lgt
](loader-sample.lgt)
file, rename it to loader.lgt
, and modify it to load your application source
files. You may also copy the [tester-sample.lgt
](tester-sample.lgt) and
[tests-sample.lgt
](tests-sample.lgt) files, renaming them to tester.lgt
and tests.lgt
, and editing them to define and run your application unit tests.