How to choose a programming language
[This article was originally published in my personal blog. This is a new version.]
People often ask what is the best programming language to write a chess engine. The answer is simple: “The one you know best!“. There are engines written in C++, C, Java, Delphi/Pascal, Visual Basic, Assembly, Ada, Prolog…
I suggest using a procedural programming language ( C, Pascal…) or an object oriented programming language (C++, Delphi…). Mizar is written in C.
Regardless of the language that you choose, you’ll need:
- a compiler (IDE + Debugger)
- a profiler (to understand where optimize your program)
- a control version system
From the web you can download many tutorials and a lot of source code and a lot of free compilers or IDE. Here a selection.
Compilers
C / C++
Windows
Microsoft Visual C++ 2010 Express
It, is available, free of charge, directly from Microsoft. It has a good IDE, a debugger. No profiler. No “Profile Guided Optimizations”. If you wish to create native Win32 programs, you may need to download Windows SDK here. You can download Visual C++ 2008 Express and Visual C++ 2005 Express too.
Open Watcom is a project of the open source community to maintain and enhance the Watcom C, C++, and Fortran cross compilers and tools.
Digital Mars C and C++ Compilers for Win32, Win16, DOS32 and DOS.
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.
MinGW, a contraction of “Minimalist GNU for Windows”, is a port of the GNU Compiler Collection (GCC), and GNU Binutils, for use in the development of native Microsoft Windows applications.
GNU C/C++ Compiler [Linux and MacOs too]
The GNU C compiler!
Pelles C is a complete development kit for Windows and Windows Mobile. It contains among other things an optimizing C compiler, a macro assembler, a linker, a resource compiler, a message compiler, a make utility and install builders for both Windows and Windows Mobile.
Cilk ANSI C Based Compiler [Linux and MacOs too]
Cilk is a language for multithreaded parallel programming based on ANSI C. Using Cilk, authors have developed three world-class chess programs, StarTech, *Socrates, and Cilkchess!
Cygwin is a Linux-like environment for Windows. It consists of two parts: 1) a DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality; 2) a collection of tools which provide Linux look and feel. The Cygwin DLL currently works with all recent, commercially released x86 32 bit and 64 bit versions of Windows, with the exception of Windows CE.
This is a C compiler that generates Win32 GUI and console applications. It comes with its own linker, IDE, debugger, resource editor and resource compiler. It is free only for non-commercial use.
Linux
It is a version of the Open64 compiler suite tuned for AMD processors.
The Intel® C++ Compiler Professional Edition for Linux is available for free non-commercial download. Read the terms of non-commercial software development.
Open64 comprises optimizing compilers for C, C++, and Fortran 90/95 for Intel Itanium systems running Linux. The compiler is the successor to the SGI Pro64 compiler suite, now released under the GNU GPL.
Compaq C Version 6.2 for Linux Alpha is available for immediate download upon acceptance of license terms and filling out an online registration form. In addition to the compiler, the kit includes the Compaq Portable Math Library (CPML) and the ladebug debugger ported from Tru64™ UNIX®. Documentation includes man pages, a Language Reference Manual, and a Programmers Guide.
MacOs
Xcode is as a complete, full-featured IDE for building Mac and iPhone apps.
Basic
Microsoft Visual Basic 2010 Express
It, is available, free of charge, directly from Microsoft. Visual Basic language is an object oriented language that has very little resemblance with the original BASIC language. Express version lacks some of the features of the full (commercial) version included in Microsoft Studio 2010, but it is fully functional and can be used to create complete computer programs for Windows. You can download Visual Basic 2008 Express and Visual Basic 2005 Express too.
XBLite – xbasic BASIC lite compiler
XBLite is a concise, simple, powerful, Windows programming language which combines the speed of C with the ease of a BASIC syntax. The XBLite compiler is free, open-source, and published under GPL and LGPL licenses.
Gambas – Gambas Almost Means Basic
Gambas is a free development environment based on a Basic interpreter with object extensions, a bit like Visual Basic™ (but it is NOT a clone !). With Gambas, you can quickly design your program GUI with QT or GTK+, access MySQL, PostgreSQL, Firebird, ODBC and SQLite databases, pilot KDE applications with DCOP, translate your program into any language, create network applications easily, make 3D OpenGL applications, make CGI web applications, and so on…
GLBCC – GNU / Liberty Basic Compiler Collection
The GNU/Liberty Basic Compiler Collection (GLBCC) is a suite of tools designed to allow Windows and Linux users to compile Liberty Basic code to a standalone application. GLBCC uses entirely independent and entirely free libraries to generate super small and super fast executables that have no external dependency. The project originally started as a single utility to convert Liberty Basic code to C but quickly became an integrated compiler system.
Mono’s VisualBasic.NET Compiler (Mono Visual Basic Compiler)
Mono is a software platform designed to allow developers to easily create cross platform applications. It is an open source implementation of Microsoft’s .Net Framework based on the ECMA standards for Visual Basic and the Common Language Runtime. Mono currently works on Linux (both x86 and PPC), Windows, S390, with work being carried on for Strong/ARM and SPARC.
FreeBASIC is a completely free, open-source, 32-bit BASIC compiler, with syntax similar to MS-QuickBASIC, that adds new features such as pointers, unsigned data types, inline assembly, object orientation, and many others.
XBasic is a comprehensive program development environment that integrates a powerful editor, compiler, debugger, function libraries and GuiDesigner into a seamless working environment that encompasses the whole process of creating fast, efficient, reliable, portable 32-bit programs. XBasic programs can create any number of windows, each of which supports input from keyboard & mouse, and output of text & graphics. And sophisticated GUI programs are easy to develop with the interactive graphical GuiDesigner built right into the program development environment.
BCX is a small command line tool that inputs a BCX BASIC source code file and outputs a ‘C’ source code file which can be compiled with many C or C++ compilers.Using BCX and a C compiler enables you to produce powerful 32-bit native code Windows console mode programs, windows GUI applications, and Dynamic Link Libraries (DLL’s) without having to incur the costs of an expensive commercial BASIC compiler. The programs that you create will be among the smallest and fastest 32 bit executable programs around, requiring no additional distributed runtime modules.
Pascal / Delphi
Bloodshed Dev-Pascal Pascal Compiler
Dev-Pascal is a full-featured integrated development environment (IDE), which is able to create Windows or console-based Pascal programs using the Free Pascal or GNU Pascal compilers. It can also handle the Insight Debugger.
The GNU Pascal Compiler (GPC) is, as the name says, the Pascal compiler of the GNU family.
It is the Pascal source of a public-domain Pascal compiler and interpreter, the P4 compiler and interpreter. It is coded entirely in Pascal, and produces a high-level so-called intermediate code as output. The program ‘pint’ is an assembler and interpreter for this language.
Vector Pascal is a language targeted at SIMD instruction-sets such as the MMX and the AMD 3d Now. It currently supports the 486, the AMD Opteron 64 bit processor, the Opteron compiler supports multi-core parallelism, the Pentium, the Athlon, the Sony Playstation 2 Emotion Engine.
Free Pascal (formerly FPK Pascal) Compiler
Free Pascal (aka FPK Pascal) is a 32 and 64 bit professional Pascal compiler. It is available for different processors: Intel x86, Amd64/x86_64, PowerPC, PowerPC64, Sparc, ARM. The discontinued 1.0 version also supports the Motorola 680×0. The following operating systems are supported: Linux, FreeBSD, Haiku, Mac OS X/Darwin, DOS, Win32, Win64, WinCE, OS/2, Netware (libc and classic) and MorphOS.