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
0 votes
1 answer
37 views

Structural induction proof for reverse(push(as, bs)) = push(reverse(bs), reverse(as))

I need to prove: reverse(push(as,bs)) = push(reverse(bs), reverse(as)) where: ...
user avatar
-4 votes
0 answers
39 views

Computer Science mini project

I need the code and some explanations to the following prompt for coding because I am struggling with arrays and loops(1301 computer science) How could I create a game for combat ships? I have to ...
user avatar
2 votes
2 answers
182 views

Similarities and differences between Unit and Bottom types?

I came across this recent Reddit thread, Thoughts on Botton vs Unit Types, but I don't understand what the similarities and differences are in regards to when you are creating a programming language. ...
user avatar
  • 1,853
0 votes
0 answers
44 views

First piece of code in scientific papers

What is the first/oldest piece of source code shown in an scientific paper or journal? I am looking for source code of assembly or a high level programming language which was real (implemented) and ...
user avatar
4 votes
1 answer
49 views

Covariance and Contravariance: Conflict without a Cause

Here is the last paragraph at page 441 of the paper ‘Covariance and Contravariance: Conflict without a Cause’ by Giuseppe Castagna: How is all this translated into object-oriented type systems? ...
user avatar
  • 113
2 votes
2 answers
64 views

What does Herb Sutter refer to in his seminal paper The free lunch is over?

In his paper The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software, Herb Sutter writes: The mainstream state of the art revolves around lock-based programming, which is subtle and ...
user avatar
  • 315
0 votes
0 answers
22 views

Find the value using call by reference and call by value

Given the following code: ...
user avatar
  • 13
0 votes
1 answer
13 views

Find the output value using call by value and call by reference

