1= References =
2
3This is a collection of notes and references on relevant syntactic
4variations in different computer languages.
5
6General references::
7
8http://progopedia.com/[the free encyclopedia of programming languages]
9
10== Standard Model ==
11
12Standard Model (SM) describes a large group of languages with
13Algol-like syntax and the following traits:
14
15* Double-quoted string literals.
16* Single-quoted character literals with exactly one character in them.
17
18There may or may not be a statement terminator/separator.
19
20== C Model ==
21
22C model adds to SM
23
24* C-style backslash escapes for string delimiters.
25* /\* \*/ block comments, no nesting.
26* // winged comments.
27* Statements terminated by ;.
28* Block begin and end are { }.
29
30Winged comments were introduced in C99 from C++ and were not present
31in older C.
32
33== Lisp Model ==
34
35* Double-quoted string literals.
36* A tick operator, always following a space.
37* Winged comments with semicolons
38* No statement terminator.
39* May or may not have block-comment syntax.
40
41== Ada ==
42
43SM plus a tick operator; tick always follows and precedes an
44identifier with no whitespace intervening.
45
46* Winged comments with --.
47* Statements terminated by ;.
48* Block begin-end are :begin" and "end".
49
50String Literals::
51https://www.adaic.org/resources/add_content/standards/05rm/html/RM-2-6.html
52
53Tick operator::
54https://stackoverflow.com/questions/7564183/anyone-can-give-me-a-summary-of-single-quote-mark-usage-in-ada
55
56Comments::
57https://www.adaic.org/resources/add_content/standards/05rm/html/RM-2-7.html
58
59== B ==
60
61* Double-quoted strings.
62* Character literals may have more than one character, the value is
63  packed into a machine word; see "putchar('*n*n');".
64* Winged comments with //.
65* /\* \*/ block comments, nesting unspecified.
66* No C backslashes yet.  Has a pre-C escape convention using an asterisk.
67* Statements terminated by ;.
68
69Block begin/end are C-like { }.
70
71User's Manual::
72https://www.bell-labs.com/usr/dmr/www/kbman.html
73
74== BCPL ==
75
76* Single quoted strings.
77* No backslashing.
78* No syntactic use of double quotes.
79* Winged comments, no block comments.
80* No statement terminator.
81
82Block begin/end are C-like { }.
83
84Reference manual::
85https://www.bell-labs.com/usr/dmr/www/bcpl.html
86
87== C, C++, Objective-C, Yacc, Lex, Java ==
88
89Straight C model.
90
91* Yacc and Lex have %% sections with different syntax.
92* Java string and character literals may contain Unicode.
93* C preprocessor is applied.
94
95Syntax reference for C and C++::
96https://www.cprogramming.com/reference/
97
98== C# ==
99
100* C model
101* Verbatim strings start with @" and end with " and may span multiple lines.
102
103Specification::
104https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure
105
106== ChucK ==
107
108C-style winged and block comments.
109No string or character literal syntax.
110Statements terminated by ;.
111
112Specification::
113http://chuck.cs.princeton.edu/doc/language/
114
115== CoffeeScript ==
116
117Block comments with ### , winged comments #.
118Strings with ' or " and can be multiline.
119Block strings with """ and '''.
120
121Language reference::
122https://coffeescript.org/#language
123
124== Crystal ==
125
126# winged comments. No block comments.
127C-style string and character literals with escapes.
128Regexp literals with bare / syntax.
129No statement terminator.
130Blocks with do/end.
131
132Language reference::
133https://crystal-lang.org/reference/
134
135== Dylan ==
136
137* C-style block and winged comments.
138* String and character literals as in C, with backslash escapes.
139* Statements terminated by ;.
140* Idiosyncratic ALGOL-68-like block syntax.
141
142Reference manual::
143https://opendylan.org/books/drm/
144
145== elisp ==
146
147Lisp model. No block comments.
148
149Reference::
150https://www.gnu.org/software/emacs/manual/html_mono/elisp.html
151
152== Elixir ==
153
154No block comments, winged comments with #.
155Strings with ' or ", multiline strings with """ or '''.
156No statement terminator.
157
158There are regexp literals, led with ~r/.
159
160== Elvish ==
161
162* Winged comments with #
163* No block comments.
164* Backslash line continuation
165* String literals with ' or ".
166* Strings may contain newlines.
167* C-style backslash escapes
168
169Reference::
170https://elv.sh/ref/language.html
171
172== Factor ==
173
174Forthlike, token-oriented language.
175Winged comment with !.
176Strings with ". C-style backslash escapes.
177
178Factor handbook::
179https://docs.factorcode.org/content/article-handbook.html
180
181== Fantom ==
182
183C-like comments with /* */ and //.
184There's an additional synax ** for documentation comments.
185
186String literals with " and C backslashes.
187Triple-quote string literals with """.
188There's an idiosyncratic third string literal syntax for DSLs.
189C-like block syntax with { }.
190No statement terminator.
191
192Language documentation::
193https://fantom.org/doc/docLang/index
194
195== Forth ==
196
197* Block comments with ( )
198* Winged comments with \\
199* The Forth word s" pushes its token argument on the stack as a literal.
200
201Guide::
202http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm
203
204More references::
205http://www.forth.org/fig.html
206
207
208== Groovy ==
209
210Like Java with some additions: inline string literals with both " and
211', Python style mutiline strings delimited by """ and '''.
212It also has "slashy strings" which behave like bare regexp literals.
213And dollar-slashy strings, a multiline version of same.
214
215Groovy allows a hashbang comment at start of text.
216
217Syntax reference::
218http://groovy-lang.org/syntax.html
219
220== Guile ==
221
222Lisp model with C backslashing.
223
224Escapes::
225https://www.gnu.org/software/guile/manual/html_node/Backslash-Escapes.html
226
227== Haxe ==
228
229C-style block and winged commments.
230Strings may have " or ' as delimiter.
231Regexp literals with ~// syntax.
232C backslashes are interpreted.
233Statements terminated by ;.
234C-style begin/end with {}.
235
236Manual::
237https://haxe.org/manual
238
239Strings::
240https://code.haxe.org/category/beginner/strings.html
241
242Regexps::
243https://haxe.org/manual/std-regex.html
244
245== Hy ==
246
247Lisp model.  Newlines are allowed in  strings.
248
249Syntax reference::
250http://docs.hylang.org/en/stable/language/syntax.html#string-literals
251
252== Io ==
253
254Winged comments with //. Block comments with /* */.
255Winged comments with # are also allowed.
256Strings with "".  C-style backslashes.
257
258Reference::
259http://iolanguage.com/index.html
260
261== JavaScript, ActionScript, es6, Typescript ==
262
263C model comments and inline strings.
264Adds single-quoted strings, regular-expression literals with bare // syntax.
265Statements terminated by ;.
266C-style begin/end with {}.
267
268Typescript is a syntactic superset of JavaScript.
269ActionScript is a JavaScript dialect for the Flash macromedia player.
270
271es6 Standard::
272https://www.ecma-international.org/ecma-262/9.0/
273
274Typescript handbook::
275http://www.typescriptlang.org/docs/handbook/basic-types.html
276
277Regexp literals::
278https://eloquentjavascript.net/09_regexp.html
279
280== JSX ==
281
282Reference::
283https://jsx.github.io/doc.html
284
285== LiveScript ==
286
287* Block comments with /* , winged comments #.
288* Strings with ' or " and can be multiline.
289* Block strings with """ and '''.
290
291Language reference::
292http://livescript.net/#overview
293
294== Logo ==
295
296* Winged comments begin with ;.  There are no block comments.
297* String literals begin with " and are terminated by whitespace.
298* No statement terminator.
299
300Reference manual::
301https://people.eecs.berkeley.edu/~bh/v2ch14/manual.html
302
303== mal ==
304
305Mal is a small pedagogic Lisp with multiple implementations that
306follow the Make-A-Lisp process.
307
308Standard Lisp model. Strings have C backslashes.
309
310Repository::
311https://github.com/kanaka/mal
312
313== MoonScript ==
314
315Reference::
316https://moonscript.org/reference/
317
318== Pony ==
319
320String literals with double quotes.
321Winged comments with //.
322No statement terminator.
323
324Like Python, module comments are multistring literals.
325
326Cheat sheet::
327https://www.ponylang.io/media/cheatsheet/pony-cheat-sheet.pdf
328
329== PowerShell ==
330
331* Winged comments with #, block commenrs with <# #>
332* Strings with "".
333* Idiosyncratic escape syntax with backtick.
334* C-like blocks with { }.
335* No statement terminator.
336
337PowerShell syntax::
338https://ss64.com/ps/syntax.html
339
340== PostScript ==
341
342PostScript is a stack-based language with graphics capabilities. It is
343usually used for defining documents that will render to printer or
344screen. PostScript files are typically generated and most PostScript
345generators put a comment starting with !PS-Adobe on the first line.
346
347Winged-comment leader us %.  No block comments.
348
349Reference manual::
350https://www.adobe.com/content/dam/acom/en/devnet/actionscript/articles/PLRM.pdf
351
352== Racket ==
353
354Lisp-model syntax. C backslash escapes.
355
356Has #| |# block comments which nest.  .
357
358Groovy allows a hashbang comment at start of text.
359
360Syntax::
361https://docs.racket-lang.org/reference/reader.html
362
363== Scala ==
364
365C-model comments, string/character literals, and escapes.
366C-style block syntax.
367No statement terminator.
368
369Specification::
370https://www.scala-lang.org/files/archive/spec/2.12/
371
372== Skew ==
373
374Winged commends with #. No bloc comments.
375String lterals with ; or " and C-style backslashes.
376C-style block syntax.
377
378Language reference::
379http://skew-lang.org/
380
381== Smalltalk ==
382
383The GNU implementation of Smalltalk-80.
384
385Winged comments with //.  No block comments.
386An initial hashbang line is allowed, but loccount doesn't know what
387"gst" means.
388
389User's Guide::
390https://www.gnu.org/software/smalltalk/manual/html_node/Tutorial.html
391
392== Visual Basic ==
393
394* Winged coments with '.
395* No block comments.
396* String literals with ""
397* C-style backslashes.
398* No statement terminator.
399
400Syntax::
401https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/
402
403== Vimscript ==
404
405* String literals with " at start of line.
406* String literals with ' or ".
407* C backslash escapes.
408
409Guide::
410http://learnvimscriptthehardway.stevelosh.com/
411
412== WebAssembly Macros ==
413
414Standard WebAssembly text format .wat is s-expr based. .wast is the
415same syntax but denotes spec tests files (multiple modules, asserts,
416etc). .wam refers to WebAssembly Macro language
417(https://github.com/kanaka/wam) and also uses the same syntax.
418
419Winged comments with ;. Block comments with (; ;). Strings are ".
420
421Specification::
422https://webassembly.github.io/spec/
423
424Syntax::
425https://github.com/WebAssembly/spec/tree/master/interpreter/#s-expression-syntax
426
427== XC ==
428
429C-model syntax.
430
431Specification::
432// https://www.xmos.com/developer/xc-specification?version=X5965A
433
434== Yorick ==
435
436C-model comments, string/character literals, and escapes.
437C-style block syntax.
438
439Reference::
440https://dhmunro.github.io/yorick-doc/qref/qrlang00.html
441