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

learn more… | top users | synonyms (1)

-4
votes
0answers
37 views

Program Termination and Halting problem

The program termination and analysis checks for whether or not the evaluation of program will get terminated but since this cannot be perfectly determined because of the halting problem.So to what ...
-6
votes
0answers
29 views

Translate Assembly to C Code [on hold]

00000000 < randomfunc>: 0: e92d40f8 push {r3, r4, r5, r6, r7, lr} 4: e1a04000 mov r4, r0 8: e1a05001 mov r5, r1 c: e1a00080 lsl r0, r0, #1 10: e2800001 add r0, r0, #1 14: e2846001 add r6, r4, ...
-6
votes
0answers
40 views

Please,I want an answer for this question [closed]

Write a Java program which contains your own function(s) to calculate the solution of the problem given below then print which choise is true. There are 4 doctors and 7 nurses. How many 5-person teams ...
-3
votes
0answers
15 views

Can I write try block inside a function and catch block in the main after that function call? [closed]

I am an engineering student.I wanted to know whether I can write try block inside a function and catch block in the main after that function call?
0
votes
0answers
17 views

How to access private variables in C++ [closed]

One of my biggest challenges I've had while learning C++ is making objects with private variables in the header document and then accessing those variables in some other function. Some of the things ...
-3
votes
0answers
19 views

how to swap two numbers in c programing without using third variable or the operator? [closed]

i am an engineering student. I wanted to know the logic to swap two numbers without using third variable or operator.
3
votes
2answers
55 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|}\ ...
-3
votes
0answers
37 views

How to master the following Computer Science Subjects [closed]

1.Probability 2.Discrete Maths 3.Algorithm 4.Python 5.Artificial Intelligence 6.DBMS 7.Operating System(linux) 8.Networking
2
votes
1answer
37 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
74 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 ...
0
votes
0answers
10 views

What is the difference between early binding and late binding in C++? [migrated]

Since i'm studying object oriented programming language it is quite better than C and pretty new concepts. I'm confused with early binding and late binding so my question is What is the ...
5
votes
1answer
238 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 ...
-1
votes
0answers
21 views
2
votes
0answers
15 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
29 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
29 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
45 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
0answers
11 views

Simple selection sort in Python [migrated]

I've seen the following code for the selection sort algorithm in Python, my question is more to do with the functionality of python than the algorithm. ...
0
votes
0answers
3 views

Python how to learn about importing files etc [migrated]

I'm fairly new to python programming, i'm familiar with the very basic stuff and i'm currently learning about creating function definitions in scripts. In particular i'm a mac user and i'm using ...
0
votes
1answer
41 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
24 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
120 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 ...
-1
votes
1answer
67 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
88 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
28 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 ...
18
votes
0answers
310 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
41 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
38 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
56 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 ...
3
votes
2answers
64 views

Compare regex in programming languages with regular expression from automata/formal language?

I'm trying to reconcile the differences/similarities between regular expression from formal language theory and automata, and the "regex" offered by programming languages. These two differ not just ...
3
votes
3answers
88 views

Examples of specialized instructions of assembly language not available in compilers?

In my CS computer organization textbook, there's this blurb on the advantage of assembly over a high-level language. Another major advantage of assembly language is the ability to exploit ...
3
votes
0answers
18 views

Detect assigned variables in expression in linear time

Let's say I have the lambda calculus extended with set! for assignment. ...
1
vote
4answers
721 views

What is the role of mathematics in programming?

I am almost totally uneducated in programming and computer science in general, though I am really fascinated by these topics. I read that mathematics is important in programming and that nowadays many ...
3
votes
2answers
48 views

Functional programming with branches that have no order?

I was wondering if there is any programming style in which the outcome does not depend on the order of statements or groups of statements such as guards. Vaguely, I imagine this would leave room for ...
1
vote
1answer
52 views

What are differences between Static Scope and Dynamic Scope?

My teacher has provided the following pseudo-code, and says that the output using static scope is 1 2 3, but the output using dynamic scope is ...
1
vote
1answer
85 views

What is a stateful computation?

I am reading about a specific field of probabilistic programming, and trying to understand what the term "stateful computation" means. See: ...
1
vote
1answer
87 views

Calculi for a computability class

Proving two push down automata equivalent is undecidable. But proving two finite state machines equivalent is decidable. You also cannot write a programming language that allows expressing the ...
2
votes
0answers
18 views

Where does the term “Amechanicity” for type-error generation come from

I've been looking at these slides about improving type error messages for programming languages. One of the things they describe, starting at Slide 8, is the concept of amechanicity. Anytime the ...
2
votes
1answer
64 views

Is the memory usage of total languages deterministic?

I'm interested in the memory usage of various programming languages when implemented on actual hardware. I believe that a Turing-complete programming language has, in general, unknowable memory usage ...
4
votes
1answer
67 views

What does Harper mean by “class”?

I've been teaching myself type theory on and off over the past couple years. I've reach large sections of Pierce's Types and Programming Languages and Harper's Foundations of Programming Languages, ...
4
votes
1answer
81 views

What was the first programming language with loop break?

While tracing the history of the BREAK and CONTINUE statements found in popular languages, I ran into a dead end right around ALGOL. Algol _? -> CPL -> BCPL -> C -> C++ -> Java -> JavaScript What ...
1
vote
3answers
182 views

String Comparison vs. Hashing

I recently learned about the rolling hash data structure, and basically one of its prime uses to searching for a substring within a string. Here are some advantages that I noticed: Comparing two ...
1
vote
0answers
19 views

converting each element in a group/list of number into other base [closed]

I am new to python programming. I am now trying to build a program which convert every element in a list of numbers of base 10 into its base 4. For example here, say i have numbers from 0 to 20 or ...
4
votes
3answers
145 views

What is the difference between Abstract Data Types and objects?

An answer on Programmers.SE characterizes an essay by Cook (Objects are not ADTs) as saying Objects behave like a characteristic function over the values of a type, rather than as an ...
2
votes
1answer
39 views

Prove an arithmetic property of a partial recursive function

I have this program written in haskell : I have to prove that: $(\forall a \in \mathbb{N})[!D_V [h](a) \Rightarrow log_2 (D_V[h](a) )\equiv 2 (mod$ $ 10) ]$. The predicate $P_2$ for the $g$ ...
2
votes
0answers
31 views

What language features would I need to remove from a real programming language to make it decidable? [closed]

Let's say that I want to restrict certain features of a common programming language--for instance, C--such that the result is decidable, and thus no longer Turing-complete. What language features, at ...
1
vote
1answer
61 views

What is the Haskell-style type signature called (i.e., who is it named after)?

A type signature in Haskell is written in the following format: functionName :: (arg1Type, arg2Type) -> returnType There's a (hyphenated, after a person or ...
3
votes
1answer
80 views

What is the point of delimiters and whitespace handling

I see that language specifies reserved words, delimiters and whitespaces in the lexer section. Are delimiters just like reserved identifiers in the punctuation space or they have additioinal function ...
0
votes
0answers
31 views

How cin and cout work in C++ [duplicate]

I am interested in knowing the blow by blow account of what happens from the time the compiler reads a text document containing a cout/cin command to the time the executable it generates is finished ...