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

learn more… | top users | synonyms (1)

0
votes
0answers
7 views

Where to go for depth in Computer Science? [on hold]

I am actually an undergraduate student enrolled in a physics programme. I did some programming at school in C and C++ and html. Also, Latex, and I have been using computers for a very long time and ...
1
vote
0answers
23 views

Is object oriented programming fundamentally different than imperative programming? [duplicate]

I have been using C for a while, for some reasons I learnt C++. I can't see why object oriented is a "new" feature. For me an object is just a structure, and a set of functions which have a pointer ...
1
vote
2answers
46 views

Is there a decidable algorithm to compose two well-behaved recursive functions that work on a recursive tree datatype?

Let the following datatype be defined: data T = A | B T | C T T That is, B, B T, B (B T), C A A, C (B T) A and so on all are ...
1
vote
1answer
25 views

Small-step semantics: for-loops

I'm trying to construct the small-step semantic rules involving the for-loops, but I can't find anything about it in the literature (only about while-loops). I was wondering if anyone could help me ...
0
votes
1answer
34 views

Are Java and C# also purely interpreted languages? [on hold]

I was wondering about the nature of these managed languages i-e since c# and java both are converted into intermediate language and byte code respectively, and are interpreted by their respective ...
0
votes
0answers
7 views

Linked lists and patterns python [migrated]

Trying to write a function that will iterate over the linked list, sum up all of the odd numbers and then display the sum. Here is what I have so far: ...
2
votes
0answers
17 views

About computer science and category theory [duplicate]

I read that Category Theory has alot to do with how programs and information can be organised.Can Category theory simplify various programming strategies? If a specific Category is represented as a ...
-1
votes
2answers
67 views

Mathematical function vs Computer program

In mathematics , an $n$-ary relation is subset of cross product on $n$ sets took under consideration. Let us take $A_1,A_2,A_3 \cdots A_n$ be the n sets. Then relation $R \subseteq A_1\times ...
1
vote
0answers
37 views

Binary and Pi codes [closed]

Okay, I have a fairly strange question, that has been eating me for a long while. Is it possible now, or could it ever be possible to program a computer using the digits of Pi (3.14...)? The idea just ...
1
vote
1answer
40 views

Can Java be accurately described as statically and dynamically typed?

Java seems to be categorized as a statically-typed language [1], but I'm wondering if it would be accurate to describe it as generally statically-typed but having some dynamic typing because of the ...
0
votes
2answers
99 views

How does an operating system implement the C library?

