ArticleslgStudy

computer science

PureBasic

PureBasic is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand PureBasic rather than just read about it. In short: PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows, Linux, macOS and Raspberry Pi. An Amiga version is available, although it has been discontinued and some parts of it are released as open-source.

PureBasic — main illustration
PureBasic — illustration

Key takeaways

  • PureBasic belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect PureBasic to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of PureBasic from memory before moving on to harder problems.

Reference excerpt

PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows, Linux, macOS and Raspberry Pi. An Amiga version is available, although it has been discontinued and some parts of it are released as open-source. The first public release of PureBasic for Windows was on 17 December 2000. It has been continually updated ever since. PureBasic has a "lifetime license model". As cited on the website, the first PureBasic user (who registered in 1998) still has free access to new updates and this is not going to change. PureBasic compiles directly to IA-32, x86-64, arm32 and arm64, PowerPC or 680x0 instruction sets, generating small standalone executables and DLLs which need no runtime libraries beyond the standard system libraries. Programs developed without using the platform-specific application programming interfaces (APIs) can be built easily from the same source file with little or no modification. PureBasic supports inline assembly, allowing the developer to include FASM assembler commands within PureBasic source code, while using the variables declared in PureBasic source code, enabling experienced programmers to improve the speed of speed-critical sections of code. PureBasic supports and has integrated the OGRE 3D Environment. Other 3D environments such as the Irrlicht Engine are unofficially supported. Since version 6.00 (June 2022), in addition to compilation using ASM, PureBasic offers compilation with a C backend. This enables access to new platforms (e.g. Raspberry) and should make it easier to add new libraries in the future.

Programming language

Characteristics PureBasic is a native cross platform 32 bit and 64 bit BASIC compiler. Currently supported systems are Windows, Linux, macOS. The AmigaOS version is legacy and open-source. The compiler produces native executables and the syntax of PureBasic is simple and straightforward, comparable to plain C without the brackets and with native unicode string handling and a large library of built-in support functions. It can compile console applications, GUI applications, and DLL files.

Hello World example The following single line of PureBasic code will create a standalone x86 executable (4.5 KiB (4,608 bytes) on Windows version) that displays a message box with the text "Hello World".

And the following variant of the same code, which instead uses an inline Windows API call with no need for declarations or other external references, will create an even smaller 2.0 KiB (2,048 bytes) standalone x86 executable for Windows.

The following is a console version of the Hello World example.

Procedural programming PureBasic is a "Second generation BASIC" language, with structured conditionals and loops, and procedure-oriented programming supported. The user is not required to use procedures, so a programmer may opt for a coding style which includes Goto, Gosub Label, and Return. Below is a sample procedure for sorting an array, although SortArray is now a built-in function of PureBasic.

Below is a sample program that displays a sizeable text editor with two menu items.

PureBasic does not escape double quotes in strings so these must be concatenated with Chr(34).

Object-oriented programming Fred, the developer of PureBasic, has stated that PureBasic will never be object oriented. However, numerous users have created object oriented support systems.

Data types Variable data type specified when you first use it (and optionally - in the future), and is separated from the name of the point. There is a set of basic types - .f, .d (float and double numbers), .b, .c, .w, .l, .q (integers - from single-byte and 8-byte), .s - strings.

Len(String) used to count the length of a string will not exceed the first null character (Chr(0)). In addition to basic types, the user can define the type of construction via

Variables can be single (actually, standard variables), dynamic array (declared using the Dim var_name.type_name (size1, size2, ... ), a linked list (List() var_name.type_name), an associative array (in new versions of language) (Map var_name.type_name())

Form Designer RAD PureBasic has its own form designer to aid in the creation of forms for applications, but other third-party solutions are also available. The original non-integrated Visual Designer was replaced with a new integrated Form Designer on 14 Feb 2013.

User community PureBasic provides an online forum for users to ask questions and share knowledge. On 17 february 2025 the English language forum had 6,484 members and contained 70,174 threads comprising 578,646 posts since 17 May 2002. Numerous code sharing sites show PureBasic is used to create tools and games in a fast and easy way, and share large amounts of open-source code.

Further reading Willoughby, Gary (2006). Purebasic: A Beginner s Guide to Computer Programming. Aardvark Global. ISBN 1-4276-0428-2. Logsdon, John. Programming 2D Scrolling Games.This book is now freely downloadable Basic Compilers: QuickBASIC, PureBasic, PowerBASIC, Blitz Basic, XBasic, Turbo Basic, Visual Basic, FutureBASIC, REALbasic, FreeBASIC. ISBN 1-155-32445-5.

References

General references Hale Ligh, Michael (2010). Malware Analysts Cookbook Tools for Thwarting Malicious Attacks. Indianapolis, IN: John Wiley & Sons Inc. p. 241. ISBN 978-0-470-61303-0. Galbreath, Nick (2002). Cryptography for Internet and database applications : developing secret and public key techniques with Java. Indianapolis, Ind.: Wiley. pp. 300. ISBN 978-0-471-21029-0. "Learning to Crack Code". Manly Daily. 25 June 2004. Georges, Philippe. "La programmation avec PureBasic". PROgrammez (141). Svoboda, Luboš (2012). Překvapivý PureBasic (Surprising PureBasic: A Czech ebook for prospective users of PureBasic). p. 89.

External links Official website Official Purebasic Forums (English) PureBasic Team Blog - Official Blog "Random thoughts on PureBasic development" Articles PureBasic - The Perfect Cross-Platform & Native Development Language (2015) Libraries and Open Source Code Archives Andre Beer's Open Source PB code archive

Illustrations

PureBasic illustration
PureBasic: PureBasic IDE 5.10
PureBasic IDE 5.10

Worked examples

Example 1 — a first encounter with PureBasic

Start with the simplest possible case. Write down what PureBasic claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to PureBasic before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about PureBasic ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of PureBasic

In research
PureBasic appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses PureBasic in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
PureBasic is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1998 software, BASIC compilers, BASIC programming language family, so understanding it makes those chapters shorter.
In everyday life
Look for PureBasic outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study PureBasic in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what PureBasic means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain PureBasic out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is PureBasic in simple terms?

PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows, Linux, macOS and Raspberry Pi. An Amiga version is available, although it has been discontinued and some parts of i…

Why does PureBasic matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study PureBasic?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on PureBasic.

Tags

  • 1998 software
  • BASIC compilers
  • BASIC programming language family
  • High-level programming languages
  • Integrated development environments
  • Linux integrated development environments
  • MacOS programming tools
  • Procedural programming languages
  • Programming languages
  • Programming languages created in 1998
  • User interface builders
  • Windows integrated development environments

Keep exploring