Skip to main content

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
6 votes
4 answers
540 views

Are there any programming languages that support state machines in their standard library?

State machines are a fundamental computer science concept and in many senarios they are the simplest way to implement a process or program. However, most programming languages don't support them ...
Blank's user avatar
  • 161
3 votes
1 answer
104 views

What is the practical difference between "differentiable programming" and existing autograd libaries?

People have recently started talking about "differentiable programming". I have listened to some people talk about this at a philosophical level, but I don't see the practical difference ...
user56834's user avatar
  • 3,922
1 vote
2 answers
85 views

Is there any programming language focused on atemporality?

It seems like a lot of programming is about converting a high-level human intuition into a very precise, ordered set of steps and conditions for the computer to execute correctly. I think programming ...
Julius Hamilton's user avatar
8 votes
2 answers
160 views

Does the concept of "side-effect" predate functional programming?

When I was reviewing a book, I saw that there's a sentence claiming "side effect is a term coming from the domain of functional programming". I would think that the concept existed before ...
kolistivra's user avatar
1 vote
1 answer
99 views

How does the Go language implements maps?

To what extent is the MAP data type implementation language dependant??? If we know that C++ implements maps as Red Black Trees, unordered maps as hash tables, How C++ and alike maps are actually ...
ShAr's user avatar
  • 138
1 vote
0 answers
121 views

Complex structs in Rust, when following ownership rules

Background I recently started learning the rust programming language. Suppose you want to create some complex struct, for example - a graph. I can see two possible ...
nir shahar's user avatar
  • 11.6k
-2 votes
1 answer
188 views

What is the reason for this contradiction about the size of the char type?

the size of one char in C is 4 bytes, however to define an 'A' character we use the sum of two values like this expression here: or in other way i want to say that the char is 4 bytes size, but in ...
meddhiaka's user avatar
0 votes
5 answers
193 views

Are there programming languages where you import only what you need?

If all programming languages more or less compile down to the same machine code. Have there been attempts at, or is there a "field" around the concept of even more modular programming ...
pDiddy's user avatar
  • 1
2 votes
1 answer
68 views

Would all objects in a reversible computing language be mutable?

Full disclosure, I'm asking this after watching a couple pop science videos; I do not know anything about the actual physics and hardware. I suspect the presenters expected an audience like me because ...
BatWannaBe's user avatar
1 vote
2 answers
143 views

How programming languages are capable of handling generic types

How programming languages are capable of handling generics ? Here is some context on why I got the question. Constructs like Lists, Dictionaries and Sets in Python can handle any type of data without ...
Kranthi Kiran's user avatar
1 vote
1 answer
202 views

What is the formal definition of precedence and associativity in programming language?

The concept of precedence and associativity seems straightforward. The operator precedence is a collection of rules that reflect conventions about which procedures to perform first in order to ...
namasikanam's user avatar
1 vote
4 answers
104 views

Should I be a good computer scientist to become a great software developer?

