📜 ⬆️ ⬇️

PureBasic programming language

I know that now everyone is writing on the pros, on the sharps, etc. But I want to draw your attention to an interesting programming language - PureBasic. This language will be useful both for beginners in programming (since the syntax of the language is very easy), and for advanced programmers (due to the great possibilities of this language).

This article does not pretend to be a manual for this language, but I hope that you at least take one look at PureBasic and will not frown on the word "BASIC".

The main advantages of this language are the very small size of the programs and the absence of the need to “carry along” additional DLLs. Let me explain that PureBasic translates all code into assembler (FASM). FASM creates an object file ( * .obj ), and then the PureBasic linker builds an EXE or DLL. Therefore, in PureBasic, you can use assembler inserts in FASM format.
')
By the way, PureBasic is available for Windows 98/2000 / XP / Vista / 7/8, Linux, MacOS and AmigaOS.

Download PureBasic from the official site . A demo version is available there (the main limitations of the demo version: the lack of direct access to the OS API, the impossibility of compiling DLLs and programs with more than 800 lines of code). However, there are activated versions on the rutracker, so we’ll leave this question.

When reviewing programming languages, they usually start with the “Hello world!” Program. Well, let's start and we:

MessageRequester("PureBasic","Hello world!")

Here is the result of this program:
image
The size of the program is only 4087 bytes!

The language contains all functions for working with windows, files, console, memory, date, etc. If the built-in functions are not enough, the OS API will come to the rescue. The OS API functions in PureBasic are called as follows:

The name of the OS API function _ (parameters)

Redo our first program on the Windows API:

MessageBox_(0, "Hello world!", "PureBasic", 0)

Also, the language functionality can be extended with the help of user libraries (User Library) . Many libraries have already been created, but most of them work only with older versions of the compiler. But some of them are constantly evolving and working under new versions of the compiler: PBOSL and Droopy — many different functions, XP_Menu_Lib — creating menus with Office 2003, Windows XP, PB_IO styles — designed for direct access to computer ports (in Windows NT, direct access to ports blocked), and many others.

Well, offhand a couple of programs written in PureBasic:


I hope that the article somehow helped someone.

Source: https://habr.com/ru/post/176123/


All Articles