Learning "The Art of Prolog" - prolog

To those of you familiar with "The Art of Prolog", which software tools (e.g. IDEs, editors, compilers, etc.) would you suggest for following the book?

SWI-Prolog is a free Prolog implementation that comes with an integrated editor (an Emacs clone written in Prolog) and graphical debugger and profiler.

If you decide to go for SWI-Prolog, I would suggest to use PDT (The Prolog Development Tool), that is a Prolog IDE. It also works for the multi-paradigm language Logtalk that uses Prolog implementation as back end compilers.
You can find PDT here

Related

SWI-Prolog Editor for OS X

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.

Good IDE to get started with prolog [closed]

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/

Mac OS System 1.0 Programming Language

I started my early days programming in a Macintosh 128k (I was 10) and I don't quite remember the programming languages used. Any one does?
I would like to know the different programming languages available at that time for that platform.
Thanks
Development was originally carried on the Lisa, using Pascal and assembler. Some time later native development environments started to appear for the Mac, e.g. TMS Pascal, MacPascal, Microsoft BASIC, MDS, and later, MPW, Think C, Think Pascal, CodeWarrior, etc.
Pascal was the original language for Mac OS programming, and all the documentation and APIs used Pascal, but there was a gradual migration towards C through the 1980s.
I expect Macintosh Programmers Workbench (MPW) which was a "worksheet" environment, mainly driven on the command line, used Makefiles - not dissimilar to Unix development, using Pascal as the main language.
I don't remember if Hypercard was available that early but that's another possibility.

What language is the compiler of Go programming language written in?

I think the title is self explanatory.
Programming languages aren't programs, hence they're not "written" in any language. They are often described by formal grammars (e.g. BNF).
Interpreters and compilers for programming languages are programs and so must be written in some kind of programming language.
Go has at least two compilers, gc and gccgo. The former was written in C, but is now written in Go itself. While the latter is a gcc frontend written mainly in C++. Go's libraries are written in Go.
Look at the source and C for yourself, if I may say.
EDIT The Go team announced in December 2013 that they will be transitioning the compiler to Go. As of February 2015, the compiler is exclusively self-hosting, as the C implementation was deleted. The new compiler shipped for the first time with Go 1.5.
It's written in C. The libraries are written in Go itself.
Edit: Now the compiler has been rewritten in Go, so it is fully self-hosting.
"go compiler written in go and little of assembly"
"but gccgo is written in c c++ and go"
Rob Pike

Windows IDE / editor for a beginner

