Overview of Language Comparisons
On this site there are several comparisons of Pascal with other languages and also comparisons between different dialects of Pascal. This overview provides an alternative route to these comparison sections and enables you to make comparisons more easily across the languages that we cover. For example, we provide comparison tables for Pascal with (in alphabetical order):
We have collated some of the data in the table below. Note in the last two rows how the languages manage to provide different routine names for changing the case of a string!
C/C++ | C# | JavaScript | Pascal | Python | VB | |
---|---|---|---|---|---|---|
Case sensitive? | Yes | Yes | Yes | No | Yes | No |
Block markers | {} | {} | {} | begin/end | Indent level | |
Assignment | = | = | = | := | = | = |
Equality test | == | == | == | = | == | = |
Single line comment | // | // | // | // | # | ' or Rem |
Multi-line comment | /* */ | /* */ | /* */ | {} | ||
String delimiter | " | " | ' or " | ' | ' or " | " |
Integer Division | / (with integer operands) | / (with integer operands) | / (with integer operands) | div | // | \ |
Modulus | % | % | % | mod | % | Mod |
Record | struct | struct | constructor function | record | tuple | Structure |
Pointers? | Yes | possible | No | Yes | No | No |
String to upper case | strupr | .ToUpper() | .toUpperCase() | UpperCase | .upper() | UCase() |
String to lower case | strlwr | .ToLower() | .toLowerCase() | LowerCase | .lower() | LCase() |
In order to compare Smart Pascal with JavaScript, Python, PHP, Lua and Dart you could use our BlocklyToSmartPascal and use the same XML description of the blocks in the Blockly Playground. Some of our Blockly pages such as Caesar Cipher, Insertion Sort and Parallel Arrays show generated code in several languages. You can follow the direct links to JavaScript and Python code.
Comparisons between Dialects of Pascal
We tabulate some differences between Smart Pascal and Lazarus (Free Pascal). Also, in the tutorial entitled Language Development, we compare the syntax of a few language features in three dialects of Pascal. The following table provides links to the code used to demonstrate the features.
Language Feature | Pascal (Lazarus) | Smart Pascal | Oxygene |
---|---|---|---|
For-in loop | for month in MONTH_NAMES do | for month in MONTH_NAMES do | for each month in MONTH_NAMES do |
In-line for loop control variable | for var a := 1 to 3 do | for a: Int32 := 1 to 3 do | |
Case string of | case direction of | case direction of | case direction of |
Generics | Generic Sort | Linked Lists and Stacks and Queues |
See also differences between Delphi and Lazarus.