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
3
votes
1answer
38 views

How to write a custom editor for a new programming language? [closed]

Let's say I've finished my compiler for my new language. Next step is write a custom editor with syntax highlighting (type checking and semantic can wait), is there a cookbook or any kind of guidance ...
-2
votes
0answers
19 views

Problem to Insert at n-th position in a singly circular linked list of integers [closed]

Here's my code to insert a node at n-th position in a singly circular linked list. When tail is NULL , I'm trying to just return but that gives me a run time error. For this particular code, I am ...
0
votes
1answer
39 views

Uncurrying and Polymorphism

How do we uncurry functions when they are polymorphic? For example, is it possible to uncurry the following types? If so what is the uncurried type? $\forall X. X \rightarrow int \rightarrow X$ ? $...
0
votes
0answers
41 views

Lambda calculus and runtime inspection of the term

This is possibly related to reflection and quoting but I don't want to assume anything beforehand. Here is my requirement. My typed lambda calculus (Curry style) is a simpler variant of Calculus of ...
3
votes
4answers
4k views

Do you ever “download” a language?

When one "downloads" a language (say, downloading the python file, or doing apt-get ruby or something), is it always the ...
-2
votes
0answers
91 views

What does module reuse mean?

In Essentials of Programming Languages by Friedman, if I am correct, Chapter 8 discusses something similar to the module system in Standard ML. 8 Modules In this chapter, we introduce modules ...
0
votes
0answers
13 views

Term for language that abstracts program location?

What is the technical term that describes a programming language that abstracts (or at least largely abstracts) the machine location of programs? I’m thinking here specifically of the evolution of ...
0
votes
0answers
45 views

Meaning of “short English phrases” [closed]

Fourth generation programming languages 4 GL Fourth generation programming languages are more advanced than traditional high level programming languages because they use commands, which are more ...
15
votes
2answers
2k views

Halting problem theory vs. practice

It is often asserted that the halting problem is undecidable. And proving it is indeed trivial. But that only applies to an arbitrary program. Has there been any study regarding classes of programs ...
-2
votes
0answers
18 views

How does fluid binding of symbols improve on dynamic binding/scoping of variables?

Practical Foundation of Programming Languages by Harper contrasts fluid binding of symbols to dynamic scoping/binding of variables: Chapter 32 Fluid Binding In this chapter, we return to the ...
0
votes
0answers
28 views

What are symbols and symbol references in Scheme?

Practical Foundation of Programming Languages by Harper distinguishes concept "symbol" and concept "symbol reference" which refers to a symbol: Chapter 31 Symbols In this chapter, we consider ...
0
votes
0answers
27 views

How is a symbol “given meaning by a family of operations indexed by symbols”?

Practical Foundation of Programming Languages by Harper says: Chapter 31 Symbols A symbol is an atomic datum with no internal structure. Whereas a variable is given meaning by substitution, ...
-1
votes
0answers
34 views

Why are the domains of operations in the existential type that represents a dynamic dispatch product types not sum types?

Regarding dynamic dispatching, Practical Foundation of Programming Languages by Harper says: Dynamic dispatch is an abstraction given by the following components: An abstract type $t_{obj}$...
0
votes
0answers
16 views

What are the implementation strategies for multiple dispatch: class-based, or method-based organization, or either?

Regarding classes and methods, Practical Foundation of Programming Languages by Harper says: Dynamic dispatch is often described in terms of a particular implementation strategy, which we will ...
0
votes
2answers
45 views

What is the single type in a dynamic typing language?

Regarding static typing and dynamic typing, Practical Foundation of Programming Languages by Harper says: There have been many attempts by advocates of dynamic typing to distinguish dynamic from ...
2
votes
1answer
41 views

Do dynamic/static languages associate types or classes to values or variables?

In Practical Foundation of Programming Languages by Harper There have been many attempts by advocates of dynamic typing to distinguish dynamic from static languages. It is useful to consider ...
-2
votes
1answer
39 views

What is the time complexity of the following triple nested loop? Kindly solve in term of n

I want to ask that what is the time complexity of this function (triple nested loop) .Kindly analysis completely so that I can understand. ...
1
vote
1answer
31 views

More the number of for loops greater the problems solved

This is more a formal language theory question. Imagine a setting where you are given a very basic programming language where variable assignments etc are taken care of without any of the iteration ...
0
votes
0answers
14 views

Interactive programming language minimizing reevaluations

