News for hackers. Stuff that matters.
Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @05:30AM (#11445953)
You can create content on tablets, and some of it is excellent content.

Development isn't done on tablets because the input devices we have to make code are limited to a keyboard, and most people think text files are code, rather than a serialisation/deserialisation format for an AST.

You could easily build an AST with gestures and speech rather than tapping buttons, and I think in 10-20 years time that's how we'll make software.

Re:Bash on Ubuntu on Windows by quanticle on Thursday April 07, 2016 @05:37AM (#11445983)
You could easily build an AST with gestures and speech rather than tapping buttons, and I think in 10-20 years time that's how we'll make software.

I doubt it. Perhaps we'll be making ASTs by writing (i.e. drawing symbols with styli or pens), but I don't think we'll be doing it via gestures and speech. There's a reason that we don't teach math via interpretive dance.

Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @05:56AM (#11446065)
There's also a reason people in the same room don't communicate by tapping buttons with letters on them.
Re:Bash on Ubuntu on Windows by TeMPOraL on Thursday April 07, 2016 @08:08AM (#11446569)
Like 'Zecc said, maybe they don't care about the third parties present. Or maybe they want everyone to be a part of the conversation, which is often fine. Or maybe they talk about emotional matters.

But text is a pretty fine form of communication and I find myself using it very often at work (and at home I often talk this way to people not in the same room, but in the same flat). It's fast, it's convenient, it's less disrupting, and the only reason to avoid it are some silly preconceptions that digital communiction is somehow "worse" than spoken words.

Also, you never passed papers to your friends while in school? That's pre-smartphone equivalent of IM.

Re:Bash on Ubuntu on Windows by tluyben2 on Thursday April 07, 2016 @06:24AM (#11446166)
We do that a lot; for technical stuff it is often many times more efficient than talking.

Edit: And easier to search, remember, read again and the less nice variant of that; 'you never said that to me' 'I did: ' copy/paste.

Re:Bash on Ubuntu on Windows by michaelmior on Thursday April 07, 2016 @08:02AM (#11446535)
I can't say I've found any scenarios where talking to someone is many times less efficient than typing them a message. There are certainly times where it's helpful to supplement conversation with code, but that's a different story.

Regarding being easier to search and read it again, it seems like there are potential technical solutions to that problem, but I would agree that we're not there yet.

Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @07:38AM (#11446432)
Obviously people occasionally do talk in person via pressing buttons. That doesn't mean it's generally preferred.

Recorded speech is also searchable so not sure that's relevant.

Re:Bash on Ubuntu on Windows by tluyben2 on Thursday April 07, 2016 @11:13AM (#11447869)
> Recorded speech is also searchable so not sure that's relevant.

It is ; recorded speech is not very searchable, especially if you are talking in a group in a conference where people can be from different countries with different dialects (which is the normal situation for our group talks). Also it is not convenient and sometimes not possible to record every (conference) meeting (too much noise etc). With text it's automatically recorded and perfectly searchable...

Also some of my colleagues are not good at English listening but are very good technically; if I type what I mean they understand while if I/we tell them, everything has to be translated and/or repeated many times.

I think the tech is not there yet to say it's not relevant.

Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @04:08PM (#11450225)
Totally agreed the tech is not there yet. I just also believe at the current rate machine learning is going it the issues will soon be much less relevant.
Re:Bash on Ubuntu on Windows by tluyben2 on Saturday April 09, 2016 @09:48AM (#11461204)
I hope so but that has been a long standing promise. For me no amount of voice to text beats typing. I do not know why but things like Dragon basically give me gibberish. And that is with natural language. With natural language, code and math it is just vomit. I have no clue how they will solve that soon and then mix.it with translation as well. Hope there is though.
Re:Bash on Ubuntu on Windows by eric_h on Thursday April 07, 2016 @11:06AM (#11447817)
I do that all the time at work. Coworker (who's sitting next to me) has headphones on? Message him on hip chat.
Re:Bash on Ubuntu on Windows by Zecc on Thursday April 07, 2016 @07:25AM (#11446380)
They don't care about other people in the same room trying to concentrate on what they're doing?
Re:Bash on Ubuntu on Windows by pmontra on Thursday April 07, 2016 @06:29AM (#11446183)
Go ask teens with a smartphone at a restaurant but I've been doing the same myself sometimes. 1-1 or group chats.

A more specialized scenario: I was copy/pasting stuff to a colleague in the same room yesterday.

Re:Bash on Ubuntu on Windows by soft_dev_person on Thursday April 07, 2016 @06:22AM (#11446152)
They don't?
Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @07:37AM (#11446427)
Generally, no they don't.
Re:Bash on Ubuntu on Windows by Marazan on Thursday April 07, 2016 @05:36AM (#11445980)
Plain text files are an incredibly powerful way of "storing ASTs", the advantages are far too numerous to list. The primary one being complete and total interoparability with all other tools that accept plain text files.

I will bet you £100 that we won't be programming by speech and gestures in even 25 years time as the disadvantages are enormous.

Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @05:55AM (#11446051)
Not saying we shouldn't store software as text. Just saying we don't need to make software with text.
Re:Bash on Ubuntu on Windows by TeMPOraL on Thursday April 07, 2016 @08:12AM (#11446587)
Get a better editor - one that lets you operate on semantic units. And/or get a better programming language - one that lets you operate on code as AST.
Re:Bash on Ubuntu on Windows by falcolas on Thursday April 07, 2016 @10:52AM (#11447710)
I think you're making good points, but please let me know when semantic editors are available for Go, Rust, JavaScript and Python.

One other advantage of directly manipulating AST - it's very easily converted into any language runtime you want. It won't matter if you are targeting the JVM, V8 or native bytecode; you can do it all from the same AST. This same thing is possible with plain text code, but not quite as common.

Re:Bash on Ubuntu on Windows by TeMPOraL on Thursday April 07, 2016 @11:05AM (#11447809)
> I think you're making good points, but please let me know when semantic editors are available for Go, Rust, JavaScript and Python.

I think there are ports of paredit-like features to those languages in Emacs too, and all the other semantic features of Emacs itself work with those. As long as the language's major mode properly defines what is e.g. a function, a symbol, etc. you can use semantic navigation and editing.

> One other advantage of directly manipulating AST - it's very easily converted into any language runtime you want. It won't matter if you are targeting the JVM, V8 or native bytecode; you can do it all from the same AST. This same thing is possible with plain text code, but not quite as common.

I don't think this is something that AST gives you. AST is just a more machine-friendly representation of what you typed in the source code. Portability between different platforms depend on what bytecode/machine code gets generated from that AST. And since AST is generated from the compiled source anyway as one of the first steps in compilation, getting it to emit a right set of platform-specific instructions means you can compile the original source there too.

And AST doesn't solve the problem of calling platform-specific functions and libraries anyway.

Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @09:03AM (#11446875)
Sure, there are many (excellent) AST based editors. However an AST editor based on a keyboard, and requires you to learn to type at 160 WPM, won't help most tablets be good code creation devices.

Data structures are shapes. A shape is better drawn than described in text.

Re:Bash on Ubuntu on Windows by TeMPOraL on Thursday April 07, 2016 @09:19AM (#11446973)
My point is - there are AST-based editors and languages (e.g. Emacs with Paredit and Common Lisp) and you can see that even in that mode of "thinking" about code, you can't beat the speed, efficiency and flexibility of the keyboard.

> Data structures are shapes. A shape is better drawn than described in text.

Draw me a linked list. Tell me how much faster it is than typing:

   (list 1 2 (foobar) (make-hash-table) (list "a" "b" "c") 6)
Even on a visual keyboard on a tablet, it's faster to type than to draw data structures. A flat sheet of glass maybe gives us the ability to get the (x, y) coordinates of a touched point easier and with more precision, but it sacrifices many other important aspects - like tactile feedback and the ability to feel shapes. With physical keyboard, you're employing more of the features your body and mind has, and that's why it's faster than a touchscreen.

Unless you can find a completely different way of designing UX, then a tablet won't be a suitable device for creation. None of the currently existing solutions come close to beating a physical keyboard and a mouse.

Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @09:28AM (#11447040)
> Draw me a linked list

I don't normally use linked lists, but here's an array:

"list joe (subtle gesture) mary (subtle gesture) dave end

If I wanted to delete dave from the list I could grab it and slide it away or say "list delete last".

> Tell me how much faster it is than typing

Everyone in the room I'm in now can talk at 200 words per minute and use their hands. Very few of them could type that fast.

Re:Bash on Ubuntu on Windows by TeMPOraL on Thursday April 07, 2016 @09:33AM (#11447080)
> "list joe (subtle gesture) mary (subtle gesture) dave end

How will you go about drawing "joe" and "mary"? Is it faster than typing? Note that you can't always select stuff from dropdowns - you often have to create new symbols and values.

> Everyone in the room I'm in now can naturally talk at 200 words per minute.

How fast they can track back and correct a mistake made three words before? Or take the last sentence and make it a subnode of the one before that? Speech is not flexible enough for the task unless you go full AI and have software that understands what you mean.

Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @09:36AM (#11447104)
>> You could easily build an AST with gestures and speech

> How will you go about drawing "joe" and "mary"?

I'll just say it, it's easier. As I said at the top of the thread, gestures and speech.

> How fast they can track back and correct a mistake made three words before?

I gave an example of opening an existing structure and modifying it in the comment you're replying to.

> Or take the last sentence and make it a subnode of the one before that?

Like in a DOM? Easily: grab it and move it, just like you do it in DevTools today, except with your hands rather than a mouse.

Re:Bash on Ubuntu on Windows by TeMPOraL on Thursday April 07, 2016 @10:05AM (#11447322)
> I gave an example of opening an existing structure and modifying it in the comment you're replying to.

Sorry, I misunderstood what you meant by "subtle gesture" there.

Anyway, in the original comment you said:

> Data structures are shapes. A shape is better drawn than described in text.

I'll grant you that speaking + gestures may not be a bad way of entering and manipulating small data structures and preforming simple operations. But until we have a technology that can recognize speech and gestures reliably and accurately (and tablets with OSes that don't lag and hang up for half a second at random), physical keyboards will still be much faster and much less annoying.

But I still doubt you could extend that to more complex editing and navigating tasks. Take a brief look at the things you can do in Paredit:

http://pub.gajendra.net/src/paredit-refcard.pdf

Consider the last three or four subsections and ask yourself, how to solve them with touch, gestures and speech. Are you going to drag some kind of symbolic representation of "tree node" to move a bunch elements into a sublevel? How about splitting a node into two at a particular point? Joining them together? Repeating this (or a more complex transformation) action 20 times in a row (that's what a decent editor has keyboard macros for)? Searching in code for a particular substring?

Sure, it can be done with the modes of input you're advocating, but I doubt it can be done in an efficient way that would still resemble normal speech and interaction. There are stories on the Internet of blind programmers using Emacs who can achieve comparable speed to sighted ones. This usually involves using voice pitch and style as a modifier, and also using short sounds for more complex operations. Like "ugh" for "function" and "barph" for "public class", etc. So yeah, with enough trickery it can be done. But the question is - unless you can't use the screen and the keyboard, why do it?

> Like in a DOM? Easily: grab it and move it, just like you do it in DevTools today, except with your hands rather than a mouse.

DevTools are a bad example for this task. Using keyboard is much faster and more convenient than mouse. C.f. Paredit.

Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @10:18AM (#11447413)
> But until we have a technology that can recognize speech and gestures reliably and accurately (and tablets with OSes that don't lag and hang up for half a second at random)

Totally agreed. Theoretically, you should just be able to gesture a list with your hands and say "joe mary dave" and the software knows from your tone that's three items and not one.

I don't know that much about lisp and s-expressions asides from that it can edit it's own AST. That's not a way of avoiding the question, it's just my own lack of experience.

> Are you going to drag some kind of symbolic representation of "tree node" to move a bunch elements into a sublevel?

Yes, I already think of a tree of blocks/scopes when editing code with a keyboard, visualising that seems reasonable.

> Repeating this (or a more complex transformation) action 20 times in a row (that's what a decent editor has keyboard macros for).

Here's the kind of stuff I use an AST for: finding function declarations and making them function expressions. I imagine that would be (something to switch modes) "find function declarations and make them function expressions". Likewise "rename all instances of 'res' to 'result'" with either tone or placement to indicate the variable names. More complex operations on the doc would be very similar to complex operations in the doc.

> Searching in code for a particular substring?

Easy. Have a gesture or tone that makes 'search' a word for operating on the document, not in it.

> Sure, it can be done with the modes of input you're advocating, but I doubt it can be done in an efficient way that would still resemble normal speech and interaction.

Yep, I don't think it would still resemble normal speech and interaction either, the same way reading code aloud doesn't. It would however be easier to learn, removing the need to type efficiently as well as the (somewhat orthogonal) current unnecessary ability to create syntax errors.

> DevTools are a bad example for this task. Using keyboard is much faster and more convenient than mouse. C.f. Paredit.

Not sure if I'm reading you correctly here: typing DOM methods in a keyboard in devtools is obviously slower than a single drag and drop operation. Using hands to do it directly is obviously even faster with the mouse.

Stepping back a little: I guess some people assume speech and gestures won't get significantly better, I assume they will.

Re:Bash on Ubuntu on Windows by Marazan on Thursday April 07, 2016 @10:05AM (#11447329)
That's great if you just want the strings joe and mary. What happens if you want a list of People?
Re:Bash on Ubuntu on Windows by nailer on Thursday April 07, 2016 @10:31AM (#11447526)
Off the top of my head:

favouritePeople is Person list, name Joe age 32, Mary 23, Steve 64, end

Using tone to separate entries, but you could use a secondary gesture for that instead. Also some pattern matching.

Re:Bash on Ubuntu on Windows by erelde on Thursday April 07, 2016 @05:56AM (#11446063)
> I will bet you £100 that we won't be programming by speech and gestures in even 25 years time as the disadvantages are enormous.

Unless AI advances considerably. For years I've imagined myself talking to the small specialized AI living in my computer, giving it instructions that it would translate to code...

Re:Bash on Ubuntu on Windows by Marazan on Thursday April 07, 2016 @10:04AM (#11447317)
Natural language is a terrible way to specify software.

Writing software is about telling a blazingly fast, literal, moron what to do. The ambiguity inherent in natural language is not a good way of telling such a thing what to do.

Re:Bash on Ubuntu on Windows by dTal on Friday April 08, 2016 @10:28PM (#11459616)
>>AI advances considerably >blazingly fast, literal, moron

I think I have discovered the source of your disagreement.

Re:Bash on Ubuntu on Windows by JadeNB on Thursday April 07, 2016 @09:28AM (#11447042)
I suddenly envision a "The feeling of power" (https://en.wikipedia.org/wiki/The_Feeling_of_Power )-type scenario, where one programmer suddenly discovers that he or she can understand and create binary patterns without relying on the AI.
Re:Bash on Ubuntu on Windows by bigiain on Thursday April 07, 2016 @08:14PM (#11451716)
And if we _are_ Ima start buying Spotify ads that just shout out "semicolon exec open bracket mail space dash s space passwords space owned at gmail dot com space less than space slash etc slash passwd close bracket semicolon" at top volume.
Re:Bash on Ubuntu on Windows by Nevor on Thursday April 07, 2016 @05:55AM (#11446054)
Actually AST edition with touch interface has been experimented by MS Research with Touch develop (https://www.touchdevelop.com/). In their editor you just insert/combine AST parts instead of typing them.
Re:Bash on Ubuntu on Windows by austinsharp on Thursday April 07, 2016 @10:09AM (#11447357)
Came here to say this. It works surprisingly well on phones and tablets, primarily for making single file scripts.
Re:Bash on Ubuntu on Windows by TeMPOraL on Thursday April 07, 2016 @08:04AM (#11446551)
It depends. If you spend some time writing in Lisp, you'll learn how it is to write in AST, including navigating and editing it as tree and not strings of characters. And you'll see that the keyboard is still the most convenient interface we have for that. Touch, gestures and speech lack both speed and precision to be effective at this job.