Skip to main content

Questions tagged [language-comparison]

For questions comparing the implementation of a feature on different languages.

Filter by
Sorted by
Tagged with
5 votes
1 answer

Prior art on precedence rules on template instantiation for inner entity clashes

I'm looking for prior art on languages handling clashes happening during template instantiation between inner entities. For example, if we have a type parameter E intended to be an exception type and ...
feldentm's user avatar
  • 1,929
0 votes
2 answers

Is it valid to call a configuration-format—with associated JSON-schema—a language?

Say I have a configuration file format that is very well defined; in say JSON format; with a JSON-schema defining what is allowed and how strict to be. Would it be too generous to call this a Domain ...
Samuel Marks's user avatar
19 votes
8 answers

What's the relation between a language being managed and its compiler being reversible?

As a starting developer, I worked with Pascal and Delphi. Later on, I came in contact with C++ and Visual Basic. All those are native languages, which means that their compiled binaries were ...
Dominique's user avatar
  • 325
5 votes
6 answers

What programming languages contain a built-in imaginary data type?

Many languages like R, Julia, and Python store imaginary numbers as a complex number with a 0 valued real component. We may see this with the following R code: ...
Adam Hyland's user avatar
8 votes
1 answer

What do you mean by the ‘computational model’ of a programming language?

What do you mean by the ‘computational model’ of a programming language? Are ‘abstract machines’ such as Stack, RAM, and Warren Abstract Machine (WAM) examples of computational models? Is the ...
Stephen's user avatar
  • 189
-4 votes
2 answers

What makes a very high level language? [closed]

Outline of question+justification soon to be expanded: Managing Complexity is job #1 Abstraction is our #1 tool A VHLL does abstraction best So VHLL's should be our aim Talking about VHLL's, with his ...
MicroservicesOnDDD's user avatar
25 votes
5 answers

I want to make breaking changes to my language, what techniques exist to allow a smooth transition of the ecosystem?

Alas, when developing my language I may have made some decisions that turned out less than ideal in hindsight. Some I managed to fix in a backwards compatible way, but others will require breaking ...
mousetail's user avatar
  • 8,531
13 votes
2 answers

Can Felleisen's expressivity metric be abused to construct ever more expressive languages that aren't actually more expressive?

The idea of comparing the expressivity of languages objectively using various metrics is very interesting. A particularly interesting answer is Matthias Felleisen's formal notion of expressivity. I ...
Bruce Adams's user avatar
  • 2,853
3 votes
2 answers

Can I use monadic types without needing colored functions?

The inspiration for this question There are many advantages of using monadic types like Promise<T> or Result<T> as ...
mousetail's user avatar
  • 8,531
84 votes
7 answers

How can we compare expressive power between two Turing-complete languages?

Is this possible? Is there an accepted (and unambiguous) notion of "expressive power" that could differ between two different Turing-complete languages? It seems like, for example, Python is ...
David Young's user avatar
  • 2,257
2 votes
3 answers

What are the differences between designing a print function Python-style as opposed to C-style?

A regular Python print statement might look like this (Dart printing looks similar to this): print(a_number) # for a number print(a_string) # for a string These ...
Redz's user avatar
  • 1,076
-5 votes
1 answer

Are you allowed to use almost identical language to another language? [closed]

In Python, you use the term print. If there was another language that worked in the exact same way as Python, but used slightly different terms (like ...
taylor.2317's user avatar
2 votes
5 answers

What are the different ways of implementing special methods?

What mechanisms could languages use to detect certain methods and handle them specially? For example, in Python, special methods are named differently, using double underscores: ...
чистов_n's user avatar
0 votes
3 answers

Should a REPL show null values as null? [closed]

I'm working on a REPL for a language that has a null value, and I'm not sure how to represent it in the output. The behavior of existing REPLs seems to be either to represent it by its name (...
Ginger's user avatar
  • 2,629
12 votes
3 answers

Why does Rust have an infinite loop construct?

The Rust programming language has an infinite loop construct, which looks like this: loop { <some code> } It's the only language I can think of that has ...
Ginger's user avatar
  • 2,629
12 votes
7 answers

What are the different ways of handling multiple return values?

(inspired by this question) Different programming languages handle multiple return values differently, used in functions such as divmod. For example, in Python or ...
naffetS's user avatar
  • 1,057
15 votes
1 answer

Segmented Stack Efficiency

Segmented stacks are one method to enable the growth of execution stacks in multi-threaded paradigms at runtime, instead of having to statically pre-allocate a fixed-sized stack at compile time. Some ...
WormholeX's user avatar
  • 153
2 votes
2 answers

What syntax options exist for variable destructuring/unpacking?

Some languages allow you to write something like x, y, z = (1, 2, 3) Which is equivalent to x = 1 y = 2 z = 3 What are some of ...
lyxal's user avatar
  • 1,825
11 votes
2 answers

What are the different types of import semantics?

As per my current understanding, there are many different ways that imports, and other related operations, are handled in different programming languages. For example, ...
FireTheLost's user avatar
  • 1,613
-4 votes
2 answers

Why does Python not allow us to call functions like other languages do?

What many other languages do In many languages, I can have a function defined in a file called get_xyz.m (for example) and then other functions or scripts can use ...
Nike Dattani's user avatar
17 votes
15 answers

What are the syntax options for implementing a ternary "if" operator?

The ternary "if" operator is a syntactic construct for returning one of two values based upon a boolean condition. In most C-family languages its syntax resembles ...
Ginger's user avatar
  • 2,629
27 votes
13 answers

What are the drawbacks of using indentation for code blocks?

I'm not aware of any language other than Python that uses indentation to denote code blocks. To me, it seems like the simplest way to indicate blocks, and it also encourages proper formatting by ...
Someone's user avatar
  • 379
-3 votes
1 answer

In Julia, what is the benefit of requiring commas between elements when defining a vector for a dot product?

Introduction (Python, MATLAB/Octave, Julia) One of things about MATLAB/Octave that I find very convenient is the simplicity when defining vectors. For example: ...
Nike Dattani's user avatar
42 votes
13 answers

What are different ways of handling runtime errors?

Most languages have a system where exceptions are classes and you can throw them then use a try/catch block to handle them. What ...
mousetail's user avatar
  • 8,531
41 votes
6 answers

Why do some PL choose to have a dedicated keyword for elseif instead of like in C?

In C, else if is nothing but a new if statement after a single-statement else clause. Why do ...
ice1000's user avatar
  • 2,504
21 votes
3 answers

Which horizontal whitespace should be supported?

There seems to be three approaches to horizontal whitespace for separating tokens: Only tab and space: Bash, C, D, Dart, Go, Java, Lua, OCaml, Python, PHP, Perl, Ruby, Rust, Scala, Swift (also ...
Adám's user avatar
  • 3,156