I wonder how a mobile-first programming language / environment would be like.
I guess something with as little punctuation as possible, so that you wouldn't need that many keys. A good autocomplete would probably be essential too. Would text still be the prefered input method? Is there something better suited to touchscreen input?
What about code display? I guess the "lots of little functions" style, which would probably allow for the easiest navigation on a tiny screen. Maybe collapsable/expandable function sections, like in WorkFlowy?
Smalltalk is surprisingly OK to develop on the phone. I've written a little on-screen keyboard in Smalltalk (subject of my next blogpost; [1,2]), and it's just a naive qwerty layout, but it works OK for the short methods common to Smalltalk programming. Very early days, plenty of improvements to be made, but I was surprised that it wasn't an immediate fail.
Interesting question. There's probably a tradeoff at play here between 'easy to input' and 'easy to read'.
As nothing more than a random guess, I believe a lisp could be appropriate here. Highly flexible syntax means it's easy to make a custom way to input code that works for a phone (you could imagine that touching a form makes a dialog appear or something like that. I'm terrible at UIs), and homoiconicity helps reconciling the input UI and code as it's written.
Yes, that's precisely what I'm talking about. The very structural nature of lisps (you're basically editing the AST directly) makes it easy to make something like that. You'd probably have to make some concessions due to a small screen/slow typing speed, but I could see something like this being actually productive.
Squeak includes EToys, which was the inspiration for Scratch (originally written in Squeak, then rewritten in Flash and then rewritten in Javascript) which was the inspiration for most current block languages.
I don't think visual code blocks based systems are particularly efficient at space usage. Code blocks are dragged and dropped in from a panel of blocks, which I would think would work best on as large a screen as possible.
If you're really going for easy data entry and are willing to sacrifice program readability, I'd go with something that just has fewer tokens. The length of them hardly matters, as you can easily find shortcuts to enter them -- even the ZX80 did that, and a modern mobile phone has soo many technical advantages compared to that.
The problem comes when introducing names. Those are pretty independent from the language itself, apart from some basic length and character set constraints. But if you have something where you don't need that many variables (point free code, stack-based PL), you don't have to go to full keyboard mode that often, and completion would have to work with fewer possibilities, too.
But in the end people manage to type pretty well on screens, as long as you don't have to switch layouts. Which brings us a constraint like many early programming languages had, where you really couldn't depend on anything but alphanumeric characters on a keyboard. That brought us Algol, Fortran and C trigraphs. Now ditch parens and you're good to go, although I guess that displaying a single additional line on your OSK with the necessary few items is easy enough.
Now, the editing environment is interesting. Fewer widgets to display on screen and more awkward shortcuts. This could point towards something like vi, or maybe even Oberon/acme, with touch gestures taking the place of mouse button chords.
I wouldn't do it like a text editor, I'd make it a structure editor aware of the grammar and only present valid alternatives at the point of entry, I would use fuzzy matching and strong types to quickly cut down the alternatives to present to the programmer. The programmer should only need to enter long stretches of text when writing comments and string literals.
In fact I may already have started working on this :-)
Microsoft tried this with Touch Develop. The project was shut down last year. The on-screen keyboard layout was context-sensitive. IIRC you could enter complete keywords with a single key, maybe even variable names. It was pretty cool. Perhaps phones just don't have the screen estate for serious programming.
Close would be the ipad app Playgrounds (https://www.apple.com/swift/playgrounds/); I've never tried it, but it seems to use the keyboard suggestions to suggest code and the like.
The APL family is probably most terse. J has an Android app.
Unfortunately, i need the documentation all the times and a larger screen makes that much easier.
Why would you want to code on mobile though? For serious development a nice desk is also beneficial.
I understand what you mean by serious development, large complex projects youre working on for an extended period of time, but that's not all development. For example a few years ago I needed to do some coding exercises for a job application and I did them all on the train during my commute on my iPad in Pythonista. There are now several excellent coding apps, git clients, decent editors etc available for iOS you can even use to develop apps for publication on the App Store.
Until the iPhone 6+ I'd have said coding on a phone was really awkward, but nowadays on the modern large format phones it's quite workable.
Environment and language evolving together seems very key, no pun intended. Remove the shift key, and instead of a top line number row, make it symbols instead. Embrace the punctuation instead of running away from it.
The phone development environment, even with the excellent physical keyboard on the Samsung Sidekick 4G, was never really all that productive for me. I sure thought it was cool though.
These days, I get more done with a light and cheap Chromebook, either inside the Linux environment itself, or just running SSH to my desktop. The size and weight aren't too bad, and I can type much faster with a nearly full-sized keyboard.
I'm still in the market for a sub 3lbs convertible Chromebook with a 13in 1080p screen. But I'll make due with what I have for now, at least until the battery dies.
Samsung galaxy s7 with bare PostmarketOS. Standard PostmarketOS sshd, and I compiled my own cog VM (on the phone!). It's running on /dev/fb0 without X. I wrote more about it all: https://eighty-twenty.org/tag/squeak-phone/
Not yet. I'm working on it. Status is that I can send and receive SMS, and make and take calls (though the audio doesn't work yet). GPRS/LTE is next on the list.
I guess something with as little punctuation as possible, so that you wouldn't need that many keys. A good autocomplete would probably be essential too. Would text still be the prefered input method? Is there something better suited to touchscreen input?
What about code display? I guess the "lots of little functions" style, which would probably allow for the easiest navigation on a tiny screen. Maybe collapsable/expandable function sections, like in WorkFlowy?