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
-1
votes
0answers
42 views

How efficient to generate random numbers using QRNG?

I wonder how efficient is to generate random numbers using quantum random number generators (using Quantis RNG device for example).
0
votes
0answers
16 views

What is the future of Language Design?

What is the future design of Programming Languages? I have heard that compilers is going to become more integrated with editors and Browsers? Are we moving to a future with less code in Language ...
-3
votes
1answer
37 views
-3
votes
0answers
27 views

Making bmi calculator [closed]

I need help to make a bmi calculator in c++ using switch statement anyone here who can help me. Now I can do it with if but i must use switch.and my next question is how am I supposed to put bmi (...
-3
votes
0answers
22 views
2
votes
1answer
112 views

SICP: applicative or normal order evaluation

I'm trying to solve Problem 1.5 from SICP book. Consider the following definitions: (define (p) (p)) (define (test x y) (if (= x 0) 0 y)) (test 0 (p)) The ...
0
votes
1answer
21 views

while loop for bitwise conversion program

int counter(char c){ int count = 0; while (c!=0){ if((c & 1) !=0) count++; c = c >> 1; } } I am trying to understand a ...
2
votes
1answer
2k views

What is a forwarding pointer? [closed]

I recently came across the concept of "forwarding pointer" and have not been able to find sources of a precise definition. In my case this was mentioned and briefly (but poorly) explained ...
0
votes
1answer
42 views

With a list of opcodes for a virtual machine, is it possible to assign a number to every possible program of size n that can be run on that machine?

Say you have some virtual machine with < 100 numbered opcodes that fully specify its behaviour. Is there an easy way to order and enumerate all possible programs of less than n instructions, the ...
0
votes
1answer
39 views

How to do asynchronous programming with only global variables?

If a programming language only supports global variables, is it still possible to use asynchronicity, like callbacks, event-driven programming, other kinds of parallelisation? How can it be done?
-3
votes
0answers
33 views

How the property of convergence or divergence of a mathematical function is used in the design of body of a program in a compiler like C [closed]

A function in C returns a value how this aspect of C Programming is concern with convergence and divergence of a function in maths.
2
votes
1answer
28 views

Fine-grained versioning of entities in programming languages

I have a question related to design, implementation of programming languages. I hope it fits here and apologize if it doesn't. All or most programming languages version modules (aka packages, ...
3
votes
0answers
86 views

What happened to Active Databases?

When reading the literature on declarative programming technology. A particular technology that sounded promising is active databases. It essentially allows the programmer to specify rules about data ...
1
vote
1answer
70 views

can a machine generate truly random numbers?

I know that for most programs pseudo-random numbers are sufficient, but there are ways that machines can generate truly random numbers! There are devices that generate unpredictable processes. However,...
0
votes
0answers
13 views

If the load factor is a decimal (say 3.6), what is the length of each chain in a hash table that utilizes separate chaining?

I understand that if the load factor were 2, then the length of the chain would be 2 for each index in the array, but what happens if the load factor is a decimal? Do we round up or down?
16
votes
3answers
4k views

Which research languages have a stronger typesystem than Haskell and why?

Here I read that: Haskell definitely does not have the most advanced type system (not even close if you count research languages) but out of all languages that are actually used in production ...
2
votes
1answer
72 views
1
vote
1answer
62 views

Resources for implementing dependent type theory

I want to implement Martin Löf's intuitionistic type theory in a functional language such as Haskell, preferably also implementing a lexer/parser for the language. How should I start approaching it? ...
2
votes
0answers
78 views

Why do programming languages use call-by-value over call-by-name?

I am reading Software Engineering 1: Abstraction and Modelling by Dines Bjørner. One of the chapters talks a little bit about call-by-value vs call-by-name. In it, the author states that most ...
1
vote
2answers
40 views

Relation between programming languages requiring declaration of variables before use and using the token class $\text{id}$ while parsing

I was going through the text Compilers: Principles, Techniques and Tools by Ullman et. al. where I came across the following excerpt. Example 4.11. Consider the abstract language $L_1 = \text{ { $wcw$...
5
votes
2answers
196 views

Regarding Backus' Commentary on von Neumann-style Programming

in John Backus' 1978 FP paper "Can Programming Be Liberated from the von Neumann Style" he says To help assemble the overall result from single words [von Neumann ie. conventional mutation-...
5
votes
2answers
813 views

Break keyword outside a loop is syntax error or semantic error?

I am designing a simple compiler for my university project. In my programming language, the break keyword is allowed. I want to know whether break keyword occurs outside a loop should be a syntax ...
1
vote
2answers
33 views

How to evaluate a Kleene's Closure through CFG and attribute grammars

For a CFG with the production rules that can represent a regular expression. How can one calculate all the set of strings that regular expression would produce. For T = {a, b,*,(,)} and an arbitrary ...
1
vote
1answer
1k views

What does deep binding mean for static scope?

When I self-study "Programming Languages: Principles and Paradigms, by Maurizio Gabbrielli, Simone Martini", I have a question: what does deep binding mean for static scope? I learned the concepts ...
0
votes
4answers
4k views

Programming Language Hierarchy

I know that Assembly is the lowest level of the stack besides machine code, but are the languages above it all considered "high level languages" or is there a hierarchy amongst these languages. For ...
0
votes
1answer
43 views

what are the weakest preconditions of these following statements

what is the meaning of postcondition and weakest postcondition in terms of programing and what are weakest postconditons of following statements. ...
13
votes
6answers
45k views

Definition of the state of an object in OOP

I need a concise definition of the "state of an object" in object-oriented programming (for a paper). For about half of a day I searched for a paper that I can cite on this topic, but I couldn't find ...
6
votes
1answer
794 views

Why product type is a dependent SUM?

It might just be a stupid question but I simply see no obvious reason why dependent sum type is a generalized form of product type. Concretely, the sigma type $\Sigma(x:S)T$ degenerates to a product ...
18
votes
2answers
5k views

Paradox? Pure Prolog is Turing-complete and yet incapable of expressing list intersection?

Pure Prolog (Prolog limited to Horn clauses only) is Turing-complete. In fact, a single Horn clause is enough for Turing-completeness. However, pure Prolog is incapable of expressing list intersection....
2
votes
2answers
41 views

Textbook on formal syntax (and semantics) of programming languages

I'd like to learn about formal syntax of programming languages: how do we describe the syntax of a programming language and how it should be parsed? How do we assign formal semantics to a parsed ...
1
vote
0answers
24 views

What will be the output when using pass-by-value-result with parameters such n+1?

Let's say a function $f$ is called with parameter $n+1$. Since I use pass-by-value-result, value of formal parameter will be transmitted to the caller's actual parameter at the end of the call. Let ...
1
vote
0answers
123 views

How can I simulate nested WHILE loops in a theoretical programming language to show Turing completeness?

PRE-WORK-POST is a theoretical programming language with the following structure, where P,Q and R are LOOP program: $$\text{PRE} \ P \ \text{WORK} \ Q \ \text{POST} \ R \ \text{END}$$ First $P$ is ...
4
votes
1answer
70 views

Explain the difference between Turing Complete and Turing Equivalence

I'm not sure if I understand the difference between Turing Complete and Turing Equivalent programming languages. A computational system that can compute every Turing-computable function is called ...
2
votes
0answers
34 views

What would you do if the author of a published CS article does not respond to code requests? [closed]

Since reproducibility is a major principle or basic norm of scientific experiments, simulations, and computations, what would you do or what to do if the author of a published CS article does not ...
2
votes
0answers
37 views

Understanding the simulate of an IF loop program through a LOOP program

We have the following operation $\text{IF} \ x_i =0 \ \text{THEN} \ P \ \text{END}$. I want to simulate this using a $\text{LOOP}$ program. Here is what I have: $$\text{IF} \ x_i = 0 \ \text{THEN} \ P ...
18
votes
6answers
7k views

Why do more powerful programming languages tend to have slower implementations?

I was reading this article. The author talks about "The Blub Paradox". He says programming languages vary in power. That makes sense to me. For example, Python is more powerful than C/C++. ...
4
votes
0answers
75 views

Understanding a paper on polynomial recursion in all finite types

So I wasn't sure weather or not this counted as "research level" or not but I figured it wasn't so I decided to post it here. There is a paper by S. Bellantoni et al. called "Higher ...
3
votes
0answers
45 views

Is there a language which enforces “no escape” of variables?

Many languages with GC perform escape analysis to reduce heap allocations. Is there a language with a "no-escape" construct that tells the programmer during compile time to not escape ...
1
vote
1answer
198 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 ...
2
votes
1answer
70 views

What is considered being proficient in a programming language?

I am a college student looking to get into industry work soon and want to understand what employers consider 'proficient' when it comes to programming languages. Right now, I understand that to mean ...
2
votes
5answers
430 views

Why isn't there a .= operator? (or ->= etc)

Considering how often we do: ...
1
vote
1answer
49 views

Is there a formalization for the trade-off between the expressiveness and the speed of a programming language?

I do not have a strong background in theoretical computer science, so the terminology I use may not be the most ideal. Basically the "trend" across programming languages I have noticed is ...
3
votes
0answers
45 views

Is there a computer language with optional dependent types?

I'm looking for a computer langauge with "dependent types" but... The problem with it having a full implementation is that you end up having to write formal type proofs to get even anything ...
2
votes
0answers
23 views

Coding max as an interaction net

I am reading Yves Lafont's introductory paper Interaction Nets. Early in the beginning he mentions that max cannot be coded as follows since in this coding it is not possible to choose which argument ...
0
votes
0answers
18 views

What is the Memory Bandwidth Usage in a Program Related to?

We can use performance counter tools to check the memory bandwidth usage while a program is running. I want to ask what is this memory bandwidth related to? What parameters are involved in memory ...
2
votes
1answer
32 views

printf(“%d”,~5); prints out -6 why is that?

I was reading the book "Computer systems: A programmer's perspective" and saw that the operator, "~", is a NOT operator. When I use it to NOT positive integers, it returns the ...
2
votes
1answer
96 views

How to view Graph Reduction/Graph Representation for a Haskell program?

I know that under the hood, for a Haskell program, the GHC compiler uses graph reduction for optimization. Is there any way to view this graphical representation of the program? I haven't been able to ...
5
votes
5answers
5k views

How does an operating system implement the C library?

I have an idea of how a C program is turned into machine code by the compiler. I also know how the processor processes the instructions (https://www.youtube.com/watch?v=cNN_tTXABUA this video has a ...
61
votes
6answers
15k views

Are there minimum criteria for a programming language being Turing complete?

Does there exist a set of programming language constructs in a programming language in order for it to be considered Turing Complete? From what I can tell from wikipedia, the language needs to ...

1
2 3 4 5
18