comparison of programming languages (syntax)#Comments
{{Short description|none}}
{{Use dmy dates|date=March 2020}}
{{ProgLangCompare}}
This article compares the syntax of many notable programming languages.
Expressions
Programming language expressions can be broadly classified into four syntax structures:
;prefix notation
- Lisp
(* (+ 2 3) (expt 4 5))
;infix notation
- Fortran
(2 + 3) * (4 ** 5)
;suffix, postfix, or Reverse Polish notation
- Forth
2 3 + 4 5 ** *
;math-like notation
- TUTOR
(2 + 3)(45) $$ note implicit multiply operator
Statement delimitation
A language that supports the statement construct typically has rules for one or more of the following aspects:
- Statement terminator {{endash}} marks the end of a statement
- Statement separator {{endash}} demarcates the boundary between two statements; not needed for the last statement
- Line continuation {{endash}} escapes a newline to continue a statement on the next line
Some languages define a special character as a terminator while some, called line-oriented, rely on the newline. Typically, a line-oriented language includes a line continuation feature whereas other languages have no need for line continuation since newline is treated like other whitespace. Some line-oriented languages provide a separator for use between statements on one line.
class="wikitable sortable" |
Language
! Statement delimitation |
---|
ABAP
| period separated |
Ada
| semicolon terminated |
ALGOL
| semicolon separated |
ALGOL 68
| semicolon and comma separatedThree different kinds of clauses, each separates phrases and the units differently:
|
APL
| newline terminated, |
AppleScript
| newline terminated |
AutoHotkey
| newline terminated |
BASIC
| newline terminated, colon separated |
Boo
| newline terminated |
C
| semicolon terminated, comma separated expressions |
C++
| semicolon terminated, comma separated expressions |
C#
| semicolon terminated |
COBOL
| whitespace separated, sometimes period separated, optionally separated with commas and semi-colons |
Cobra
| newline terminated |
CoffeeScript
| newline terminated |
CSS
| semicolon terminated |
D
| semicolon terminated |
Eiffel
| newline terminated, semicolon separated |
Erlang
| colon separated, period terminated |
F#
| newline terminated, semicolon |
Fortran
| newline terminated, semicolon separated |
Forth
| semicolons terminate word definitions; space terminates word use |
GFA BASIC
| newline terminated |
Go
| semicolon separated (inserted by compiler) |
Haskell
| in do-notation: newline separated, |
Java
| semicolon terminated |
JavaScript
| semicolon separated (but often inserted as statement terminator) |
Kotlin
|semicolon separated (but sometimes implicitly inserted on newlines) |
Lua
| whitespace separated (semicolon optional) |
Mathematica a.k.a. Wolfram
| semicolon separated |
MATLAB
| newline terminated, separated by semicolon or comma (semicolon – result of receding statement hidden, comma – result displayed) |
MUMPS a.k.a. M
|newline terminates line-scope, the closest to a "statement" that M has, a space separates/terminates a command, allowing another command to follow |
Nim
|newline terminated |
Object Pascal (Delphi)
| semicolon separated |
Objective-C
| semicolon terminated |
OCaml
| semicolon separated |
Pascal
| semicolon separated |
Perl
| semicolon separated |
PHP
| semicolon terminated |
Pick Basic
| newline terminated, semicolon separated |
PowerShell
| newline terminated, semicolon separated |
Prolog
| comma separated (conjunction), semicolon separated (disjunction), period terminated (clause) |
Python
| newline terminated, semicolon separated |
R
| newline terminated, semicolon separatedFrom the R Language Definition, section 3.2 Control structures: "A semicolon always indicates the end of a statement while a new line may indicate the end of a statement. If the current statement is not syntactically complete new lines are simply ignored by the evaluator." |
Raku
| semicolon separated |
Red
| whitespace separated |
Ruby
| newline terminated, semicolon separated |
Rust
| semicolon terminated, comma separates expressions |
Scala
| newline terminated, semicolon separator |
Seed7
| semicolon separated (semicolon termination is allowed) |
Simula
| semicolon separated |
S-Lang
| semicolon separated |
Smalltalk
| period separated |
Standard ML
| semicolon separated |
Swift
| semicolon separated (inserted by compiler) |
V (Vlang)
| newline terminated, comma or semicolon separated |
Visual Basic
| newline terminated, colon separated |
Visual Basic (.NET)
| newline terminated, colon separated |
Xojo
| newline terminated |
Zig
| semicolon terminated |
= Line continuation =
Listed below are notable line-oriented languages that provide for line continuation. Unless otherwise noted the continuation marker must be the last text of the line.
- bash[https://www.gnu.org/software/bash/manual/bashref.html Bash Reference Manual], [https://www.gnu.org/software/bash/manual/bashref.html#Escape-Character 3.1.2.1 Escape Character] and other Unix shells
- C preprocessor macros; used in conjunction with C, C++ and many other programming contexts
- Mathematica, Wolfram Language
- Python[https://docs.python.org/ Python Documentation], [https://docs.python.org/3/reference/lexical_analysis.html 2. Lexical analysis]: [https://docs.python.org/3/reference/lexical_analysis.html#explicit-line-joining 2.1.5. Explicit line joining]
- Ruby
- JavaScript – only within single- or double-quoted strings
- Vimscript as first character of continued line
;Ellipsis (three dots)
- MATLAB: The ellipsis need not end the line, but text following it is ignored.{{Cite web|url=http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f0-5789.html|archiveurl=https://web.archive.org/web/20100207151905/http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f0-5789.html|url-status=dead|title=Mathworks.com|archivedate=7 February 2010}} It begins a comment that extends through (including) the first subsequent newline. Contrast this with a line comment which extends until the next newline.
- Ruby: comment may follow delimiter
- Batch file: starting a parenthetical block can allow line continuation{{Cite web|url=https://ss64.com/nt/syntax-brackets.html|title=Parenthesis/Brackets - Windows CMD - SS64.com|website=ss64.com}}
- Ruby: left parenthesis, left square bracket, or left curly bracket
- Ruby: as last object of line; comment may follow operator
- AutoHotkey: As the first character of continued line; any expression operators except ++ and --, and a comma or a period{{Cite web |url=https://autohotkey.com/docs/Scripts.htm#continuation |title=Scripts - Definition & Usage | AutoHotkey}}
;Some form of line comment serves as line continuation
- Turbo Assembler:
\
- m4:
dnl
- TeX:
%
;Character position
- Fortran 77: A non-comment line is a continuation of the prior non-comment line if any non-space character appears in column 6. Comment lines cannot be continued.
- COBOL: String constants may be continued by not ending the original string in a PICTURE clause with
'
, then inserting a-
in column 7 (same position as the*
for comment is used.) - TUTOR: Lines starting with a tab (after any indentation required by the context) continue the prior command.
The C compiler concatenates adjacent string literals even if on separate lines, but this is not line continuation syntax as it works the same regardless of the kind of whitespace between the literals.
Consuming external software
{{Expand section|date=December 2009}}
Languages support a variety of ways to reference and consume other software in the syntax of the language. In some cases this is importing the exported functionality of a library, package or module but some mechanisms are simpler text file include operations.
Import can be classified by level (module, package, class, procedure,...) and by syntax (directive name, attributes,...).
;File include
#include <filename>
or#include "filename"
{{endash}} C preprocessor used in conjunction with C and C++ and other development tools
;File import
addpath(directory)
{{endash}} MATLABFor an M-file (MATLAB source) to be accessible by name, its parent directory must be in the search path (or current directory).- {{code|COPY filename.|cobolfree}} {{endash}} COBOL
:-include("filename").
{{endash}} Prolog#include file="filename"
{{endash}} ASP#include <filename>
or#include "filename"
{{endash}} AutoHotkey, AutoIt#import "filename"
or#import <filename>
{{endash}} Objective-C- {{code|Import["filename"]|mathematica}} {{endash}} Mathematica, Wolfram Language
- {{code|include 'filename'|fortran}} {{endash}} Fortran
include "filename";
{{endash}} PHPinclude [filename] program
or#include [filename] program
{{endash}} Pick Basicinclude!("filename");
{{endash}} Rustload "filename"
{{endash}} Ruby- {{code|load %filename|red}} {{endash}} Red
- {{ml-lua|filename}} {{endash}} Lua
require "filename";
{{endash}} Perl, PHP- {{code|require "filename"|ruby}} {{endash}} Ruby
- {{code|source(""filename"")|r}} {{endash}} R
@import("filename");
{{endash}} Zig
;Package import
#include filename
{{endash}} C, C++#[path = "filename"] mod altname;
{{endash}} Rust@import module;
{{endash}} Objective-C<<name
{{endash}} Mathematica, Wolfram Language- {{code|:-use_module(module).|prolog}} {{endash}} Prolog:
from module import *
{{endash}} Pythonextern crate libname;
{{endash}} orextern crate libname as altname;
ormod modname;
{{endash}} Rustlibrary("package")
{{endash}} R:IMPORT module
{{endash}} Oberonimport altname "package/name"
{{endash}} Go:import package.module;
orimport altname = package.module;
{{endash}} Dimport Module
orimport qualified Module as M
{{endash}} Haskellimport package.*
{{endash}} Java, MATLAB, Kotlinimport "modname";
{{endash}} JavaScriptimport altname from "modname";
{{endash}}JavaScriptimport package
orimport package._
{{endash}} Scalaimport module
{{endash}} Swiftimport module
{{endash}} V (Vlang)import module
{{endash}} Python- {{ml-lua|modname}} {{endash}} Lua
- {{code|require "gem"|ruby}} {{endash}} Ruby
use module
{{endash}} Fortran 90+use module, only : identifier
{{endash}} Fortran 90+use Module;
{{endash}} Perluse Module qw(import options);
{{endash}} Perluse Package.Name
{{endash}} Cobrauses unit
{{endash}} Pascalwith package
{{endash}} Ada@import("pkgname");
{{endash}} Zig
;Class import
from module import Class
{{endash}} Pythonimport package.class
{{endash}} Java, MATLAB, kotlinimport class from "modname";
{{endash}} JavaScriptimport {class} from "modname";
{{endash}} JavaScriptimport {class as altname} from "modname";
{{endash}} JavaScriptimport package.class
{{endash}} Scalaimport package.{ class1 => alternativeName, class2 }
{{endash}} Scalaimport package._
{{endash}} Scalause Namespace\ClassName;
{{endash}} PHPuse Namespace\ClassName as AliasName;
{{endash}} PHP
;Procedure/function import
from module import function
{{endash}} Pythonimport package.module : symbol;
{{endash}} Dimport package.module : altsymbolname = symbol;
{{endash}} Dimport Module (function)
{{endash}} Haskellimport function from "modname";
{{endash}} JavaScriptimport {function} from "modname";
{{endash}} JavaScriptimport {function as altname} from "modname";
{{endash}} JavaScriptimport package.function
{{endash}} MATLABimport package.class.function
{{endash}} Scalaimport package.class.{ function => alternativeName, otherFunction }
{{endash}} Scala- {{code|use Module ('symbol');|perl}} {{endash}} Perl
use function Namespace\function_name;
{{endash}} PHPuse Namespace\function_name as function_alias_name;
{{endash}} PHPuse module::submodule::symbol;
{{endash}} Rustuse module::submodule::{symbol1, symbol2};
{{endash}} Rustuse module::submodule::symbol as altname;
{{endash}} Rust
;Constant import
use const Namespace\CONST_NAME;
{{endash}} PHP
The above statements can also be classified by whether they are a syntactic convenience (allowing things to be referred to by a shorter name, but they can still be referred to by some fully qualified name without import), or whether they are actually required to access the code (without which it is impossible to access the code, even with fully qualified names).
;Syntactic convenience
;Required to access code
import altname "package/name"
Goimport altname from "modname";
JavaScriptimport module
Python
Block delimitation
A block is a grouping of code that is treated collectively. Many block syntaxes can consist of any number of items (statements, expressions or other units of code) {{endash}} including one or zero. Languages delimit a block in a variety of ways {{endash}} some via marking text and others by relative formatting such as levels of indentation.
;Curley braces (a.k.a. curly brackets) {
... }
:
- Curly brace languages: A defining aspect of curly brace languages is that they use curly braces to delimit a block.
;Parentheses (
... )
- Batchfile, F# (lightweight syntax),{{cite web |url = https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/verbose-syntax |title = Verbose Syntax - F#
| Microsoft Learn |date = 2021-11-05 |access-date = 17 November 2022 |website = Microsoft Learn}} OCaml, Prolog, Standard ML
;Square brackets [
... ]
;begin
... end
:
- Ada, ALGOL, F# (verbose syntax), Pascal, Ruby (
for
,do/while
&do/until
loops), OCaml, SCL, Simula, Erlang.
;do
... end
:
;do
... done
:
- Bash (
for
&while
loops), F# (verbose syntax) Visual Basic, Fortran, TUTOR (with mandatory indenting of block body), Visual Prolog
;do
... end
;X ... end
(e.g. if
... end
):
- Ruby (
if
,while
,until
,def
,class
,module
statements), OCaml (for
&while
loops), MATLAB (if
&switch
conditionals,for
&while
loops,try
clause,package
,classdef
,properties
,methods
,events
, &function
blocks), Lua (then
/else
&function
)
;(begin
...):
;(progn ...):
;(do
...):
;Indentation
- Off-side rule languages: Boo, Cobra, CoffeeScript, F#, Haskell (in do-notation when braces are omitted), LiveScript, occam, Python, Nemerle (Optional; the user may use white-space sensitive syntax instead of the curly-brace syntax if they so desire), Nim, Scala (Optional, as in Nemerle)
- Free-form languages: most descendants from ALGOL (including C, Pascal, and Perl); Lisp languages
;Others
- Ada, Visual Basic, Seed7:
if
...end if
- ALGOL 68:
begin
...end
,(
...)
,if
...fi
,do
...od
- APL:
:If
...:EndIf
or:If
...:End
- Bash, sh, and ksh:
if
...fi
,do
...done
,case
...esac
; - COBOL:
IF
...END-IF
,PERFORM
...END-PERFORM
, etc. for statements; ....
for sentences.* Lua, Pascal, Modula-2, Seed7:repeat
...until
- Small Basic:
If
...EndIf
,For
...EndFor
,While
...EndWhile
- Visual Basic (.NET):
If
...End If
,For
...Next
,Do
...Loop
Comments
With respect to a language definition, the syntax of Comments can be classified many ways, including:
- Line vs. block {{endash}} a line comment starts with a delimiter and continues to the end of the line (newline marker) whereas a block comment starts with one delimiter and ends with another and can cross lines
- Nestable {{endash}} whether a block comment can be inside another block comment
- How parsed with respect to the language; tools (including compilers and interpreters) may also parse comments but that may be outside the language definition
Other ways to categorize comments that are outside a language definition:
- Inline vs. prologue {{endash}} an inline comment follows code on the same line and a prologue comment precedes program code to which it pertains; line or block comments can be used as either inline or prologue
- Support for API documentation generation which is outside a language definition
= Line comment =
= Block comment =
In these examples, ~
represents the comment content, and the text around it are the delimiters. Whitespace (including newline) is not considered delimiters.
class="wikitable" |
Syntax
! Languages |
---|
comment ~ ;
|
¢ ~ ¢ ,# ~ # , co ~ co ,comment ~ comment
| ALGOL 68{{cite web|title=Algol68_revised_report-AB.pdf on PDF pp. 61–62, original document pp. 121–122|url=http://www.softwarepreservation.org/projects/ALGOL/report/Algol68_revised_report-AB.pdf|access-date=27 May 2014}}{{cite web|title=HTML Version of the Algol68 Revised Report AB|url=http://jmvdveer.home.xs4all.nl/report.html#941h|access-date=27 May 2014|url-status=dead|archiveurl=https://web.archive.org/web/20130317015548/http://jmvdveer.home.xs4all.nl/report.html#941h|archivedate=17 March 2013}} |
/* ~ */
| ActionScript, AutoHotkey, C, C++, C#, CSS, D,{{cite web|title=DLang.org, Lexical|url=http://dlang.org/lex.html#comment|access-date=27 May 2014}} Go, Java, JavaScript, Kotlin, Objective-C, PHP, PL/I, Prolog, Rexx, Rust (can be nested), Scala (can be nested), SAS, SASS, SQL, Swift (can be nested), V (Vlang), Visual Prolog |
#cs ~ #ce
| AutoIt{{cite web|title=AutoItScript.com Keyword Reference, #comments-start|url=https://www.autoitscript.com/autoit3/docs/keywords/comments-start.htm|access-date=27 May 2014}} |
/+ ~ +/
|
/# ~ #/
| Cobra (can be nested) |
<# ~ #>
|
<!-- ~ -->
|
=begin ~ =cut
| Perl (Plain Old Documentation) |
#`( ~ )
| Raku (bracketing characters can be (), <>, {}, [], any Unicode characters with BiDi mirrorings, or Unicode characters with Ps/Pe/Pi/Pf properties) |
=begin ~ =end
| Ruby |
#<TAG> ~ #TAG> , {{nowrap|#stop ~ EOF ,}}#iffalse ~ #endif , {{nowrap|#ifntrue ~ #endif ,}}#if false ~ #endif , {{nowrap|#if !true ~ #endif }}
| S-Lang{{cite web|title=slang-2.2.4/src/slprepr.c – line 43 to 113|url=ftp://space.mit.edu/pub/davis/slang/v2.2/slang-2.2.4.tar.bz2|access-date=28 May 2014}} |
{- ~ -}
| Haskell (can be nested) |
(* ~ *)
| Delphi, ML, Mathematica, Object Pascal, Pascal, Seed7, AppleScript, OCaml (can be nested), Standard ML (can be nested), Maple, Newspeak, F# |
{ ~ }
|
{# ~ #}
| Nunjucks, Twig |
{{! ~ }}
|
{{!-- ~ --}}
| Handlebars (cannot be nested, but may contain |
~
| Curl |
%{ ~ %}
|
~
|
~
| Julia{{cite web|url=https://docs.julialang.org/en/v1/base/punctuation/ | title=Punctuation · The Julia Language}} |
~
| Nim{{Cite web|url=https://nim-lang.org/docs/manual.html#lexical-analysis-multiline-comments|title=Nim Manual|website=nim-lang.org}} |
-- ~ ,--[=[ ~ ]=] ,--[= ...=[ ~ ]= ...=]
| Lua (brackets can have any number of matching = characters; can be nested within non-matching delimiters) |
" ~ "
|
(comment ~ )
| Clojure |
#If COMMENT Then ~ {{nowrap|#End If }}{{efn|Visual Basic (.NET) does not support traditional multi-line comments, but they can be emulated through compiler directives.}}
|
#if COMMENT ~ #endif {{efn|name=cs-cd|While C# supports traditional block comments /* ... */ , compiler directives can be used to mimic them just as in VB.NET.}}
| C# |
' comment _ or {{nowrap|REM comment _ }}{{efn|name=vb|The line continuation character _ can be used to extend a single-line comment to the next line without needing to type ' or REM again. This can be done up to 24 times in a row.}}
|
= Unique variants =
;Fortran
Indenting lines in Fortran 66/77 is significant. The actual statement is in columns 7 through 72 of a line. Any non-space character in column 6 indicates that this line is a continuation of the prior line. A 'C
' in column 1 indicates that this entire line is a comment. Columns 1 though 5 may contain a number which serves as a label. Columns 73 though 80 are ignored and may be used for comments; in the days of punched cards, these columns often contained a sequence number so that the deck of cards could be sorted into the correct order if someone accidentally dropped the cards. Fortran 90 removed the need for the indentation rule and added line comments, using the !
character as the comment delimiter.
;COBOL
In fixed format code, line indentation is significant. Columns 1–6 and columns from 73 onwards are ignored. If a *
or /
is in column 7, then that line is a comment. Until COBOL 2002, if a D
or d
was in column 7, it would define a "debugging line" which would be ignored unless the compiler was instructed to compile it.
;Cobra
Cobra supports block comments with "/#
... #/
" which is like the "/*
... */
" often found in C-based languages, but with two differences. The #
character is reused from the single-line comment form "#
...", and the block comments can be nested which is convenient for commenting out large blocks of code.
;Curl
Curl supports block comments with user-defined tags as in |foo# ... #foo|
.
;Lua
Like raw strings, there can be any number of equals signs between the square brackets, provided both the opening and closing tags have a matching number of equals signs; this allows nesting as long as nested block comments/raw strings use a different number of equals signs than their enclosing comment: --comment --[=[ nested comment ]=]
. Lua discards the first newline (if present) that directly follows the opening tag.
;Perl
Block comments in Perl are considered part of the documentation, and are given the name Plain Old Documentation (POD). Technically, Perl does not have a convention for including block comments in source code, but POD is routinely used as a workaround.
;PHP
PHP supports standard C/C++ style comments, but supports Perl style as well.
;Python
The use of the triple-quotes to comment-out lines of source, does not actually form a comment.[https://twitter.com/gvanrossum/status/112670605505077248 "Python tip: You can use multi-line strings as multi-line comments"], 11 September 2011, Guido van Rossum The enclosed text becomes a string literal, which Python usually ignores (except when it is the first statement in the body of a module, class or function; see docstring).
;Elixir
The above trick used in Python also works in Elixir, but the compiler will throw a warning if it spots this. To suppress the warning, one would need to prepend the sigil ~S
(which prevents string interpolation) to the triple-quoted string, leading to the final construct ~S""" ... """
. In addition, Elixir supports a limited form of block comments as an official language feature, but as in Perl, this construct is entirely intended to write documentation. Unlike in Perl, it cannot be used as a workaround, being limited to certain parts of the code and throwing errors or even suppressing functions if used elsewhere.{{cite web |url = https://hexdocs.pm/elixir/1.12.3/writing-documentation.html |title = Writing Documentation — Elixir v1.12.3 |access-date = 2023-07-28}}
;Raku
Raku uses #`(...)
to denote block comments.{{cite web|url=https://docs.perl6.org/language/syntax#Comments |title=Perl 6 Documentation (Syntax) |at=Comments |publisher=docs.perl6.org |access-date=2017-04-05}} Raku actually allows the use of any "right" and "left" paired brackets after #`
(i.e. #`(...)
, #`[...]
, #`{...}
, #`<...>
, and even the more complicated #`{{...}}
are all valid block comments). Brackets are also allowed to be nested inside comments (i.e. #`{ a { b } c }
goes to the last closing brace).
;Ruby
Block comment in Ruby opens at =begin
line and closes at =end
line.
;S-Lang
The region of lines enclosed by the
and
delimiters are ignored by the interpreter. The tag name can be any sequence of alphanumeric characters that may be used to indicate how the enclosed block is to be deciphered. For example,
could indicate the start of a block of LaTeX formatted documentation.
;Scheme and Racket
The next complete syntactic component (s-expression) can be commented out with #;
.
;ABAP
ABAP supports two different kinds of comments. If the first character of a line, including indentation, is an asterisk (*
) the whole line is considered as a comment, while a single double quote ("
) begins an in-line comment which acts until the end of the line. ABAP comments are not possible between the statements EXEC SQL
and ENDEXEC
because Native SQL has other usages for these characters. In the most SQL dialects the double dash (--
) can be used instead.
;Esoteric languages
Many esoteric programming languages follow the convention that any text not executed by the instruction pointer (e.g., Befunge) or otherwise assigned a meaning (e.g., Brainfuck), is considered a "comment".
= Comment comparison =
There is a wide variety of syntax styles for declaring comments in source code.
BlockComment
in italics is used here to indicate block comment style.
LineComment
in italics is used here to indicate line comment style.
class="wikitable" |
width=30%| Language
!width=30%| In-line comment !width=40%| Block comment |
---|
Ada, Eiffel, Euphoria, Occam, SPARK, ANSI SQL, and VHDL
| | |
ALGOL 60
| | |
ALGOL 68
| |
|
APL
| | |
AppleScript
| | |
Assembly language (varies)
| | |
AutoHotkey
| | |
AWK, Bourne shell, C shell, Maple, PowerShell
| | |
Bash
| | |
BASIC (various dialects):
|
| |
C (K&R, ANSI/C89/C90), CHILL, PL/I, REXX
| | |
C (C99), C++, Go, Swift, JavaScript, V (Vlang)
| | |
C#
| | |
COBOL I to COBOL 85
| | |
COBOL 2002
| | |
Curl
| |
|
Cobra
| | |
D
| |
|
DCL
| | |
ECMAScript (JavaScript, ActionScript, etc.)
| | |
Elixir
| | |
Forth
| |
|
FORTRAN I to FORTRAN 77
| | |
Fortran 90 and later
| | |
Haskell
| | |
J
| | |
Java
| |
|
Julia
| | |
Lisp, Scheme
| | |
Lua
| | |
Maple
| | |
Mathematica
| | |
Matlab
| | |
Nim
| | |
Object Pascal
| | |
OCaml
| | |
Pascal, Modula-2, Modula-3, Oberon, ML:
| | |
Perl, Ruby
| |
|
PGN, Red
| | |
PHP
| | |
PILOT
| | |
PLZ/SYS
| | |
PL/SQL, TSQL
| | |
Prolog
| | |
Python
| | (Documentation string when first line of module, class, method, or function) |
R
| | |
Raku
| |
|
Rust
|
|
|
SAS
| | |
Seed7
| | |
Simula
| | |
Smalltalk
| | |
Smarty
| | |
Standard ML
| | |
TeX, LaTeX, PostScript, Erlang, S-Lang
| | |
Texinfo
|
| |
TUTOR
| | |
Visual Basic
| | |
Visual Basic (.NET)
|
| |
Visual Prolog
| | |
Wolfram Language
| | |
Xojo
| |
Zig
| | |
See also
- C syntax
- C++ syntax
- Curly bracket programming languages, a broad family of programming language syntaxes
- Java syntax
- JavaScript syntax
- PHP syntax and semantics
- Python syntax and semantics
References
{{Reflist}}
Notes
{{Notelist}}