As I am headed into a Computer Science major wishing to eventually become a software developer, I wonder this: should I immerse myself in computer science theory and knowledge (data structures, ...
Attitude12136's user avatar
0 votes
2 answers
928 views

What is the best book on the theory of programing languages?

I want to learn programming. I have knowledge of mathematical logic. So, what I am searching is a book (or varios books) for learning to programming, but I think that a book like one which I imagine ...
Marco Medina's user avatar
-4 votes
1 answer
413 views

Is Programming Witchcraft or Actual Magic? [closed]

I may sound stupid, but few people say that programming is witchcraft (maybe Joking) as a Christian I Must take it seriously, because I am planning to become Software Architect in the future. Honestly ...
Dead Pool's user avatar
1 vote
2 answers
279 views

Loop Invariants: Can someone explain this concept?

I am reading Algorithms Unlocked By Tom Cormen and find this concept a little confusing. Why is it that we require loop invariants and how does it help in analyzing algorithms?
Yuv's user avatar
  • 139
1 vote
1 answer
32 views

Is a constant literal an example of a built-in?

My understanding is that in a programming language, built-ins are bindings that exist without the user having to make them. (Like + to its referent, for example.) ...
Eric Auld's user avatar
  • 115
4 votes
1 answer
340 views

How compiler optimizations create irreducible control flow graph?

I've been looking through research papers and the internet and found many claims that "compiler optimizations can cause irreducible control flow". However, I was not able to find a single ...
Edown's user avatar
  • 41
2 votes
1 answer
100 views

What is "invariants of the code"?

The Wikipedia page for strong and weak typing says: "Strong typing" generally refers to use of programming language types in order to both capture invariants of the code What is "...
robertspierre's user avatar
20 votes
5 answers
12k views

How do computers perform operations on numbers that are larger than 64 bits?

There are many reasons why numbers larger than 64 bits must be computed. For example, cryptographic algorithms usually have to perform operations on numbers that are 256 bits or even larger in some ...
CCS's user avatar
  • 343
1 vote
0 answers
36 views

A beginner's question on programs that can search and calculate in very large sets

I am not in the computer science field and was looking for some guidance on books/papers/programs that allow me to learn how to design algorithms for problems that involve very large number of ...
Mwazr A's user avatar
  • 11
1 vote
1 answer
156 views

How does asynchronous operations save time in I/O

I'm reading a book CLR via C# which says how Windows does asynchronous I/O: To read data from the file, ReadAsync internally allocates a Task object to represent the pending completion of the read ...
amjad's user avatar
  • 135
2 votes
1 answer
150 views

Macros vs lazy evaluation in scheme inspired language

I'm writing a simple scheme inspired interpreter. I'm not calling it a scheme implementation because I don't really want to implement all the standard, only the minimal set of primitives needed to ...
geckos's user avatar
  • 243
1 vote
1 answer
119 views

virtual machine based programming languages vs low level

I took programming lecture it was about C/java and how to build compilers, so I wanted to know. As far I see, languages like Java/C# are developing their virtual machine CLR/JVM with good base and are ...
MR.-c's user avatar
  • 197
1 vote
0 answers
185 views

What constitutes a programming language dialect?

Usually I see the term dialect for programming languages referring to small variations of a language, such as slightly different syntax or supported features in BASIC, SQL, or Lisp. I have also seen ...
qwr's user avatar
  • 618
21 votes
4 answers
12k views

Are modern programming languages context-free?

Which language class are today's modern programming languages like Java, JavaScript, and Python in? It appears (?) they are not context-free and not regular languages. Are these programming languages ...
Jonte YH's user avatar
  • 443
0 votes
1 answer
85 views

What other implementation styles are there besides compilation, interpretation and transpilation?

Obviously there is JIT but it is basically run-time compilation. There is also implementing things in VHDL or ASIC. But my question is more towards software techniques for program building and ...
Teodor Dyakov's user avatar
1 vote
0 answers
25 views

How do bottom up parser evaluate things that need an inherited attribute?

I learned that Bottom up parsers use only synthesized attributes to evaluate semantics. Which makes sense considering that it would be very hard to evaluate an inherited attribute in bottom up ...
JsonResponse's user avatar
2 votes
1 answer
417 views

Which would be better for programming using Homotopy type theory Agda or Idris

I'm looking to model data inputs for an artificially intelligent system, which is affected by its internal parts and has feedback loops. I'd like to model it mathematically, using category theory or ...
Ali S's user avatar
  • 21
2 votes
1 answer
91 views

Why does universe level restriction behave differently between inductive family and parameterized inductive type without axiom K in agda

An observation when defining List in agda with --without-K enabled: The following parameterized inductive definition is accepted:...
Kaa1el's user avatar
  • 191
0 votes
1 answer
350 views

BNF syntax for a recursive function?

I'm to write a syntax that will allow for a recursive function, i.e. f(x) = if x == 0 then x else f(x+1) Here's one attempt at creating the grammar: But I don't ...
gust's user avatar
  • 155
2 votes
0 answers
64 views

Do any industry programming languages use Martin-Löf style identity types?

Most programming languages have some kind of type systems but are there any programming languages widely used outside of academia (in consumer-oriented tech, finance etc.) that have intensional ...
kodi's user avatar
  • 21
0 votes
1 answer
999 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 ...
x89's user avatar
  • 167
0 votes
1 answer
60 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 ...
SubstantialRange's user avatar
0 votes
1 answer
84 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?
minseong's user avatar
  • 161
1 vote
1 answer
138 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,...
Monther's user avatar
  • 118
5 votes
1 answer
794 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? ...
thoughtpolice's user avatar
4 votes
3 answers
858 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 ...
Blake F.'s user avatar
1 vote
2 answers
110 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$...
Abhishek Ghosh's user avatar
5 votes
2 answers
960 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 ...
Buddhika Chathuranga's user avatar
5 votes
2 answers
318 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-...
user3779002's user avatar
1 vote
2 answers
259 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 ...
MicroMaximus's user avatar
-1 votes
1 answer
43 views

Find the most frequent alphabet appearing in the given string. In case letter with same frequency, choose the one which comes first alphabetically

This is the desired result which I want:
sohamb172's user avatar
  • 115
6 votes
1 answer
196 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, ...
Blue Nebula's user avatar
1 vote
0 answers
56 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 ...
choptxen's user avatar
2 votes
2 answers
112 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 ...
user56834's user avatar
  • 3,922
1 vote
0 answers
217 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 ...
salami sauce's user avatar
5 votes
1 answer
1k 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 ...
Ski Mask's user avatar
  • 463
2 votes
0 answers
36 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 ...
cser's user avatar
  • 21
2 votes
0 answers
47 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 ...
Ski Mask's user avatar
  • 463
3 votes
0 answers
51 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 ...
Olle Härstedt's user avatar

1 2
3
4 5
20