Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-3
votes
1answer
49 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
243 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
346 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
107 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
238 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
160 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
75 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
131 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=&...
27
votes
13answers
10k 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
73 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
223 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 ...
3
votes
2answers
205 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
229 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: ...
29
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
387 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
118 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
41 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. ...
8
votes
3answers
440 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
63 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
424 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
194 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
434 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
94 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
165 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?
-2
votes
1answer
126 views

What is the minimum set of operations a language implementation must provide for it to be usable for all applications?

As a fun hobby project, I'm writing a simple bytecode VM and a compiler from a basic high-level language to the said bytecode. (Offtopic: the compiler is inspired by Jack Crenshaw's awesome tutorial -...
3
votes
1answer
123 views

How hard should I try to write idiomatic code in a polyglot environment?

I work on a small team (2 primaries with one or two other occasional contributors) on a project/product that spans a number of separate platforms. We do embedded firmware in straight C on Arm0 chips. ...
0
votes
1answer
139 views

Is JavaScript unique in the way it treats missing property access?

Javascript has the behavior where an error is not thrown on missing property access on objects, which is the cause of many pernicious bugs: console.log("iPhone".missingProperty) // undefined I'm ...
0
votes
2answers
223 views

What makes PHP a language and jQuery a library?

PHP is written in C, but is considered a language. What makes it different from something like jQuery which is considered to be a library of Javascript? Why is PHP not a library of C or jQuery a ...
3
votes
3answers
512 views

In functional programming, what it means “Order of evaluation does not matter” when function is pure?

In context of pure functions in FP, apart from several benefits mentioned like easy to reason about, testability it also says "order of evaluation does not matter" since output remains same for given ...
1
vote
0answers
86 views

What obstacles should I expect in building universal Abstract Syntax Tree's manipulation tool?

I am trying to build code generation and transformation tool and hence I need software for Abstract Syntax Tree manipulation for at least three languages (Coq, Haskell, Java). So far I have managed to ...
0
votes
3answers
325 views

Is there a programming language with objects and generics, but without inheritance?

The GO programming language has objects but no inheritance. It also has generics for the built-in types Array and Map. Is there a programming language with objects but no inheritance and with generics ...
1
vote
6answers
342 views

Is it okay to have a parent class that doesn't represent an entity and doesn't have an “Is-A” relationship with its child classes?

I want to have an array that can hold elements of many classes data types, and each of these classes have a method called printInfo(). The way I can do that is by having a parent class called ...
4
votes
5answers
576 views

What is the “killer feature” of OOP? [closed]

I don't have much experience working with OOP, so I'm trying to understand what is the feature (or features) that would give you a great motive not to write some program in a procedural language, but ...
2
votes
4answers
287 views

Is there an object-oriented language that doesn't allow you to have private member variables? [closed]

I know that JavaScript doesn't explicitly allow you to have a member variable of an object as private, but you can do that implicitly by using closures. But is there an object-oriented language that ...
1
vote
3answers
240 views

Programming Language Interoperation for Website

Say I have one website created with the LAMP stack and another with the MEAN stack. I want to create a program which estimates the entropy of a password so that I can add a password strength meter to ...
2
votes
1answer
211 views

I'm moving away from using global variables after 7 years, I need help figuring out the basics

Until recently I was a huge fan of global variables because they are simple and allow building solutions to problems quickly. At one point I had to make a slight change to my application: it needed ...
-1
votes
1answer
69 views

What kind of of tools/architecture would work well for a student team competing in a robot soccer competition?

The scenario is as follows. There is a PC running a complex piece of AI software wirelessly controlling a number of soccer robots. This software is written and maintained by a team of students that ...
9
votes
1answer
179 views

Name of technique for inferring type arguments of a type parameter?

Setup: Let's assume we have a type called Iterator which has a type parameter Element: interface Iterator<Element> {} Then we have an interface Iterable which has one method which will return ...
150
votes
7answers
25k views

Was the C programming language considered a low level language when it came out?

Currently C is considered a low level language, but back in the 70's was it considered low level? Was the term even in use then? Many popular higher level languages didn't exist until the mid 80's ...
0
votes
1answer
199 views

How cross platform and different programming languages deployment is done?

I'm interested to know how software deployment for cross platforms as well as different programming languages happen. Like, Customers is on - linux and Windows Languages - Java, .Net, Ruby and ...
4
votes
2answers
436 views

Was Java the first programming language to support inner classes?

The Wikipedia article on the subject of inner classes enumerates a number of programming languages that support nested class definitions. Historically speaking, which programming language first added ...
0
votes
1answer
244 views

Do any programming languages let you use other languages without restriction within them?

This may be a stupid question, and it would certainly take one Hell of a lexer, but do any extant programming languages allow you to do something like: c# (1.2) { // c# code } Perl (5) { # ...
8
votes
2answers
523 views

Only one number type in language design

I am currently learning about compiler construction and language design and I am thinking about what native datatypes I want to support in my language. Now there is a whole lot of languages that make ...
4
votes
3answers
320 views

Using of different language in same project

I was started programming in 6 months ago in college. I learned Python, C and Java. I want to create a project and using these languages. For example to searching part should use C because it's faster ...
-1
votes
1answer
99 views

Do JITs typically have their own internal assembler, use a library, or use an executable assembler?

Amongst the successful and widely used JITs out there (e.g. JVM JITs, JavaScript JITs, LuaJIT), is there a strong consensus on how the JIT compiler should interface with an assembler? The plausible ...
111
votes
12answers
28k views

Why are multiple programming languages used in the development of one product or piece of software?

I am a recent grad student aiming to start my Master's in Computer Science. I have come across multiple open source projects that really intrigue me and encourage me to contribute to them (CloudStack, ...
1
vote
1answer
124 views

How do you actually utilize coding to produce projects? [closed]

I’m new to the whole programming society and the languages I’m learning right now are C++ and Lua. But as I’m learning it I can’t help but wonder how simple syntax such as print and if statements and ...
-4
votes
1answer
140 views

Assemblers Used During the Development of a Programming Language?

I am currently designing and developing a programming language from scratch. Mostly as a learning experience. Although it's not entirely related to the question, it's important that you know a little ...
4
votes
2answers
342 views

Should I duplicate code across languages?

Where I work, we use a language for our desktop software development (Delphi) and an other for web apps (asp.net/c#). My bosses want me to implement a feature on a website but they ask me to develop ...
0
votes
4answers
542 views

Why does C provide both the comma operator and the semicolon to separate statements?

Both the comma operator and the semicolon can be used to separate statements. Let's consider this simple code: #include <stdio.h> void do_something(int*i) {(*i)++;} int main() { int i; ...