Re: What is the semantics of a language?

gah4 <gah4@u.washington.edu>
Wed, 26 Jan 2022 13:21:04 -0800 (PST)

          From comp.compilers

Related articles
What is the semantics of a language? costello@mitre.org (Roger L Costello) (2022-01-22)
Re: What is the semantics of a language? luser.droog@gmail.com (luser droog) (2022-01-24)
Re: What is the semantics of a language? gah4@u.washington.edu (gah4) (2022-01-25)
Re: What is the semantics of a language? gneuner2@comcast.net (George Neuner) (2022-01-26)
Re: What is the semantics of a language? gah4@u.washington.edu (gah4) (2022-01-26)
Re: What is the semantics of a language? lkrupp@invalid.pssw.com.invalid (Louis Krupp) (2022-02-18)
| List of all articles for this month |
From: gah4 <gah4@u.washington.edu>
Newsgroups: comp.compilers
Date: Wed, 26 Jan 2022 13:21:04 -0800 (PST)
Organization: Compilers Central
References: 22-01-081 22-01-113
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="67308"; mail-complaints-to="abuse@iecc.com"
Keywords: semantics
Posted-Date: 26 Jan 2022 20:23:21 EST
In-Reply-To: 22-01-113

On Wednesday, January 26, 2022 at 11:48:28 AM UTC-8, George Neuner wrote:


(snip)


> I learned addition in /elementary/ school - so is addition elementary?
> Or is it composite? The reader has to know - or be told - that in the
> context of compiling "2" should be considered elementary but "1 + 1"
> should be considered composite.


For some reason, I have recently been answering questions (not here) about
which AP calculus class to take, and when.


I was reminded about the way some students think about math. That they
learn each subject (algebra, geometry, calculus), take the exam, check
it off the list of accomplishments, and then forget about it.


And my counterexample is that you still need the addition you learned
in first grade, even in calculus. (This is especially for students
hoping to finish calculus before college, so they don't have to think
about it any more.)


But as recent discussions here have noted, you can't completely
separate syntax and semantics. The line is fuzzy. A compiler class
might teach syntax for some lectures, and semantics later, try to
separate them to make it easier for students, but in the end you need
both of them.


This goes back to the way languages are defined. It goes into the way
compilers are written, which isn't always the same way as the language
definition. (And is more important when you try to get error messages
right.)


I remember so many years ago, learning about operator precedence
parsers, but that seems to be a lost art now.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.