Earlier quoted context omitted.
Come back when you can write excel as an excel macro. The argument that spreadsheets are easy for non programmers to use is not an argument for replacing programmers current tools with structured tools. Nor an argument against.
Come back when you can write a database in sql, or a browser in html. Hell, try writing a browser in javascript. How much of what the average programmer does looks like implementing a programming language and how much is just throwing some UI over a CRUD database? Why insist that a tool is only worthwhile if it can do both? There is plenty of room for tools that just solve the kinds of problems that most people have…
Programmer Tooling Beyond Plain Text
21–30 of 75 posts
Re: Programmer Tooling Beyond Plain Text
#22 With previously working code above and below, I start
to declare foo. In the process I introduced unmatched
‘{’; '('; and '"', and am referencing the not yet
(fully) declared foo. This is routine editing, but it
causes huge problems to tools like
* typechecking
* go to source
* code folding
* autocomplete
* etc
Visual Studio and C# aren't without problems, but they are without this problem. This works fine.[1] I'd be quite surprised if it didn't also work in VS-supported languages such as VB.net, F#, and JavaScript - but I can't attest to it.[1] - I personally find it annoying that VS complains about unmatched punctuation the moment I insert the opening one. "Jesus, VS, give me a minute!" And there are other parts of VS and/or C# that I (and probably you) find annoying. But the above is a Solved Problem, if you choose your tools carefully.
Re: Programmer Tooling Beyond Plain Text
#23The article claims that parsing isn't necessary with structured editing. We're working on some abstract data structure representing our language's syntax. This might be an AST, like any programming language in common use today, or maybe in the future we've thought up some better way to represent programming languages within the compiler/interpreter. Since we're working directly with the AST or whatever, we don't need to parse! We just do whatever actions the programmer wants do over on our data structure.
Now, let's talk about how parsing works in your language of choice in 2015. We're going to take a string, and we'll turn it into a representation of our program. If we're lucky, our language implementation isn't awful, and our parser will be a function from some sort of Unicode-encoded text into an AST. OK, maybe our input is ASCII or some other text encoding, but the point is the same. Either way, we're taking some keypresses from the programmer, and turning them into a data structure representing the program.
Let's abstract a bit. Maybe in the future we don't use keyboards. Instead, we have whatever peripheral you like. This peripheral is capable of sensing some sort of action from the user, and turning it into actions within the computer. So now, our parser is a function from some user action to a data structure representing the program.
This sounds an awful lot like "we just do whatever actions the programmer wants do over on our data structure". The question is, how do we figure out what the user wants? The answer is, we parse it! It doesn't matter if we're parsing text or not. We will always need some way of determining the programmer's intention from the signals we get through their peripheral device. Viewed through this lens, the camera requires a parser just as much as the keyboard does, just as much as the mousepad does, just as much as the microphone does. We will always need a way to convert the unstructured thoughts of a human programmer into the formal language of a compiler's internals. Regardless of what representation we choose for any part of this process, it's going to be subject to the article's quote:
> This situation is a recipe for disaster. The parser often has bugs: it fails to handle some inputs according to the documented interface. The quoter often has bugs: it produces outputs that do not have the right meaning. Only on rare joyous occasions does it happen that the parser and the quoter both misinterpret the interface in the same way.
Re: Programmer Tooling Beyond Plain Text
#24Earlier quoted context omitted.
Excel, Access, Labview, Scratch. Pretty much anything that doesn't require years of training as a programmer uses a mixture of structured editing and small chunks of raw text. If you look at it by sheer number of users, structured tools are winning and have been for a long time.
Except for programmers. And when people try to do what we do, but in Excel, it's bad. Or if they try to do it in Labview, it's also bad. (I've personally seen both.) These tools can't do, structurally, what git (or even cvs) does with plain text, or what vim or emacs (or even notepad!) do with plain text.
Re: Programmer Tooling Beyond Plain Text
#25Earlier quoted context omitted.
Thank you, and you're absolutely correct. I think a side-by-side video comparison would work even better, because it's not immediately clear how much time is spent moving commas around, playing with whitespace or hunting parenthesis. That said, I'm not trying to convert people just yet. It still needs polishing and support for a few more languages (right now it only does Lua, Python and basic Lisp, which is not very…
Is your editor open source? It looks really interesting.
1) Premature open-sourcing complicates commercial projects, and a man gotta eat.
2) Because it would be a first, any flaws in the implementation will be assigned to the concept of structured editing itself, hurting the development of alternative implementations. Even if my vision of it fails, I want other people to have a shot without fighting incorrectly formed opinions.
In the end, it's the ideas and not the source that are important. It's like developing for VR now, or mobile a few years ago. The space of possible interfaces is so big that most of the effort goes into combing it.
Re: Programmer Tooling Beyond Plain Text
#26Earlier quoted context omitted.
Thank you, and you're absolutely correct. I think a side-by-side video comparison would work even better, because it's not immediately clear how much time is spent moving commas around, playing with whitespace or hunting parenthesis. That said, I'm not trying to convert people just yet. It still needs polishing and support for a few more languages (right now it only does Lua, Python and basic Lisp, which is not very…
Is your editor open source? It looks really interesting.
Re: Programmer Tooling Beyond Plain Text
#27Earlier quoted context omitted.
Come back when you can write a database in sql, or a browser in html. Hell, try writing a browser in javascript. How much of what the average programmer does looks like implementing a programming language and how much is just throwing some UI over a CRUD database? Why insist that a tool is only worthwhile if it can do both? There is plenty of room for tools that just solve the kinds of problems that most people have…
> Hell, try writing a browser in javascript. http://breach.cc/
Re: Programmer Tooling Beyond Plain Text
#28I've been working on a Structured Code Editor for a couple of years: https://i.imgur.com/wvcduDk.png (in the picture above "string" is selected, and "find" is slightly highlighted because its on the same level. this helps visualize the tree and plan your movements) It actually started as my final project during undergrad. Here's my 78-page thesis on it (unfortunately Portuguese, but has English pictures): https://pro…
You can do a lot of things with a parser and a rich code editor...e.g.
http://research.microsoft.com/en-us/projects/liveprogramming...
Parsing is just a detail, if you can get it right, you don't necessarily need a structured or projected text editor. And its not even the "big" detail, which would definitely be type checking, and structural isn't going to help you much there (that is, if you want any kind of fluidity).
Re: Programmer Tooling Beyond Plain Text
#29I've been working on a Structured Code Editor for a couple of years: https://i.imgur.com/wvcduDk.png (in the picture above "string" is selected, and "find" is slightly highlighted because its on the same level. this helps visualize the tree and plan your movements) It actually started as my final project during undergrad. Here's my 78-page thesis on it (unfortunately Portuguese, but has English pictures): https://pro…
> Structured editing is much, much, MUCH better suited for programming than plain text. Syntax preservation and source-display separation are game changers, and they are not the only benefits. You can do a lot of things with a parser and a rich code editor...e.g. http://research.microsoft.com/en-us/projects/liveprogramming... Parsing is just a detail, if you can get it right, you don't necessarily need a structured o…
The large screenshot[0] is a textbook example of structured editor, but the cursor moves around as if it was text. It looks like the document is modeled as a combination of complete structures plus a few incomplete pieces of text. That's interesting because you get the benefits of structured display without paying for structured input.
However, I'm not sure I would use this. It's not clear how to call the Δ function, for example. You can consult the manual or ctrl+c the character, but that's not desirable. Also, does erasing the dot after ≱ yield ≥ or ≯?
I do like structured input. You type an awful lot less and there's no meddling with commas and parenthesis. The learning curve is tough, but Vim users are here to prove people are willing. If structured editing lives up to the hype, of course.
Anyway, I'm always glad to see research in this area.
[0] http://research.microsoft.com/en-us/projects/liveprogramming...
Re: Programmer Tooling Beyond Plain Text
#30I think the author has made an interesting point, but I would add that "time has come" to, not abandon text tools (which I don't think has worked; I think the trend is going away from Excel to R and python+pandas, in data science etc), but have a hybrid system, where the text representation of the "view" is visible to the programmer all/most of the time.
For example:
- we either have plain text "LaTeX" editing where we edit out document/source "blindfolded", and only get to see the result when we compile and view the pdf.
- we use a WYSIWYG tool like Word (and some WYSIWYG LaTeX editors) where we stick to the view and are scared (sometimes it's impossible) to dig into the text representation
- what we need is something like a hyprid, where a "view" line, and a "text" line are interweaved, or "view" on left side, and "text" on right side. And we could edit any of the two ways, and the other should update.
I've been thinking along these line for quite a while, and if I get a change I intend to create some kind of system based on that.