The latest programming language

The old language is old, can you still eat?

Organize | Su Mi

Produced | CSDN (ID: CSDNnews)

In HN’s hot list, an article titled “Programming Language Tools Slow Progress” attracted the attention of many netizens, which wrote, “When a new tool is innovatively developed, a newer programming language is sufficient. more opportunities to incorporate this innovation into their language tools and standardize it, ultimately giving itself a bit of an edge over the old language. If these increments are added up over time, the old language becomes painful and obsolete, and even eventually eliminated.”

Looking at programming lists such as TIOBE , although the top rankings are still familiar languages ​​such as Python, C, C++, Java, etc., but in recent days, it seems that we have seen the trend mentioned at the beginning of the article, and we have witnessed a lot of old-fashioned languages. For example, some are concave languages ​​initiated by a group of Go language enthusiasts, some are front-line employees from large factories such as Vely created by members of the Oracle core team, and some are carbon developed by technology giants such as Google itself.

Next, we will take a look at the latest programming language with you to see if it can fill the regrets left by the old languages.

“Concave Language” initiated by domestic Gopher

Concave language (concave reading wa), as an experimental programming language that has just started, it was initiated by a group of Go language enthusiasts in China. One of the main design goals is to “become a C++ language with the syntax coat of Go and Rust”.

At the beginning of its creation, three Gophers, Chai Shushan, Ding Ernan and Shi Bin, decided to promote the development of concave language in an open source way. The open source address is: https://ift.tt/ZqCvGcR.

The specific installation and testing methods are as follows:

  1. Install Clang, make sure local clang commands work

  2. go install github.com/wa-lang/[email protected]

  3. wa init -name=_examples/hi

  4. wa run _examples/hi

Currently the project provides simple executable examples such as “print prime numbers within 30”:

 // 版权@2021 凹语言™ 作者。保留所有权利。 fn main() { for n := 2; n <= 30; n = n + 1 { let isPrime int = 1 for i := 2; i*i <= n; i = i + 1 { if x := n % i; x == 0 { isPrime = 0 } } if isPrime != 0 { println(n) } } }

run and output the result:

 $ go run main.go run _examples/prime 2 3 5 7 11 13 17 19 23 29

Another Demo is shown below:

Currently, concave languages ​​are in a very early experimental stage, and the team has set expectations in terms of both concave language features and compiler implementations. Among them, concave language contains two sets of mutually equivalent grammars, namely concave grammar and WaGo grammar. The meaning of “equivalent” here is that the two can generate the same AST and convert each other without loss. The suffix of source files written using concave syntax is .wa, and the suffix of source files written using WaGo syntax is .wa.go. WaGo syntax is a proper subset of Go syntax, in other words: a valid WaGo package must be a valid Go package. In this regard, Chai Shushan, one of the founders, also further stated on Zhihu, “Equivalent is not the ultimate goal, it is just for the convenience of users who are used to Go.”

In terms of the concave compiler, the team released the following work flow chart, hoping to support C/C++, LLVM IR, WASM and other outputs to meet different target scenarios.

Source: https://ift.tt/MUtBbPR

As a personal part-time project, several founders said, “Throughout the programming world, no widely used common language was born under the KPI system”, so there is currently no clear KPI indicator for this project. With the support of energy and interest, from the perspective of outcome classification, the team hopes to complete the first stage:

  • Determine Concave Language™ grammar rules;

  • Implements a usable Concave Language™ compiler;

  • Create a web application using Concave Language™.

Regarding the original intention of designing the concave language, in the README.md file of GitHub, the team also wrote very bluntly, “This project has borrowed a lot of Go’s design ideas and specific implementations when it was launched – this is a must under limited investment. We hope that with the development of the project, we will accumulate more original designs and contribute to the tide of independent innovation.”

At the same time, the team will also “hold an open attitude” to the future development of the concave language, hoping that more developers can participate in the construction of the concave language.

A new embedded programming language with C as the host language – Vely language

Like the concave language, the newly born Vely language is also a personal project. Its author, Sergio Mijatovic, is a senior software engineer in middleware who has worked in Oracle core engineering for over a decade.

