Questions related to design, implementation, and analysis of programming languages

learn more… | top users | synonyms (1)

0
votes
0answers
3 views

Is Terra the only system programming language able to compile code at runtime?

I stumbled across Terra last year, and the most similar language I can think of is Julia. Terra is inspired by and uses Lua for templating/metaprogramming instead of being derived from e.g. the Lisp ...
-5
votes
0answers
23 views

Grammar for concrete syntax [on hold]

It is given concrete syntax: data Stmt = SExp Exp | String := Exp | SBlock [Stmt] ...
0
votes
0answers
21 views

What does return 0 in int main() do in a c++ program? [on hold]

int main() { cout << "Hello world!" << endl; return 0; } In this c++ program what is return 0 doing? Is it telling the compiler that there ...
7
votes
1answer
329 views

Data Flow Analysis with exceptions

Data flow analysis work over a control flow graph. When a language under consideration supports exceptions, control flow graph can explode. What are the standard techniques for dealing with this ...
5
votes
1answer
74 views

Is it possible to prevent arithmetic errors with a dependent type system?

In a functional programming language I have functions like $$f\colon Int \times Int \times \cdots \times Int \to Int$$ which do some computation. However for certain arguments $(x_0, \dots, x_n)$ the ...
1
vote
3answers
269 views

Why the Smallest Operable Data Type in Most Programming Languages Is One-Byte Sized? [duplicate]

Why the smallest operable data type in most programming languages is one-byte sized? Is it possible that to operate with a single bit? If it is possible, how to do it in practical?
2
votes
2answers
44 views

Is the punctuation part of the alphabet?

Given a language $L \subseteq \Sigma^*$, (it could be Italian, English, C++ or anything else), should we consider the punctuation (".", ";", "->") as a part of the alphabet $\Sigma$ upon the ...
4
votes
2answers
70 views

Does every procedure have a structural equivalent?

Suppose I have a basic mathematical function like: $ f(x) = x^2 + 2$ implemented in typed pseudo-code as: int f(x) { return x*x + 2; } If we were to break ...
4
votes
2answers
90 views

Is there a point to an all-encompassing programming language? [duplicate]

There are many programming languages in use throughout the world today, including languages that specialize in database manipulation, functionality, object-orientation, concurrency, etc. Would there ...
1
vote
1answer
59 views

On the fly manipulation of operators

Assume that you are writing sorting algorithms, and that you want the ability to select between ascending and descending order. The only change required to do this for comparison sorts is to use the ...
1
vote
1answer
33 views

Can LOOP-Programm stop when its value goes below 0?

I am wondering, if in the LOOP programing language, whether instances of the LOOP x DO P END are defined to stop in the case $x < 0$. The definition only says "...
2
votes
1answer
38 views

What are these questions in the PoplMark challenge asking?

I was reading the paper Mechanized Metatheory for the Masses: the PoplMark Challenge by Aydemir et al (PDF) and I found the following three questions on page 13 of the PDF a bit confusing. ...
3
votes
1answer
42 views

How does recursion works when there are 2 or more consecutive recursive calls?

I was learning about recursion and i came across the following pseudo code for quicksort. ...
0
votes
0answers
10 views

how to understand these in PoPLMARK challenge? [duplicate]

I was reading the PoPLMARK challenge and in the paper proposed that challenge, I find some parts confusing me, here original paper. In challenge 3:Testing and Animating with respect to semantics, I ...
4
votes
2answers
76 views

Is there a relationship between “sound and complete” in logic and “type safety” in PLs?

I've been wondering if there's a connection between "good logics" and "good programming languages". It seems that logics are shown to be "locally sound and complete" whereas programming languages are ...
2
votes
3answers
264 views

Number of possible programs in a language

Is the number of possible programs usually finite or infinite? I'm playing with the idea of generating all possible programs for a language - is that even a finite number or must we be more specific, ...
7
votes
2answers
89 views

Why is BNF considered an unsatisfactory technique for describing a language?

