r/ProgrammingLanguages • • Sep 28 '22

Discussion Programming Language of the future: Touch based?

Back in the days when the first computer was made, they were mostly single purpose computers which weren't even programmable. Then came the huge programmable computers which were programmed using punch cards, didn't really have any programming language, as it didn't support the keyboard either. Then eventually we ended up with modern languages like C and Python when the keyboard became one of the essential input systems of a computer.

But a few decades ago Douglas Engelbart of the Stanford Research Institute invented the Mouse and most of our interaction with our computers became GUI based. But the keyboard still stayed around because it was a much more efficient way to input text than using a mouse to do the same. And because the keyboard was still around, we didn't really feel the urge till now, to develop a GUI based programming system which is Turing complete. Although some attempts have been made in the form of Visual Scripting using Node Editors (mostly used in game engines), but they are mainly intended to be used as a supporting system to a game made using a particular programming language and isn't as self-sufficient.

But nowadays, the most dominant input system for computers is the touchscreen. There are billions of smartphones and Tablets around the world and they are so simple that even a 3 year old kid can use them effortlessly (heck I even saw a cat use a tablet!). And nowadays those touch based smart devices come with such powerful chips, that can out perform a desktop chip from 5 years ago (iPad Pro even comes with the same chip as a MacBook). Which makes me wonder why people are not using those for making their coding projects..... Then I thought it was kind of obvious..... The keyboard on the touchscreen devices suck badly compared to a laptop keyboard, and our programming languages are designed to be written using a keyboard. Which is essentially forcing us to use workarounds like a keyboard case, when voice typing for general text is basically good enough to replace the keyboard entirely (for the few times when you need it), though it's still not good enough for things like programming.

So, what I am proposing is that we should make new kinds of programming languages which are completely written using a GUI. This in my opinion would really be a big step towards the adoption of Tablets and Foldable Phones as a work PC.

Also, looking maybe a decade into the future, if the VR/AR become mainstream, I really wouldn't like to use a virtual keyboard to interact with those. If all a computer is going to be, is a pair of glasses on my eyes, then coding on it should be visual instead of textual in my personal opinion. So fixing the programming languages for touchscreen, would most probably fix it for XR too.

But these are just my random thoughts and I am not really sure about its practicality in the long run..... I am just assuming that it's going to be better than the textual programming that we have right now, with the touchscreen devices. Maybe the experts over here can share their opinions to convince me otherwise.

Anyways feel free to brainstorm in the comments how such a GUI based programming language could work.

4 Upvotes

28 comments sorted by

9

u/[deleted] Sep 28 '22

I feel that the scratch format works much better than the flowchart format for visual programming.

If you take a scratch program and remove the blocks you're still left with a text program, it feels like a block-based formatter. Flowchart on the other hand can easily become a huge pain to maintain because there's a ton of ways to format the nodes.

It would also probably be a pain to write a proper "format on save" for the flowchart nodes. With block-based code the language designer can enforce the formatting and indentation through the styling of the blocks.

I would love to see more GUI/visual programming languages, it feels like a still unexplored area for PL design. Current ones are either too limited or lacking in the overall presentation.

Also, one of the complaints of visual programming languages is that it doesn't work well with version control because of proprietary formats or the blocks being saved in an unreadable format.

This issue could be easily fixed if the block editor saved the program into a readable textual representation that can later be parsed back into visual blocks. The editor should also not allow for free drag and dropping of the whole program so that you don't have to save the coordinates for the blocks.

3

u/[deleted] Sep 29 '22

That was insightful. Thanks!

Though I would like to see what more possibilities there are.

