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
0answers
13 views

Calling bsearch() in C [closed]

I'm coding a program in Turbo C (yes, I know that's old) and I keep getting an error message. Pieces of the function: ...
-1
votes
0answers
27 views

Is Matlab a programming language?

My question is that, because I'm not sure what a programming really need to become a programming language. So, is Matlab a programming language?
2
votes
1answer
53 views

What are the most used statements in programming (ranked)?

I was wondering if there are any resources for a study/ranking of the most frequently used statements (by statements I mean assigning, invoking, instantiating etc, like in C#) in programming overall (...
-1
votes
1answer
19 views

Random numbers with condition in matlab

I need ’n’ random numbers that: each one is bigger than ‘a’ their sum is smaller than ‘b’ How can I have that in Matlab?
-2
votes
0answers
15 views

How do you write the sql to get following result?

How do I write sql for the following question to get the following result?
0
votes
0answers
22 views

Are there any beginner-friendly courses teaching how to create a programming language?

There are many excellent step-by-step courses (free and paid) teaching you how a specific programming language works and how to use it to create applications. I've benefited a lot from these courses. ...
9
votes
1answer
826 views

Monad in Haskell programming vs. Monad in category theory

I have a question about concept of monad used in Haskell programming and category theory in math. Recall in Haskell a monad consists of following components: A type constructor that defines for each ...
-1
votes
0answers
26 views

How should I decode the string?

I am working in an data entry application and it saves the data in a .db file with some sort of encoding. It has columns startdate, enddate, starttime, endtime, f1, f2 upto f15 and each column stores ...
0
votes
1answer
44 views

I want to learn more about computer science. Where should I start?

Hello computer scientists, I am a mathematician. I have taken some undergraduate courses in C++, Python, assembly language, boolean algebra, logic, graph theory, etc. I would like to learn more about ...
2
votes
1answer
57 views

How does the undecidability of Extensional Martin-Löf Type Theory apply to real type-checking compilers?

It is claimed in many sources (for example, here) that adding a rule like "if Id(X,Y) then X really equals ...
2
votes
1answer
20 views

How would you model Rust procedural macros?

In Rust programming language one can write a compiler extension function that works on abstract syntax tree, effectively modifying source code before it gets converted into machine instructions. In ...
-1
votes
1answer
34 views

Java programming object terminology

Say there is a class called Person. Then in the following expression : Person human = new Person() Which is the "reference&...
-1
votes
1answer
44 views

doubts on cin and scanf [closed]

i spent literally 5hrs trying to figure out, why the value of n is 1 for my second test case ( which begins at line 12 ) , but i am unable to, could you help me with that? ...
0
votes
1answer
22 views

Can you use binary files to reverse engineer cpu architecture?

I wanted to know if it was possible to add code directly to a computer without an operating system or any programming language. To do that, I thought that maybe I could use the binary files to reverse ...
2
votes
1answer
69 views

Type-checking function calls with functional subtyping

I'm relatively new to the topic. Suppose that you want to type-check an expression of the form f(a), i.e. a function call. Assuming that all the declarations are ...
0
votes
0answers
20 views

How would I convert separate digits to an actual number?

In Dr. Racket, how would I combine the digits w, x, y, z to wxyz (for example 3, 7, 8, 9 to 3,789)? I haven't gotten very far on this: (define digits-to-numbers w x y z)
0
votes
1answer
25 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. ...
0
votes
0answers
24 views

Regular expressions accepted by programming languages but are not regular [duplicate]

The below definition of Regular Language is given in Wikipedia. In theoretical computer science and formal language theory, a regular language (also called a rational language) is a formal language ...
19
votes
5answers
4k views

What is the formal, rigorous definition of a programming language?

In programming language theory, people study the theory behind programming languages. But I have never heard any formal definition of programming languages themselves. What is the formal definition, ...
3
votes
0answers
50 views

Semantics of “write-once” variables for complex data structures

Question My use case for what is described below is not a language or compiler implementation, but finding a reasonable semantics for this feature in a an abstract calculus. Ideally, you give me a ...
0
votes
2answers
58 views

Are C standard library functions considered part of C programming language

Do we consider functions like printf part of C language even if it's not a keyword in it.
0
votes
1answer
36 views

First-order mutual-recursive functions Turing-complete or incomplete?

Assume we have a C-like programming language with no pointer/heap semantics (i.e. there is no concept of memory; everything is on the stack). The only datatype supported is Integer, but suppose the ...
1
vote
1answer
43 views

Terms for different models of sum types

There seem to be at least a couple different possible ways of modeling sum types in a type system, but I haven't been able to find consistent terms for referring to them: A sum type is formed from a ...
1
vote
1answer
41 views

In the dataflow programming paradigm programs are modeled as directed graphs. Are the edges of the graph variables? And are the vertexes functions?

As I understand it in dataflow programming, programs are structured as directed graphs, an example of which is below Is it true to say that the arrows (or edges) represent the variables within a ...
3
votes
0answers
59 views

What's the meaning of linguistics?

In the programming language theory world, there are two important terminologies, i.e syntax, and semantics. I can understand these two terminologies: syntax is about sentence's structure (e.g. a valid ...
1
vote
2answers
42 views

What programming language should I use to run physics simulations of CO2 being absorbed by different materials?

I want to model the absorption of CO2 with multiple different materials such as cement, limestone, wood, etc? I know Matlab is capable of these types of physics simulation according to this research ...
2
votes
1answer
52 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 ...
0
votes
0answers
59 views

What does it take to create a new programming language and its toolchain?

I am super novice to this topic, so my apologies if my question looks completely nonsense to you all! Imagine you want to create a new programing language that transpiles to a more common high/low-...
0
votes
0answers
25 views

Exceptions from exceptions, does such a thing exist?

I am intrigued: In many languages there are both normal control flow and exceptions. But I never saw "an exception from an exception" or "an exception from an exception from an ...
17
votes
5answers
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++. ...
0
votes
0answers
24 views

Question regarding definition of recursive function

According to Wikipedia, and also a very common definition of a recursive function found in several books, "functions that call themselves from within their own code". I agree that this solves the ...
6
votes
3answers
856 views

Where should I start to understand how computers work? [duplicate]

I am interested in how computers work but I have no idea how the concept of 0's and 1's converts to making possible for people to control a computer by programming. I would like to understand from ...
1
vote
2answers
102 views

Do there exist coding languages where the halting problem is solvable but not trivial

Does there exist a coding language where 1. It is always possible to determine whether a computer program will halt or run forever. And 2. The answer is not always yes. (or always no) So languages ...
3
votes
1answer
70 views

How to prove that replacing a character in a string in both C and JavaScript is equivalent?

I would like to try some different proofs, specifically in proving equivalence of the implementation of some feature in two different programming languages (C and JS in this question). This is about ...
2
votes
1answer
67 views

Difference between assignment, binding, and substitution?

I am trying to understand the difference of assignment, binding, and substitution. I know the three things are related, but to me it's not exactly clear what word refers to what. Example, illustration,...
3
votes
1answer
43 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
3answers
91 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$ ? $...
1
vote
0answers
45 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
5k 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 ...
0
votes
0answers
16 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 ...
21
votes
6answers
3k 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 ...
0
votes
0answers
40 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
30 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, ...
0
votes
0answers
17 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
66 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
49 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
46 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
33 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 ...
2
votes
1answer
27 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
27 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 ...

1
2 3 4 5
17