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

learn more… | top users | synonyms (1)

-1
votes
0answers
16 views

HOW TO FIND SUBSET OF A SET IN PYTHON [on hold]

I am trying to find the subsets of a set in python.. for example, I have a set A={1,2,...10}, I am trying to find all subsets except empty set. Any help will be highly appreciated..
16
votes
4answers
3k views

How do garbage collectors avoid stack overflow?

So I was thinking about how garbage collectors work and I thought of an interesting issue. Presumably garbage collectors have to traverse all structures in the same way. They can't know weather they ...
6
votes
0answers
63 views
+100

Why do we have to forbid non-conforming lower and upper type bounds?

(it's a repost of my unanswered question from scala-user@googlegroups.com about Scala) In the Scala Language Specification, §4.4 Type Parameters, there is a requirement: The most general form of ...
0
votes
0answers
38 views

Learning many languages or concentrating on just one [closed]

I'm just a newbie in programming. So far, I only know C++. I've already learned about classes, inheritance, polymorphism, lists, stacks, queues, a little bit about recursion, a little bit about binary ...
-1
votes
0answers
15 views

Which is the best language to programme a webpage to play chess online? [closed]

I just wanted to know, which is the best language to programme a webpage to play online a game very similar to chess (in which the pieces can move more freely instead of square to square). A user ...
-1
votes
0answers
11 views

I have three text files which are 3 different classes consisting of students with 3 scores each [closed]

Class1 = Elizabeth, 2, 7, 3 Anna, 9, 6, 4 Jenny, 8, 1, 5 Victoria, 1, 4, 6 Class2 = Rachel 7, 8, 9 Quinn 1, 2, 3 Britanny 5, 7, 5 Santana 4, 6, 2 Class3 = Toby, 2, 3, 6 Caleb, 10 ,9 ,8 Ezra, 2, 5, ...
3
votes
4answers
533 views

Do we need recursion in programming language to solve any problem?

My question is simple: If we want to be able to solve every problem, that we can solve using recursions, do we need programming language to allow us use recursions? Assuming we are allowed to use: ...
-1
votes
0answers
7 views

What does that for(int i:x) mean? [migrated]

I am new to java. Once I was reading someone's solution to a question and I encountered this ...
2
votes
1answer
25 views

Return values of Probabilistic Programs

Syntax and semantics section of this paper on probabilistic programming mentions that the return expression of the program is a function f satisfying $ f : \sum \rightarrow ...
1
vote
1answer
84 views

Is there a term for “delegate” function in CS?

This question is all about terminology (names). When you consider "list", this term is well defined in CS -- despite the fact programming languages use and misuse this term (for example C# ...
-1
votes
0answers
2 views

Simple python credit card problem [migrated]

I am supposed to write a simple program to do the following: Taking the following inputs: The outstanding balance on the credit card Annual interest rate as a decimal I am supposed to print the ...
3
votes
2answers
43 views

What's the difference between declarative syntax and encapsulation?

I had been first introduced to the idea of declarative syntax when using Angular JS. From what I understand, the idea is that you say, "do this" instead of "in order to do this, do this, this and ...
2
votes
1answer
71 views

Abstract algebra and programming languages

Quite often, I stumble upon abstract algebra concepts like initial algebra, free algebra, and similar while reading papers on programming languages. For instance, in papers on algebraic data types, ...
1
vote
0answers
29 views

What is effect typing useful for when all global effects already have to be in the IO monad?

This paper adds effect handlers to a number of languages, including Haskell - and also adds a form of effect typing to Haskell. But what's the point of the latter? I know that effect types can be used ...
22
votes
8answers
3k views

What determines the “speed” of a programming language?

Suppose a program was written in two distinct languages, let them be language X and language Y, if their compilers generate the same byte code, why I should use language X instead of the language Y? ...
4
votes
2answers
34 views

Are class methods closures?

In the wiki article about closures one can read: closure ... is a function or reference to a function together with a referencing environment At the same time in the wiki article about class ...
2
votes
1answer
23 views

Monotone Frameworks: Transfer functions for flow edges instead of labels

So, in generic program analysis, we have a lattice $L$ with a join operation $\sqcup$, program with statements labelled, and for each label $b$, a transfer function $F_b : L \rightarrow L$. The goal ...
4
votes
1answer
71 views

What is the difference between assignment, valuation and name binding?

I read that Name binding assigns some value (data/code/expression) to an identifier. Assignment and valuation seem to do the same thing. It is confusing. Can I just tell that free variable is one, ...
4
votes
2answers
90 views

How to bridge theory and implementation for while loops?

I'm working on my own little programming language for educational purposes, and I've run into a little bit of a problem. There are a few different solutions for it, but all of them seem inelegant - ...
7
votes
1answer
71 views

What is a non-contrived example of static type-checking being too conservative?

In Concepts in Programming Languages, John Mitchell writes that static type checking is necessarily conservative (overly strict) because of the Halting Problem. He gives as an example: ...
0
votes
2answers
24 views

R Integer Overflow [closed]

I have a quick question. I have a huge database and I am try to sum all the elements in a column of my data base but there are over 100,000 values and I consequently, get integer overflow (returns ...
1
vote
6answers
247 views

Computer Program vs. Algorithm

It's said that a program include algorithms, however if we refer to their definition, an algorithm is a sequence of instructions written to perform a specified task and a computer program is also a ...
-2
votes
2answers
92 views

What Programming Languages a Computer Science Engineer must learn [closed]

During my college I studied C/C++, C#.Net and ASP.Net. Now one my friend suggested me to learn Python & MATLAB also. He wasn't much specific why to learn these languages, He said it would be ...
2
votes
2answers
117 views

Is 95% of code really non-semantic fluff? [closed]

According to A Study of Wheat and Chaff in Source Code, 95% of code is "chaff", or "non-core functionality", whatever that means. Is this really a sensible study? Does the IT World article correctly ...
3
votes
1answer
52 views

When was the terminology *tracing collector* introduced to denote both mark-and-sweep and copy collectors

Automatic storage reclamation, aka garbage collection, comes in two main families, sometimes cooperating: the reference count collectors and the tracing collectors. I may develop specifics of each ...
2
votes
1answer
42 views

Proof via induction for small-step semantics

I'm doing a course in Computer Programming Languages and I'm trying to prove the following (roughly following Pierce's Types and Programming Languages book): if $t \rightarrow^* t'$ then $if\; t\; ...
5
votes
4answers
854 views

Can we write algorithms without conditional statements?

Regarding turing completeness, i read that for a language/machine to be turing complete it is required that it has some sort of conditional. Consider the factorial problem, we would typically define ...
10
votes
5answers
257 views

Why is the object destructor paradigm in garbage collected languages pervasively absent?

Looking for insight into decisions around garbage collected language design. Perhaps a language expert could enlighten me? I come from a C++ background, so this area is baffling to me. It seems ...
-1
votes
1answer
23 views

Programming Languages Grammar Ambiguity [closed]

I don't know if it is the right site to ask this. But we're studying about ambiguities of grammar. Including left most derivation and right most derivation. We are given the problem: ...
2
votes
1answer
30 views

Most frequently tools or programming language for implementation text processing and nlp algorithms in academic papers and journals [closed]

I want to prototype and try some idea (some algorithm) in the field of text processing and nlp and if the results was good I want to publish some paper or journal article about that. I am familiar ...
8
votes
2answers
169 views

What is the difference between variables and pointers?

Whist reading an article outlining differences in OO and Functional programming I came across function pointers. It has been a while since I completed my Computer Science degree (2003) and so I looked ...
2
votes
2answers
106 views

What do I need to study in order to understand and design a programming language? [closed]

What do I need to read in in order to : understand the specs of an already made programming language Design a programming language Design a compiler and assembler for that language make an ...
0
votes
2answers
72 views

How to learn computer science the right way [closed]

I looked through the sites and this seems to be the best place to ask this question. I am sure it has been asked 10000 times but I am looking for a tailored answer to me and my situation. I currently ...
3
votes
0answers
48 views

In 1968 there were more than 3000 programming languages known, how large would this number be today? [closed]

Alan Kay stated in one of his talks that there was a paper in 1968 that listen at least 3000 programming languages that were known in the year 1968. What would be an unsientific but "educated guess" ...
5
votes
2answers
121 views

Is there an equivalent of lambda calculus for object oriented languages? [duplicate]

Lambda calculus serves as a foundation for all sorts of functional languages and its various extensions are compiler targets for languages like Haskell, ML, etc. So what is the equivalent for object ...
18
votes
3answers
3k views

Can regular languages be Turing complete?

I was reading about Iota and Jot and found this section confusing: Unlike Iota, where the syntactic tree for a string can branch either on the left or on the right, Jot syntax is uniformly ...
1
vote
1answer
32 views

Haskell: implementation issues of some basic features [closed]

I'm taking a "Programming Language: Design and Implementation" course and our professor asked to make a case study about: Haskell programming language. In this case study he asks to make a report ...
2
votes
1answer
145 views

Is There a Programming Language That Embraces Globals?

All programming languages have globally defined symbols. While best practices invariably abjure their use as mutable entities the philosophy of what is mutable and what is not mutable is highly ...
2
votes
2answers
46 views

Second order function formalization

I need to work on a optimizer for a language whose operator are second order functions. They are the well known ones filter, map, reduce, fold, foreach etc. etc. I need to formalize as much as ...
2
votes
0answers
30 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 Type Recursion, ...
0
votes
0answers
19 views

Companion to Böhm-Jacopini

The Böhm-Jacopini theorem states that any 'unstructured' program can be rewritten in structured way. There is a companion theorem that states that in this structuring process the tests that are ...
0
votes
0answers
62 views

Evaluating Functions Using a Parse Tree

I'm making a compiler/interpreter for a language similar to C. I already have a parse tree. I was able to evaluate expression statements by converting my code to another language and then using an ...
0
votes
1answer
78 views

Why are types and grammar non-terminals so distinct?

Sorry ahead of time if some of my terminology is inaccurate, my formal training isn't quite to the level it should be. Almost all programming languages with types separate built-in functions ...
0
votes
1answer
58 views

Is there a name for the 'scope tree' organization?

I could describe JQuery as a library that allows you to easily select elements on and traverse the DOM, the DOM would be the name of the tree or organizational structure of the HTML. When you are ...
2
votes
1answer
42 views

Enumerating programs as graphs, or executing graphs?

Graphs have nodes connected together by edges, for example (not directed, not including connecting nodes to themselves, or multiple connections between the same two nodes) 2 graphs exist with 3 nodes, ...
10
votes
1answer
223 views

Why aren't we researching more towards compile time guarantees?

I love all that is compile time and I love the idea that once you compile a program a lot of guarantees are made about it's execution. Generally speaking a static type system (Haskell, C++, ...) seems ...
3
votes
1answer
47 views

Are fixed-point combinators general recursive?

I don't know if I'm using the vocabulary correctly, but what I'm interested in is this: If your language has fixed-point combinators, is it Turing-complete?
-1
votes
1answer
26 views

Cocurrent programming language being Turing-equivalent and difference between Turing-complete and equivalent

In Is concurrent language CCS or CSP turing-equivalent in language power?, the answer says that CCS or CSP is Turing-complete. But that does not seem to answer whether CCS or CCP is Turing-equivalent. ...
2
votes
1answer
50 views

Is concurrent language CCS or CSP turing-equivalent in language power?

Does the concurrent language CSP (or CCS, $pi$-calculus) model interacting machines? Is CSP (or CCS, $pi$-calculus) Turing-equivalent to other programming languages like C?