I was searching for a SWI-Prolog editor for Mac OS X but i could not find one, so is there one or do I have to use another editor to build Prolog files?
Thanks
I do not use mac OS-X myself, but there are two very good SWI-Prolog editors that are cross-platform (thus also work on OS-X):
PDT works with the Eclipse IDE. It has good syntax coloring, an in-IDE Prolog console, a dynamically generated visualization of the call graph, to name only a few of the many features it has. See http://sewiki.iai.uni-bonn.de/research/pdt/docs/v2.1/start I believe refactoring of Prolog code is not there yet, but the developers plan to add that cool feature in the future as well.
PCE Emacs, an Emacs implementation by Jan Wielemaker that uses SWI-Prolog's graphical library XPCE. The UI elements look very Windows '95-ish, but don't be fooled by mere appearances here. PCE Emacs is completely tuned to SWI-Prolog and is probably the most versatile editor for SWI-Prolog out there. You can simply run it from within the SWI-Prolog console by typing emacs.
Hope this helps!
Assuming that you're considering not only IDEs but also text editors, the Logtalk distribution includes support for a large number of text editors that is also usable for editing Prolog source code. See https://github.com/LogtalkDotOrg/logtalk3/tree/master/coding for a list of all supported text editors.
I use OS X and work in Emacs with prolog-mode.
This version has all the features one would expect, including syntax highlighting, auto indent, and full interaction with an inferior Prolog process. The mode supports in principle any Prolog system, though it is primarily maintained with SWI Prolog in mind.
It lacks many of the features of PCE Emacs, but has all of the features of GNU Emacs, and I'm pretty happy with it.
Related
I have xQuartz installed as I use VSCode to code with c++. I am a bloody beginner and have absolutely no clue how to use SWI Prolog with the built in editor on my Mac. Or VSCode as an editor.
None of the questions posted here previously help me as I don't understand any of the instructions given.
Could someone tell me what to do in the easiest way possible? I have never used the terminal to install things so should you give me instructions, make these fool proof.
I got as far as downloading SWI Prolog from the website and dragging it into my applications folder. It opens as seen here. What else do I need to do? I would ideally have the same editor that is being used here
Page https://www.swi-prolog.org/IDE.html says:
SWI-Prolog Editor (Windows)
Gerhard Röhner has developed an integrated Prolog editor in MS-Windows following the conventions of this platform. The embedded SWI-Prolog provides functionality similar to swipl-win.exe, including the possibility to run XPCE GUI programs.
And the linked website has this image:
That suggests there is no macOS version of the program you want to run, and you would need a way to run Windows software on a Mac.
On Windows, I get "Prolog" and "SWI Prolog" as different menu items, and SWI Prolog gives me the same kind of terminal screen you see, but "Prolog" gives me a GUI editor environment. Quite plain, but more features than the terminal. Maybe there is similar on your Mac install?
https://swish.swi-prolog.org/ is an online editor for SWI Prolog which is good for testing small code.
I have to understand an existing code in prolog which is written for win-prolog 4.800, and then build my work on that. The problem is the ide supplied along with win-prolog is very clumsy. I searched internet, but did not find better substitue for that. So i want someway (ide or something) that lets me
Understand (trace through) the code. Atleast, something like ctags will be helpful.
Have proper syntax color highlighting facility.
Have some sort of debugger if possible.
Have some interface where i can readily fire predicates and see output.
Note:- I can use Vim, if it is configurable for Win-prolog. Please let me know if using the default ide supplied along with win-prolog is the only best available way and you too could not discover better way.
Unless the existing code is very simple, it's quite likely that it will contain e.g. calls to WinProlog proprietary predicates and use WinProlog proprietary control constructs, not to mention syntax differences between WinProlog and de facto and official Prolog standards. Thus, it's unlikely that you will be able to use a Prolog implementation other than WinProlog to debug and trace through the code.
For syntax highlight, you have plenty of choices besides Vim. Several other text editors either include support for Prolog syntax highlighting or some plug-in is available that provide that service. See the Prolog FAQ for more information.
Likely only after porting the code or making it portable to other Prolog implementations you will be able to use IDEs written for those Prolog implementations. If that's not your goal, you're likely restricted to IDE provided by WinProlog.
I'm looking for an OS X editor (preferably a dedicated Forth editor, but I doubt it exists) that has/can be customized to change the font color of Forth variables, programs, etc. If not, is there any sort of workaround?
I know it's an old question, but: atom with the forth-language package. See http://atom.io/
Longer answer:
I have tried both emacs and atom on Mac OS X and both are more than adequate for editing Forth. Atom is lighter and easier to learn while maintaining many emacs-ish capabilities (cmd-shift-p in place of meta-x).
I don't have automatic indenting working in atom yet, the syntax package I found needs a little work, but this hasn't been a real problem as yet.
atom also plays well with git.
I'm using the following packages: emacs-plus, language-forth, clipboard-plus, disable-arrow-keys. The key and clipboard are for a more emacs like experience. There are more themes and color schemes than I need available, I'm using the 4-color-dark and minimal-syntax themes.
UltraEdit has a Forth syntax highlight mode. MicroProcessor Engineering have an up to date copy in there downloads page.
Look no further !!
I'm currently programming in FORTH using the 'Visual Studio Code; editor.
Has (installable) syntax-highlighting for many languages, including FORTH.
Have a try:
https://code.visualstudio.com/download
It has even automatic indenting, AND code folding!!
...and let me know if you like it like I do.
Robbert / PA3BKL
I would suggest Gedit and if you change the forth.lang in the app you can change the syntax highlighting
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I need to start learning Prolog for my job.
I haven't used Prolog before and my company needs to build a program that will use Prolog.
So the program will be used commercially.
So some questions:
1) Does Prolog use a compiler to compile the programs. Like gcc does for c?
2) Is there commercial standard of Prolog? I have only heard of SWI Prolog.
3) I have been using GNU Emacs with Linux for many years. I am thinking of using the Prolog.el package? Any comments on that?
Many thanks for any answers,
The most elaborate Prolog IDE I'm familiar with is the Eclipse-based IDE for Amzi! Prolog. This is a commercial product, but the IDE can be downloaded and used for free in the Student Edition. It might be ideal for a beginning Prolog programmer. Disclaimer: I may be biased because I supply a lot of free advice at Amzi!'s support forum. I think there's an open source Eclipse plugin that supports some of the open source Prolog implementations as well. Update (May, 2016) Amzi! Prolog v. 10 has now become open source using an MIT-like license.
Although SWI-Prolog is open source (GPL), it is possible to develop commercial applications with it, as with several other open source Prolog implementations like GNU Prolog and YAP. Besides Amzi! Prolog there are several other commercial products. Visual Prolog is different enough from the ISO standard for Prolog that most Prolog programmers do not consider it "real prolog". SICStus Prolog is an ISO compliant commercial Prolog implementation. There are some others that are Prolog-like but with substantial extensions, such as ECLiPSe (not to be confused with the IDE) and Mercury. A number of commercial implementations of Prolog have become obsolete over the years, as when IF Prolog was superseded by MINERVA. Here's a list of implementations from 2006.
I know many programmers who speak highly of the Prolog mode for GNU EMACS. However I'd think a beginner would benefit from an integrated debugger/editor such as Amzi! Prolog offers. SWI-Prolog has a graphical IDE under construction based on XPCE, which is the graphical interface library SWI-Prolog has chosen for cross-platform development. Almost all programmer editors will supply syntax highlighting for Prolog, with the right definitions file installed.
SICStus Prolog has an IDE based on Eclipse. The SICStus IDE has many advanced features not found in competing products, free or commercial. Among other things it detects syntax errors and other common mistakes as you type, which can be especially valuable for a beginner.
SICStus also has an Emacs mode but it does not offer all of the functionality of the Eclipse-based IDE.
You can download an evaluation of SICStus Prolog from the home page.
I am biased, I am one of the SICStus Prolog developers and the developer of the SICStus Prolog IDE.
You can generally compile your prolog project. However, depending on the prolog environment you are using, it might be an intermediate code and not directly executable code.
SWI Prolog and Sicstus prolog both allow to generate an executable of this form (embedding the interpreter along with you compiled intermediate code).
Other prologs like Arity Prolog/32 compiles directly to an x86 executable. There is a page on Wikipedia that compares various prolog systems.
There is an ISO standard for prolog. However almost every prolog system will be mostly compatible with each other, requiring minor changes to port the code from one prolog system to another.
In addition to what gusbro already said: SWI-Prolog is, I think, the best Prolog for learning. It may not be the fastest implementation, but is has quite a few bells & whistles such as command line editing and a built-in Emacs-like editor, it's free software and it's easy to install on both Windows and Linux (and Mac OS X, too, I reckon). It's implemented as a bytecode compiler for a virtual machine, like most Prologs; even the ones that produce native code often use a virtual machine at some point.
The basics of Prolog are much the same among implementations; non-standard extensions such as extra libraries, OS interfaces, constraint programming etc. tend to be a little different.
Various Prolog-Java and Prolog-C# interfaces interfaces exist. SWI has extensions that allow it to function as a web server.
I'm using the swi-prolog built in ide for commercial development.
Depending on your os, you might need to start with swipl-win.exe or xpce
to get the graphic environment
I am using an eclipse IDE plug-in called PDT. The installation is fairly easy and I think it is a nice environment. After installation, you can follow the instructions at the "getting started page" to finish your installation and get you up and running.
if you are used to work in an emacs environment you should try using the Ciao distribution. It has many interesting and powerful features, libraries, and is also GNU LGPL license. Highly documented and supported.
Go to http://ciaohome.org/
What is your Mac OS X (Intel) based lisp setup (of any dialect), how do you like it, and how painful was it to set up? I'm looking for a versatile lisp that is easy to set up, but if you feel strongly about investing more effort, or even money, I would like to hear why you think it's worth it.
I am currently using newLisp, which was a breeze to set up and gives me simple access to things like graphics and sound. I have heard of SBCL with emacs and slime, but that seems a real pain to set up, and I'm still not friends with emacs. I want to see if there's anything I'm missing out on. I would primarily be using this for pleasure, with no commercial goal in mind.
Please recommend only one setup per answer to enable voting, but feel free to submit multiple answers.
Ready Lisp:
Ready Lisp is a binding together of several popular Common Lisp packages especially for Mac OS X, including: Aquamacs, SBCL and SLIME. Once downloaded, you’ll have a single application bundle which you can double-click – and find yourself in a fully configured Common Lisp REPL.
It’s ideal for OS X users who want to try out the beauty of Common Lisp with a minimum of hassle. It could also be used by teachers to give their Mac students a free, complete Common Lisp environment to take home with them.
The best Lisp for Mac OS X is LispWorks. It is commercial though. Installation is done with an installer in a few seconds. It is started then with a double-click from the programs folder. It has a Cocoa-Bridge and the user interface is written with it, but based on a portable substrate - so the same development environment is available for Windows and Unix/Linux/FreeBSD.
I suppose it depends on what you mean by "setup". Clozure CL (previously Open MCL) has an experimental Cocoa bridge, and you can even build a smallish IDE as well (just fire it up and do a (require "COCOA-APPLICATION") and it'll build the .app bundle for you). I use vim myself, but you're free to use whatever editor you like (+ Interface Builder), of course. CCL supports Emacs+Slime, but does not require it.
Try PLT Scheme. It is mature, has lot of libraries and comes with an IDE.
Gambit scheme is a "complete, portable, efficient and reliable implementation of the Scheme programming language":
Gambit consists of two main programs: gsi, the Gambit Scheme interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains the complete execution and debugging environment. The compiler is the interpreter extended with the capability of generating executable files. The compiler can produce standalone executables or compiled modules which can be loaded at run time.
The Gambit compiler allows Scheme to be compiled to C, with some pretty cool applications, like writing an iPhone app in Scheme (with a REPL for remote debugging).
There is a FFI for Gambit so you can use external C libraries.
There is an installer or you can install via MacPorts.
You could install guile. I'd use fink.
That is easy, but it gives you a fairly lightweight scheme installation.
General Comments
Most lisps are not that hard to set up on OS X if you're used to working on the command line, though some are harder than others. I think the hardest to set up are CMUCL and Clozure; if memory serves, you need to make a symbolic link into a directory on your path if you don't want to run them from their respective directories (they don't install an executable into /usr/local/bin on installation). In any case, you'll put more work into getting Slime going in Emacs than you will actually installing a lisp. New Lisp is an easy install from the OS X gui, installed from a OS X package (making it the easiest install of all lisps except, perhaps, for PLT Scheme).
I do recommend using a some form of IDE, be it Emacs + Slime or the LispWorks or Clozure IDEs. People use other editors, but those are the ones that have been tailored most to programming in lisp. Personally, I wouldn't enjoy programming in lisp if I couldn't use Emacs + Slime, but I've put in a lot of time to learn the Emacs and Slime commands.
Implementation Recommendation
Here is a specific recommendation that is different from the others. If you are new to lisp and not too picky that it be Common Lisp, you should look at PLT Scheme. It comes with an IDE and an implementation (DrScheme and mzscheme) that can't be beat for ease of installation and use for a beginner. PLT Scheme comes with lots of extensions to Scheme that make is easier to use for more programming tasks than the other Schemes as well.
Easiest solution: (assumes you have the excellent Mac Ports installed)
Step 1:
$ sudo port install mit-scheme
Step 2:
$ scheme
Step 3:
Read Structure and Interpretation
of Computer Programs http://mitpress.mit.edu/sicp/full-text/book/book.html
Clojure is a wonderful lisp. it is truly modern lisp designed for pragmatic concurrent programming. It compiles to the JVM and can call and be called by java nativity with no wrapping and a minimum of ceremony.
clojure.org
try: XMLisp for OS X (FOSS)
3D: Open Agent Engine: scene graph based mini engine, 3D objects, animation, mouse hovering, selection, camera control, texture management
2D: controls: layout managers, buttons, sliders, text
http://code.google.com/p/xmlisp/
It is an extension of Clozure CL. IDE is included. You should be able to get this running in no time.
Alex