Skip to content
Paul Lipkowski edited this page Dec 14, 2024 · 6 revisions

Papaj (pronounced like popeye, previously RPN Calculator) is a computational program and interpreter of PapajScript.

History

The first ever piece of code was written in late March 2014 in C++ as a part of a project for Computer Science lessons. Then that project became rewritten to FreePascal in April 18, 2016, as a part of the file manager. However, the first standalone RPN Calculator was built on November 24, 2017. That 2017 program later became a base for further developments up to January 12, 2018, when the unstable development build (Leviathan) was made. Along with the console interpreter, the GUI application is also being developed. Since November 2018 (v.0.4.1), the console interpreter has its REPL.

The PapajStudio, i.e. IDE for PapajScript, is planned to be released in the future.

icon256_1
Logo of RPN Calculator (since v.0.5.0)

Releases history

Version Version Name Date of Release Improvements Lines of code
0.0.1 Bereshit 2014-04-04 First working RPN calculator (written in C++) 148
0.0.2 Shemot 2016-05-05 First working FreePascal unit 476
0.1.0 Aleph 2017-11-24 Basic version – the first standalone FreePascal-written program 287
0.2.0 Bet 2017-11-27 Improved computing power of integer values 317 (+30)
0.2.1 Gimel 2017-12-10 Unary operands 460 (+143)
0.3.0 Dalet 2018-01-12 Detect system language (GUI, Linux), fix of some bugs, first loops and stack operations 582 (+122)
0.3.1 Hey 2018-01-24 More operands (e.g. GCD, LCM, more stack operations), Danish language for GUI 880 (+298)
0.4.0 Vav 2018-04-26 Core improvements for console app, blocks of instructions, parsing script files, string and numbers management, more stack commands and other various abilities 2526 (+1646)
0.4.1 Zain 2018-11-08 Reconstruction and optimization, RPN logo, conditionals, creating own functions, REPL, variables, more string functions 3532 (+1006)
0.4.2 Chet 2019-05-16 postfix calls, further code reconstruction 3943 (+411)
0.4.3 Tet 2020-05-15 Hebrew language for GUI, syntax changes, Arrays, Packages 4811 (+868)
0.5.0 Yod 2020-08-14 More packages, new Gen3 upgraded syntax, fix of some bugs and more 6900 (+2089)
0.5.1 Khaf 2021-03-21 Array mapping and reducing, Date/time namagement, Mathematical utilities, eliminating bugs 9880 (+2980)
0.5.2 Lamed 2021-12-18 Rebuild of PS Environment, more GUI languages, runtime arguments, Mathematical and Console utilities, fix bugs 13720 (+3840)
0.5.3 Mem 2023-04-08 Locales, number systems, environment optimization 15870 (+2150)
0.5.4 Nun 2024-12-14 Complex numbers, polynomials, MacOS and FreeBSD support, new name 20900 (+5030)
0.5.5 Samech a few moments later Matrices, dataframes, files and memory management TBA
X.X.X Leviathan one eternity later Development Edition, may be sometimes pretty unstable who cares

History

First builds

The first mechanisms of RPN Calculator (now Papaj) were programmed in 2014. The input was given step-by-step, as the program could not read the RPN strings. The only operations included addition, subtraction, multiplication and division. The project was written in C++, built in Borland C++ Builder and tested on a 32-bit laptop with Windows Vista. Nearly all its code was written in 2014. Then that project became rewritten to FreePascal in April 18, 2016, as a part of the file manager.

Gen1

The Generation 1 (2017-2018) builds are the first RPN Calculator builds. Their commands were limited to mathematical operations and simple scanning of numbers. All new Gen1 versions were built using explicitly the stable precedessor – sometimes those old stable builds had to be fixed after the release. Furthermore, there was barely any documentation of changes – unlike in Gen2 and Gen3 builds. Right after the release of the 0.3.0 version, the unstable development build, called Leviathan, was made. The release of Leviathan ended the Gen1.

Gen2