I was reading the paper Fundamental Concepts in Programming Languages by C. Strachey the other day, wherein I read something that was quite strange to me. Quoting directly (with the strange part ...
1
vote
2answers
38 views

Should names of built-in funtions be part of BNF grammar?

We're creating our own programming language for a subject. And we're confused whether to add the names of the functions we want to have in our language (like our own version of print) in the BNF ...
7
votes
2answers
169 views

Why do we have to trade abstraction for speed?

Why can high-level languages seemingly never reach lower-level languages in terms of speed? Examples of high-level languages would be Python, Haskell, and Java. Low-level languages would be trickier ...
0
votes
0answers
15 views

Is XSL-Transformation a type of compiling? [duplicate]

I am currently working on a paper based on the topic of creating a source-to-source compiler from an existing application to C#. The existing application is actually just based on XML files, which ...
7
votes
2answers
113 views

Running programs backwards

I never used a debugger that can run a program backwards but I would like to. Now I wonder if there is much evidence and theory about backwards runnable programming, when and why a program can be run ...
3
votes
3answers
163 views

Do we create a programming language by writing a compiler?

Say, I wanted to create my own programming language. Assuming that I have made all of the decisions about how I want it to look and act, do I just need to write a compiler for it? For example, is ...
7
votes
0answers
43 views

Denotational semantics of object-oriented languages

I am interested in denotational semantics of object oriented languages. Namely, what are the common/typical denotations of objects used in the literature? Is this an interesting topic these days? The ...
3
votes
0answers
46 views

Which object-oriented programming language is the closest to the untyped sigma-calculus?

I'm wondering which of the dynamic object-oriented (or prototype-oriented) languages (like JavaScript, Ruby, Python, etc.) can be considered as the closest to Abadi and Cardelli's untyped sigma ...
7
votes
2answers
163 views

What are the most expressive, terminating languages?

I'm less interested in languages where you can write almost anything, but then are required to write an accompanying proof that what you wrote terminates. I'm more interested in the design space of ...
0
votes
1answer
44 views

How does a language abstract away from underlying byte machines?

So as the title suggests, How does a programing language, such as Java or C, abstract itself away from underlying byte machines? Im curious, because I know that static/dynamic typing, data ...
56
votes
13answers
15k views

How can I explain to my parents that I study programming languages?

I am currently finishing my MSc in computer science. I am interested in programming languages, especially in type systems. I got interested in research in this field and next semester I will start a ...
3
votes
2answers
63 views

Why do some authors not include summation in the $\pi$-Calculus?

In Robin Milner's book "Communicating and Mobile Systems: the $\pi$-Calculus", on page 87, the set of expressions of the $\pi$-Calculus is defined as $$P ::= \sum_{i\in I} \pi_i.P_i\ {\huge|}\ P_1|...
2
votes
1answer
43 views

Examples of context sensitive syntactic constructs (statements)

So, I am implementing a context sensitive syntactic analyzator. It's kind of an experimantal thing and one of the things I need are usable syntactical contructs to test it on. For example, the ...
4
votes
0answers
81 views

What techniques could be used to support thread-local contexts and resources in a language?

I am interested in the subject of thread-local contexts, which is a feature that I use quite often in solutions, but seems to lack first-class support in any languages I have used. Quite often in ...
5
votes
1answer
241 views

Why injection into sum type apparently leads to ambiguity?

I have been reading Benjamin Pierce's Types and Programming Languages, plus a couple of course notes on type systems and typed $\lambda$-calculus, and there is one thing I don't get: it seems that ...
2
votes
0answers
19 views

Framework of code generation in model-driven development workflow. Is formal language semantics necessary?

I am implementing worflow where the code in industrial programming languages (JavaScript and Java) should be generated from the formal (formally verified) expressions (from ontologies as objects and ...
-1
votes
1answer
32 views

How is a procedure application a control structure?

In scheme, a procedure application is considered as a control structure. Why is this?
1
vote
0answers
33 views

DML , ML with restricted dependent types

Refering to this paper Dependent ML: An Approach to Practical Programming with Dependent Types Have defined datatype 'alist ( int ) Its not clear why they have used int as a parameter rather than a ...
2
votes
0answers
46 views

Question about Dynamic Scoping example output

I'm trying to do a runtime stack on a simple code example that uses dynamic scoping. The code is this: ...
0
votes
1answer
53 views

I want to pursue a career in computer programming. Where do I start? [closed]

I am currently finishing up my junior year as a Biochemistry major at a 4-year university. In a year, I will graduate with a B.S. in Biochemistry and way more credit hours than anyone should ever have ...
4
votes
1answer
31 views

Incremental compilation over AST

Is incremental compilation ever done based on the AST? That is, the compiler would just regenerate code for the parts of the AST that have changed. I know that many compilers do incremental ...
3
votes
1answer
121 views

How can I check constraints on my state machine behaviour?

My background is fairly practical rather than theoretical, so this question may be a bit basic. I have a state machine with events, and events may optionally trigger action functions to be called as ...
-2
votes
1answer
72 views

What is the difference between the friend class and inheritance consept in C++? [closed]

In C++ ,friend class allows us to inherit the proprieties of one class to another class(es) which is also possible using inheritance. And also in inheritance we can set different levels of privileges ...
2
votes
3answers
105 views

Design patterns for simple text based scripting language?

In my current application I am trying to determine the best way to implement a simple scripting language. This language would allow a user to create a script that controls a machine with various ...
1
vote
1answer
33 views

Matrix of Matrices in Python [closed]

I want to create a matrix where each entry itself is a random matrix. What would be a good way to represent this? It is not necessary but some hints on how to implement your proposed solution in ...
20
votes
0answers
384 views

on “On the cruelty of really teaching computing science”

Dijkstra, in his essay On the cruelty of really teaching computing science, makes the following proposal for an introductory programming course: On the one hand, we teach what looks like the ...
0
votes
1answer
43 views

Searching through all program of a stack-based language with little memory

I wrote a simple stack based language, and am looking to exhaustively generate all programs for it, to find the shortest program that generates a particular output. Given a program fragment, I can ...
1
vote
1answer
42 views

How might I express a sequence of operations in formal terms?

I want to be able to represent a set of operations in sequential order such that they will represent what is traditionally called a "function" (which is not always the mathematical definition of a "...
3
votes
2answers
40 views

What is the difference between a function and a procedure

In general, what is the difference between a function and a procedure when talking about programming languages?
2
votes
1answer
61 views

Do Scheme operators have associativity?

Do operators in the Scheme programming language have associativity. For example, the code (- 5 2 1) evaluates to 2, but it could evaluate to 4 if it was evaluated ...