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.[1] 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).[2][3]
In 2017[4] and 2022,[5] independent audit of 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.[6][7][8] 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.[9] PascalABC.NET is widely used as a basic programming language in pedagogical universities for the training of computer science teachers.[10][11][12][13] It also serves as a tool for scientific computing.[14][15] PascalABC.NET is also built into a number of validation systems used for programming competitions.[16][17]
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.[18]
Though the core of the PascalABC.NET community is located in Russia, the language is also known in other countries such as Belarus,[19] Romania,[20] Indonesia,[21] Algeria.[22]
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,[23] while in Delphi they were implemented in 2018.[24][25]
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)
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.[26] An anonymous function can be assigned to the variable of this type:
##// denotes that the main program will be written without enclosing begin-endvarf:real->real:=x->x*x;
Here is an example of superposition of two functions:
In the book "How To Program Effectively In Delphi"[27] and in the corresponding video tutorials,[28][29] Dr. Kevin Bond, a programmer and a Computer Science teaching specialist,[30] notes that PascalABC.NET has powerful functional programming capabilities which are missing in Delphi. As an example, partial function application is demonstrated:
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:[31]
Usual PascalABC.NET style
beginvar(a,b):=ReadInteger2;// read input into tuple of two variablesvarsum:=0;// type auto-inferenceforvari:=atobdosum+=i*i;Print($'Sum = {sum}')// string interpolationend.
This solution uses .NET extension methods for sequences and PascalABC.NET-specific range (a..b).
beginvar(a,b):=ReadInteger2;(a..b).Sum(x->x*x).Print// method chaining with lambda expressionsend.
Object-oriented style
This solution demonstrates PascalABC.NET-specific short function definition style.
typeAlgorithms=classstaticfunctionSumSquares(a,b:integer):=(a..b).Sum(x->x*x);staticfunctionSumCubes(a,b:integer):=(a..b).Sum(x->x*x*x);end;beginvar(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.
usesSystem;// using .NET System namespacebeginvararr:=Console.ReadLine.Split(newchar[](' '),StringSplitOptions.RemoveEmptyEntries);var(a,b):=(integer.Parse(arr[0]),integer.Parse(arr[1]));varsum:=0;forvari:=atobdosum+=i*i;Console.WriteLine($'Sum = {sum}')end.
Criticism
Though PascalABC.NET is actively used for teacher training,[7][10][32][33] 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.[34][35] 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.[8][36][37] PascalABC.NET allows students to write as concise and expressive programs as Python,[38] and acts as a "bridge to production programming" by applying a static typing concept.[8] 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.[8][39]
References
^Osipov, Alexander V. (2019). PascalABC.NET: Vvedenie v sovremennoe programmirovanie [PascalABC.NET: Introduction to Modern Programming] (in Russian). Rostov-on-Don, Russia. p. 28.{{cite book}}: CS1 maint: location missing publisher (link)
^Osipov, Alexander V. (2019). PascalABC.NET: Vvedenie v sovremennoe programmirovanie [PascalABC.NET: Introduction to Modern Programming] (in Russian). Rostov-on-Don, Russia. pp. 116–120.{{cite book}}: CS1 maint: location missing publisher (link)
^Kevin R. Bond (2021). "Chapter 44. Anonymous methods". How to Program Effectively in Delphi for AS/A Level Computer Science. Educational Computing Services Ltd. ISBN9780992753603.
^Panova, I.V.; Kolivnyk, A.A. (2020). "Methodological Aspects of Teaching Python Programming in the School Informatics Course". Informatics in School (in Russian) (6): 47–50. doi:10.32517/2221-1993-2020-19-6-47-50. S2CID225133880.
^Osipov, Alexander V. (2020). PascalABC.NET: vybor shkol'nika. CHast' 1. [PascalABC.NET: Schoolchildren's Choice. Part 1] (in Russian) (2nd ed.). Southern Federal University. pp. 16–19.