Artificial languages for instructing computers to do steps of computation in order to complete tasks. They allow programmers to communicate with computers.

learn more… | top users | synonyms

0
votes
1answer
58 views

Creating a metaphorical compiled scripted language.

I'm studying for a final exam and I came across this question which I found pretty interesting. I was wondering what the stackExchange community who are more experience in scripted languages than I ...
0
votes
0answers
74 views

Decided to code the new project in TypeScript, should everything be coded in this language?

We have decided to code the new project in TypeScript at the company. Does this mean that everything should be coded in this language? Discussion My first thought was Yes. On the other hand ...
1
vote
1answer
80 views

Is D3.js really data-driven?

In The Art of Unix Programming, Eric Raymond tells that the data-driven style is about creating small interpreters for "mini-languages" to allow controling the control-flow of the program at runtime. ...
5
votes
1answer
236 views

Are programming languages unit tested? [closed]

I'm just wondering—Are the programming language features unit tested? Basic features, i.e. built-in types, operators, arrays, generics, etc. The question applies to unit testing for runtime behaviour,...
63
votes
10answers
14k views

Why do languages require parenthesis around expressions when used with “if” and “while”?

Languages like C, Java, and C++ all require parenthesis around an entire expression when used in an if, while, or switch. if (true) { // Do something } as opposed to if true { // Do ...
2
votes
2answers
138 views

Can conditional break in a loop be rewritten for easier understanding?

while cond1 ... if cond2 ... else ... break The while loop above has two termination conditions, cond2 and !cond1 !cond2 When the commands that are represented ...
0
votes
2answers
141 views

How to remember code when you are working with a lot of languages? [closed]

Sometimes I work for a project that requires some programming languages for about 3 months, later I work for another project that requires a different set of languages. I know and studied of of these ...
0
votes
0answers
46 views

Front end code and quality [duplicate]

I'm a software developer since 3 years and I'm really interested in Javascript since ~1,5 years. I have a backend profile at first, and I'm familiar with SOLID, DDD and some other kind of making code ...
4
votes
1answer
74 views

The bound mechanism by generics for a type variable to appear in its own bound

From Programming Languages: Principles and Paradigms By Maurizio Gabbrielli, Simone Martini The bound mechanism for type variables is fairly sophisticated and flexible. In particular, a type ...
5
votes
2answers
108 views

What is the programming language concept for not evaluating an expression by default in bash?

In Bash, to increase an integer value stored in a variable, we need to explicitly use arithmetic expansion. i=1 i=$((i+1)) Otherwise i=1 i=i+1 will not evaluate the expression i+1, but assign ...
4
votes
4answers
303 views

Design Pattern for Indirectly Connecting Two Classes

Admittedly, this is a homework problem but I have tried to figure it out on my own. Just want to make sure I get it correct. So far, the only design pattern I believe to be correct would be the ...
31
votes
6answers
4k views

Why is SQL the only database query language? [duplicate]

For general-purpose programming there are literally hundreds of programming languages. But for interacting/querying the databases, why is SQL pretty much the only used language?
6
votes
2answers
410 views

How are generics implemented in a modern compiler?

What I mean here is how do we go from some template T add(T a, T b) ... into the generated code? I've thought of a few ways to achieve this, we store the generic function in an AST as Function_Node ...
40
votes
3answers
2k views

What is a type system?

Background I am designing a language, as a side project. I have a working assembler, static analyser, and virtual machine for it. Since I can already compile and run non-trivial programs using the ...
0
votes
1answer
33 views

Two questions about Simula

I am looking over Simula language to see how it compares to C++/Smalltalk, and I have two questions that are difficult to find answers to because each time I type in Simula into Google, it gets ...
3
votes
3answers
261 views

How do programming languages work?

This is probably a dumb question, but how do programming languages work on a low level? If you go to the Go language GitHub page here, it says almost 90% of the source files are Go files. How is it ...
-2
votes
1answer
59 views

Rotate a matrix in place, moving elements? (How to write a part of flow/logic after understanding the problem?)

Following is a java solution of the classic question of rotating a nxn matrix in place clockwise by 90 degrees. public void rotate(int[][] matrix, int n) { for (int layer = 0; layer < n / 2; ++...
2
votes
1answer
173 views

Why is there such a fight for companies to produce new languages + frameworks

There's currently a huge growth in larger companies offering new languages and / or frameworks for us to use to create websites, apps or software and I'm interested to know for what reason do people ...
2
votes
2answers
163 views

Is a linked list considered a collection of objects?

Sedgewick's Algorithm 4ed says Several fundamental data types involve collections of objects. Specifically, the set of values is a collection of objects, and the operations revolve around ...
61
votes
10answers
12k views

Syntax Design - Why use parentheses when no arguments are passed?

In many languages, the syntax function_name(arg1, arg2, ...) is used to call a function. When we want to call the function without any arguments, we must do function_name(). I find it odd that a ...
4
votes
2answers
225 views

Java Design Philosophy

I was reading through design philosophy of java and this line struck me: "The VM checks whether the signature of the Java code is valid and would refuse to interpret if any change of the code is ...
1
vote
1answer
30 views

Relation and difference between recursively enumerable languages and Turing complete languages?

From https://en.wikipedia.org/wiki/Recursively_enumerable_language a formal language is called recursively enumerable (also recognizable, partially decidable, semidecidable, Turing-acceptable or ...
0
votes
2answers
196 views

Is there a need for thenif besides elseif?

For nested if constructs, some languages provide constructs similar to if Bexp1 then C1 elseif Bexp2 then C2 ... elseif Bexpn then Cn else Cn+1 endif All I have seen provide elseif. I wonder ...
18
votes
6answers
5k views

What is the mathematics foundation for first/second/third class values in programming languages?

Added Just found two related questions http://math.stackexchange.com/q/1759680/1281 http://stackoverflow.com/a/2582804/156458 In programming languages, from Michael Scott's Programming Language ...
0
votes
3answers
69 views

Are commands for variable initialization ever used as expressions?

In C, the assignment command also returns the value assigned, so it is also an expression. Similarly, initialization, which happens when defining a variable, also assigns a value to the newly created ...
1
vote
1answer
116 views

How does static scoping apply to recursive functions?

Under static scoping, by its definition, how can we determine the scope of a variable inside a recursive function? For example, in a pseudo-language, int i=1; function myfun(){ if (i > 4){ ...
0
votes
1answer
38 views

Relation between static and dynamic bindings and scopings?

From https://en.wikipedia.org/wiki/Name_binding name binding is the association of entities (data and/or code) with identifiers.[1] An identifier bound to an object is said to reference that ...
0
votes
1answer
80 views

Differences between deep and shallow bindings for static scoping

I am self-learning Michael L. Scott's Programming Language Pragmatics. The following quote explains how deep binding and shallow binding are different in the presence of static scoping: program ...
2
votes
1answer
78 views

Can dynamic typing and dynamic scoping lead to each other?

By definition, dynamic typing and dynamic scoping have different purposes. But some cases make me wonder if they can lead to each other sometimes. Dynamic typing allows a name i.e. identifier to ...
24
votes
1answer
881 views

Why was the caret used for XOR instead of exponentiation?

Not that it's really a problem for anyone that has faced this syntactic issue before, but I see a wild amount of confusion stemming from the use of the caret (^) as the XOR operation in lieu of the ...
3
votes
0answers
87 views

Create in-browser IDE for own grammar

We are going to use our new own programming language. We have designed grammar, json parser and everything seems to work. Code in my language is transpiled into javascript and interpreted by node.js ...
2
votes
2answers
157 views

How is a abstract syntax tree used to execute source code?

After researching how a parser generates an AST, I believe that I can know attempt to create one. Before I started on this project, I began to ponder what I should be done next after creating a AST ...
0
votes
2answers
149 views

How do I determine the visibility of “objects” as defined in the C programming language?

This question was asked by my professor in an exam and I couldn’t find an answer on Google, so here I am. I don't understand what objects are in C at all.
-1
votes
1answer
96 views

Where does Firebase fit in?

I am a front-end developer who is familiar with HTML, CSS, JS and to a degree, AngularJS. I've chanced upon Firebase (firebase.google.com) - and was wondering if I could, with my lack of knowledge ...
4
votes
4answers
217 views

Learning languages: high-level first, or low-level first? [closed]

Whenever I learn about a high-level language I want to learn about, part of me says, "I should probably learn the lower-level language it's built upon to really master it". For example, Ruby => ...
1
vote
4answers
201 views

Why does string.find(“”) = 0? [closed]

I'm studying Python and hung up on a simple problem. Let's say we have: string = "hello" When we invoke the find method on the string to find an empty string like this: string.find("") Why does ...
0
votes
1answer
158 views

Two C program sharing same addresses

I was trying to understand structure padding , so i wrote a simple program as written below and i executed it . just to make clear i made two copy of this program program1.c and program2.c and ...
1
vote
1answer
90 views

What is the best way to incorporate new language features into your code? [closed]

My main language is currently JavaScript, and I'd say I'm fairly proficient in it. That is, when I think "I want to do x", I don't (generally) Google "how to do x", but I think "I know! I will use ...
3
votes
1answer
1k views

Why is Lustre used for programming critical control software (Nuclear power plants etc)?

So, as stated on wikipedia: Lustre is a formally defined, declarative, and synchronous dataflow programming language for programming reactive systems. It began as a research project in the ...
-1
votes
1answer
79 views

Why do we use 'assert not' in this example?

My code takes 2 dates and finds the age of those dates in days. In my daysBetweenDates method the instructor uses an assert statement: assert not dateIsBefore(year2, month2, day2, year1, month1, day1)...
1
vote
2answers
106 views

Property of functions with same input => output independent of language or naming

Let's consider these four functions: # Racket (define (square x) (* x x)) (define (sqr a) (* a a)) # Javascript function square(x) { return x * x } function sqr(y) { return y * y } All ...
0
votes
1answer
128 views

Commonalities between Programming languages [closed]

I've tried looking on google but can't get the answer I want to this. Is there a book or article or a video where various commonalities of different popular high level languages like Python, Java, C++ ...
-2
votes
1answer
204 views

What is an efficient way to implement 'Stack' without generics?

Today I was reading a lot of articles complaining about Java Generics or C++ Templates. Now, my question is: How can someone implement a collection data structure like Stack without using them?
4
votes
2answers
241 views

Runtime Inheritance

I recently came across the term "runtime inheritance" when reading this Wikipedia article. I tried to search for it and came across this article that tries to explain the difference between runtime ...
2
votes
3answers
214 views

Why do programming language authors choose not to implement UFloat?

I realized I haven't seen this type in Objective C or Swift. But we have UInt. Is there some more Computer Science specific reason we do not have an Unsigned Float? Afaik it's not in c# too.
0
votes
1answer
160 views

What algorithm or program does Java use for arithmetic?

I was looking at bitwise ways to multiply and add numbers without using * or + operators. But I want to know that it might be possible that java may already be using a better approach underneath. I ...
1
vote
2answers
112 views

Different Number Base Systems

I am doing a summer assignment for AP Computer Science. For this I am learning about different number base systems and how to convert them. These topics led to me wondering about why programmers use ...
0
votes
3answers
104 views

Compiling methods in interpreted programming language as standalone c++ app

I'm writing an interpreted implementation of a new programming language (just for fun). In this implementation language is first being compiled to an intermediate language, which is then interpreted ...
8
votes
6answers
765 views

How is static typing really helpful in bigger projects?

While curiosing on the main page of a scripting programming language's site, I encountered this passage: When a system gets too big to keep in your head, you can add static types. This made me ...
1
vote
1answer
74 views

What is the connection between type inference and advanced type systems?

I don't understand the connection between type inference and advanced type systems. I don't see why Haskell or Standard ML or OCaml could not have existed without type inference. My only guess is that ...