Surface: a new programming language design view

This article is not going to introduce another programming language, but, a new view on designing a programming language. (Or addition feature we may need)

Below explains the reasons, examples, and something might be done for adding this feature.

So, what’s the problem?

When we are doing coding, whatever the language is, normally, we are based on the text editor (famous editors like vi/vim, or IDEs like vscode/jetbrains). We are coding like this (PHP for example):

No alt text provided for this image

It is 2D as we know, so it brings problems.

Problem 1: Comments

"Good programmers do comments.", "good programmers do fewer comments in the code"…

OK, we know, comments are part of coding. But when there’s a lot of comments, it is hard to get the full picture of the code itself. (What is your attention in the below code? I’m not saying the comments are useless, but it should be in another way on showing this.) 

No alt text provided for this image

Problem 2: ORM, Json or other data serializer/deserializer methods

When we are dealing with the data storage and the model/class in the programming language, we normally map them together.

Example 1. Orm in java

Example 1. Orm in java

Example 2. PHP Doctrine Annotations

No alt text provided for this image

Example 3. Golang Tags for serializing/deserialize json

No alt text provided for this image

As you can see, they mixed with normal codes there.

Problem 3: Context-based process

We also have other purposes of using annotations, ex. REST API entries.

Example 1. Swagger REST API in code:

No alt text provided for this image

Example 2. Python decorator

No alt text provided for this image

Obviously, they do special stuff.

Problem 4: Async codes

Though nowadays we are very familiar with async/await and make the code seems like we are doing synchronous steps, but it obviously is against our sense when writing the code.

No alt text provided for this image

I can't get you, so what's the problem exactly?

One picture explains everything. Why our programming language/IDE is not working like this in the below? (I called it "surface" for the solution.)

No alt text provided for this image

The "main code" is the coding you are writing normally. If you want to add comments/orm/json/async... just click the lineno or even highlight/select the words you want to comment/orm mapping/add json tag/add async code. It displays a block you can enter with tracing features. (See the lineno mapping)

And of course, to achieve this, the programming language should add tracking features and also it requires good IDE supporting...

At least, we are entering the 3D world from a coding view!



+ listener or subscriber (if event-driven supported) 

Like
Reply

You should know, maybe you are coding in a VR environment in the future. Links between different parts (`surfaces` here) is absolutely needed.

Like
Reply

To view or add a comment, sign in

More articles by Yarco Wang

  • My First glance at AutoAI in Watson Studio

    First of all, let me introduce myself, I am not an expert in the area of Data Science, and even didn't graduate from…

  • Evolution of the Open Source development: Using Blockchain

    We’ve once created open source projects for fun or they are just the side projects during working. Those projects may…

    1 Comment
  • Differences between REST&GraphQL -- my view

    Original Post: https://notes.bbish.

    2 Comments
  • Namespace: right and wrong between PHP and Node.js

    I have learned both PHP and Node.js, there are something I want to say according to the design of the concept…

  • Yin- Yang and Coexistence Theory

    Abstract Game theory(see 1.) is discovered by John von Neumann, mainly focus on the rela- tionships between competitors.

    2 Comments
  • html5 - suggestion of new element and attribute `greyarea`

    There are different types of resources in internet, from article to video. Normally, when we publish a resource, we…

  • Why we work 5 days a week

    I always feel unhappy or losing inspiration during a job in some company. And of cause, we need job to live.

  • Sex, Yin-yang And Family

    The basic axiom in natural is everything try to keep balance, like Swing or pendulum, always goes from one side to…

    1 Comment
  • Data structure and society

    When i'm trying to solve the problem (or at least on the first step ): My Question and when i review the book i bought…

Others also viewed

Explore content categories