PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

Comments

Comments

< >

Comments is a language feature.

Comments generally refer to free text ignored by the compiler that is not part of the language grammar.


Languages without Comments include JSON, Regular Expressions, JCOF

Languages with Comments include Java, JavaScript, C, Python, SQL, C++, HTML, XML, PHP, Perl, MATLAB, C#, Ruby, Fortran, MySQL, R, Go, CSS, COBOL, Ada, Scala, Swift, PostgreSQL, Rust, PowerShell, Kotlin, Pascal, ARM, Haskell, Lua, TypeScript, SAS, Prolog, Bash, Clojure, Objective-C, Mathematica, Erlang, Elixir, Visual Basic, CUDA, Dart, Julia, Scheme, Modula-2, Tcl, VBA, ActionScript, Solidity, Verilog, Reason, BASIC, Crystal, Delphi, awk, CoffeeScript, F#, Maple, Elm, OCaml, Eiffel, Modula-3, YAML, Yacc, Smalltalk, Racket, Groovy, Sage, D, Common Lisp, GraphQL, VHDL, LaTeX, Nginx, APL, Smali, OpenCL, XQuery, LLVM IR, Nim, SPSS, PostScript, Visual Basic .NET, Chapel, Red, Haxe, Rexx, WebAssembly, LFE, PureBasic, Forth, fish, ANTLR, MIPS architecture, VBScript, Lasso, CIL, Oz, Applescript, Oberon, SVG, Tex, Idris, Protocol Buffers, ABAP, AMPL, Simula, PureScript, Logo, sed, PicoLisp, V, BCPL, PL/SQL, Processing, HAML, REBOL, Hack, FLUX, DOT, Nearley, Rust MIR, idyll, MoonScript, Dylan, Terra, Fantom, Squirrel, Monkey, Jison, Agda, BlitzBasic, EuLisp, Ballerina, ColdFusion, Frege, MUMPS, Emacs Lisp, AutoIt, Zig, x86 Assembly, GNU Octave, TOML, Hy, Lean, NewLisp, Zephir, Icon, Vala, X10, Flow, Makefile, Turing, Pug, J, Scilab, QML, Mercury, Io, PL/I, IDL, xBase, Nextflow, Click, Boo, EDN, PostCSS, QBasic, Java Bytecode, Ceylon, Nemerle, SPARQL, JSON5, Object Pascal, Clean, SystemVerilog, Opa, SuperCollider, Stata, CLIPS, SNOBOL, NetLogo, Bison, HCL, AGC, Factor, API Blueprint, PL/pgSQL, Deno, odin, Isabelle, TLA, Batchfile, Ini, MiniD, Wren, Pike, ATS, ClojureScript, Dafny, eC, Csound, S-algol, Lex, B, Xojo, FoxPRO, Dhall, Perl 6, GW-BASIC, Alloy, Embedded Crystal, E, LiveScript, Modelica, AutoHotkey, halide, Clipper, Bicep, Objective-J, PEG.js, M4, wisp, Datalog, Wolfram Language, Gambas, Befunge, UrWeb, PowerBuilder, Less, Seed7, XS, GAP, Twig, Pig Latin, Classroom Object Oriented Language, YASnippet, Genie, Maxima, AspectJ, Falcon, JFlex, Transact-SQL, XBase++, starlark, FreeBASIC, SETL, Cap'n Proto, unison, KaTeX, Netwide Assembler, PRQL, Dc, DTrace, NSIS, PEG, Golo, Bluespec, Croc, WxBasic, JCL, True BASIC, Augmented Backus-Naur Form, Fennel, Ion, mlir, CWL, Sather, Oberon-2, K, LiveCode, Closure Templates, SourcePawn, WDL, Cue, CIL, Eve, Xtend, datascript, Java Properties, Ren'Py, Argdown, EBNF, Koka, Ragel, Fortress, HLSL, muPad, Unicon, HOPE, PARI/GP, Ring, XSLT, Gosu, OpenVera, SIL, Hjson, GLSL, Ron, Expect, BETA, Action!, carp, Mirah, Cg, LilyPond, PL/M, IGOR Pro, UNLAMBDA, Felix, PAWN, Pony, Taichi, Slope, JAI, P4, QB64, LPC, MQL5, Jule, Guile, Euphoria, Angelscript, beads-lang, NCAR Command Language, mgmt, KiXtart, Volt, Dockerfile, Futhark, LotusScript, Filebench WML, Spin, JADE, Yoix, NetLinx, ThinBasic, Concise Encoding, blockml, ARexx, CLOS, Cryptol, S3, LookML, Mu, OpenSCAD, Apex, BlitzMax, Aldor, Logica, Joy, DM, Gettext Catalog, ooc, Linden Scripting Language, GDScript, Neko, Nit, Eclipse Command Language, clay, Lily, PIC, ShaderLab, FutureBASIC, Mask, Tea, Turbo Basic, ArkScript, StarOffice Basic, Harbour, Whiley, zephyr-asdl, COMPONENT PASCAL, POV-Ray SDL, carth, SugarSS, CartoCSS, Ch, Jasmin, RenderScript, Literate Agda, Fancy, WebIDL, Game Maker Language, Observable, storyscript, PowerBASIC, Praat Script, Refal, Edje Data Collection, Objective C++, Not Quite C, omega, OX, Alpine Abuild, Slice, mun-lang, CLIST, OpenEdge ABL, SimCode, ECL, BLISS, JSON with Comments, Vigil, GCC Machine Description, ActiveVFP, Shen, Fibonacci, Brightscript, Reia, SCSS, MVEL, Script.NET, Cycript, winxed, Raku, Caché Basic, SMT, Ezhil, NetRexx, Strips, spry, Logtalk, Spatial, Pan, Cell, Not eXactly C, SRecode Template, Flow9, Mary, Creative Basic, MAXScript, LoomScript, Type Language, MOO, Treelang, Arden syntax, dex, Operational Control Language, VHDL-AMS, Bel, Fable, c3, Opal, FML, Handel-C, Cypher Query Language, XBLite, Logos, lispyscript, Lingo, ACL2, Gerbil Scheme, Maya Embedded Language, HiveQL, Quaint, Dale, Guix Workflow Language, basic calculator, MACRO-10, KRL, Module Management System, turnstile, NS Basic, S-PLUS, tht, monte, Q#, dslx, Plus, Xbasic, NestedText, neut, OCL, BitBake, Gentoo Ebuild, Vale, gentee, Rescript, spiral, Grammatical Framework, PROMAL, HAGGIS, Redcode, Mako, Simple Actor Language System and Architecture, Frink, Parser 3, Rc, CIR, Gherkin, flagship, RELAX NG, JSLT, DAX, Orc, ddfql, Hocon, neeilang, hilvl, PowerQuery M, Tuple space, Yet Another Scripting Language, Recfiles, holyc, CFScript, Parrot BASIC, txr, Zimpl, Nymph, Jsonnet, Boron, Ren, Mouse, Language Server Index Format, Ligo, NESL, Adventure Game Studio Script, C shell, Charity, dlvm, epsilon, GraphQL Schema Definition Language, Z, JS++, Pawn, manool, Uniform eXchange Format, Judoscript, Finite State Language, Soy, HuJSON, silk, Augeas, Claro, Fjölnir, z80, owen-lang, verifpal, StruQL, Yedalog, kai, BuddyScript, fizz, JSL, ldpl, OEM, popr, Easytrieve, Lite-C, Structured Query Reporter, Sophia, parasail, Manchester syntax, dedukti, pointless, Project Mentat, tremor-query, Heron, taf, atomese, TAL, Reactive Plan Language, FloScript, Action Code Script, XPL0, ISETL, Boogie, rosette-lang, xxl, Bla, False, Lexon, Urbiscript, ca65 Assembly, ctalk-lang, rbs, Pnuts, Portable Bit Map Format, Wart, stella, Savi, OptimJ, ProbeVue, AmbientTalk, Plot, Netpbm grayscale image format, Amazon Redshift, USD, wescheme, Robots.txt, lain, luau, bioscript, ppm-format, sora, SubX, RLaB, blz, Sweet Expressions, Rita, KonsolScript, boa, PromQL, Spice, SARL, rbscript, Smithy, PacmanConf, PkgConfig, BABEL, Lighttpd configuration file, SNOBOL4

