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
-1
votes
2answers
191 views

Why are constants declared with `let`? [closed]

A few weeks ago, I went on Udemy course on Swift, the instructor mentioned that constants are called let in Swift because it's standard in OOP (JavaScript uses it for example). I know this may seem ...
1
vote
1answer
66 views

How to manage versioning for changes that only affect some pieces of a package?

I'm designing a new language and the package-management system for it (something like NPM, Cargo, Pip, Gem, Cpan, Cabal, NuGet or the like). I'm trying to decide what's a good way to handle the ...
-8
votes
1answer
68 views

Are the stone-dead PHP mailing lists really how PHP developers and the PHP community communicate? [closed]

I've been looking at this for a long time: https://news-web.php.net/ Almost every single mailing list has the last messages sent to them in the year 2000-2003. That's 17-20 years ago! It would be an ...
3
votes
0answers
58 views

Choosing the design of a scientific DSL: purely or impurely functional?

My aim is to create a language specific to the scientific field (which would be used mainly in the field of machine learning and physics) which would be based on the functional paradigm, a paradigm ...
2
votes
2answers
122 views

Why do some languages decouple operations from data type?

This is a pretty difficult question to frame. But I'll try my best. In some languages, data types are decoupled from the operations they can perform, while in other languages like JavaScript they are ...
0
votes
2answers
156 views

Name for a “called function”

I am writing a documentation for a programm where a function is defined and it is called three times. I call the definition of the function "function definition". But what is the correct ...
27
votes
6answers
8k views

What does it mean when you say C++ offers more control compared to languages like Python?

I am comparing C++ with Python. It is clear that C++ is much more efficient and that the C++ code compiles directly to machine code whereas in Python it is interpreted. I do understand that Python is ...
0
votes
3answers
337 views

What are programming languages written in?

This is my first question so be nice lol... Think of it this way. Python is written in C, which is written in an older C compiler, which is written in an even older C compiler, which is written in B, ...
-3
votes
3answers
129 views

is python(cpython) code represented as c code by the interpreter?

what i know is , in cpython when we run a code then its first compiled into byte code and the cpython interpreter( which is written in c interprets it) interprets the byte code and converts it into ...
1
vote
1answer
63 views

How do covariant parameterized types nested inside invariant parameterized types act?

Here is a concrete example of what I'm asking about: MutableList[ImmutableList[Object]] Where ImmutableList is covariant wrt its first parameter, but MutableList is invariant wrt its first parameter. ...
-4
votes
1answer
115 views

How do they make programs so lightweight?

I was checking out a sample project of NetBeans IDE called "Stopwatch". Then ran it! Then I opened TaskManager to see how much RAM it uses. It was using ~110MB. Then I opened the "...
-3
votes
1answer
396 views

What naming convention should I use for a JSON RPC client API designed for multiple languages?

This is the documentation with the original RPC client API specification. The naming convention in the specification is camel case. Naming conventions might differ in subtle ways for different ...
5
votes
1answer
171 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
189 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
183 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
287 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
384 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
197 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
89 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
230 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
139 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
76 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
56 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
136 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
223 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 ...
9
votes
1answer
553 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
384 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
7k 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
4answers
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
283 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
175 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
181 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
102 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
116 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
166 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
775 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'...
-3
votes
3answers
1k 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
322 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
231 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
175 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
78 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
1k 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
358 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 : ...

1
2 3 4 5
28