Questions tagged [semantics]

For questions related to the semantics of programming languages, i.e. the intent, meaning and action of syntactically valid code.

Filter by
Sorted by
Tagged with
3 votes
1 answer

Does ActionScript 3's specification use "frame" to mean the same thing as "scope"?

The ActionScript 3 specification frequently uses the term "frame" within the verification phase such as in: (1) Code inside a with statement will have a <...
Hydroper's user avatar
  • 909
19 votes
3 answers

How can I specify a programming language step-by-step more formally than by providing a reference interpreter?

I want to give an exact specification of the meaning of my programming language. I know how to write an interpreter for it, but: I don't want to require people to read the interpreter code to learn ...
David Young's user avatar
  • 1,967
11 votes
4 answers

Data structures for scopes and variable shadowing

Let's say I have some code in my target language like: ...
Rob N's user avatar
  • 1,073
10 votes
1 answer

How can denotational semantics be defined for imperative statements?

Denotational semantics associate each term in a program with some mathematical object representing the meaning of that term. When I see denotational semantics explained (e.g. in this answer), this is ...
kaya3's user avatar
  • 17.3k
6 votes
5 answers

What languages have semantics with more than one "way" to execute each statement?

This is a difficult question to get across because I don't think there is an established term for what I'm asking about. In the title I've called it "ways" of executing statements, but I ...
kaya3's user avatar
  • 17.3k
3 votes
1 answer

Call-by-value: Left-to-right vs right-to-left

There are three standard evaluation strategies for the lambda calculus: Call-by-value (CBV) Call-by-name Call-by-need There are two variants of CBV that differ on how they behave with respect to ...
user76284's user avatar
  • 159
24 votes
8 answers

Pros and cons of semantically-significant capitalization

In Go, capitalized identifiers are public (exported), while lowercase identifiers are private (within the package it's defined in). Most other programming languages don't have this sort of semantic ...
bigyihsuan's user avatar
  • 1,663
4 votes
1 answer

Algorithm for type resolution without forward declaration

I'm trying to find an algorithm/data structure behind type resolution without forward declaration. Something a little bit like this in Java: ...
Clément Jean's user avatar
13 votes
1 answer

What are denotational semantics, and what are they useful for?

The semantics of a language can be specified either by denotational semantics or operational semantics. These are sometimes summarised as: Denotational semantics specify the "meaning" of ...
kaya3's user avatar
  • 17.3k
14 votes
1 answer

How can we define a denotational semantics for recursive functions?

Motivation I want to define a denotational semantics (see here or here) for recursive functions in my language, by representing them as mathematical functions. Background Consider a simple language ...
David Young's user avatar
  • 1,967
8 votes
2 answers

Semantics of Haskell's `seq`

The section "The seq Function" on mentions that The seq function, which ...
Bubbler's user avatar
  • 703
5 votes
2 answers

Can something like a Donkey Sentence exist in a programming language?

I am interested, whether, in some programming language, there can be something like a Donkey Sentence, a sentence that defies straightforward attempts to translate it into a formal language, but is ...
FlatAssembler's user avatar
2 votes
3 answers

How should a language with period-based tuple indexing be parsed?

A few languages, most notably Rust, have tuple-indexing syntax that looks like this: tuple.0 // Access the first element of tuple This syntax is quite similar to ...
Ginger's user avatar
  • 2,579
5 votes
1 answer

How could I implement a non-null pointer qualifier in a C-style language?

In C currently, pointers just are, and there are no qualifiers to tell programmers whether they can be null or not. Objective-C kind of solves this problem by adding ...
user16217248's user avatar
  • 7,535
1 vote
1 answer

What computation models are typically used when designing a language? [closed]

I am familiar with the standard computation models like the RAM model, stack model etc. And I also know that operational semantics for a language views the language features as transitions in a ...
jude's user avatar
  • 27
11 votes
2 answers

What are the different types of import semantics?

As per my current understanding, there are many different ways that imports, and other related operations, are handled in different programming languages. For example, ...
FireTheLost's user avatar
  • 1,583
8 votes
6 answers

How might one formally communicate/define/describe a programming language design?

How would one formally define a programming language? What are the ways in which one can think about how to communicate a programming language design? What languages and frameworks exist with which to ...
Lee's user avatar
  • 195