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
-4
votes
0answers
24 views

What is the state of art in Programming Language Package Management? [closed]

Apparently there are many programming language specific package managers these days. Each with different takes on versioning, dependency resolution, version pinning / locking etc.. Usually I see Ruby'...
4
votes
1answer
99 views

Real-world scenarios for protected inheritance

C++ supports protected inheritance: A class can derive from a base class B in a way that the "outside" world doesn't see that class "as a B" but the class itself and it's derived ...
36
votes
8answers
6k views

If null is a billion dollar mistake, what is the solution to represent a non-initialized object? [duplicate]

This comes with a debate with my colleague that I'm using null as an object initial state. type Value = Node | null const [value, setValue] = React.useState<Value>(null) function test(v: Value) ...
1
vote
2answers
171 views

Is there a statically typed programming language that implements Polymorphism without using a superclass or an interface?

Is there a statically typed programming language that implements Polymorphism without using a superclass or an interface (if such implementation is even possible)?
2
votes
4answers
169 views

A language design with variable qualifier

I am planning to design a programming language. One challenge I face with is whether it is a good idea to have const as a variable qualifier instead of a type qualifier. For example in C++: const int ...
2
votes
2answers
148 views

Programming a library in multiple languages

I am planning to implement a cryptographic library for several languages and looking for best practices. I have looked at several threads, especially this, this, and this one, which answer my ...
-2
votes
1answer
70 views

An expression in the first line of the control flow statement

Is there a term or some short wording to refer to an expression in the "first" line of the control flow statement? func() { if (a == b) { var = 1 + 1 return True } else { var ...
9
votes
3answers
373 views

Being great in one language when you need to know many?

My job requires me to know how to work with Ruby, Python, Bash, Puppet, Golang, MySQL and occasionally Scala and PHP. Yes I really do have projects including most of these and there are weeks where I ...
0
votes
4answers
188 views

What prevented compiled languages from being adopted on the web originally, as opposed to JavaScript?

Since my previous question was closed (https://stackoverflow.com/q/62354455/1173166), I thought this would be a better place to ask the question. Original: JavaScript we designed specifically for ...
-5
votes
1answer
56 views

In what programming language is Python's regex module written in? [closed]

If I try to rewrite specific regex functionalities (e.g. substituting a string) in Python, a solution using the regex module is always faster. Is regex written in C?
-2
votes
2answers
227 views

Conditional jump statements in middle- and high-level languages

In Java, C, and C++ we have the following jump statements: break, continue, goto, and return. In C#, there is also throw. I'm not really familiar with either of these languages. This is simply what I ...
1
vote
3answers
109 views

Is “early binding” the same as “static dispatch”, and “late binding” the same as “dynamic dispatch”?

I often see the terms "early binding" and "static dispatch" used interchangeably, and I also often see the terms "late binding" and "dynamic dispatch" used interchangeably. Do these terms mean the ...
18
votes
4answers
3k views

What do IDEs use to do code completion suggestions?

For example if I have a class like class Foo { public int bar; public Foo(int constructor_var) { bar = construction_var; } public bar_plus_one() { return bar++; }...
3
votes
2answers
67 views

How do language implementations implement native-extension class instantiation?

I'm writing a language interpreter in C. I'm currently implementing a system that allows writing extension modules in C for the interpreter. These modules are loaded into a code file like a normal ...
-6
votes
1answer
49 views

How I can make multi language program?

I'm new in programming I knew some programming languages. When I search anything about any program it is written in more than one programming language. How can I do it. And it is important to use ...
3
votes
1answer
127 views

How can one bake a GUI framework inside an interpreter without freezing the interpreter?

I am writing a bytecode interpreter in C for a simple programming language. I want to add GUI capabilities to the language. As a first step, I decided to bake into the interpreter a wrapper for the ...
0
votes
1answer
219 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 ...
8
votes
1answer
400 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 ...
9
votes
1answer
337 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 ...
40
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
1k views

Definition of “Behaviour”?

What is exactly meant when software-engineers talk about "behaviour" in contrast to "state" (Definition of "state")?
6
votes
2answers
268 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
168 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
162 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
99 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
81 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
164 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
11k 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
655 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
58 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
673 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
203 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
133 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
2k 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
173 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
76 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 ...
3
votes
3answers
857 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. ...
3
votes
3answers
325 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 : ...
6
votes
2answers
496 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
350 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
67 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
320 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
620 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
124 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
331 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
371 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
676 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=&...
29
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
2 3 4 5
27