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.

Filter by
Sorted by
Tagged with
2
votes
0answers
67 views

Is there a term for the psychological issue of “code loss” for programmers?

I am a programmer. I have just deleted a huge amount of code which I painstakingly researched, thought about, coded, then improved and fixed as bugs popped up for a long time. All of that code, which ...
-1
votes
0answers
15 views

How to capture an input device and prevent it's default behavior [closed]

I have an RFID tag reader. But it works like a HID device (like a keyboard). It sends keystrokes to the computer when a tag is scanned. When I open notepad and scan a tag - it types the ID one digit ...
5
votes
1answer
51 views

Why is the type ∀t.t un-inhabited in System F?

How do you prove that there exists no term with the type $\forall t. t$ in System F? I tried searching through Pierce's TAPL and Reynold's ToPL, but could not find anything. I suspect that the proof ...
1
vote
2answers
64 views

Does the callback concept of programming has any basis in computer science?

Although I seriously code with computer languages in general since 2010 and as an amateur programmer with programming languages in particular since 2015 (primarily Bash and JavaScript imperative ...
0
votes
0answers
20 views

How can there be so many programming languages? [duplicate]

For many years, I've regularly found myself at Wikipedia and other pages about various programming languages which I've barely heard ever mentioned, yet have been around for 50-70 years and had ...
0
votes
0answers
19 views

What makes a program flow different from a program path?

Program flow and path are discriminated in the literature of program analysis. However, I have failed to find a formal definition of program flow and path. Can anyone please point me to some authentic ...
0
votes
0answers
19 views

Why am I apparently the only one who would VASTLY prefer polishing the existing product instead of adding more features? [closed]

Take PostgreSQL as just one example out of countless. It's more than "mature" now. Yet the upgrade process is a painful ordeal which makes me upgrade once every few years instead of months. It really ...
0
votes
0answers
23 views

What does it mean if a generic structure is type-erased?

This documentation states that the generic structure AnyIterator is a type-erased iterator of Element.
2
votes
1answer
23 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 ...
-1
votes
0answers
12 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 : ...
1
vote
0answers
21 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 ...
0
votes
1answer
44 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 ...
-1
votes
2answers
55 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 ...
1
vote
1answer
37 views

Hindley-Milner system with let expansion

I'm reading these slides that present Hindley-Milner type inference. In the system HM, we have the following let rule: $\dfrac{\Gamma \vdash t:S \;\; \Gamma,x:S \vdash t':T }{\Gamma \vdash \text{let} ...
0
votes
0answers
15 views

Is there an algorithm to switch from classical notation to concatenative stack-based notation?

Reading a bit about Joy, I was wondering if there wasn't an algorithm to switch from classical notation and style to concatenative and stack-based style. Of course, for simple mathematical ...
0
votes
0answers
32 views

Can the most general unifier be defined categorically?

I remember from my reading of Category Theory for Computing Science that classical concepts like weakest preconditions can be seen as the categorical notion of pullback. I was wondering if the same ...
3
votes
1answer
73 views

What should I read to understand semantics of programming languages?

I would like to have a good conceptual understanding of the semantics of programming languages: operational-, denotational-, axiomatic-, categorical-. Is there a good (standard?) textbook for this?
0
votes
1answer
46 views

Exact meaning of metalinguistic variable

Consider the following BNF <join-command> ::= <string> + <string> In this context <join-command> and <...
0
votes
4answers
87 views

Why are not programs already in binary code?

First of all, please forgive me if this question shows ignorance on my behalf. What I'm asking is not why we don't program in languages written in binary code, I know the answer for that. What I would ...
0
votes
0answers
28 views

Proof strategy to show that an algorithm cannot be implemented using just hereditarily terminating procedures

I am taking my question here from there. Consider the following scenario: You are given a fixed programming language with no nonlocal control flow constructs. In particular, the language does not ...
1
vote
1answer
44 views

Dynamic testing of down casts as explained in TAPL

On page 195 of Pierce's TAPL book, he states that one can replace a down-cast operator by some sort of dynamic type test. Then he gives the following rules: T-Typetest: $\dfrac{\Gamma \vdash t_1:S \;...
1
vote
0answers
37 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 ...
2
votes
0answers
18 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: ...
0
votes
1answer
77 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 ...
0
votes
1answer
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 ...
1
vote
0answers
32 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 ...
1
vote
1answer
84 views

Confluence to show equivalent terms have one common reduct

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 \...
3
votes
0answers
30 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$ ...
2
votes
0answers
54 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 ...
1
vote
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 ...
2
votes
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( ...
4
votes
1answer
60 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: ...
0
votes
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 ...
3
votes
2answers
195 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 ...
1
vote
1answer
56 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 ...
1
vote
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 ...
0
votes
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, ...
0
votes
1answer
26 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. ...
3
votes
0answers
151 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 ...
0
votes
3answers
73 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 ...
2
votes
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 confined attention to binary fork/join parallelism ...
0
votes
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 ...
1
vote
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 ...
0
votes
1answer
41 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 ...
0
votes
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 ...
2
votes
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 ...
0
votes
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 ...
-1
votes
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 ...
0
votes
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 ...
2
votes
2answers
41 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 ...