PascalABC.NET

{{Short description|Computer programming language}}

{{Use dmy dates|date=September 2016}}

{{Infobox programming language

| name = PascalABC.NET

| logo =

| screenshot = Screenshot of PascalABC.NET IDE.png

| paradigm = Multi-paradigm: procedural, functional, object-oriented, generic

| year = {{Start date and age|2007|df=yes}}

| designer = PascalABC.NET Compiler Team

| programming language = PascalABC.NET

| latest release version = 3.8.3.3255

| latest release date = {{Start date and age|2023|04|04|df=yes}}

| typing = Static, partially inferred

| influenced by = Delphi, Pascal, Oxygene, C#, Python, Kotlin, Haskell

| operating system = Cross-platform

| license = LGPLv3

| website = {{URL|pascalabc.net/en}}

| file ext = .pas

}}

PascalABC.NET is a high-level general-purpose programming language supporting multiple paradigms. PascalABC.NET is based on Delphi's Object Pascal, but also has influences from C#, Python, Kotlin, and Haskell. It is distributed both as a command-line tool for Windows (.NET framework), Linux and MacOS (Mono), and with an integrated development environment for Windows and Linux, including interactive debugger, IntelliSense system, form designer, code templates and code auto-formatting.

PascalABC.NET is implemented for the .NET framework platform, so that it is compatible with all .NET libraries and utilizes all the features of Common Language Runtime, such as garbage collection, exception handling, and generics. Some language constructions, e.g. tuples, sequences, and lambdas, are based on regular .NET types. PascalABC.NET is ideologically close to Oxygene, but unlike it, provides high compatibility with Delphi.

History of PascalABC.NET

