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

Comments

Comments

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

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, MoonScript, Terra, PL/SQL, Agda, Frege, Dhall, Pig Latin, Transact-SQL, unison, Classroom Object Oriented Language, Aldor, zephyr-asdl, Literate Agda, omega, dex, Opal, VHDL-AMS, HiveQL, OCL, Grammatical Framework, manool, Bla, ISETL, Amazon Redshift, luau:
-- A comment
Example from R, Bash, Crystal, Sage, GraphQL, Smali, Nginx, MIPS architecture, AMPL, Nearley, TOML, Icon, Makefile, Boo, SPARQL, AGC, API Blueprint, Perl 6, LiveScript, YASnippet, starlark, PRQL, Dc, CWL, Ren'Py, WDL, Java Properties, Ragel, Unicon, Hjson, Expect, Filebench WML, mgmt, Dockerfile, Mu, LookML, Logica, ArkScript, GDScript, PIC, Tea, storyscript, Praat Script, Golo, Alpine Abuild, Vigil, spry, Pan, Reia, Raku, Ezhil, BitBake, S-PLUS, NestedText, Gentoo Ebuild, Rc, Parser 3, Gherkin, Parrot BASIC, Yet Another Scripting Language, Embedded Crystal, Zimpl, C shell, Yedalog, BuddyScript, Claro, 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 Haskell:
-- a single line comment {- A multiline comment which can continue for many lines -}
Example from Pascal:
{ This is a single line comment in pascal. But needs to be closed. }
Example from TypeScript, Objective-C, Reason, Solidity, Yacc, Groovy, OpenCL, CIL, ANTLR, V, Protocol Buffers, BCPL, idyll, FLUX, Hack, DOT, Rust MIR, Fantom, Ballerina, Zephir, Vala, Pug, Flow, Click, QML, Java Bytecode, xBase, JSON5, Ceylon, SuperCollider, SystemVerilog, HCL, Bison, odin, Dafny, Wren, ATS, Deno, Alloy, Modelica, Bicep, PEG.js, halide, Objective-J, Clipper, Less, AspectJ, PowerBuilder, XBase++, mlir, Argdown, Cue, CIL, Koka, eC, Eve, Ron, Cg, PAWN, SIL, OpenVera, Felix, Taichi, P4, BETA, MQL5, Angelscript, JAI, Volt, IGOR Pro, LPC, NetLinx, beads-lang, MiniD, Yoix, JADE, Concise Encoding, Mask, Whiley, DM, Linden Scripting Language, SugarSS, ShaderLab, FutureBASIC, Harbour, POV-Ray SDL, CartoCSS, Game Maker Language, Objective C++, Slice, mun-lang, Script.NET, OX, SimCode, Not Quite C, Strips, Spatial, SCSS, Cycript, winxed, MVEL, Flow9, Cell, LoomScript, Type Language, Not eXactly C, Treelang, Cypher Query Language, c3, Operational Control Language, Maya Embedded Language, Fable, Logos, KRL, Vale, spiral, tht, Q#, DAX, NS Basic, JSON with Comments, Rescript, dslx, CIR, gentee, Tuple space, CFScript, flagship, PowerQuery M, ddfql, Hocon, neeilang, hilvl, holyc, Adventure Game Studio Script, Nymph, Jsonnet, Language Server Index Format, Ligo, HuJSON, epsilon, Soy, silk, Judoscript, verifpal, Finite State Language, StruQL, owen-lang, kai, fizz, JSL, Sophia, OEM, Lite-C, Heron, Action Code Script, dlvm, xxl, Pnuts, ctalk-lang, OptimJ, sora, rbscript:
// A comment
Example from ARM, LLVM IR, Red, LFE, EuLisp, MUMPS, Emacs Lisp, x86 Assembly, Hy, CLIPS, NetLogo, Csound, wisp, Augmented Backus-Naur Form, Netwide Assembler, Fennel, datascript, carp, Action!, Guile, NCAR Command Language, KiXtart, CLOS, carth, Jasmin, GCC Machine Description, SMT, SRecode Template, Bel, lispyscript, Guix Workflow Language, MACRO-10, turnstile, neut, PROMAL, z80, Fjölnir, Project Mentat, taf, atomese, Reactive Plan Language, rosette-lang, ca65 Assembly, stella, Plot, wescheme, Sweet Expressions, lain:
; A comment
Example from Elixir:
# this is a comment
Example from Erlang:
% hello world program
Example from CUDA, ActionScript, Jison, X10, PL/I, Nextflow, PostCSS, Opa, B, Lex, JFlex, XS, DTrace, SourcePawn, Closure Templates, Xtend, PARI/GP, PL/M, ARexx, blockml, WebIDL, RenderScript, 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 Rexx:
* => 1000000000 */
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 Tex, Turing, Mercury, Datalog, KaTeX, Eclipse Command Language, Mary, Charity:
% A comment
Example from Oberon, Isabelle, UrWeb, Bluespec, EBNF, Fortress, COMPONENT PASCAL:
(* 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 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 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 Mouse:
~ A comment
Example from popr:
__ A comment
Example from dedukti:
(; This is a comment ;)
Example from Lexon:
COMMENT A comment
booleans-feature.html · comment-feature.html · directives-feature.html

View source

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