According to the official introduction (https://vely.dev/), Vely is an embedded programming language with C as the host language. It is precompiled to C, creating a native executable. Vely’s logo is a cute elephant, for which Sergio Mijatovic explained, “Elephants are smart, although they are neither fast nor light, I know they will like Vely because Vely has both. “

Why create Vely?

When it comes to Vely’s advantages over other programming languages, Sergio Mijatovic says performance and simplicity are the short answer to that question.

From a positioning point of view, the Vely language itself was born to quickly build server-side applications with maximum performance .

Sergio Mijatovic said that by using the Vely language, this means generating efficient and safe C code with simple statements. Such statements are written directly in C code, so by definition it is not a new language. It is a merger of C and an embedded language that generates C. As such, Vely aims to lean on the embedded language side, as it will be safer, richer, faster to build applications, and write C when needed.

In a nutshell, Vely statements are simple and written in C code, so there is no need to learn anything new about the layers below. Most Vely statements generate many C statements.

Vely Features

Vely applications are native executables with no interpreter or bytecode scheme, which results in high performance and small footprint.

Additionally, Vely language can easily work with databases (MariaDB, PostgreSQL, SQLite) and write backends for web applications via FastCGI servers. Run the same code on the command line.

Vely coding covers the web, databases, strings, files, processes and execution, encoding/encryption, timing, error handling, daemonizing code, and other common tasks. It comes with automatic memory management and garbage collection.

Users can also use Vely for web applications, command-line programs, and as middleware, database applications, service software, data integration, Internet of Things (IOT), and elsewhere. The language is also well suited for cloud computing applications due to its low resource requirements and ease of containerization.

Hello World example

Vely is currently available on Linux for amd64 or aarch64 architectures (download here: https://vely.dev/pkg/).

After installing Vely, create the Hello World source file (hello.v):

 echo '#include "vely.h"void hello() { out-header default @Hello World! }' > hello.v

Create the Hello World application:

 sudo vf -i -u $(whoami) helloworld

Make a Hello World runner:

 vv -q helloworld

Run – You can run Hello World as a service or from the command line.

  • As a service, first start your Hello World FastCGI application server.

 vf helloworld

Then connect to it.

 export REQUEST_METHOD=GET export QUERY_STRING="req=hello" cgi-fcgi -connect /var/lib/vv/helloworld/sock/sock  /
 export REQUEST_METHOD=GET export QUERY_STRING="req=hello" export VV_SILENT_HEADER=yes /var/lib/vv/bld/helloworld/helloworld

Expected result:

The final result is as follows (note that the bold type is the response from the web application and the command line):

Sergio Mijatovic said, “I wouldn’t say Vely is elegant, and that’s certainly not its goal, but Vely can be called very simple, more about the actual needs of people. The idea is not to sacrifice performance, and significantly improve productivity and safety.”

As for Vely’s creation, Sergio Mijatovic said, “It was created on my own time without financial support.” Currently, Vely does not accept contributions from the public, in order to be more focused and less expensive.

Currently, Vely is a free and open source software, under the GNU General Public License v3.0 (GPL 3), developers can use Vely to write applications (both proprietary and commercial) without releasing the source code.

“I worked on Vely on and off for a few years, going through several complete rewrites, mostly to learn how to make things better. I hope it helps you do the same,” says Sergio Mijatovic.

Benchmarking the C language, the Hare language is released!

Another benchmark for the C language is the Hare language , which was launched in April this year. It was created by software developer Drew DeVault. It is based on the qbe compiler backend and provides good performance in a small footprint. Staff can use good tools.

For use cases, Hare uses a static type system, manual memory management, and a minimal runtime, making it ideal for writing operating systems, system tools, compilers, networking software, and other low-level high-performance tasks.

According to foreign media The Register, Hare’s standard library also incorporates Google’s Go programming language ideas, especially many functions built into the standard library and “battery” to avoid the need to import external dependencies. Doing so, saves programmers from looking for dependencies, while also having a manageable scope.

According to author Drew DeVault, who described Hare as a way to avoid the pitfalls of C, saying, “Many languages ​​that were designed to compete with C are just too far off. Hare is a conservative language that aims to In distilling the lessons of the past 30 years into a small, simple, robust language that programmers can rely on for the next 30 years. We’re not focused on bold innovation, but on careful engineering.”

The Hello World example is as follows:

 use fmt; export fn main() void = { fmt::println("Hello world!")!; };

Aiming to be the successor to C++, Google releases Carbon

Not long ago, Google open sourced and released a new language called Carbon, taking into account security considerations and also aiming to help developers create “performance-critical software.” Previously, CSDN also published a document analyzing the design goals of the Carbon language :

1. Fast and works with C++

  • Performance matches C++ using LLVM, with low-level access to bits and addresses

  • From “legacy” to templates, interoperate with existing C++ code

  • Fast and scalable builds that work with existing C++ build systems

2. Modern and capable of continuous development

  • Solid language foundation, easy to learn, especially for those who already use C++

  • Simple, tool-based upgrades between Carbon versions

  • Rationale for more safety, and a step-by-step approach to implementing a memory-safe subset

3. Build a welcoming open source community

  • Clear goals and priorities with strong management skills

  • The community is committed to being a welcoming, inclusive and friendly community

  • Methods that contain “batteries”: compilers, libraries, documentation, tools, package managers, etc.

For its future development, Google said Carbon needs to be an “independent and community-driven project,” not just for Google’s own use.

write at the end

In addition to the above, as early as 2012, due to the challenges of dealing with complex JavaScript code when developing large-scale applications, Microsoft launched TypeScript, which is a syntax superset of JavaScript and is open to developers; in 2014, Apple launched TypeScript. Swift is designed to replace Objective-C, another language launched by itself; in 2017, Google also announced Jetbrains’ Kotlin as the official language for Android development at the I/O conference in 2017, quickly setting off a wave of Kotlin replacing Java technology.

Driven by this, new programming languages ​​are emerging and emerging rapidly, especially against established languages ​​such as C, C++, and Java. But everyone knows that it is not a day’s work that old programming languages ​​can have their current status. It is not difficult to see from the above-mentioned several languages ​​that have been launched. Among the two pairs of target languages, the most successful one is Apple’s Swift, because whether it is in the development environment, functions, or performance, toolkits and community support In the past, Apple has pushed the elimination of old tools from the root, and the options available to iOS developers are really limited, and Swift can be today.

Today, relying on open source, the rise of new languages ​​is just the beginning. Faced with the rise of this trend, Bjarne Stroustrup, the father of C++, commented in an email, “There are always new languages ​​trying to be the successors of C++. I welcome experimentation with programming languages ​​and programming styles, but not Hope to fuel the debate. It’s easy to criticize existing languages ​​because we know what’s wrong with them, but it’s often difficult to provide alternatives without creating entirely new problems with language rules, libraries, and management. Carbon is so new, And the specification is insufficient, and I can’t really make a meaningful technical comment.”

Although each new programming language is bound to have its own goals, we will wait and see what the future holds.

The text and pictures in this article are from CSDN

loading.gif

This article is reprinted from https://www.techug.com/post/the-latest-programming-languagea59cc782ff04407c1113/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment

Your email address will not be published.