PascalABC.NET was developed by a group of enthusiasts at the Institute of Mathematics, Mechanics, and Computer Science in Rostov-on-Don, Russia.{{Cite book |last=Osipov |first=Alexander V. |title=PascalABC.NET: Vvedenie v sovremennoe programmirovanie [PascalABC.NET: Introduction to Modern Programming] |publisher= |year=2019 |location=Rostov-on-Don, Russia |pages=28 |language=ru-RU}} In 2003, a predecessor of the modern PascalABC.NET, called Pascal ABC, was implemented by associate professor Stanislav Mikhalkovich to be used for teaching schoolchildren instead of Turbo Pascal, which became outdated and incompatible with modern operating systems but was still used for educational purposes. Pascal ABC was implemented as an interpreted programming language, that led to a significant lack of performance. Four years after that it was completely rewritten by students Ivan Bondarev, Alexander Tkachuk, and Sergey Ivanov as a compiled programming language for the .NET platform. In 2009, PascalABC.NET started to be actively used for teaching high school students. By 2015, the number of users of the language had increased significantly. It began to be actively used throughout Russia in schools and at programming contests, surpassing Free Pascal. Since then, the PascalABC.NET developers have set themselves the goal of actively incorporating modern features into the language. In the same year, PascalABC.NET became an open source project distributed under the GNU Lesser General Public License (LGPLv3).{{Cite web |date=2021-03-30 |title=Twisted Pair Podcast, #389 |url=https://tpair.org/podcast/tp-389/ |website=Twisted Pair Podcast |language=ru-RU}}{{Cite web |last1=Bondarev |first1=Ivan V. |last2=Belyakova |first2=Yulia V. |last3=Mikhalkovich |first3=Stanislav S. |date=2013-04-24 |title=PascalABC.NET programming system: 10 years of development |url=https://pascalabc.net/downloads/Presentations/10letPABC.pdf |access-date=2023-04-09 |website=PascalABC.NET}}

In 2017{{Cite web |date=2017-03-29 |title=Analysis of PascalABC.NET using SonarQube plugins: SonarC# and PVS-Studio |url=https://pvs-studio.com/en/blog/posts/csharp/0492/ |website=PVS-Studio |language=en}} and 2022,{{Cite web |date=2022-02-11 |title=Re-checking PascalABC.NET |url=https://medium.com/pvs-studio/re-checking-pascalabc-net-f8bfc94aba3c |website=Medium |language=en}} independent audit of [https://github.com/pascalabcnet PascalABC.NET public repository] was conducted. Based on the results of the static check, potentially dangerous code fragments were listed that require additional analysis by developers. It was also noted that the overall quality of the code could be improved. To do this, code duplication and redundant checks should be eliminated, and refactoring should be performed more carefully.

Use in school and higher education

Designed for education, PascalABC.NET remains the most common programming language in Russian schools and one of the recommended languages for passing the Unified State Exam on informatics.{{Cite web |title=Metodicheskie rekomendacii po podgotovke i provedeniyu edinogo gosudarstvennogo ekzamena po informatike i IKT v komp'yuternoj forme v gorode Moskve v 2021 godu [Guidelines for the preparation and conduct of the unified state exam in computer science and ICT in the city of Moscow in 2021] |url=http://rcoi.mcko.ru/resources/upload/RichFilemanager/documents/2020-2021/org_metod/11/mr_kege_inf_2021.pdf |publisher=Departament obrazovaniya i nauki goroda Moskvy [Department of Education and Science of Moscow] |page=110 |language=ru-RU |access-date=5 April 2023 |archive-date=28 January 2022 |archive-url=https://web.archive.org/web/20220128150316/http://rcoi.mcko.ru/resources/upload/RichFilemanager/documents/2020-2021/org_metod/11/mr_kege_inf_2021.pdf |url-status=dead}}{{Cite web |last=Polyakov |first=Konstantin |title=Doklady na konferenciyah i seminarah [Reports at conferences and seminars] |url=https://kpolyakov.spb.ru/school/doklad.htm |language=ru-RU}}{{Cite web |last=Bogdanov |first=Alexey |date=2022-10-04 |title=PascalABC.Net or Python/ C#/C++ |url=https://www.youtube.com/watch?v=RulhCYnbRAA |access-date=2023-04-05 |website=YouTube |language=ru-RU}} In the Southern Federal University, it is used as the first language for teaching students majoring in computer science, and for teaching children in one of the largest computer schools in Russia.{{Cite news |last=Popova |first=Ekaterina |date=2022-09-06 |title=Kak v Rostove gumanitarii uspeshno obuchayutsya IT-special'nostyam [How humanitarians successfully study IT specialties in Rostov] |language=ru-RU |work=Komsomolskaya Pravda |url=https://www.rostov.kp.ru/daily/27441/4643617/}} PascalABC.NET is widely used as a basic programming language in pedagogical universities for the training of computer science teachers.{{Cite journal |last1=Dzhenzher |first1=V.O. |last2=Denisova |first2=L.V. |year=2019 |title=Mathematical animation in computer simulation at school |url=https://www.sciencegate.app/document/10.32517/2221-1993-2019-18-6-51-54 |journal=Informatics in School |language=ru-RU |issue=6 |pages=51–54 |doi=10.32517/2221-1993-2019-18-6-51-54 |s2cid=203704481|url-access=subscription }}{{Cite journal |last1=Dzhenzher |first1=V.O. |last2=Denisova |first2=L.V. |year=2021 |title=Implementation of the Hamming code on PascalABC.NET while studying the theoretical foundations of informatics |journal=Informatics in School |language=ru-RU |volume=1 |issue=9 |pages=29–38 |doi=10.32517/2221-1993-2021-20-9-27-36 |s2cid=245473319|doi-access=free}}{{Cite journal |last1=Dzhenzher |first1=V.O. |last2=Denisova |first2=L.V. |year=2020 |title=Scientific graphics in PascalABC.NET: plotting function graphs in a rectangular cartesian coordinate system |url=https://www.sciencegate.app/document/10.32517/2221-1993-2020-19-1-31-39 |journal=Informatics in School |language=ru-RU |issue=1 |pages=31–39 |doi=10.32517/2221-1993-2020-19-1-31-39 |s2cid=215844807|url-access=subscription }}{{Cite journal |last=Kulabukhov |first=S.Yu. |year=2021 |title=Mathematical modeling in informatiсs lessons using numerical solution of differential equations |url=https://school.infojournal.ru/jour/article/view/528/528 |journal=Informatics in School |language=ru-RU |issue=2 |pages=14–21 |doi=10.32517/2221-1993-2021-20-2-14-21 |s2cid=235541530|url-access=subscription }} It also serves as a tool for scientific computing.{{Cite journal |last1=Khazieva |first1=R.T. |last2=Ivanov |first2=M.D. |year=2020 |title=Selection of optimum device parameters for permanent magnetic field generation |url=https://www.energyret.ru/jour/article/view/1625/696 |journal=Power Engineering: Research, Equipment, Technology |language=ru-RU |volume=22 |issue=6 |pages=176–187 |doi=10.30724/1998-9903-2020-22-6-176-187 |s2cid=233658494|doi-access=free}}{{Cite journal |last1=Lukyanov |first1=O.E. |last2=Zolotov |first2=D.V. |year=2021 |title=Methodological support for the training of UAV designers and operators |url=https://journals.ssau.ru/vestnik/article/view/8633/pdf |journal=VESTNIK of Samara University. Aerospace and Mechanical Engineering |language=ru-RU |volume=20 |issue=1 |pages=14–28 |doi=10.18287/2541-7533-2021-20-1-14-28 |s2cid=236617894|doi-access=free}} PascalABC.NET is also built into a number of validation systems used for programming competitions.{{Cite web |title=ACMP Olympiad System |url=https://acmp.ru/article.asp?id_text=120 |url-status=live |archive-url=https://web.archive.org/web/20230327035528/https://acmp.ru/article.asp?id_text=120 |archive-date=2023-03-27 |access-date=2023-04-05}}{{Cite web |title=Yandex Contest Compilers List |url=https://contest.yandex.ru/compilers/ |url-status=live |archive-url=https://web.archive.org/web/20230314174434/https://contest.yandex.ru/compilers/ |archive-date=2023-03-14 |access-date=2023-04-05 |website=Yandex Contest}}

In 2020, during anti-COVID lockdowns and home schooling period, PascalABC.NET website was ranked 3rd in Yandex traffic rating in the "Programming" category, and the number of downloads of the installation kit exceeded 10000 a day.{{Cite web |last=Kubysheva |first=Olga |date=2020-04-17 |title=PascalABC.NET: Sajt sistemy programmirovaniya, razrabatyvaemoj na mekhmate YUFU, podnyalsya v rejtinge YAndeksa na tret'e mesto [PascalABC.NET: Site of programming system developed at SFedU MMCS faculty climbed up to the third place in Yandex ranking] |url=https://www.rostov.kp.ru/online/news/3839814/ |website=Komsomol'skaya pravda |language=ru-RU}}

Though the core of the PascalABC.NET community is located in Russia, the language is also known in other countries such as Belarus,{{Cite journal |last=Kutysh |first=Aleksandr Z. |year=2018 |title=Razrabotka soderzhaniya vzaimosvyazannogo obucheniya budushchih uchitelej informatiki tekhnologiyam programmirovaniya [Development of interconnected training content for future computer science teachers in programming] |url=https://www.adu.by/images/2019/05/PedNauka_3(24)_2018.pdf |journal=Pedagogical Science and Education |language=ru-RU |issue=3 |pages=44–52}} Romania,{{Cite web |date=2020-01-21 |title=Practică în Pascal |url=https://www.youtube.com/playlist?list=PLP11T_LhFxPlQoxbZ1ZTlrv6AXDQjJJqB |website=YouTube}} Indonesia,{{Cite web |title=Mengenal PascalABC.NET |url=https://www.pascal-id.org/news/357/mengenal-pascalabc.net |url-status=live |archive-url=https://web.archive.org/web/20220810114037/https://www.pascal-id.org/news/357/mengenal-pascalabc.net |archive-date=2022-08-10 |access-date=2023-04-08}} Algeria.{{Cite web |date=2022-06-12 |title=PASCAL AND DELPHI TUTORIAL |url=https://www.youtube.com/playlist?list=PLmFVPmv0ntGNq-mu4vCT68I5ekJQj-Ocn |website=YouTube}}

Language syntax

= Differences between Delphi and PascalABC.NET =

== New features ==

loop statement

loop 10 do

Write('*');

for loop with a step

for var i:=1 to 20 step 2 do

Print(i);

foreach loop with an index

foreach var c in Arr('a'..'z') index i do

if i mod 2 = 0 then

Print(c);

a..b ranges

(1..10).Printlines

short function definition syntax

function Sum(a,b: real) := a + b;

method implementation can be placed inside a class definition

type Point = class

x,y: real;

procedure Output;

begin

Print(x,y);

end;

end;

sequence of T type as an abstraction of arrays, lists and sets

var seq: sequence of integer := Arr(1..10);

seq.Println;

seq := Lst(11..100); seq.Println;

seq := HSet(1..20); seq.Println;

lambda functions

var a := ArrGen(10,i -> i*i);

auto classes - classes with an automatically generated constructor

type Point = auto class

x,y: real;

end;

var p := new Point(2,5);

one-dimensional and multi-dimensional array slices

var m: array [,] of integer := MatrGen(3,4, (i,j) -> i+j+1);

Println(m); // 1,2,3,4],[2,3,4,5],[3,4,5,6

Println(m[:2,1:3]); // 2,3],[3,4

Some other features such as inline variable declarations, type inference, and for statement with a variable declaration are standard in the current version of Delphi. However, PascalABC.NET pioneered these features in 2007,{{Cite web |title=PascalABC.NET. What's New |url=https://pascalabc.net/chto-novogo |access-date=2023-04-09 |website=PascalABC.NET |language=ru-RU}} while in Delphi they were implemented in 2018.{{Cite web |last=Embarcadero Technologies |date=2018-11-21 |title=See What's New in RAD Studio 10.3 |url=https://www.youtube.com/watch?v=RreUFdxaR20&t=44s |website=YouTube}}{{Cite web |title=Help for RAD Studio 10.3 Rio. What's New |url=https://docwiki.embarcadero.com/RADStudio/Rio/en/What%27s_New |access-date=2023-04-09 |website=Embarcadero. Product Documentation Wikis}}

== Changed features ==

  • strings in case statements
  • sets based on arbitrary type: set of string
  • constructors can be invoked with new T(...) syntax
  • type extension methods instead of class helpers
  • modules can be defined in a simplified form (without interface and implementation sections)

== Not implemented features ==

= Functional style features =

In PascalABC.NET, functions are first-class objects. They can be assigned to variables, passed as parameters, and returned from other functions. Functional type is set in the form T -> Res.{{Cite book |last=Osipov |first=Alexander V. |title=PascalABC.NET: Vvedenie v sovremennoe programmirovanie [PascalABC.NET: Introduction to Modern Programming] |year=2019 |location=Rostov-on-Don, Russia |pages=116–120 |language=ru-RU}} An anonymous function can be assigned to the variable of this type:

  1. // denotes that the main program will be written without enclosing begin-end

var f: real -> real := x -> x*x;

Here is an example of superposition of two functions:

function Super(f: T1 -> T2; g: T -> T1): T -> T2 := x -> f(g(x));

var f: real -> real := x -> x*x;

var fg := Super(f,Sin);

var gf := Super(Sin,f);

Print(fg(2));

Print(gf(2));

Superposition operation is defined in the standard library:

var f: real -> real := x -> x*x;

Print((f*Cos)(2));

Print((Cos*f)(2));

In the book "How To Program Effectively In Delphi"{{Cite book |author=Kevin R. Bond |title=How to Program Effectively in Delphi for AS/A Level Computer Science |publisher=Educational Computing Services Ltd |year=2021 |isbn=9780992753603 |chapter=Chapter 44. Anonymous methods}} and in the corresponding video tutorials,{{Cite web |author=Kevin Bond |title=How to Program Effectively in Delphi. Lesson 44. Part 1 |url=https://www.youtube.com/watch?v=RBlg-ItyyTA&t=377s |access-date=2023-04-04 |website=YouTube |date=10 February 2022 |language=en}}{{Cite web |title=Delphi Boot Camp 2022 - Delphi and functional programming using anonymous methods |url=https://www.youtube.com/watch?v=OmregYuqLU8&t=1640s |access-date=2023-04-04 |website=YouTube | date=28 August 2022 |language=en}} Dr. Kevin Bond, a programmer and a Computer Science teaching specialist,{{Cite web|language=en|url=https://www.educational-computing.com/DelphiBook/KRBsBriefBiography.pdf|title=Brief biography Dr Kevin R Bond|website=Educational Computing Services Ltd}} notes that PascalABC.NET has powerful functional programming capabilities which are missing in Delphi. As an example, partial function application is demonstrated:

begin

var f: integer -> integer -> integer := x -> y -> x + y;

Writeln(f(2)(6));

end.

Code examples

PascalABC.NET is a multi-paradigm programming language. It allows one to use different coding styles from oldschool Pascal to functional and object-oriented programming. The same task can be solved in different styles as follows:{{Cite web |title=PascalABC.NET programming styles |url=https://pascalabcnet.github.io/mydoc_progr_styles.html |access-date=2023-04-09}}

= Usual PascalABC.NET style =

begin

var (a,b) := ReadInteger2; // read input into tuple of two variables

var sum := 0; // type auto-inference

for var i:=a to b do

sum += i*i;

Print($'Sum = {sum}') // string interpolation

end.

= Procedural style =

function SumSquares(a,b: integer): integer;

begin

Result := 0;

for var i := a to b do

Result += i * i

end;

begin

var (a,b) := ReadInteger2;

Print($'Sum = {SumSquares(a,b)}')

end.

= Functional style =

This solution uses .NET extension methods for sequences and PascalABC.NET-specific range (a..b).

begin

var (a,b) := ReadInteger2;

(a..b).Sum(x -> x*x).Print // method chaining with lambda expressions

end.

= Object-oriented style =

This solution demonstrates PascalABC.NET-specific short function definition style.

type Algorithms = class

static function SumSquares(a,b: integer) := (a..b).Sum(x -> x*x);

static function SumCubes(a,b: integer) := (a..b).Sum(x -> x*x*x);

end;

begin

var (a,b) := ReadInteger2;

Println($'Squares sum = {Algorithms.SumSquares(a,b)}');

Println($'Cubes sum = {Algorithms.SumCubes(a,b)}')

end.

= Close to regular C# style =

It is possible to write programs without usage of PascalABC.NET standard library. All standard .NET Framework classes and methods can be used directly.

uses System; // using .NET System namespace

begin

var arr := Console.ReadLine.Split(

new char[](' '),

StringSplitOptions.RemoveEmptyEntries

);

var (a,b) := (integer.Parse(arr[0]),integer.Parse(arr[1]));

var sum := 0;

for var i:=a to b do

sum += i*i;

Console.WriteLine($'Sum = {sum}')

end.

Criticism

Though PascalABC.NET is actively used for teacher training,{{Cite journal |last1=Dzhenzher |first1=V.O. |last2=Denisova |first2=L.V. |year=2022 |title=Dynamic arrays and lists in PascalABC.NET |url=https://school.infojournal.ru/jour/article/view/614/611 |journal=Informatics in School |language=ru-RU |issue=1 |pages=67–80|doi=10.32517/2221-1993-2022-21-1-67-80 |s2cid=249662060 |doi-access=free}}{{Cite web |title=Nauchno-metodicheskaya konferenciya «Ispol'zovanie sistemy programmirovaniya PascalABC.NET v obuchenii programmirovaniyu» (29-30 marta 2023 g.) [Scientific and methodical conference "Using PascalABC.NET programming system in teaching programming" (March 29-30, 2023)] |url=http://mmcs.sfedu.ru/registration/28-PABCConf2023 |access-date=2023-04-10 |website=Institute of Mathematics, Mechanics, and Computer Science |language=ru-RU}} some members of the teaching community ignore difference between historically used Turbo Pascal and PascalABC.NET, criticizing some unspecified "Pascal" language for being far from modern programming, too wordy and not simple enough to be used as the first programming language.{{Cite journal |last1=Panova |first1=I.V. |last2=Kolivnyk |first2=A.A. |year=2020 |title=Methodological Aspects of Teaching Python Programming in the School Informatics Course |journal=Informatics in School |language=ru-RU |issue=6 |pages=47–50|doi=10.32517/2221-1993-2020-19-6-47-50 |s2cid=225133880}}{{Cite web |date=2021-05-28 |title=What's wrong with modern computer science teaching |url=https://habr.com/ru/companies/skillfactory/articles/559010/ |access-date=2023-04-08 |website=Habr |language=ru-RU}} They consider Python to be the best starting point, as it is more concise and practically applicable. Their opponents, including  PascalABC.NET developers themselves, argue that it is incorrect to put an equal sign between the classic Pascal and PascalABC.NET, as the latter contains lots of modern multi-paradigm features, including the ones from Python.{{Cite web |last=Bragilevsky |first=Vitaly |date=2020-04-14 |title=The First Programming Language Dispute: The Final Solution |url=https://www.youtube.com/watch?v=OtcKHgkPiyk&t=2318s |website=YouTube |publisher=JetBrains}}{{Cite web |last=Polyakov |first=Konstantin |date=2021-08-24 |title=New features in PascalABC.NET |url=https://kpolyakov.spb.ru/download/pas2021.ppt |place= |language=ru-RU}} PascalABC.NET allows students to write as concise and expressive programs as Python,{{Cite web |last=Mikhalkovich |first=Stanislav |date=2021-11-22 |title=Comparing Python and PascalABC.NET |url=https://www.youtube.com/watch?v=ZcWP82JBqZI |website=YouTube}} and acts as a "bridge to production programming" by applying a static typing concept. PascalABC.NET is also a compilable language, which makes it easier to learn programming, because all semantic errors are caught at compile time rather than occur unpredictably at runtime.{{Cite book |last=Osipov |first=Alexander V. |title=PascalABC.NET: vybor shkol'nika. CHast' 1. [PascalABC.NET: Schoolchildren's Choice. Part 1] |publisher=Southern Federal University |year=2020 |edition=2nd |pages=16–19 |language=ru-RU}}

Pascal is often regarded as a strictly structured programming language, which makes it a popular choice for introductory programming education. However, some authors argue that the promotion of Python as a beginner-friendly language is driven, in part, by commercial interests.

References

{{Reflist}}