# Questions tagged [programming-languages]

Questions related to design, implementation, and analysis of programming languages. NOT for questions about how to program, which are off-topic on this site.

785 questions
Filter by
Sorted by
Tagged with
19 views

### Policies for handling symbols leaking out of a lexical scope

Suppose it's possible for a symbol to escape the scope in which it is defined. What are considered the possible policies for handling that? I mean possible in the sense of what choices of language ...
11 views

### How to class object from one page to another page asp.net [closed]

How I can pass information from page 1 to page 2 when I click in button. By using only class object by c# asp.net . Example for a form (cv) : Page 1 First Name : abc Last name : dcd Sumbit Page 2 : ...
20 views

### What are the correlation between Actor model and Reactive Programming

Could anyone explain the difference/relation between the Actor model and Reactive programming? It seems that they are located at different levels of abstraction - one can design the interaction ...
43 views

### What is the property of a PL that extracting a subroutine should not change the meaning?

What is the name of the property of a Programming Language that says that extracting a subprogram into a subroutine and using that subroutine instead of the subprogram should not change the meaning of ...
53 views

### Are there any educational virtual machines?

There is plenty of machine/assembly languages such as LC-3, DLX, etc. designed for educational purposes. I am looking for an educational VM, by VM I mean stack virtual machine that has instructions ...
36 views

36 views

### What is the main concept of a promise?

The short question is: is a promise just a way to separate the code into different sections, so that when task 1 is done, do this task 2, 3, and 4. And when task 2 is done, do task 5, and so on? These ...
17 views

### How does one program in a tag system?

I've played with 2-tag systems a bit and read all about tag/lag systems. They're great for experimenting with computation, and obviously useful as intermediaries in various proofs. My question is: ...
72 views

### Applying FP/Categorical terminology to non-FP languages

In my continuing effort to finally wrap my brain around advanced FP/categorical concepts, I've been reading dozens of articles and tutorials; what I have concluded is that: 1) Category Theory and ...
16 views

### If declarative programming is possible at the instruction/action level?

I am considering what the possibilities are with declarative programming. I have a firm understanding of how to use declarative programming in practice, but, short of having examples, I don't know if ...
30 views

### How does progress fail in system $F_{\omega}$ when types $T_1 \to T_2$ and $T_2 \to T_1$ are equivalent?

Pierce's TAPL book gives in exercise 30.3.17 the setting where $T_1 \to T_2 \equiv T_2 \to T_1$ (the function type are assumed to be equivalent). In the solutions, he claims that this assumption ...
84 views

