Questions tagged [programming-languages]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
187 views

Have the inventors of Java ever publicly expressed regret about hashCode and equals in class Object? [closed]

I was talking to a colleague recently about hashCode and equals being methods in class Object in Java (among other languages). I am from a more theoretical background while my colleague is more of a ...
7
votes
1answer
241 views

Why is Assembly Language called “Assembly”?

Why is assembly language called "assembly"? I was just watching the 1st video in the "Crockford on JavaScript" series. In it, Douglas says, ". . . the first program to make programming easier was ...
-1
votes
0answers
40 views

What should the parser do with the output of the lexer?

Currently I am working on my own compiled language. I have finished the lexer and its output is a token list, the parser should go through this list and build the trees. Example file for the language:...
8
votes
1answer
291 views

Which was the first language to allow underscore in numeric literals?

Java 7+ allows to use underscores in numeric literals,which do not affect the value of the literal, yet are useful for grouping. Examples from the Java 7 documentation, entitled "Underscores in ...
38
votes
5answers
6k views

What makes a scripting language “embeddable”?

According to my experience, Wikipedia and prior answers, a scripting language is vague category of languages which are high-level (no manual memory management) and interpreted. Popular examples are ...
8
votes
3answers
953 views

Definition of “Behaviour”?

What is exactly meant when software-engineers talk about "behaviour" in contrast to "state" (Definition of "state")?
5
votes
2answers
250 views

What was the first language to allow Unicode in function names?

People often get excited about JuliaLang supporting Unicode function names. But it's not new at all,it's just that the Julia community decided that it was sometimes appropriate, and built tooling to ...
3
votes
3answers
157 views

Precisely define “what to solve” and “how to solve” corollary in functional and imperative programming respectively

I am not sure if I ever clearly understood standard corollary "what to solve" and "how to solve" used to point out difference between functional (declarative) and imperative programming paradigm ...
2
votes
2answers
150 views

Implementing Classes as Coroutines?

most OOP languages implement a class as a garbage-collected reference. however, a task (coroutine) based implementation may offer several advantages over traditional object references: -- method ...
-3
votes
1answer
85 views

Receiver parameters in Go

I have no idea where to post this question since it isn't about the Go language specification itself but rather the justification. In the Go language, functions can have receiver parameters to ...
-4
votes
1answer
51 views

Is it a good idea to use a Parser Combinator to parse unstructured input?

I'm writing a parser that needs to accept unstructured input. By that I mean it needs to take in a raw signal (text, in this case) and look for significant character sequences while accumulating the ...
-3
votes
2answers
163 views

What is the name of this type of problem

I've seen the Wikipedia page about it a while ago - but I can't find it now. The problem is something like: Mary lives next to Jane Rob has a green door Mike likes dogs Jeff likes cats and can't ...
51
votes
7answers
10k views

Is it a bad design for a programming language to allow spaces in identifiers? [closed]

Some (link 1, link 2) programming languages allow spaces in their identifiers (e.g. variables, procedures) but most of them don't and instead programmers usually use camel case, snake case and other ...
3
votes
4answers
516 views

What are the advantages of a 'pure' object oriented language over a non-pure object oriented language?

My first programming language is C++. C++ is a multi-paradigm programming language. One of the paradigms C++ supports is Object Oriented Programming. I want to say I get the general idea and benefits ...
-3
votes
1answer
56 views

What are the existing solutions for creating object graphs in an interpreter?

Please let me know if this isn't the right SE site (or otherwise) for this kind of question, it's the best match I could find. I'm working on a humble interpreter written in C for a simple language I'...
-4
votes
3answers
286 views

Is it really always easier to write an interpreter than a compiler?

I've read that generally it's easier to write an interpreter than a compiler. If that's true, what's the reason? Writing an interpreter seems to me equivalent in the level of difficulty as writing a ...
0
votes
2answers
86 views

Where is the difference with client-socket port and server-socket port?

