RustEiffel?

Guido van Rossum (the Python programming language’s inventor) stated in an interview a few days ago that it would be difficult for Python 4.0 to see the light of day since the programming language is now through a challenging difficulty, which would be the migration from Python 2.0 to Python 3.0.

He also discussed other languages such as Rust, Go, Julia, and TypeScript. Guido thinks Rust is a fascinating language that almost perfectly handles memory management problems. He went on to say that Go and Julia are quite comparable to his design, and that the Python project team learns and is inspired by various TypeScript features.

Guido van Rossum and other members of the Python development team have stated that they were not very enthusiastic about the prospect of Python 4, having learnt some important lessons during the transition from Python 2 to Python 3.

“I’m not excited about the idea of Python 4 and no one on the core development team really is, so there will probably never be a 4.0 and we’ll continue until 3.33, at least. We’ve learned our lesson from Python 3 vs. 2, so it’s almost taboo to talk about Python 4 seriously.”

Guido van Rossum returned to the company in November 2020 with a new post at Microsoft after retiring in 2019. On Twitter, he stated that he will endeavor to make Python even easier to use. It will be available on all platforms, not just Windows, which should make it more appealing and competitive. In truth, Python has been competing with newer languages deemed more current by its authors and community for the previous decade.

According to Guido, Rust is a “great” programming language that deserves all of the attention:

“It sounds like a great language, for some things. Rust really improves C++ in one particular area: it’s much harder to bypass compiler controls. And, of course, it solves the memory allocation problem in a near-perfect way. If you wrote the same thing in C++, you couldn’t be so sure, compared to Rust, that you got all the memory allocation and memory management right. So Rust is an interesting language “

In addition, compared to C++, Rust is a relative newcomer to the programming industry, and many developers are hesitant to invest in it. However, in recent years, big industry initiatives have begun to use it.

And such is the case with the Linux community, which has been announcing for some time that it has begun to create elements of the kernel in Rust.

Microsoft started its Rust for Windows project last year, with the goal of providing programmers with simple access to Windows APIs for creating Rust apps on Windows. Facebook, Amazon, Apple, and Microsoft, among other key industry giants, have lately revealed that they are looking for Rust developers.

Finally as for TypeScript, the creator of Python believes that:

“TypeScript is a great language. You may have noticed that in the last six or seven years we’ve added optional static typing to Python, also known as progressive typing “

“I wasn’t really aware of TypeScript when we started this project, so I can’t say that the language inspired us to begin with. TypeScript, because it jumped on the JavaScript bandwagon, and because Anders is a very smart guy, TypeScript did some things that Python is still waiting to understand. So today we’re definitely looking at TypeScript for examples. We have a TypeScript SIG where we discuss extensions to the syntax and semantics of TypeScript and the type system in general for Python “

Guido went on to remark that JavaScript is more similar to Python than you may expect, and that the Python development team gets a lot of inspiration from TypeScript’s advances.

“Sometimes we come up with new features because we know that some features were also initially missing in TypeScript, then they were added to TypeScript based on user demand and became very popular in TypeScript. And now we can see that we are in the same situation.”

And he added

“Because JavaScript and Python are relatively similar. Much more so than Python and, say, C++ or Rust or Java. So we learn from TypeScript, and from time to time, from my conversations with Anders, it seems that TypeScript also learns from Python, just like JavaScript learned from Python in some areas,”

Guido concluded

Anders Hejlsberg is a Danish programmer working at Microsoft and one of the great architects of TypeScript.

Design by contract in a spreadsheet!

Today I wanted to format a boolean value in a spreadsheet so that true values are shown as “SĂŹ” and false as “No” (italian words for “yes” and “no”). I was easy as librelive describe in Change Boolean to Yes/No instead of True/False – Ask LibreOffice

i suggest basically the same as m.a.riosv wrote, but a little better:

in format cells dialogue fill format code input with the following:

[=1]"Yes";[=0]"No";General – this means it will be yes on true/1 values, no on false/0 values and will use general format otherwise.

one may even use the following string to format it as ✓/✗ instead of yes/no and color differentiation: [GREEN][=1]"✓";[RED][=0]"✗";[BLUE]General;[BLUE]@

this works on libreoffice calc v6.1.5.2 for ubuntu – i’ve tested

i call it “a little bit better” solution because it implements design by contract pattern, i.e. if for some unexpected reason the value will be something else than a boolean, then it will be displayed as usual, and not hidden, thus hiding a possible error in design!

But the real gem is finding a reference to design by contract!

The V Programming Language

I’ve just read “Is Zig the long awaited C replacement” and it cites: The V Programming Language seems to be a “fastly compiling” language.

Compilation speed benchmark

  • C 5.2s gcc test.c
  • C++ 1m 25s g++ test.cpp
  • Zig 10.1s zig build-exe test.zig
  • Nim 45s nim c test.nim
  • Rust Stopped after 30 minutes rustc test.rs
  • Swift Stopped after 30 minutes swiftc test.swift
  • D Segfault after 6 minutes dmd test.d
  • V 0.6s v test.v

I wrote a small program that generates 400 000 lines of code in several languages to benchmark their compilation speed.

#!/bin/bash
echo "
class FOO
create make
feature make
local i: INTEGER
do"
let i=0
while (( $i < 200000 ))
do
echo "
i := "$((++i))"
i.print_on(std_output) "
done
echo "
end
end -- class FOO
"
class FOO
create make
feature make
local i: INTEGER
do

  i := 1
  i.print_on(std_output) 

  i := 2
  i.print_on(std_output) 
....
end
end --class 

Liberty Eiffel is a trans-compile you know. It didn’t take too much to turn it into C but it run the C compiler underneath after 8 minutes is still compiling a 20mb behemoth it produced….

But the most urgent problem is that bootstrapping Liberty is still a mono-core script…

What Is Faster In C#: A Struct Or A Class? – C# Architects – Medium

What do you think is faster: filling an array with one million structs, or filling an array with one million classes?

Mark Farragher ask himself What Is Faster In C#: A Struct Or A Class? – C# Architects – on Medium. But of course the third version is faster because he’s not comparing apples and oranges!

The first two routines handles the points by reference while in the third by value. Speaking in Eiffel, the first two versions are “normal” classes, the third is an expanded one. It makes a world of difference!

Well, I do acknowledge that many programming languages does not make the difference manifest.