PascalABC.NET

PascalABC.NET
Paradigm Multi-paradigm: procedural, functional, object-oriented, generic
Designed by S.S. Mikhalkovich, Ivan Bondarev, A.V. Tkachuk, S.O. Ivanov
First appeared 2002 (2002)
Stable release
3.2.0.1311 / 29 August 2016 (2016-08-29)
Typing discipline Static, partially inferred
Implementation language PascalABC.NET
OS Cross-platform
License LGPLv3
Filename extensions .pas
Website pascalabc.net/en/
Influenced by
Delphi, Pascal, C#, Python

PascalABC.NET – is a Pascal programming language integrated development environment that implements classic Pascal, most Delphi language features, as well as a number of their own extensions. It is implemented on the Microsoft.NET platform and contains all the modern language features: classes, operator overloading, interfaces, exception handling, generic classes and routines, garbage collection, lambda expressions, parallel programming tools (OpenMP only as of 2016).

PascalABC.NET is also a simple and powerful IDE with integrated debugger, IntelliSense system, form designer, code templates and code auto-formatting. Command-line PascalABC.NET compiler is also available on Linux and MacOS (under Mono).[1]

PascalABC.NET is popular in Russian schools and universities. In Southern Federal University, it is used as the main language for teaching students of Information technology in the course "Fundamentals of programming" and for teaching children in one of the largest computer schools in Russia.

Programming Taskbook developed by Prof M. E. Abramyan is a part of PascalABC.NET. This taskbook contains 1100 learning tasks and covers almost all sections of a basic programming curriculum.[2]

Key features of PascalABC.NET

Pascal language extensions

System units

Most units are focused on education:

Samples

1. Swap the first and second halves of an array

begin
  var a := ArrGen(10,i->2*i+1);
  a.Println;
  Assert(a.Length mod 2 = 0);
  var n := a.Length div 2;
  a := a.Skip(n).Concat(a.Take(n)).ToArray;
  a.Println; 
end.

2. 100!

begin
  var p: BigInteger := 1;
  for var i:=1 to 100 do
    p := p * i;
  write(p);
end.

3. Display all Fibonacci numbers less than 1000

begin
  SeqWhile(1,1,(x,y)->x+y,x->x<1000).Print;
end.

4. Word frequence dictionary for a file

begin
  var d := new Dictionary<string,integer>;
  foreach var s in ReadLines('words.txt') do
    foreach var word in s.ToWords do
      d[word] := d.Get(word) + 1;
  d.Print(NewLine);
end.

4а. Word frequence dictionary for a file. Solution in functional style

begin
  ReadLines('words.txt').SelectMany(s->s.ToWords()).GroupBy(v->v).ToDictionary(x->x.Key,x->x.Count()).Print(NewLine);
end.

5. Parallel matrix multiplication using OpenMP directives

procedure Mult(a,b,c: array [,] of real; n: integer);
begin
  {$omp parallel for}
  for var i:=0 to n-1 do
    for var j:=0 to n-1 do
    begin  
       var cc := 0.0;
       for var l:=0 to n-1 do
          cc += a[i,l]*b[l,j];
       c[i,j] := cc;   
    end;
end;
 
const n = 1000;
 
begin
  var a := MatrixRandomReal(n,n,1,1.1);
  var b := MatrixRandomReal(n,n,1,1.1);
  var c := new real[n,n];
  Mult(a,b,c,n);
  writeln(MillisecondsDelta/1000);
end.

See also

References

This article is issued from Wikipedia - version of the 9/25/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.