The Generation 2 (2018-2020) builds are the RPN Calculator builds that changed the look of the program drastically. The pace of evolution was so fast that one Gen2 version may be incompatible with another. Gen2 began on January 12, 2018 with creating the development version of RPN Calculator – Leviathan – since then all the new releases of RPN Calculator were made out of Leviathan. Notice that the 0.3.1 version looks similar to Gen1 builds – however it was developed from Leviathan and therefore it counts as Gen2 build.
Gen2 introduced plenty of new structures to RPN Calculator – conditionals, entities and their types, variables, blocks of instructions, arrays and first packages of functions.
Gen2 was the generation where the first edition of PapajScript was ever developed.

Gen3

The Generation 3 (2020-2022) brought a new look to RPN Calculator and PapajScript language, bringing more types of loops, conditionals, entities and lots of mathematical functions.

Nowadays

The generations have been abolished on August 31, 2022, as it were considered unnecessary for the app development. In 2023, core interpreter engine became overhauled, having improved runtime speed by about 60%. On December 9, 2023, the application got its current name (Papaj).

The current development goals are: introduction of object-oriented programming, file management, more mathematical mechanisms (polynomials, matrices, etc.) and

Requirements and installation of Papaj console application

  • Have installed
    • Lazarus IDE (version 1.6 or higher recommended – I use Lazarus 2.0.4 as of now)
    • or FreePascal Compiler (FPC) (3.0.4 recommended) – alternative for Unix/Linux users only
    • xterm for the GUI app (may be recommended for non-Debian-like Linux users)
  • There are three ways to build RPN Calculator
    • if you have Lazarus IDE and you use the GUI app,
      then compile it by clicking "Run" or "Compile" on this app
    • if you have Lazarus IDE and you are on a command shell or you don't use the GUI app,
      then simply run compile.sh (in Unix/Linux systems) or compile.bat (in Windows systems) to compile the project either by clicking on the script file or by running it via command line.
    • if you don't have Lazarus IDE and you use a Unix/Linux-like system,
      then you may compile the project using compileWithFPC.sh.
  • You can make a Desktop shortcut to a Papaj REPL by running installREPL.sh (Unix/Linux) or installREPL.bat (Windows)

How to use the RPN Calculator console application

  • Execute a command papaj with a quoted PS expression (e.g. papaj do "2 3 + 4 *", since version 0.5.4, or previously rpn do "2 3 + 4 *", since version 0.4.3). More info about expressions in papaj expression and papaj functions.
  • Remember that all values and operands must be delimited with at least 1 whitespace char (e.g. space bar).
  • If you need help, you can type papaj help, rpn -h or papaj --help.
  • If you want to run an PS script file, then execute papaj FILENAME or papaj run FILENAME.
  • If you want to include some input parameters, then provide them after the FILENAME delimited by space, e.g. papaj run FILENAME param1 param2 param3. All these params are treated as PS strings. For example papaj run script.ppsc 2 3 4 executes script.ppsc with input parameters of 2 3 4 being strings wrapped into the array called Params.
  • If you want to run a REPL of PapajScript, then execute papaj repl.
  • If you want to load all pre-built packages on application start, then use flag -L or --load-all, e.g. papaj do '2 PI * sin' -L or papaj repl --load-all
  • If you want to pause the application after script execution in order to exit manually, then use flag -P or --pause, e.g. papaj do '2 2 +' -P or papaj script.ppsc --pause.
  • If you need app version, you can type papaj version, papaj -v or papaj --version.

How to use the Papaj GUI App

  • Open an app executable.
  • In order to compute an PS expression, just type it in the upper text box and click the "Count it!"-button. The result appears in the result box below.
  • There is also a simple script running engine – just paste your PS script or load it from file and click "Run script" to see its result.
  • Remember that all values and operands must be delimited with at least 1 whitespace char (e.g. space bar).
  • There is a possibility of executing the PS script in an external terminal window (it is an experimental feature)
    • Linux and FreeBSD users are required to have papaj console app in the $PATH or the same directory as the GUI app. It is recommended to have xterm installed, if the external terminal window does not appear (unless you use a Debian-like system, or any other Linux that uses Xfce, GNOME or KDE desktop).
    • Windows users are required to have papaj console app in the same directory as the GUI app

Articles for releases

Precedessor:

Builds:

Development version:

Clone this wiki locally