What is the alternative to C++

Which language is best suited to replace C++ after 35 years of existence and millions of crashes due to its insecure syntax?

The C++ successor must produce very fast applications and code that works on all platforms. But you can also talk about continuity for a language that exactly repeats the C syntax, adds classes and brings more evolving functions. So modern C++, even if it is not destined to replace it everywhere.

Vala (2002)

Available on the Gnome website, it looks like a GObject demo written by the same team. Vala replaces C++ on the Gnome platform.

Characteristics:

A simple example:

int main () {      
   print ("Hello World\n");         
   return 0;  
}

Class:

class Hello : Object {      
    void bye () {          
          stdout.printf ("Hello World\n");     
    }  
} 
   
var example = new Hello ();
example.bye(); 

Many programs were written in Vala, but even if it can be used outside the Gnome environment, it is essentially in combination with GTK. Leprojet is still up and running in 2022 with a new site, vala.dev.

D (2001)

Designed as an alternative to C++ with simplifications including dynamic tables.

A simple example:

import std.stdio;     

void main()  {     
    writeln("Hello World!);
}

Class:

class Hello  {
  char[] content;
  this(char[] str)   {        // constructeur 
    content = str;
  }

 void display()  { 
   writeln(content);      
 }
}

Hello hello = new Hello("Hello World!");

C # (2000

)

From the Roslyn platform available on GitHub, C # can be compiled in machine language rather than bytecode, and it can access system resources, so even if it was originally an alternative to Java, it becomes a possible replacement for C++ for applications or collector's garage is not a minus.

Characteristics:

A simple example:

void Main() {
    Console.WriteLine("Hello, World!");     
}

Class:

public Class Point : Shape {
   public int x, y;
   Point(int x, int y) {
      this.x = x; 
      this.y = y;
   }
   public void move(int w, int h) {
      this.x += x;
      this.y += h;
   }
}

Point p = new Point(0,0);
p.move(100,50);

Dart (2013)

Developed as an alternative to JavaScript with C syntax, it is not a system language, but it replaces C++ to generate scripts on the server or desktop at near-Asm.js execution speed.

A simple example:

void main() {    
   print('Hello World!');  
}

Class:

class Point {
   num x, y;
   Point(this.x, this.y);   // constructeur
   void move(num xo, num yo) {     
     x += xo;
     y += yo;
  }
}

var p = new Point(0, 0);
p.move(100, 50);

Other languages

Other languages are also derived from C or have the vocation to replace C++ as a system language.

After all, what's the successor for C or C++? If we proceed from the ranking of languages ​ ​ by popularity, then not a single one at the moment! It remains the most commonly used language and C++ is in third place, after Java and before C #.
The trend is that a set of languages, each in a specific domain, a game, a web application, scripting, etc., can together very well replace C++, a universal language that cannot be replaced everywhere with one language. This gives the only real advantage to C-derived syntax: a programmer can switch more easily from one language to another to implement different types of applications.

Programming and dated languages - Asm.js- - BASIC- C- -C++ # C- - Darth-Eiffel - Guo- --JavaJavaScript--Julia PascalPHP- - - Python- - Prolog RubyLa ScalaScriptolSwift TypeScriptHTMLVasmXMLXAML SQL