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

learn more… | top users | synonyms (1)

0
votes
0answers
8 views

Concept of SOLVER [on hold]

A) Is it that a SOLVER is a customized tool made out of various other tools or softwares, meaning, is it more analogous to the concept of "Library of different Modules"? B) Just like creating ...
0
votes
0answers
40 views

LALAR vs SLR Table for Given SLR Grammar

i'm so glad that ask my first question on my favorite site. Infact i ran into multiple choice question in recent exam on Compiler Course. Suppose T1, T2 is created with SLR(1) and LALR(1) for ...
2
votes
1answer
70 views

Why multiple return values is not a common thing?

I would like to ask a question about multiple return values, why this construct is not preferrable in programming languages (conceptual and/or technical difficulties). I've heard something about stack ...
0
votes
0answers
30 views

Learning to program in C [closed]

I have about a month to become proficient at programming in C. I wonder if anybody could recommend some worksheets/exercises that get progressively harder so I can practice and learn. Many thanks!
4
votes
2answers
104 views

what would be the drawbacks of lecturing two programming languages simultaneously?

One colleage came with the idea/comment that it would be useful to lecture two programming languages, eg. Java and Scheme, at the same time while lecturing an Introduction to Programming course aimed ...
0
votes
1answer
41 views

What is the difference between symbol and enumerated datatypes?

I wonder what differences and relations are between symbol and enumerated types? A symbol is a primitive datatype whose instances have a unique human-readable form an enumerated type is a ...
-1
votes
1answer
52 views

Implementability of a (abstract) data structure/type? [closed]

Do people consider the implementability of a (abstract) data structure or a data type, just like people do for implementability/computability of an algorithm? By implementability, I mean if a ...
4
votes
0answers
46 views

Are there specific rules for programming languages applicable to Quantum Computers?

What would be the requirements for programming languages that are used for quantum computers? Do standard procedural languages with their constructs be sufficient, and succinctly capture the computing ...
2
votes
4answers
102 views

Why isn't there a .= operator? (or ->= etc)

Considering how often we do: ...
4
votes
2answers
40 views

Incorporating newline-as-statement-terminator heuristics into context-free languages

Several block structured languages (Scala, Go, Ruby, Julia, Quorum, ...) use semicolons as statement terminators, but allow newlines instead of semicolons under certain circumstances. My question is: ...
1
vote
2answers
58 views

Call‑by‑name will succeeds where call‑by‑value may fails: some example cases?

I've landed to SML pages, comparing call‑by‑name and call‑by‑value, asserting the former always succeed while the latter may fails. As this seems counter intuitive to me, I feel at least an example ...
1
vote
1answer
49 views

Programming languages for genetic engineering [closed]

I'm interested in getting a Ph.D. and would love to work on a project such the GEC project at Microsoft Research, which studies the application of programming languages for synthetic biology and ...
2
votes
1answer
22 views

Ordering of conditions in multi-way conditional constructs [closed]

Most programming languages provide multi-way conditional constructs (like cond in Lisp, guards in Haskell, etc) that allow one to define program behavior according ...
1
vote
2answers
119 views

What are the definitions of syntax and semantics?

For a formal language $L \subseteq \Sigma^*$ over an alphabet $\Sigma$. From https://proofwiki.org/wiki/Definition:Syntax The syntax of a formal language is its structure, and is specified by a ...
6
votes
1answer
65 views

Tag-free garbage collection for object oriented languages

I'm looking around for a good garbage collection technique for my language and found this paper, where Benjamin Goldberg describes a garbage collection technique for strongly typed languages, which ...
0
votes
1answer
63 views

High Level Programming Languages vs Block Programming Environments [closed]

I am looking for the opinions of more experienced programmers as to the effectiveness of writing programs in Block Programming Environments such as Scratch or App Inventor as opposed to High Level ...
1
vote
0answers
66 views

How does one guarantee that the commutative, associative and distributive properties hold for a type?

While most main stream programming languages allow for user defined types that can have the following properties: associative commutative distributive the only way I know of that this can ...
-4
votes
1answer
39 views

Understanding the symbolic computation of a derivative [closed]

I've been watching the sicp videos lectures by Hal Abelson and Gerald Jay Sussman and am lost on lecture 3b. Can someone explain to me what's going on in this video? ...
2
votes
0answers
40 views

Are there models of type theory that allow the real numbers to be a type?

Do there exist models of type theory that allow types to contain an uncountable number of inhabitants? Traditionally type theory seems to be swirled in with computable programs as constructive proofs ...
6
votes
6answers
245 views

Language for teaching basic programming

I'm interesting in teaching programming to middle school students. I'd like a programming language with the following criteria: Simple - pared down to the absolute minimum needed to support ...
0
votes
1answer
75 views

Why does Pascal have a high code density?

The plots in http://blog.wolfram.com/2014/06/04/how-the-wolfram-language-measures-up/ seems to indicate that Pascal has a relatively high code density. What features of the language makes it so? ...
4
votes
2answers
221 views

Why isn't the Swift programming language type inference more aggressive?

Couldn't the type inference in Apple's new programming language Swift had been done more aggressive? For instance why can't the return type of a function be deduced? ...
0
votes
0answers
21 views

Type inference example?

In my programming languages course we are reviewing type inference, i didnt get very well how to make this task. I all ready search at the bibliography of my course (PLAI by Shriram krishnamurthi) ...
0
votes
0answers
7 views

How to apply the unification algorithm to a racket function

In my programming languages course we are reviewing unification algorithm by hand. The TA can't solve some examples of how to apply the unification algorithm to the ...
2
votes
0answers
34 views

Defunctionalization and known arity function calls by pointer

Defunctionalization is nice for higher order functions where it is completely necessary to avoid runtime support, but in some cases it's favourable to use function pointers instead (since they don't ...
3
votes
0answers
85 views

Is there any programming system that enables reversible computations?

Better explained with examples, I need a programming system with the following characteristics: ...
2
votes
2answers
68 views

Is there a name for defining recursive functions as an infinite list of input/output pairs?

Recursive functions are usually defined by directly calling a function inside its own body. Nat = Z | S Nat double Z = Z double (S x) = S (S (double x))) What ...
1
vote
0answers
23 views

Is VHDL a description language for a Boolean circuit or are both concepts unrelated

I am looking for a way to translate basic c programs (subset of c or java or some declarative programming language) to a Boolean circuit. I know that Turing machines are reducible to Boolean circuits ...
1
vote
1answer
86 views

Operator overloading: Java vs. Python

Why operator overloading was included in Python and not in Java? How does one decide to include or exclude operator overloading in a programming language? It is said here that operator overloading is ...
0
votes
0answers
40 views

Proving the small-step semantics of factorial program

I am given the following command $C$: $y:=1;$ while $\neg (x=1)$ do $y:= y*x;$ $x:= x - 1$. I have to show that $[\![ C ]\!]_s(s) = \{x \mapsto 1, y \mapsto s(x)!\}$ if $s(x) \geq 1$ and undefined ...
1
vote
0answers
24 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
50 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
46 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
46 views

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

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 ...
2
votes
0answers
25 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
86 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
1answer
49 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
154 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 ...
1
vote
2answers
696 views

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

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
60 views

Are instructions defined as expressions with side-effects? [closed]

Can we define instructions as expressions with side-effects?
1
vote
1answer
35 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
335 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
94 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
89 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
91 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
98 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
64 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
61 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
20 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 ...