Example from C:
/* hello world */ // hi
Example from Python, Julia:
# This is a comment
Example from HTML:
<!-- Hello World in HTML -->
Example from Perl:
# This is a comment in perl =begin comment This is all part of multiline comment. You can use as many lines as you like These comments will be ignored by the compiler until the next =cut is encountered. =cut
Example from MATLAB:
% This is a comment
Example from C#, Go:
// This is a comment
Example from Ruby:
# This is a single line comment.
Example from Fortran:
C C Lines that begin with 'C' (in the first or 'comment' column) are comments C
Example from MySQL, PostgreSQL, Idris, PL/SQL, MoonScript, Terra, Agda, Frege, Dhall, Pig Latin, Classroom Object Oriented Language, Transact-SQL, unison, Aldor, zephyr-asdl, Literate Agda, omega, dex, VHDL-AMS, Opal, HiveQL, OCL, Grammatical Framework, manool, ISETL, Bla, Amazon Redshift, luau:
-- A comment
Example from R, Bash, Crystal, Sage, GraphQL, Nginx, Smali, MIPS architecture, AMPL, Nearley, TOML, Icon, Makefile, Boo, SPARQL, AGC, API Blueprint, Perl 6, Embedded Crystal, LiveScript, YASnippet, starlark, PRQL, Dc, Golo, CWL, WDL, Java Properties, Ren'Py, Ragel, Unicon, Hjson, Expect, mgmt, Dockerfile, Filebench WML, LookML, Mu, Logica, GDScript, PIC, Tea, ArkScript, storyscript, Praat Script, Alpine Abuild, Vigil, Reia, Raku, Ezhil, spry, Pan, S-PLUS, NestedText, BitBake, Gentoo Ebuild, Parser 3, Rc, Gherkin, Yet Another Scripting Language, Parrot BASIC, Zimpl, C shell, Claro, Yedalog, BuddyScript, ldpl, tremor-query, rbs, Portable Bit Map Format, Wart, Netpbm grayscale image format, Robots.txt, ppm-format, SubX, blz:
# A comment
Example from CSS:
/* This is a single-line comment */ p { color: red; }
Example from Rust:
// https://doc.rust-lang.org/reference/comments.html // a comment
Example from Pascal:
{ This is a single line comment in pascal. But needs to be closed. }
Example from ARM, LLVM IR, Red, LFE, EuLisp, MUMPS, Emacs Lisp, x86 Assembly, Hy, CLIPS, NetLogo, Csound, wisp, Netwide Assembler, Augmented Backus-Naur Form, Fennel, datascript, Action!, carp, Guile, NCAR Command Language, KiXtart, CLOS, carth, Jasmin, GCC Machine Description, SMT, SRecode Template, Bel, lispyscript, Guix Workflow Language, MACRO-10, turnstile, neut, PROMAL, Fjölnir, z80, Project Mentat, taf, atomese, Reactive Plan Language, rosette-lang, ca65 Assembly, stella, Plot, wescheme, lain, Sweet Expressions:
; A comment
Example from Haskell:
-- a single line comment {- A multiline comment which can continue for many lines -}
Example from TypeScript, Objective-C, Solidity, Reason, Yacc, Groovy, OpenCL, ANTLR, CIL, Protocol Buffers, V, BCPL, Hack, FLUX, DOT, Rust MIR, idyll, Fantom, Ballerina, Zephir, Vala, Flow, Pug, QML, xBase, Click, Java Bytecode, Ceylon, JSON5, SystemVerilog, SuperCollider, Bison, HCL, Deno, odin, MiniD, Wren, ATS, Dafny, eC, Alloy, Modelica, halide, Clipper, Bicep, Objective-J, PEG.js, PowerBuilder, Less, AspectJ, XBase++, Croc, mlir, Cue, CIL, Eve, Argdown, Koka, OpenVera, SIL, Ron, BETA, Cg, IGOR Pro, Felix, PAWN, Taichi, JAI, P4, LPC, MQL5, Angelscript, beads-lang, Volt, JADE, Yoix, NetLinx, Concise Encoding, DM, Linden Scripting Language, ShaderLab, FutureBASIC, Mask, Harbour, Whiley, POV-Ray SDL, SugarSS, CartoCSS, Game Maker Language, Objective C++, Not Quite C, OX, Slice, mun-lang, SimCode, JSON with Comments, SCSS, MVEL, Script.NET, Cycript, winxed, Strips, Spatial, Cell, Not eXactly C, Flow9, LoomScript, Type Language, Treelang, Operational Control Language, Fable, c3, Cypher Query Language, Logos, Maya Embedded Language, KRL, NS Basic, tht, Q#, dslx, Vale, gentee, Rescript, spiral, CIR, flagship, DAX, ddfql, Hocon, neeilang, hilvl, PowerQuery M, Tuple space, holyc, CFScript, Nymph, Jsonnet, Language Server Index Format, Ligo, Adventure Game Studio Script, dlvm, epsilon, Judoscript, Finite State Language, Soy, HuJSON, silk, owen-lang, verifpal, StruQL, kai, fizz, JSL, OEM, Lite-C, Sophia, Heron, Action Code Script, xxl, ctalk-lang, Pnuts, OptimJ, sora, rbscript:
// A comment
Example from Erlang:
% hello world program
Example from Elixir:
# this is a comment
Example from CUDA, ActionScript, Jison, X10, PL/I, Nextflow, PostCSS, Opa, Lex, B, XS, JFlex, DTrace, Closure Templates, SourcePawn, Xtend, PARI/GP, PL/M, blockml, ARexx, RenderScript, WebIDL, Edje Data Collection, CLIST, Arden syntax, Handel-C, Plus, Simple Actor Language System and Architecture, ProbeVue, bioscript:
/* A comment */
Example from Dart:
// Hi /* Assume address is not null. */
Example from BASIC:
REM This BASIC program shows the use of the PRINT and GOTO Statements.
Example from OCaml:
(* This is a single-line comment. *) (* This is a * multi-line * comment. *)
Example from XQuery:
(: Hello World with XQuery :)
Example from SPSS:
* A comment where first character must be *.
Example from Visual Basic .NET, Monkey, WxBasic, QB64, Spin, ThinBasic, Turbo Basic, StarOffice Basic, PowerBASIC, Brightscript, Caché Basic, Creative Basic, XBLite, Xbasic:
' A comment
Example from Rexx:
* => 1000000000 */
Example from Oberon, Isabelle, UrWeb, Bluespec, EBNF, Fortress, COMPONENT PASCAL:
(* A comment *)
Example from Tex, Turing, Mercury, Datalog, KaTeX, Eclipse Command Language, Mary, Charity:
% A comment
Example from HAML:
-# A comment
Example from Object Pascal:
(* This is a multi-line comments and it will span multiple lines. *) { This is a single line comment in pascal }
Example from SNOBOL, Refal, ActiveVFP:
* A comment
Example from TLA:
\* A comment
Example from Batchfile:
REM A comment
Example from Ini:
# a '#' or ';' character indicates ; a comment
Example from S-algol, True BASIC, BLISS, Module Management System, Structured Query Reporter:
! A comment
Example from Wolfram Language:
(* A comment *)
Example from Twig:
{# A comment #}
Example from HOPE:
--- A comment
Example from Slope:
; I am a comment
Example from Jule:
// A comment /* A comment */
Example from S3:
@ a comment @
Example from Fibonacci:
(* query examples *)
Example from FML:
# This is a line comment ### This is a block comment ###
Example from Quaint:
;; A comment
Example from HAGGIS:
''' A comment '''
Example from RELAX NG:
# Comments start with a # and continue to the end of the line:
Example from Orc:
{- A comment -}
Example from Recfiles:
# Blah blah… # Unlike some file formats, comments in recfiles must be complete lines. You cannot start a comment in the middle of a line.
Example from Mouse:
~ A comment
Example from Z:
-- A simple function, that is used inside the macro below. defun ap x y ++ x y defmacro : input z:string input -- Example with print: print : Hello, World! What's going on in here?
Example from Uniform eXchange Format:
# <This is a comment>
Example from popr:
__ A comment
Example from dedukti:
(; This is a comment ;)
Example from Lexon:
COMMENT A comment
binary-operators-feature.html · comment-feature.html · directives-feature.html

View source

PLDB - Build the next great programming language · v2022 · Day 111 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com