I'm looking for any programming language, DSL, library or pattern for live scripting but minimizing the expressions reevaluation. Topological sorting provides non-revaluation of expressions. ...
0
votes
2answers
26 views

Error handling in a size_t hashfunction

For school I have a big assignment on hashtables etc. One of the functions is a size_t function where we calculate the hash value. (Keep in mind the structure of every function is given so we are not ...
2
votes
0answers
28 views

Compiling an impure language into a pure stack-based language

For a personal learning and fun project, I build an abstract virtual machine based on a stack. The instructions are simple and act on the top of the stack only. There are also stack operators such as <...
0
votes
0answers
9 views

FOIL system for learning PROLOG rules from facts

I'm trying to use FOIL, a system from the 1990s developed by Ross Quinlan, to learn Prolog rules from facts. However, the input file syntax is tricky for me. Could someone provide me an example input ...
1
vote
1answer
26 views

Type inference with overloading

I am working on a type system supporting overloading. I have a rough idea of how type inference is usually implemented in such a scenario, but I am wondering how - after type inference is completed - ...
0
votes
2answers
21 views

Does hiding variables work in terms of blocks or line-by-line?

Let's assume I have the following code: declaration of a declaration of b ..a..b { ..a..b declaration of a declaration of b ..a } In this code {} ...
0
votes
0answers
22 views

≤ shown as £; ≥ shown as ³

I have a printed answer to a math problem which has weird symbols on it. I figured out that the symbols were just incorrect renderings of usual symbols. Do you know what might have caused this?
52
votes
1answer
11k views

What is the earliest use of the “this” keyword in any programming language?

I understand the this (or self or Me) is used to refer to the current object, and that it is ...
2
votes
0answers
27 views

Is Event Calculus applied for program verification?

Recently I've read wiki page about Robert Kowalski (Prolog author) and stumbled upon interesting concept of Event Calculus. The wiki article mentions only few applications of this logical language. I ...
1
vote
2answers
64 views

resource on translating imperative programs to functional programs

I'm not asking this question for the purpose of any particular project. Rather, I'm trying to understand how to translate non-trivial programs in imperative style to functional style. By functional ...
0
votes
1answer
49 views

Parallel programming models: Why do OpenMP and MPI dominate?

In a lecture on HPC parallel programming (for CPUs) we discussed various models available from Pthreads to OpenMP to MPI and others like Charm++, X10, UPC, Chapel…. The main focus was clearly on the ...
2
votes
3answers
222 views

Can the same node appear twice in a tree?

Can the same node appear twice in a tree? I'm asking about the node object itself, not the node's value. For example, in the following code, a's left and right ...
1
vote
1answer
31 views

Passing a non-mutable argument by value or by reference?

A function can generally be defined to receive parameters by value or by reference. If we want to mutate an object inside the function and have those changes reflected outside the function, then it ...
1
vote
2answers
64 views

How the kernel works in a LCF theorem prover

I heard that there is some mechanism in LCF-based theorem provers that only allows some functions to create values of type theorem. I believe these are based on abstract data types. Could someone ...
5
votes
1answer
70 views

Good book on the history of programming languages?

I'd like to read a book on the history of programming languages, that places their development into the context of their times. What was the context in which concepts like structured programming, ...
3
votes
9answers
917 views

Why, in programming languages in general, must function declarations be followed by a parameter set, external to the sub-routine scope?

I understand that in programming languages in general, function routines have what I can generally name a parameter set (or "list"), usually symbolized with parenthesis and if it is not empty, it is ...
0
votes
0answers
14 views

Finding bound function of loop invariant

In Programming in the 1990s, by Edward Cohen, the author gives an example of a bound function. For example, if we have $B \equiv 10 - n$ where $n = 0$, say, then $B$ will eventually be falsified if ...
2
votes
0answers
73 views

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

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 ...
6
votes
2answers
84 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 ...
0
votes
2answers
166 views

Does the callback concept of programming have 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
23 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
21 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
1answer
48 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
27 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
vote
0answers
29 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 ...
1
vote
1answer
56 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
80 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 ...
2
votes
1answer
45 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} ...
1
vote
0answers
16 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 ...
1
vote
0answers
39 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 ...
4
votes
1answer
92 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
53 views

Exact meaning of metalinguistic variable

Consider the following BNF <join-command> ::= <string> + <string> In this context <join-command> and <...

1
2 3 4 5
17