In lemma 30.3.9, Pierce states a confluence property for $F_{\omega}$: $S \to_* T \land S \to_* U \implies \exists V. T \to_* V \land U \to_* V$ He then states the following proposition: $S \... 0answers 28 views ### On the diamond property for$F_{\omega}$in TAPL In page 455, of Pierce´s TAPL and page 560, the single-step diamond property of reduction:$S \Rrightarrow S' \land T \Rrightarrow T' \implies \exists V. T \Rrightarrow V \land U \Rrightarrow V$... 0answers 51 views ### Are the permutation or weakening lemmas needed for term substitution? In TAPL book, page 453, Pierce discusses the following lemma:$\Gamma , x:S , \Delta \vdash t:T \land \Gamma \vdash s:S \implies \Gamma, \Delta \vdash [x \mapsto s]t:T$He claims that when$t$is ... 1answer 46 views ### Does a generator really stops the execution at the machine code level, and does it not use the stack? Never have I heard of a partially executed function before. But it seems the idea of it has been out for some time. Does a generator really stop execution at the machine code level, and that next ... 0answers 42 views ### What is the first programming language where the keyword “new” appeared? It's really interesting when this keyword first appeared as a lot of popular languages but relatively old languages( C++, C#, Java, JS ) use it. I understand use of "new" in C++ in practical manner( ... 1answer 58 views ### Why does the category of language types have morphisms, not functors? I am probably not phrasing this question well, so please bear with me as I try to explain what I mean. I am working on learning category theory, as applied to programming. So far, I understand that: ... 1answer 30 views ### What is the relation between a programming language and the language of its input? I find some references say that all the features of programming language fall within what can be captured by context-sensitive grammars. In fact, no programming language known to humankind anything ... 2answers 194 views ### Why is the assignment rule the way it is in Hoare Logic? Why is the assignment rule the way it is in Hoare Logic/Axiomatic Semantics? I can't wrap my head around why the assignment rule is backwards from what I expected. I understand Hoare logic is use to ... 1answer 53 views ### How to translate automaton (Turing machine) into the program of high level programming language? Every program in high level ("industrial") programming language can be expresses as some Turing machine. I guess, that there exists universal algorithm for doing that (e.g. one can take the Cartesian ... 2answers 31 views ### Are these two sensible and related or unrelated ways of regarding a logic system as a programming language? When I am trying to understand logic programming languages e.g. Prolog, I am immediately confused by the following two ways of relating logic systems and programming languages or type systems. In ... 0answers 30 views ### What are the pros and cons of these two coding patterns/structures? And do they have a formal term? I have traditionally been doing things like this: function test() // A { if (/* conditions */) return true; else return false; } Of late, ... 1answer 23 views ### Is relational algebra a procedural, imperative, and/or declarative language? In Database System Concepts 6ed, 6.2 The Tuple Relational Calculus When we write a relational-algebra expression, we provide a sequence of procedures that generates the answer to our query. ... 0answers 150 views ### Proper algorithm for resolving ambiguity in grammars via enforcing associativity and precedence rules I was told there is a algorithm that always resolves ambiguity for grammars that have issues with precedence and associativity. I know ambiguity in general is undecidable, so I only want to resolve ... 3answers 55 views ### Can a programming language be designed to use a fixed amount of memory? I have been toying around with the idea of creating a programming language as a side-project, specifically trying to get extreme performance out of a machine. I have been thinking about the ... 0answers 31 views ### When concatenating two sequences, can evaluations of two input sequences be in parallel with each other? In Practical Foundation of Programming Languages by Harper (www.cs.cmu.edu/~rwh/pfpl/2nded.pdf), 37.3 Multiple Fork-Join So far we have conﬁned attention to binary fork/join parallelism ... 0answers 14 views ### How is cooperative multi-threading implemented in terms of coroutines? In Practical Foundations of Programming Languages by Harper, Although it is relatively easy to visualize and implement coroutines involving only two partners, it is more complex and less useful to ... 1answer 27 views ### What is the denotation for identifiers? I am trying to understand what is the domain for denotational semantics. Right now the way I understand denotational semantics is that given some syntax of a program that maps to some mathematical ... 1answer 39 views ### How shall I understand the undesirable consequences of dynamic scoping? In Practical Foundation of Programming Languages by Harper 8.4 Dynamic Scope Another approach, called dynamic scoping, or dynamic binding, is sometimes advocated as an alternative to static ... 0answers 52 views ### Why was R designed as a 1-starting indexes language? Spawning from here: We usually don't care whether indices start at$0$or$1$(except in the sense we'd rather start with our favourite if it doesn't matter, and the old joke is that set theorists ... 2answers 47 views ### Does assembly language get translated to binary code? If so, is assembly language portable across machines? I've tried to find the answer through Google but I've come across conflicting uses of terminology, so I just wanted to be absolutely clear. Here is my understanding: High level code written in a ... 1answer 76 views ### What is the language feature which allows a variable to be associated with values of different types? In Python, I can change the types of values associated with a variable: >>> x=1 >>> x="abc" In C, I can't do the same. What is the name of ... 1answer 47 views ### Is the choice of static and dynamic typing not visible to the programmers of the languages? [closed] From Design Concepts in Programming Languages by Turbak Although some dynamically typed languages have simple type markers (e.g., Perl variable names begin with a character that indicates the type ... 1answer 31 views ### Why is this grammar ambiguous? S ::= x S ::= if E then S S ::= if E then S else S This is example if E then if E then x else x proves that it is ambiguous ... 2answers 40 views ### Are type variables really only used in mathematical conversation about types? Are type variables really only used in mathematical conversation about types? i.e. are type variables (meta-variables that only contain the type classification label) only exist in proofs for types ... 1answer 87 views ### What is the difference between$ \alpha \to \alpha $vs$ \forall \alpha. \alpha \to \alpha$? I was studying polymorphic types and I was finding the distinction with monomorphic types difficult to pin down (context CS 421). From the course I linked the have the following (vague attempt) at a ... 1answer 79 views ### What does$ \forall \alpha_1, \dots , \alpha_n . \tau \$ mean formally as a type?

I was learning about polymorphic types but I couldn't understand the notation, can someone explain it means (context cs421 UIUC): $$\forall \alpha_1, \dots , \alpha_n . \tau$$ its supposed to be a ...
32 views

### Why is empty in this Abstract Syntax Tree?

I given the following code to write as AST: { a = 4; while (a<10) if (a<5) a = a+5; else a = a+3; } ...
22 views

### Confused about substitution in grammar in certain cases

To illustrate my confusion let's say I'm given this unambiguous grammar in BNF: ...
29 views

### How to intuitively come up with an example for an ambiguous grammar and how to make that grammar unambiguous?

I don't get how to intuitively come up with an example for an ambiguous grammar. Let's take as an example this grammar: ...
62 views

### Difference between ⫾ (U+2AFE) and ⫿ (U+2AFF) in the context of Dijkstra's Guarded Command Language?

Continuing https://tex.stackexchange.com/questions/435986/how-to-draw-the-box-of-dijkstras-guarded-command-language, what is the difference in the intended usage of ⫾ (Dijkstra choice, U+2AFE) and ⫿ (...