Jump to content

Talk:Syntax (programming languages)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Untitled

[edit]

cAn you give the exact meaning of syntax? iTs verY important... syntax meaning in programming?

Syntax in non textual languages

[edit]

Visual programming languages don't necessarily have sequences of characters, but they have syntax. Defining syntax as rules on text is too restrictive. Diego (talk) 12:43, 20 October 2008 (UTC)[reply]

Perl and Undecidability

[edit]

I've have changed the first source for the Perl/Undecidability discussion from it's original version in on a bulletin board, which has many flaws of presentation, to an later, carefully rewritten version which appeared in an edited journal. The new source in more in keeping with WP:Verifiability, and is just plain better all around. In the interests of full disclosure, I am the author of both. Since the new title presents no issues when taken literally, I also removed the comment. —Preceding unsigned comment added by Jeffreykegler (talkcontribs) 17:37, 15 April 2010 (UTC)[reply]

Actual definition of "syntax highlighting"

[edit]

The example highlights "str" differently than "children" because "str" is a keyword. However, I would argue that this is not a syntactic difference, it concerns semantics. So the "syntax highlighting" is actually more than that. Does anyone agree? How can we explain this? --Ysangkok (talk) 00:38, 25 December 2014 (UTC)[reply]

Image to use

[edit]
Computer programmer protest at SFO -noban Protest -Jan 29, 2016 (32451983322)

anyone know what language this is? Mercurywoodrose (talk) 21:26, 11 February 2017 (UTC)[reply]

This can be syntactically correct at least in many C-like languages, e.g. C, C++, Java, C#... -- 幻の上帝 (talk) 14:09, 1 March 2019 (UTC)[reply]

Normative syntax

[edit]

We should better clarify the boundary of syntax and semantic rules are not that simple.

In practical specializations of industrial programming languages, the rules of syntax are often insufficient to judge the correctness of the form of a source program.

For example, ISO C requires an implementation to diagnostic both syntactic and "constrained" semantic violations, despite the undefined behavior otherwise.

Further, C++ has the notion of well-formed program, which is (by definition) "constructed according to the syntax rules, diagnosable semantic rules, and the one-definition rule". The last two are definitely not in the set of syntax rules, but they literally constraint the form of a source program, with syntactic checks together during translation. Thus, the precise choice to make a rule syntactic or not is more or less normative in the specification (rather than being differentiated through the phases of implementation like "compilation" or "runtime"), namely it depends on the concrete design of the language being specified. One more side effect is, there may be no "real" (in the sense of the current article) full set of the syntax in a specification at all, although a proper subset of syntax rules can still be specified. In fact this is exactly the case of ISO C++.

Note the current examples can also be improved in this aspect. The lexeme sequence "(add 1 1" is syntactically ill-formed as per both ordinary Lisp syntax and the S-expression subset of that syntax. However, "(_ 1 1)" may be syntactically ill-formed as per the Lisp syntax, but definitely well-formed as per the S-expression syntax. Such divergence can be put in a same paragraph to show the variety of the choices.

-- 幻の上帝 (talk) 13:59, 1 March 2019 (UTC)[reply]

Wiki Education assignment: Linguistics in the Digital Age

[edit]

This article was the subject of a Wiki Education Foundation-supported course assignment, between 15 January 2024 and 8 May 2024. Further details are available on the course page. Student editor(s): Minhngo6 (article contribs).

— Assignment last updated by Cakelover44 (talk) 03:36, 19 February 2024 (UTC)[reply]