If we decided to create a (TCP) socket-server (for example) on port 12336 imagine it like a: socket.bind(12336) and then to create a (TCP) client-socket for it, like a: socket.connect("12.34.56.78"...
1
vote
1answer
119 views

Storage of global variables

In C, global variables are stored with the program code. I.e. the space to hold them is part of the object file (either in the data or bss section), instead of being allocated during execution (to ...
14
votes
5answers
1k views

Can every language be categorized as either compiled or interpreted? [duplicate]

As per Wikipedia: A compiled language is a programming language whose implementations are typically compilers (translators that generate machine code from source code). And an interpreted language is ...
52
votes
11answers
11k views

Why does C++ have 'undefined behaviour' (UB) and other languages like C# or Java don't?

This Stack Overflow post lists a fairly comprehensive list of situations where the C/C++ language specification declares as to be 'undefined behaviour'. However, I want to understand why other modern ...
0
votes
1answer
171 views

Why do so few languages provide tree or graph types in their core? [closed]

The more CS I read the more I encounter trees, heaps and graphs. All languages seem to incorporate linear data types like lists and arrays and most have some compound data type like objects or structs ...
0
votes
2answers
75 views

An 'internal' scope class available only to selected classes

In many languages there is a scope that is just less than public called internal. Wondering, Why none of the language, implemented a feature on internal such that one can specify Only what other ...
2
votes
3answers
494 views

Why is it necessary for every new api to be async?

I'm expressing my frustration here somewhat, but why do many new libraries only have asynchronous APIs? For example I'm creating a small utility to fetch a web page and parse some data from it. ...
2
votes
2answers
252 views

Language design : How to type higher order functions parameters?

I'm trying to design a theoretical programming language and I'm facing a problem with high order functions. The language is strong-typed, so the way to define a standard function is like so : ...
5
votes
1answer
375 views

Transpiling <XY> language into a custom one

Our company has a legacy assembly-like language with some terrible design choices. I'm pretty sure the language is not going to change, since way too many legacy things might change their behavior ...
0
votes
4answers
343 views

Are there limits for programming languages calling others?

So earlier today I found about IronPython: IronPython is an open-source implementation of the Python programming language which is tightly integrated with the .NET Framework. This was my first ...
-3
votes
1answer
63 views

Can accessing the same API from different languages be more performant?

I've just started my first proper internship in industry (not learning to code but learning to write software that does stuff). My employer makes use of Apache Spark, as they do a lot of Big Data ...
2
votes
2answers
289 views

Why does C# type pattern matching use a different variable scoping behavior than traditional switch blocks?

Traditional switch blocks have one scope, so the following throws a compiler error "A local variable or function named 'message' is already defined in this scope": switch(value) { case 1: ...
0
votes
3answers
442 views

Why do we still have programming languages that rely on indentation / white space? [duplicate]

A long time ago when starting learning programming I remember a teacher saying that compiler do not care about whitespace and they are useful to make code readable for human beings. It made perfect ...
1
vote
1answer
121 views

Why doesn't Comparable<T> include any type bound? [closed]

Why do you think the definition of Comparable<T> lacks an upper bound on T? That is, why is it not defined as: Comparable<T extends Comparable<?>> or Comparable<T extends ...
1
vote
1answer
288 views

Why do programming languages have both double and float? [duplicate]

I know that doubles are more precise than floats and that they should be used for financial stuff and other things that require precision, but why do we use floats? Why not just get rid of floats and ...
-3
votes
1answer
227 views

Is algorithm performance dependent on the programming language used? [closed]

I have studied complexity of algorithms that how long an algorithm will take to execute completely, then why it is said that certain programming languages are faster than others such as C++ is faster ...
2
votes
2answers
82 views

What are the benefits of aggregating structure and functions associated with it in one object? [closed]

What are the benefits of aggregating a structure and functions associated with it in one object? What are the benefits of explicitly decalring a class. If i write procedural code i already know that ...
1
vote
2answers
386 views

What does the colon before the name mean in this JSON like string?

I encountered this string that looks like JSON syntax but I've never seen a property with a colon before it and not with a backwards greater than or equals sign: Badge { :id=>36, :name=&...
28
votes
13answers
11k views

Why don't programming languages automatically manage the synchronous/asynchronous problem?

I have not found many resources about this: I was wondering if it's possible/a good idea to be able to write asynchronous code in a synchronous way. For example, here is some JavaScript code which ...
-1
votes
1answer
95 views

Reactive programming language [closed]

I had been using react-js and really like its concept so I want to know if there is a programming language/framework that sort of works like it. For instance, I want to define: var A = something var ...
0
votes
3answers
253 views

Side-effect free programming language for reproducible data transformation

Is there a usable programming language that disallows all side effects except for its input stream (aka STDIN) and its output stream (aka STDOUT)? All executable scripts in the language should be ...
4
votes
2answers
211 views

Are there any languages that let you specify that a function can only be called from a single call site? [closed]

Out of curiosity, are there any languages that let you tag a function with an attribute that indicates that it may only be called from a single call-site, such that if any code tries to call the ...
2
votes
1answer
734 views

Why did Java and C sharply dip in popularity around 2017 in the TIOBE index? [closed]

The TIOBE Programming Community Index shows Java and C dramatically falling in popularity between late 2016 and mid 2017 before rebounding by mid 2018. What is the cause of the volatility? Source: ...
30
votes
10answers
7k views

Why are standard libraries not programming language primitives? [closed]

I was thinking why are there (in all programming languages I have learned, such as C++, Java, Python) standard libraries like stdlib, instead of having similar "functions" being a primitive of the ...
-3
votes
3answers
425 views

Why are script languages so popular? [closed]

I am currently writing a memoire on the evolution of developing tools. Among them is of course the programming languages. I made some researches, and a lot of the most popular languages are scripts ...
1
vote
3answers
215 views

Is it really correct to talk about compiled and interpreted languages? [duplicate]

It is pretty obvious that any interpreted language CAN also be compiled. For a long time I thought that it was not necessarily the other way around. Then I discovered Ch which is an interpreter that ...
0
votes
2answers
59 views

What's the exact usage of the term “foreign function interfaces”?

I'm working on a project that requires using multiple programming languages. I'm confused about what term to use to specify the interfaces available to bind two languages, e.g JNI, ctypes, jpype, etc. ...
9
votes
3answers
476 views

Is there a programming language where every string is a valid program?

Does there exist a Turing complete programming language such that for a fixed alphabet (say, ASCII), every possible permutation of those characters is a semantically valid program capable of being ...
1
vote
1answer
68 views

Meaning / usage of vertical bar in Practical Foundations for Programming Languages?

I'm working my way through Practical Foundations for Programming Languages but am finding some of the notation difficult to follow. In section 3.3 (page 46 of linked PDF) the author introduces a ...
2
votes
3answers
578 views

From a language design perspective, is the reference type in C++ mis-designed

Besides the fact that all primitive types of C++ are copy assignable except the reference type, it also doesn't play well with containers or any other parts of the language where copy-assignable ...
-2
votes
2answers
236 views

Why was the caret used for exponentiation in BASIC?

As far as I have been able to find, the first language to use ^ for exponentiation was BASIC, in 1964. Earlier languages, such as Fortran, used other symbols such as ** for exponentiation (although in ...
0
votes
2answers
1k views

Understanding Context Free Grammar using a simple C code

I'm trying to understand the difference between terminal and non-terminal values in a real language. I wasn't able to find enough examples on real language CFGs on the internet, most examples are ...
0
votes
1answer
110 views

Why are new modern languages shifting to a variableName: VariableType syntax approach? [duplicate]

Modern languages like Rust, Kotlin, and TypeScript, define their syntax to declare variables as: myVariableName: VariableType As opposed to the C-like approach not so old languages like JavaScript, ...
-1
votes
1answer
171 views

Writing programs in an unsupported language

Is it possible to write a program in a language unsupported by an editor or IDE, save it, then run it in different IDE or editor that does support the language?

1 2 3 4 5 27