I have an idea of how a C program is turned into machine code by the compiler. I also know how the processor processes the instructions (https://www.youtube.com/watch?v=cNN_tTXABUA this video has a ...
0
votes
0answers
41 views

Writing programs with a block programming environment vs. Writing programs using high level prgramming language

I'm a GCSE Computing student and I've been asked to compare writing programs in a block programming environment (I think this means using programs such as Scratch or App Inventor but I'm not entirely ...
1
vote
1answer
41 views

Are instructions defined as expressions with side-effects?

Can we define instructions as expressions with side-effects?
1
vote
1answer
34 views

Variable programs and variable data

I'm reading "Sets for Mathematics" by Lawvere, and he uses the following metaphor at the end of section 1.3: "we will see...how any abstract set F of the right size can act as mappings between given ...
0
votes
1answer
152 views

What is pass-by-value-result and its advantage and disadvantage? [duplicate]

I have searched on Google, but I can't quite understand what is pass-by-value-result. What is the advantage and disadvantage of using pass-by-value-result? If I have a program code like this, what ...
2
votes
0answers
46 views

Which programming language is used at the Large Hadron Collider? [closed]

First off I am new to computer science (first semester) and do not know anything about physics, so I am appologizing up front for this not very scientific question. I've been wondering how data is ...
4
votes
1answer
51 views

How are REGEXP implemented in programming languages?

Is there a good general paper about the interpretation or compilation of REGEXP in programming languages for pattern matching, with or without variables? I am not looking for a quick explanation about ...
3
votes
1answer
67 views

Lambda Calculus: How do evaluation contexts “work”

In the pure lambda calculus, we have the inductively defined set of terms (the grammar): $$e::= x \mid \lambda x . e \mid e_1 e_2$$ Under the call-by-value evaluation strategy, we have the inference ...
6
votes
2answers
77 views

Lambda calculus: difference between contexts and evaluation contexts

Firstly, I'd like to say that my text below may contain errors, so feel free to point out any mistakes in my formulation of the question. Consider an untyped lambda calculus with booleans and ...
3
votes
2answers
53 views

Is List comprehension equivalent to composition of filter and map?

Wikipedia says A list comprehension is a syntactic construct available in some programming languages for creating a list based on existing lists. It follows the form of the mathematical ...
2
votes
0answers
53 views

Is this a good approach for first attempt to create my own language and compiler?

I want to try to create my own very simple programming language and it's compiler or interpreter. The programming language I use is Java. My idea was to create a compiler which will compile source ...
0
votes
0answers
18 views

Automata Theory countably and uncountably infinite [duplicate]

I'm going over some of the pre-requisite math regarding Automata theory, and finite representations. I read the following: If ∑ is a finite alphabet the set of all strings over the alphabet (∑*) is ...
1
vote
0answers
17 views

Why is this execution happens-before consistent?

In section 17.4.5 "Happens-before Order" of Java Language Specification, a trace is examined for the notion of happens-before consistency. The trace is shown in the figure in which $A$ and $B$ are ...
0
votes
1answer
39 views

Is it possible to have 2 languages with different syntax but the same semantics? [closed]

I have two questions Is it possible to have 2 languages with different syntax but the same semantics? If not why not else give an example of 2 languages . Is it possible to have 2 languages with ...
1
vote
0answers
27 views

What is a trampolined interpreter? [closed]

Can anyone explain me what is a trampolined interpreter? I am versed with relevant concepts viz. procedural languages, continuations etc but am finding difficulty understanding the definition/need for ...
1
vote
1answer
40 views

How are programming paradigms classified? [closed]

When I started to learn about imperative programming and declarative programming it raised many doubts, like, how are structured, modular and object-oriented programming classified: declarative or ...
3
votes
2answers
76 views

Mathematical background for programming languages, compilers and formal methods in software engineering [closed]

Can you tell me what mathematical background (concrete themes) should I have for studying and doing some investigations (in future) in programming languages, compilers and formal methods in software ...
1
vote
1answer
108 views

When do type systems start needing a logic engine?

I've noticed that some languages include a logic engine as part of their type system (e.g. Shen, Typed Clojure). Other languages have a much more direct type checking algorithm (e.g. Haskell / ...
2
votes
1answer
39 views

What is the Inversion Lemma

I am taking a programming languages course, and we have had to use the Inversion Lemma many times in our proofs of preservation. We have been given the Inversion Lemma in each of these examples, but ...
3
votes
2answers
54 views

Dependent types vs refinement types

Could somebody explain the difference between dependent types and refinement types? As I understand it, a refinement type contains all values of a type fulfilling a predicate. Is there a feature of ...
2
votes
2answers
47 views

what is a good source for learning how to design a programming language? [closed]

I am trying to find a good resource for learning on how to design and create a new programming language. It seems like a search for books in amazon raises some difficulties, because the vast majority ...
3
votes
0answers
75 views

Is there any defined programming model for 'Self-Learning' NPUs?

Qualcomm is creating a Neuromorphic Processing Unit or an NPU called zeroth. IBM is also working on a brain inspired chip under Synapse program. Standford's Neurogrid might be a similar example. ...
2
votes
4answers
52 views

Are references of any use without updating?

Almost all type-theoretical treatments of references that I've studied introduce references as accompanied with at least three operations (sometimes including the fourth): Construction (allocation): ...
4
votes
1answer
88 views

Why are there multiple computer languages instead of multiple libraries?

If someone realizes that a computer language is deficient under some aspect or the other, couldn't he just create a library for the new language instead of a new language? Couldn't you have a library ...
0
votes
2answers
63 views

How is a type system related to a progam?

In another question about Lambda Calculus, Andrej Bauer made the comment: Lambda calculi of various forms are formal systems. They consist of abstract syntax (for terms and for types, if ...
2
votes
0answers
65 views

Can type information be encoded in the untyped lambda calculus?

I'm going to take the few pieces of knowledge I have about lambda calculi and ask a pair of very uninformed questions :-) Is it possible to "embed" the corners of the lambda cube within the untyped ...
2
votes
1answer
107 views

Is it possible to design a C++ like language without a Preprocessor?

According to the dragon book, one of the first steps the source code of a program goes through during compilation is the Preprocessor. Assuming a language like C++ where there is no underlying ...
4
votes
1answer
92 views

How close are common programming languages to not being Turing complete?

The term "Turing completeness" has been discussed in several of the Computer Science classes that I've taken. However, I've never gotten an intuitive feel for what Turing completeness actually ...
4
votes
1answer
62 views

Can parameters be contra- or covariant in Python?

I've just now studied about covariance and contravariance in static languages (more specifically C#). This concept is rather clear to me, however I'm in doubt on how this applies to dynamic languages ...
6
votes
1answer
119 views

What makes PROLOG Turing-complete?

I know that it can be proven PROLOG is Turing-complete by constructing a program that simulates a Turing machine like this: ...
4
votes
2answers
211 views

What can Idris not do by giving up Turing completeness?

I know that Idris has dependent types but isn't turing complete. What can it not do by giving up Turing completeness, and is this related to having dependent types? I guess this is quite a specific ...
0
votes
3answers
88 views

Is safety-critical software a subset of real-time software?

I would like to refute my hypothesis that all safety-critical software (that is, software where errors can have catastrophical consequences, either in terms of human lives or high material costs) is a ...
0
votes
0answers
15 views

Is there a fusion law for the mapreduce operation used on conc-lists?

Conc lists are similar to cons lists. In contrast to folds, mapreduce is the main "iterating" operation used on it. Composed mapreduces produce intermediate lists. Is there a fusion law for them, ...
6
votes
2answers
91 views

How to find the minimal description for an array?

The following array occupies 10000 slots in memory: a = [0,1,2,3,4,5,6,7,8,9,10,...,10000] But one could easily represent the same array as: ...
1
vote
2answers
55 views

If dynamically typed languages are truly statically typed, unityped languages, what is the (finite) type expression of the one type?

Some claim that dynamically typed languages are in reality statically typed, unityped languages. This would imply to me that this one type should be expressible as a static, finite type expression, so ...
1
vote
0answers
119 views

lexical scoping vs. dynamic scoping

I'm wondering about the result of this program as I get confused when it comes to lexical scoping and dynamic scoping. ...
3
votes
2answers
131 views

Isn't Functional Programming just Imperative Programming in disguise?

A YouTube video I was watching explained the differences between Imperative and Functional programming by demonstrating how the numbers from 1 to ...
2
votes
3answers
211 views

What would dynamically-typed languages actually do if type enforcement was removed?

I program in Python, which is a well-known dynamically typed language. I understand dynamic typing to mean mainly that "operations" (in a loose sense) in the language are either allowed or denied ...
4
votes
0answers
64 views

Resources for teaching computer science with R

I am a professor at a university of applied sciences and will teach computer science next semester. My question is if you know resources which use the R project as the basis, i.e. not using it ...
9
votes
9answers
453 views

Corresponding noun for “side-effect-free”?

For functions or computations we have terms like: Deterministic – Determinism Pure – Purity Now what is the correct corresponding noun for side-effect-free? "Side-effect freeness"? ...