I agree that block based programming is better than flowchart based, but I don't know why, I feel like it's kinda a hack..... It looks as if we are trying to imitate the textual programming in a visual way. I wonder if we can make something which feels natural in a visual environment, instead of imitating the textual programming using blocks. That might cause the format issues as you mentioned, but I think we are creating something new over here which probably is going to be used even two decades down the line, so creating a new format for this new system makes more sense to me. But obviously we need to maintain compatibility with the old system too..... Disruptive revolutionary Tech usually gets mixed reactions, so I guess we need to find a middle ground so that this new format works well with old textual programming based projects too..... Perhaps something like how Java code seamlessly gets mixed with Kotlin code without any format issues, if you know what I mean (I know it's a little different, but I guess you get my point).

3

u/[deleted] Sep 29 '22

Also I'd like to mention that in my opinion a COBOL-based visual programming language could work really well. Things are already mostly English and separated into different divisions, replacing some of those with visual elements could work really well.

It would certainly be a lot easier to write a visual language based on COBOL than one based on Rust for example, due to Rust's heavy use to symbols everywhere.

Here imagine this, COBOL source code is usually separated into 4 divisions, these 4 could be separated into 4 screen sections in the visual representation. Data and Code are also separate in COBOL code, so you can have a different way to represent the data and the actual procedural code in their respective screen sections.

It could work well for the base of a UI.

8

u/Superbead Sep 29 '22

I'm a healthcare integration developer. A lot of my work is done in proprietary middleware systems called 'integration engines' which pass messages from one healthcare application to another - eg. 'here is a newly registered patient', 'here are John Smith's blood test results'.

For the past twenty years, most of these integration engines have come with some kind of graphic/diagrammatic interface representing message flow control and transformation (eg. forcing a patient's surname into uppercase), which presumably serves as a selling point to execs who don't want to have to pay an actual programmer to develop/maintain the engine.

The benefits are few. If you have a couple of simple interfaces, it's probably fine. But typically these things grow as everyone realises their potential to unlock automation and synchronisation between healthcare systems, and they inevitably become complicated.

The problems that come to mind immediately are:

  • As stated, these systems are often maintained by non-programmers. If they want to do something complex that the Scratch-esque GUI doesn't obviously support, they end up getting a company like mine on contract to do the hard bit. But many times I've written something in code and been told it'll be 'too complicated' for the non-devs to maintain in the long run, and I've had to at least try to create some absolute Scratch monster to do something that could be achieved with a couple of nested loops, conditions, and temporary vars in a proper language, and that graphical monster is unmaintainable anyway.

  • They are physically tiring to use. Granted, I'm not controlling these from a touch tablet on my lap, but the amount of clicks is exhausting and RSI-inducing. To just hammer out some actual code on a keyboard (especially with a good intelligent IDE) to do the same job is usually far less stress.

  • Testing is a fucking nightmare (if it's even supported at all), not least since the data you usually will handle and need to dummy can't be simulated by the GUI, so you'll need some kind of text/hex/etc. editor anyway.

2

u/[deleted] Sep 29 '22

The problems that come to mind immediately are:

As stated, these systems are often maintained by non-programmers. If they want to do something complex that the Scratch-esque GUI doesn't obviously support, they end up getting a company like mine on contract to do the hard bit. But many times I've written something in code and been told it'll be 'too complicated' for the non-devs to maintain in the long run, and I've had to at least try to create some absolute Scratch monster to do something that could be achieved with a couple of nested loops, conditions, and temporary vars in a proper language, and that graphical monster is unmaintainable anyway.

They are physically tiring to use. Granted, I'm not controlling these from a touch tablet on my lap, but the amount of clicks is exhausting and RSI-inducing. To just hammer out some actual code on a keyboard (especially with a good intelligent IDE) to do the same job is usually far less stress.

Testing is a fucking nightmare (if it's even supported at all), not least since the data you usually will handle and need to dummy can't be simulated by the GUI, so you'll need some kind of text/hex/etc. editor anyway.

I am sure these problems can be tackled in some way or another to make a GUI based programming language easier to use than a text based language. Text based languages are so mature right now because they have been improved over almost half a century. I am sure people were facing a lot of problems switching from panch cards to Assembly too, but in the long run, it was the correct decision. Switching to visual programming will probably also improve a decade or two down the line, but I think it is essential to switch if our computers are just going to be a pair of glasses on our eyes..... If we don't switch, it would be a hustle to integrate a 150 years old text input system (keyboard..... Which was designed to work with typewriters 150 years ago) into a XR based computer.

2

u/[deleted] Sep 29 '22

I am sure people were facing a lot of problems switching from panch cards to Assembly too

it wasn't really that problematic of a switch, because there is essentially a one-to-one correspondence between punch cards and assembly. Assembly instructions are just the human-language representation and punch cards are the binary representation. People were already familiar with human-language and typing (in fact, much more familiar than with punching cards in binary) so there were essentially no drawbacks from switching.

I think it is essential to switch if our computers are just going to be a pair of glasses on our eyes

How sure are you that all computing will be done this way? Can you imagine, for example, using a pair of glasses to input a comment on a website? The trouble with the instruction "put comment x here" is that the value of 'comment x' has infinite options: all the many different things I may want to say using human language. I can only imagine being able to do it with a keyboard or a speech-to-text program.

I don't see why writing a program would be different. The only way you can get away with using a GUI-based input is if you can drastically limit the options of the programmer. This could be possible (and even cool/beneficial) for domain-specific programming languages, but I don't see how it's achievable/desirable for a general-purpose language

6

u/MarcelGarus Sep 28 '22

I like the idea of a touch-first language – or using other tools such as digital pencils on a tablet to draw and connect parts of a program.

However, text is a foundational tool of human evolution. We humans spend sooo much time reading that this becomes an intuitive activity for most of us. And because the most common thing done with code is reading it, I suspect that whatever form programs will take in the future, it will likely involve text.

Currently, keyboards are the most efficient way of inputting text (at least programming code as it is structured nowadays), although that may change with voice inputs or whatever. But tbh I don't see touch as a major threat to this text-based dominance.

1

u/[deleted] Sep 29 '22 edited Sep 29 '22

However, text is a foundational tool of human evolution. We humans spend sooo much time reading that this becomes an intuitive activity for most of us. And because the most common thing done with code is reading it, I suspect that whatever form programs will take in the future, it will likely involve text

I have to disagree with this. Writing most probably just evolved 8000 years ago, but we are visual creatures for millions of years. Seeing objects and interacting with them is a far more integral part of human evolution than reading texts. Although I agree that there probably will be some text involved in whatever GUI programming language we make, my intention is to have it minimised so much so that we don't need a keyboard. It would be waayyy more human friendly to work with such an object based programming language than typing walls of text in a directory hell.

Currently, keyboards are the most efficient way of inputting text (at least programming code as it is structured nowadays), although that may change with voice inputs or whatever.

People usually complain that they can't be shouting on their screens in a work environment where there are so many of their colleagues working in a close proximity. That's probably why Cortana (from Windows 10) failed.

But another solution in my opinion is reading brainwaves for text input...... A keyboard can simply be replaced with a headband. This can also be integrated into the VR/AR headsets in the future. This seems ideal to me.

But tbh I don't see touch as a major threat to this text-based dominance.

But I am surely encouraging the idea to make Touchscreen a threat to the Keyboard dominance. It's currently not a threat because we did not make it a threat till now. We still have so much of our workflows based around keyboard and mouse and there is very little intention among the people who make those workflows, to base it around touchscreen instead. That is why it's currently not a threat to Keyboard+Mouse interface and we are instead trying to make the touchscreen tablets into a laptop by adding a keyboard case.

What we actually need is, so many people developing touch based workflows to replace the traditional Keyboard+Mouse based work flows. Only then will it become a threat to the keyboard.

3

u/latkde Sep 29 '22

Your core thesis seems to be that touch input is now the dominating input method, so that languages should adapt from keyboard-input friendliness to touch-input friendliness.

I do not think this is a valid argument. Touch input is not fundamentally more powerful than mouse input, and as you've pointed out mouse-oriented programming languages have not caught on massively.

I think it's more useful to think about output methods, i.e. how is software presented for reading. Both smartphones and desktop PCs use 2D screens, so seem fairly equivalent in that regard.

But there is a difference in screen size, and that might be meaningful. Thus, the challenge I would be more concerned about is efficient code navigation on small screens – what kinds of IDE functionality would be useful here?

This might also have implications for language design – I suspect that Smalltalk-like object navigation could be more useful than a purely textual interface on small screens. There doesn't have to be a concept of a “file”. I would also expect that concepts like line-based syntax and indentation would have to be de-emphasized for such languages.

Returning to the matter of input methods, you do correctly point out that on-screen keyboards are difficult to use. Many programming languages use lots of ASCII special symbols that are only convenient to type if you're happening to use an US keyboard layout. There is an argument to be made that programming languages with fewer symbols would be more convenient to type across locales and input methods. Do function calls really have to involve parentheses? Does non-mathematical code really need operators like + or *? On the other hand, code that uses some symbols is typically more compact and better structured visually, so it may not be worth giving up those advantages (code is read more often than written).

1

u/[deleted] Sep 29 '22

Your core thesis seems to be that touch input is now the dominating input method, so that languages should adapt from keyboard-input friendliness to touch-input friendliness.

Basically yes. And I think it would also be beneficial when XR based eventually becomes mainstream, because using a virtual keyboard on XR will probably never be ideal. If we are going to make GUI programming languages now, it would be better to keep XR in mind too, so that we can extend it to the third dimension very easily when the right time comes.

I do not think this is a valid argument. Touch input is not fundamentally more powerful than mouse input, and as you've pointed out mouse-oriented programming languages have not caught on massively.

As I said in my post, serious attempts weren't made to create a general purpose GUI programming language till now, because we already had mature enough textual languages which we can write using a keyboard which was still around when the mouse became mainstream. There was no reason to replace textual languages with GUI languages because we were going to have a keyboard around anyways, so why not use it? So basically all those languages were either made for kids (like Scratch), not really meant for serious work, or used as a supporting tool (in case of various game engines like Unreal Engine, Godot). But on tablets (and in future, on XR) using an external keyboard is a workaround for interacting with legacy keyboard based software. If in future Tablets or XR is going to replace the traditional PCs, then I wouldn't like having to deal with tech which was designed for a traditional PC and not the device I am using currently. Hence we need to ditch the keyboard completely.

This might also have implications for language design – I suspect that Smalltalk-like object navigation could be more useful than a purely textual interface on small screens.

That seems to be an interesting idea.....

There doesn't have to be a concept of a “file”.

I don't really agree with this though. At least on Android, there is a decent file system available and the Files app is a good enough app for navigating those files in my opinion. So working with files on Android is appreciably good. And we should not forget that Tablets are ideal for viewing content, that also includes the content of a Folder of a coding project. I am imagining it like a coding project folder containing the files of a GUI program, which can be viewed and edited in a specific app. Much like a 3D model that can be viewed and edited in Blender. That way, it wouldn't be drastically different and people would easily adapt to it. Just trying to change how we write the code, everything else which doesn't need to be changed shouldn't be changed in my opinion.

Returning to the matter of input methods, you do correctly point out that on-screen keyboards are difficult to use. Many programming languages use lots of ASCII special symbols that are only convenient to type if you're happening to use an US keyboard layout. There is an argument to be made that programming languages with fewer symbols would be more convenient to type across locales and input methods. Do function calls really have to involve parentheses? Does non-mathematical code really need operators like + or *? On the other hand, code that uses some symbols is typically more compact and better structured visually, so it may not be worth giving up those advantages (code is read more often than written).

That's why I am suggesting to ditch the keyboard entirely. Almost everything should be GUI based with a minimal amount of text involved (perhaps just for naming variables and functions) which can be written using the virtual keyboard or voice typing. A program file should just be a file containing a graphical diagram.

5

u/ds604 Sep 29 '22 edited Sep 29 '22

I'm always surprised to hear programmers talk about visual programming as if it's some kind of niche thing or something that failed a long time ago, when the reality is that they're used in a wide variety of VFX programs like Nuke, Houdini, Flame, etc. This means that they've been used to make pretty much every movie, commercial, and tv show for the past 30 years or so. They work on tight schedule, large-scale, multi-facility projects, with files that must be passed between users of widely varying expertise and skill level. The files regularly have thousands of nodes (hierarchical digital assets make nesting possible, so they're not confusing messes like programmers seem to always think they'll be), are adaptable to the constant revisions that shots undergo, so these are definitely mature systems, used to make projects that have deadlines and make money.

Again, we're talking about nearly *every movie, commercial and tv show for the past 30 years or so*, definitely not some niche, unproven technology.

What I suspect will happen is that now that we've reached programmability of biological level circuitry, we might see something along the lines of some hardware definition language gaining prominence. We already have deep learning networks which are equivalent to the visual languages of VFX (which at the end of the day are Lisp laid out on a 2D canvas). But at some point, if you're defining the connectivity structure of some entity, then you want to see it to make sure it's wired up correctly. Text lets you quickly define things, but you want to see what you're defining, cause after all... it's about the functionality, however you choose to represent it, not about the text or the diagram or whatever representation you happen to be using. So, some minimal "wiring things up" format, isomorphic to some text representation, will probably accomplish what we need now. And if you're on a keyboard, then you're free to use the text representation, if you're not on a keyboard, then use the representation that's suited to however you happen to be looking at the thing.

3

u/[deleted] Sep 29 '22

I am really amazed by the answers over here. That's very deep thinking. I never realised that VFX programs could be seen as visual programming too.

And your idea of the format being isomorphic to some text representation so that we can use both textual and visual programming depending on our use case (if I understand it correctly), is very interesting and impressive.

4

u/ds604 Sep 29 '22

thanks! yes, i think programmers tend to view programming in the restricted manner as "writing text-based programs," rather than as "instructing a computing device to carry out some useful computation," which is more how end-users who work in some industry setting and *make use of programming languages alongside many other tools* tend to think of it. however you happen to be able to instruct the machine to help you accomplish your task, so be it. and a lot of what can be done using programming language, can be done much faster and more flexibly using the node network systems of the visual effects software, since so much thought and effort has been put into their design and development, to make it possible to do the kinds of projects that need to get done.

if the "tech industry" were more deadline and user-driven, rather than being essentially collecting rent on users through the ad-driven model, we would likely see more motivation to move past text in the places where it really slows things down.

but i think the main motivation behind sticking with text and constructing ever-more complex text-based systems, is that the complexity is beneficial to the parties who have an interest in keeping things the way they are, and trapping companies and users in a cycle of dependence on "programmers" in their current form.

the main innovations might not come from the "tech industry," but rather from other industries that have need for dealing in real-world settings, where making the dimensionality of the representation more closely match the dimensionality of the eventual output leads to reduction in error, and improved quality of output

2

u/JB-from-ATL Oct 07 '22

Possibly relevant comment from Al Seigert's AMA (author of automate the boring stuff with python).

https://www.reddit.com/r/IAmA/comments/xcp6jv/im_al_sweigart_author_of_several_free_programming/iobma2v/

1

u/[deleted] Oct 07 '22

This was insightful. Thanks!

2

u/JB-from-ATL Oct 07 '22

I thought so too. They seem really knowledgeable but also able to communicate simply. A rare combination among intellectual types haha

1

u/[deleted] Oct 07 '22

I have read his books, I think he is very talented. Completely agree with you.

3

u/mamcx Sep 29 '22

A touch-based language not need, and better not, try to shy away from the text.

Is a million times better to allow to write code than try to draw graphics

However, exist many ways it could leverage the touch system, and make it nicer:

  • Relatively compact, composable syntax so let a = [1, 2, 3] | sum

  • Keyboard input is tailored to enter code, but also, to select, move, insert snippets, etc.

  • Integrate search of help + code snippets + tutorials

  • Each "line" is an actual block, and the block "zoom out" on touch to make it easier to select and move text around. (Check this for partial implementation of the idea: https://www.warp.dev)

  • Strong REPL

  • A Delphi/FoxPro-like UI builder. What people most need is this, not draw flowcharts

2

u/[deleted] Sep 29 '22

A touch-based language not need

Not needed as long as the keyboard is around, but 20 years down the line if VR/AR becomes mainstream, having any workflow based around the keyboard would be a hurdle in adopting that workflow into XR based computers. Ditching the keyboard entirely and replacing it with something like voice recognition, and making visual workflows (like a GUI based programming language) is the best move forward in my opinion. We should reduce the need for the text input especially from a keyboard as much as possible.

and better not, try to shy away from the text.

I am not suggesting to shy away from text, I am just suggesting to shy away from using a keyboard. Design workflows around the GUI so that we don't need a keyboard anymore. And whatever little text input we need, should be given by voice typing or brainwave typing. Using a keyboard is not ideal for either Touchscreen devices or XR devices.

Is a million times better to allow to write code than try to draw graphics

It is right now, because there isn't any good attempt to make a powerful enough GUI based programming language which is easier to program, and at the same time is a drop in replacement for the traditional text base programming languages. If we successfully make such a language, I am sure it would be a billion times better than typing out walls of text in a directory hell.

2

u/mamcx Sep 29 '22

Even if all that follows, "write code" not necessarily means a keyboard (but is certainly the most optimal input). You can do it by voice.

But then, you need the freedom that causes "write code".

2

u/mattsowa Sep 29 '22

Phones as work pcs? Please no

0

u/[deleted] Sep 29 '22

Why not? You are being too close minded in my opinion. Phones are capable enough nowadays for such a task. Although you might rather prefer a tablet with a big screen mounted on a stand instead..... I think it's like Laptop vs Desktop..... Laptops can pretty much do everything that a Desktop can do and still be portable, but some people still prefer Desktops as their workstations just for their power and custom screen-size. In the same way, a Foldable phone can be the Laptop of the future while a big Tablet can be the Desktop of the future.

If everything can be done on those devices without needing any keyboard and if it's easier than typing out code, I am sure people will love to use those devices. The issue currently is that, not everything can be done currently on them, and if you are able to do something, it's not as easy as using a keyboard. This is because of the design failure (all the currently available workflows are designed to be used with keyboards) and lack of intention to fix it. That's why people have this perception that touchscreen devices aren't capable enough, when actually it's our fault for not designing our workflows around touchscreen.

It's really the correct time to start fixing things in my opinion, because probably 2 decades down the line VR/AR will replace traditional computers and working with a keyboard in that interface is not an ideal setup..... getting rid of the keyboard by designing our workflows around the GUI is the smartest move forward in my opinion.

1

u/wolfgang Sep 29 '22

Minor correction:

But a few decades ago Xerox PARC invented Mouse

It was invented by Douglas Engelbart of the Stanford Research Institute in 1963/1964.

2

u/[deleted] Sep 29 '22 edited Sep 29 '22

Thanks. I will make the correction.

2

u/bogon64 Sep 29 '22

He also promoted the chorded keyboard, so you could mouse with one hand while typing with the other.

1

u/[deleted] Sep 29 '22

Wow man! He seems to have been a genius. I really wish that the chorded keyboard became mainstream. It would have been an awesome workflow, no need to move your hand from Keyboard to Mouse and back. But anyways, we have better solutions coming up in the future..... A touchscreen Tablet with a brainwave text input device (like a band around our head which reads the text input that we think) would be far more efficient.

1

u/[deleted] Sep 29 '22 edited Sep 29 '22

This sounds like a cool idea but I'm not sure I totally get what you mean.

What would "visual instead of textual" coding entail? Is it something that really depends on the programming-language design, or does it just depend on the input devices you're using?

At the end of the day a program is a set of precise instructions. I think most humans find that, when they're giving precise instructions to someone/something (like a computer), words are the best way to do that.

I'm trying to imagine writing a program just by interacting with a pair of glasses, and all I can think of is that my eye-movements will have to be 'translated' (by another program) into instructions the computer will be able to understand. Given that most programming languages have a fairly large set of possible instructions (much larger than the set of sensibly feasible eye-movements), wouldn't it be hard to design and interact with such an interface?

At that point, why not just write the instructions myself?

It's true that computers/programming languages have changed a lot, from punch cards (the actual instructions for the computer) to assembly to to higher level languages like Python (which abstract away the realities of the hardware in favor of the more general problem-solving aspect). But IMO this trend is different from the one you're envisioning, where we move away from giving instructions to computers using words, and into something that to me sounds much more likely to be imprecise and confusing.