Given the following code: int p = 5 , q=2; int f( int b, int c){ b = 2 * c; c = 3 + p; return b + c ;} print f(p,q); print p; print q; I have found that the output values using call by value are: f(p,...
user avatar
  • 13
0 votes
1 answer
47 views

What is an API, exactly

I’ve read the Wikipedia article and know it’s basic function but I don’t understand what it physically is. Like, is an api a text file that the main program reads from and you are just putting your ...
user avatar
1 vote
0 answers
30 views

What is the definition of a redex and what are they for in programming languages literature?

I saw the word "redex" in the context of proramming language theory/semantics in 2018 and now when I was reading a neurosymbolic research paper (machine learning with neural nets + symbolic ...
user avatar
0 votes
1 answer
32 views

Partially correct?Totally correct?Deterministic?Determined?Terminating? What do these adjectives mean for an algorithm?

These terms are often used to describe algorithms but I'm not really sure what they mean. I would like to see more examples of what each one is like and how they can be identified. Can anyone please ...
user avatar
0 votes
0 answers
82 views

How to incorporate Duplicate Letter Handling for Wordle?

I am trying to reverse engineer the following image. So far, the way I would take into account of duplicate letter handling is the following . I am unsure how I could code this such that the ...
user avatar
1 vote
0 answers
29 views

Are there any algorithms that become much easier to design & implement in reversible computation settings?

If your program can move backwards (even if just for a preset amount like 10,000 atomic steps), then it's easier to do these things: Undo/Redo history (automatically for everything). This can be a ...
user avatar
1 vote
2 answers
92 views

What are the technical reasons programs in C and C++ do not show runtime errors, but programs in Rust and Golang do?

When a runtime error occurs with a program in language likes C or C++ using GCC/G++, it just crashes the process. When it occurs with a program in language like Rust or Golang, a detailed error ...
user avatar
0 votes
0 answers
34 views

Interpretation of semantics of queue algebra

I am trying to understand the semantics for stack algebra and queue algebra as introduced in section 8.5, "Specification Algebras" of textbook Software Engineering 1, Abstraction and ...
user avatar
  • 459
0 votes
2 answers
45 views

In Programming data types size are depends upon what?

In Programming there is different data types (int , cahr , bool , float ) and they have different sizes (1,2,4,8 .. Bytes) , and the size of data type are depends upon hardware or architecture of ...
user avatar
  • 1
1 vote
1 answer
52 views

What exactly are functions in programming?

Are conditional statements, loops, and basic maths operators are functions? I learn functions as a "specific action". But, I saw in a video from youtube that a guy called loops and math ...
user avatar
1 vote
1 answer
21 views

Books for learning horn clause logic

I want to learn prolog,two reason for that are -one can always find a counter example to the argument by searching for negation.So,one can learn by debugging the scripts.I heard that prolog is based ...
user avatar
2 votes
1 answer
112 views

is HaltingFuck computable?

A while ago I defined the language HaltingFuck, but I've never been able to figure out its computational class. The language is defined as follows: HaltingFuck is a language very much like Brainfuck, ...
user avatar
  • 375
1 vote
0 answers
36 views

Is try...catch a control flow pattern?

Is try...catch a control flow pattern such as if-than-else-elseif or ...
user avatar
  • 11
-1 votes
3 answers
218 views

What is a pseudocode of try-catch?

What is a pseudocode of try-catch? Is it this? **Try** SOMETHING If you succeed Do nothing special Else, if you didn't succeed Do what's described in the **Catch** block Anyway, either if ...
user avatar
  • 11
3 votes
1 answer
36 views

What is a program analysis technique for tracing assignments (mutations)?

I am looking to write a program analysis for Java programs that tracks assignments and is able to discern: whether a class field (static or not) is read and where the read originated whether a class ...
user avatar
0 votes
0 answers
21 views

What exactly is "compositional desugaring"?

I've been reading Pombrio and Krishnamurthi's Hygienic Resugaring of Compositional Desugaring and I don't fully understand what they mean by "compositional desugaring". For example, they ...
user avatar
2 votes
0 answers
55 views

Named outputs of a function

Is there a programming language with named return values? I imagine something like in the following (syntax to be workshopped): ...
user avatar
  • 129
2 votes
0 answers
75 views

What is the runtime (time complexity) of Type Inference in Simply Typed Lambda Calculus?

I was told that the runtime of OCAML or Scala is EXPTIME - which seems really bad! However, since people use type inference (deciding the type of a term or program or expression) in practice - it must ...
user avatar
0 votes
1 answer
51 views

kolmogorov complexity for finite Language?

In lectures my professor proved that there is no Turing machine that for every x it calculates k(x). On the other hand, I saw a claim online that for finite language L there is a Turing machine that ...
user avatar
  • 51
10 votes
4 answers
4k views

What are some interesting/important Programming Language Concepts I could teach myself in the coming semester?

I’m a CS senior with and Individual Study period this coming semester, and I’ve decided I’d like to learn more about Programming Language Concepts. More specifically, different programming paradigms, ...
user avatar
  • 119
1 vote
2 answers
78 views

How was swapping program born?

Code: a=10 b=5 temp=a a=b b=temp I am studying Python and I stumbled upon the classic program: The Swapping Program. It is simple: ...
user avatar
  • 13
0 votes
0 answers
27 views

Shallow Binding with static scope, is it possible?

I'm new in programming, I'm currently studying programming languages. I'm trying to implement Shallow Binding with static scope, starting from an abstract syntax (producing a programming language ...
user avatar
0 votes
1 answer
38 views

Which type can cause problems with encapsulation in Java?

Out of the following, which type can cause problems with encapsulation? A. Int B. Int[] C. String D. non of the above I chose D and was incorrect. I am kind of confused what this questions is asking ...
user avatar
0 votes
1 answer
32 views

Grammar where the precedence of condition operators are asymmetric with regard to assignment operators

In Unix shell programming, there's the ideom: program1 && program2 && program3 where successful completion of ...
user avatar
  • 151
1 vote
1 answer
58 views

When is a stuck state not final and when is a maximal sequence not complete in transition systems?

Reading the book Practical Foundations for Programming Language. In section 5.1 Transition Systems, the author said that Whereas all final states are, by convention, stuck, there may be stuck states ...
user avatar
  • 247
2 votes
0 answers
19 views

History of the category of effectful computations

The 1971 paper A Catalog of Optimizing Transformations contains this passage: irreducible subprograms require special handling. (An irreducible subprogram is one which maintains a history, performs I/...
user avatar
  • 41
2 votes
2 answers
87 views

Semantics and implementation of side effects

From a practical point of view, how do functional languages with formally specified semantics (like ML) handle side effects like printing? I'm aware of things like the IO monad in Haskell but I'm ...
user avatar
3 votes
4 answers
188 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 ...
user avatar
  • 131
2 votes
1 answer
49 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 ...
user avatar
  • 3,464
1 vote
2 answers
63 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 ...
user avatar
7 votes
1 answer
112 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 ...
user avatar
1 vote
1 answer
82 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 ...
user avatar
  • 140
1 vote
0 answers
49 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 ...
user avatar
  • 10.7k
-2 votes
1 answer
46 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 ...
user avatar
0 votes
2 answers
100 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 ...
user avatar
  • 1
2 votes
1 answer
60 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 ...
user avatar
1 vote
2 answers
84 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 ...
user avatar
1 vote
1 answer
84 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 ...
user avatar
1 vote
3 answers
72 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, ...
user avatar
0 votes
2 answers
130 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 ...
user avatar
-4 votes
1 answer
143 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 ...
user avatar
1 vote
2 answers
68 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?
user avatar
1 vote
1 answer
25 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.) ...
user avatar
  • 115

1
2 3 4 5
19