purr changed the topic of #elliottcable to: a _better_ cult || topics << 'gamedev'
<ELLIOTTCABLE> or to rephrase that: is there a complete, textual representation of the source-code at all times? or does your tree representation *replace* it?
<ELLIOTTCABLE> (i.e. ‘what can come out will always been limited to what the parser understood.’)
<Cheery> the tree representation replaces it.
<Cheery> otherwise you couldn't extend a language
<Cheery> without some really hard constraints
<ELLIOTTCABLE> ‘couldn't extend a language’
<ELLIOTTCABLE> well, if it replaces it, you can't *write* a language.y
<ELLIOTTCABLE> you can only write the subset representation implemented by whoever's writing the language parser. and that will *always* be a subset (trust me, I have extensive experience with linters, transpilers, compilers, parsers, …)
<ELLIOTTCABLE> They always, always fail to do what the user wants in some case.
<Cheery> I've thought I've thought this out. :) Well I've got the thing here. it's just missing good input.
<Cheery> and thought it's generic. I can write a new schema file, and a new layouter function.
<ELLIOTTCABLE> so, what was your question?
<Cheery> the question is how would I build up the keyboard input.
<ELLIOTTCABLE> sorry, re-phrase that … language barrier
<ELLIOTTCABLE> ‘build up?’
<Cheery> I know how to remove from my tree. how to add into the tree.
<Cheery> I know how to show a selection that spans across the tree
<Cheery> how to move the caret
<ELLIOTTCABLE> regarding editing:
<Cheery> also made a system that lets you fill in beginning symbols of a structure, it replaces it with a blank structure.
<ELLIOTTCABLE> again, I suggest you have a textual representation stored internally, and constantly keep your tree-representation *mapped* to that textual representation;
<ELLIOTTCABLE> and if you do so, then you get something else: an improved textual-style (as opposed to, say, click-and-drag, or tap, or etc) editing experience
<ELLIOTTCABLE> everything that a user does text-wise (i.e. vim or emacs bindings, the usual movement commands and insertion/deletion, so on and so forth), can *literally* be applied exactly to the textual structure; then the effects in the visual structure can be inferred from there.
<ELLIOTTCABLE> this lends precise adherence to user expectations, because they literally *are* editing a textual document, even if it's not rendered that way.
<Cheery> that's something done by jetbrains MPS.
<ELLIOTTCABLE> jetbrains MPS? wassat?
<Cheery> jetbrains got a meta programming system, which does something like this, but the details are different.
<Cheery> I agree to the point that the editing model must be fairly textual
<Cheery> anyway I only have the box projection. I believe it's sufficient
sharkbot has quit [Remote host closed the connection]
<Cheery> and the problem I have with input.. I think it's mapping-related.
<Cheery> say in my system.. the user wants to input a new statement.
<Cheery> there are no way to move the caret into statement-level directly
<Cheery> Instead I expect that a slot is shifted up into the statement-level, from where the users' cursor sits.
<Cheery> another thing is that I can't accept operations that can break the schema and layout.
<Cheery> so whenever an user does an operation that does so, it can insert a breakpoint box, which adjusts the layout to comform.
<Cheery> breakpoint node.. actually. it's part of the document
<Cheery> inside that breakpoint box you can write in symbols, then press a key to get them parsed
<Cheery> since the schema is a CFG too, I can apply earley parsing to build up nodes for the user
<Cheery> so it allows both bottom-up/top-down working on code.
<Cheery> additionally, that earley parsing approach allows me to cut apart in middle of structure..
<Cheery> say the user wants to change parentheses in the construct
<Cheery> select stuff, press reorganization, it reorganizes
<Cheery> there's some problems in this though. I need to somehow produce some scoring and return the constructs with best score first.
<ELLIOTTCABLE> I gotta roll.
<Cheery> without structure tokens, the schema ends up being ambiguous.
<ELLIOTTCABLE> get incomprehensibly/glowcoil's attention, he's got visual-programming Opinions too
<Cheery> I may have figured out stuff while just describing this out.
<Cheery> it may be I just figured out how to make it work.. or at least I've got an approach to try
<Cheery> anyway. If I get this to work. I plan to hook it into linux.
<Cheery> kind of. linux-terminal-repl -sort of thing.
<Cheery> that is.. if it works so well that it's comformtable to write python with it.
<Cheery> getting sleep.. going to try out the things tomorrow.
<Cheery> thanks for listening.. :)
<Cheery> I'll try to build up some document about that.
sharkbot has joined #elliottcable
Nuck has joined #elliottcable
Nuck has quit [Remote host closed the connection]
eligrey has quit [Read error: Connection reset by peer]
eligrey has joined #elliottcable
kaplan has quit [Read error: Connection reset by peer]
kaplan has joined #elliottcable
eligrey has quit [Quit: Leaving]
eligrey has joined #elliottcable
eligrey has quit [Read error: Connection reset by peer]
vil has quit [Read error: Connection reset by peer]
vil has joined #elliottcable
eligrey has joined #elliottcable
kaplan_ has joined #elliottcable
<Cheery> I'm about to finish the completion feature..
kaplan_ has quit [Quit: Ex-Chat]
kaplan has quit [Remote host closed the connection]
kaplan has joined #elliottcable
<Cheery> now I've got completion
<Cheery> and once I improve my parser, it will successfully parse infix expressions with no problem. :)
<Cheery> theoretically now the input system functions for every language.
<Cheery> it doesn't need adjustments to support a new language
<Cheery> how this works is by the schema.
<Cheery> there's few generic commands that adjust to the structures that make sense in the context
<Cheery> I'm not done yet though
<Cheery> I have to check that this tool really works for programming
<Cheery> also, although it works, it's possibly not well designed.
<kaplan> Cheery, what tool is this?
<Cheery> it is a projectional editor.
<Cheery> the source code's available in my github account (https://github.com/cheery/textended-edit/)
<kaplan> What is a projectional editor?
<Cheery> though you may need assistance if you desire to try it out
<Cheery> it's hard to explain
<Cheery> or I've not figured out how to explain it well. :)
<Cheery> in outline my editor is a non-plain text editor, meant for programming.
<Cheery> it represents programs as cells, and trees of those.
<kaplan> ah, like scratch?
<Cheery> each cell represents a symbol or a string.
<Cheery> yes. like scratch
<Cheery> but different
<Cheery> first of all, the cells aren't displayed as jigsaw.
<Cheery> rather it's driven through a layouting module, which is different for every programming language.
<Cheery> also it's keyboard oriented unlike scratch.
<kaplan> ah, I see
<Cheery> the cursor travels in the symbols, you can loosen them into fields and edit in place.
<Cheery> the loosened symbols can be parsed, the parsing result creates new structures.
<Cheery> most of that's ambiguous, so I have to add scoring mechanism there, to present the "best fitting" result first.
<Cheery> the document model is unrestricted, so anything can be represented
<Cheery> but it's intended to be restricted by schema, which is defined in beginning of every file
<Cheery> the schema is a context free grammar, consisting of patterns allowed in the language
<Cheery> Here's an example of such: http://i.imgur.com/tGbtauG.png
<Cheery> it's been described inside the projectional editor
<Cheery> point is, you could extend any schema, present the extension and use it.
<kaplan> interesting
<Cheery> https://github.com/cheery/textended-edit/blob/master/layouts/schema.py -- this module describes how schema files are layouted.
<Cheery> once I figure out more, it may be useful to replace this with a declarative template or such.
<Cheery> by the next week, I think I'll have finally found out how well my current design works, and whether there's point to continue further.
<kaplan> I understood nothing of the code
<kaplan> I am so confused without descriptive comments
<Cheery> it contains lot of dead code now. couple earlier designs didn't work out.
<Cheery> and I had to figure out things, so there's likely code that isn't easily understood
<Cheery> but it's not complex thing.. I mean. not more complex than an usual editor.
<Cheery> if it works.. I'm sure it'll be well documented, by me and possibly others too.
<Cheery> if you want to understand it.. start from edit.py
<Cheery> read through init() first
<Cheery> then main()
<Cheery> in the main() pay attention to the big keyboard loop
<Cheery> it consists of a chain of calls to actions -module.
<Cheery> then you may be interested to look into render -function in edit.py
<Cheery> getting sleep. :)
<Cheery> I'll answer questions once I wake up