I'm teaching (or trying to teach) computer programming to a grad-student. Her previous experience amounts to little more than writing spreadsheet formulae. Which IDE or text editor should I recommend?
Please bear in mind that:
I only meet my student about once a week.
She uses Windows and I use Linux.
She doesn't have a community of users on hand.
She doesn't have much money to spend.
Edit: The languages she's learning at the moment are Perl and R. (Sorry ... for forgetting to mention them earlier.)
Edit: Thanks for all your answers!
The most highly recommended editors are jEdit and Notepad++.
If I can find a way to give my student adequate support for Notepad++ (e.g. by running it under Wine) or if I think that she can manage without support from me, then I'll recommend that. If not, I'll go for jEdit.
Apologies, once again, to those who saw the question before I got around to listing the languages that I'm teaching.
The Visual Studio Express products are all free. Unless the fact that you're using Linux changes things :)
Start off simple. Do not not scare her with an IDE! They are overwhelming at first and are not core to developing software. I learnt rudimentary Java with Crimson Editor.
If I started again I'd probably go for Notepad++.
Eclipse might be a good option (if a little overwhelming at first).
You obviously need to look at a cross-platform IDE. Eclipse is one of the best in this regard, as well as having support for many languages. It also comes with a good set of tutorials.
Since you didn't mention what programming language (guess it doesn't matter) you were teaching, I'll stick to something that supports multiple programming languages and multiple platforms. Given your situation, I would use jEdit (http://www.jedit.org).
jEdit is a programmer's text editor with hundreds of plugins, auto indent, and syntax highlighting for more than 130 languages and since it's written in Java, it runs beautifully on Linux, Windows or MAC. Hope this helps.
The best, most documented, IDE that is free in my opinion is Visual Studio Express. There are tons of blogs, howtos, videos, training, etc. You can find more information about them here:
http://www.microsoft.com/Express/
Also, if you are a student, Microsoft provides an entire stack of software free to students just for this purpose. This is through a program called DreamSpark. Included is an operating system, the professional version of the IDE, SQL Server, XNA Game studio and Expression. Any student can get this. More information is here:
https://downloads.channel8.msdn.com/
Hope that helps.
I have used Notepad++]1 a lot for various editing tasks, and I find it quite useful and competent.
Depends on the programming language. FoR C/C++ and anything .net Visual Studio is the way to go. The Express edition is free.
Eclipse or Jedit, if Eclipse is too complicated. jEdit is cross platform, free and supports a number of different languages.
Crimson Editor is also very nice; it's similar to Edit Plus. Syntax highlighting, tabs, etc.
Notepad++ for editing is awesome to me: it's Windows only, but maybe you can use it with Wine under Linux. But if you want someting more like an IDE, then Eclipse, or NetBean (both use java) can be very useful, although they are very resource expensive on old PC.
My suggestion is Textpad. You can teach her javascript, all the basic, and some advanced concepts are there. It's fun for the student see the output in a browser, and you can even teach a little HTML if the mood strikes.
Komodo Edit from active vision is free, open source, and available for Windows and Linux. Very nice features.
Otherwise, Emacs as it is available on both platforms and can be configured for CUA controls.
The Cream version of VIM is also a good option.
It really depends on the language you are teaching her.
EditPlus is a good simple editor. Free trial version and pretty cheap license.
Dev-C++ as a non-MS alternative.
Quote: "Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as it's compiler. Dev-C++ can also be used in combination with Cygwin or any other GCC based compiler."
Code::Blocks is also another good one, free and cross platform. Unless you need something for using VB / C# or other .NET languages as it is mostly C/C++. For the .NET languages on linux I would recommed MonoDevelop
Aptana is very handy for web-oriented programming.
http://www.aptana.com
That depends at least in part on the programming language you intend to teach her. That said, you might want to take a look at Eclipse. Though it started primarily as a Java IDE, it's been extended via plugins to support many others (including C/C++, Flex, Haskell, and ColdFusion, to name a few), and can fairly easily be adapted to a new language if support isn't already out there.
Add to that the fact that the IDE is cross-platform so you can both use the same tool on your platforms of choice, and it looks like this might be a good fit.
I'd recommend SciTE, as it's both available for *nix and Windows and free (as in beer). It supports pretty much anything you'd expect from a decent editor and, if she goes on to use it, quite customizable. It also isn't too complex, so it should be easy for her to get going with it.
+1 to the Notepad++ suggestion - Anything I do that's not .Net-related I do in that.
For Java, BlueJ is an excellent teaching IDE. It doesn't confuse the new student with a lot of advanced functionality (stuff they won't use for years to come). Eclipse is a great IDE, but there is a LOT of stuff there they could drown in. The same is true for Visual Studio, but I don't know of a simpler IDE for .NET languages.
You may also consider Ruby with Scite as a teaching option. The IDE isn't that fancy, but along with the ease-of-startup of learning Ruby this could work very well. Ruby certainly has some advantages over Java/C#/C++ for the beginning student (mostly in that you don't have to create a full class with a main method just to get a program running).
For the easy to teach Component Pascal language (a successor to Niklaus Wirth's Pascal and Oberon) try the free, open source BlackBox IDE and the book Computing Fundamentals by Stan Warford.
Regards,
tamberg
If you are writing software targeted at a Windows platform then Visual Studio is more or less the standard IDE. Since you are teaching a graduate student I would recommend getting the academic license for the professional edition if they are going to be writing a lot of software, otherwise the express editions should be enough for leaning purposes.
In terms of text editors, the one that I currently use the most is Notepad++ which is free, open source, and support a wide variety of features that are useful to software development. There are also also a number of useful plug-ins available for it as well.
I can't believe nobody has mentioned vi. I'll argue that the less your tool does for you in the beginning the better coder you'll be in the end. For a newbie, give them syntax highlighting and some helpers for dealing with blocks and lines. Something like vi is great, emacs is also fine, or if you absolutely must be on Windows, something like notepad++ or jedit will be decent. The main point is to learn to program before you learn to let your IDE insert code that you don't understand for you.
MultiEdit
Extremely powerfull (and extensible on emacs level) text editor with many IDE features (integration with compilers/debuggers etc). Beats all other suggested editors on every aspect.
Much easier to learn and use than editors with UNIX/terminal roots like vi or Emacs.
Not free (not too expensive though), and requires some learning to use effectively.
Another full blown IDE is SharpDevelop. It's OpenSource.
http://www.icsharpcode.net/OpenSource/SD/
Zeus - http://www.zeusedit.com
I have to mention PSPad.
It is very good, feature rich free editor. I have used UtraEdit and finally found free alternative in PSPad

Resources