Why Argentum uses “=” to declare and “:=” to assign variables
There are four reasons for having = for variable introduction and := for mutation:
programming language
programming language
There are four reasons for having = for variable introduction and := for mutation:
In short expressions, the name “_” is readable and appropriate. However, in larger constructs, it can become problematic and conflicting, especially if multiple “?” operators are nested within each other. Actually the ?-operator expects its RHS operand to be a…
In many languages it’s considered OK to have non-bool values in if statement conditions. Python has 16+ different values and scenarios when objects of different types are considered false, Java Script – 9, C++ – 3. Rust allows to define…
TLDR; in Argentum there is no separate nullable, bool and optional types. It’s the same concept, thus all operations, guaranties and safety measures are uniformly and seamlessly applicable all of them. Nowadays, it has become fashionable to add Null safety to all programming languages. In Argentum,…
What values can hold optional<T>? It’s either the value T itself or a special value “nothing” that doesn’t match any values of T . Now let’s try a trick: what is optional<void>? It’s a single-bit value that distinguishes between “nothing”…
In Argentum, there is an operator {A; B; C}, which executes A, B, and C sequentially, returning the result of C. Blocks can group multiple expressions: Blocks allow local variables: Blocks can appear in any expressions, for example in a variable initializer. Note the absence of…
but there are two binary operators: “?” and “:” Let’s consider an example: Actually, the expression a ? b : c in this example consists of two nested binary operators. They can be written separately as well: The type of…
The main fundamental feature of Argentum is its reference-based data model, which not only ensures memory safety, like in Java-Rust-Go, but also completely prevents leaks. But aside from this feature, Argentum has many other interesting aspects, including ultra-fast dynamic type…
TL;DR Argentum programming language can make interface method dispatch in just 4 instructions and dynamic_cast in just 8 CPU instructions – many orders of magnitude faster than rivals.Unlike most modern languages it doesn’t use double-sized pointers for interfaces, doesn’t require…
Practical example, comparison with popular languages, operation semantics, multithreading features, internal structure Original link: reddit To avoid excessive theorizing, let’s examine the reference model of the language using a practical example of a desktop application’s data model. We’ll design a…