A proposal for the Python Dev's

67 views
Skip to first unread message

tfer

unread,
Jan 21, 2020, 1:34:43 AM1/21/20
to leo-editor
All the talk on parsers is probably something I'm going to need when l get around to working on the following proposal to make Python a even better teaching language for programming.

I check out different editors all the time, and the one that inspires ithis is called jGrasp, (I even mentioned it on here before). It's written in Java and only recently added support for Python. The feature I'm trying talking about is CSD, control structure diagrams, a decoration of the code using 3 columns to the left of the text plus the white space of indented lines replaced by glphs that show control flow.

Now this has to be computed and added to the code then stripped when ever you save your code,and I suspect this is something that one of these parsers could handle.

But if we add these glphs to our programming font, (a utf-8 one, in the code lock for application use say), we can compile Python with these characters told to be treated as whitespace and as a consequence allow the decorated code be perfectly runnable -- (this is the proposal).

I'll include a picture of a CSD.
In the next post.

tfer

unread,
Jan 21, 2020, 1:38:49 AM1/21/20
to leo-editor
Here is a CSD:
 

john lunzer

unread,
Jan 24, 2020, 6:41:59 AM1/24/20
to leo-editor
CSD is nice, it seems like a more structure aware indent highlighter. 

I can see how it could be done entirely with unicode characters. I think in visual function it would be not much different from a whitespace mode.

As you stated, the algorithms need to be code aware meaning they're doing parsing, which I would think is non-trivial.

That said, CSD is very awesome looking and would be a welcome addition, so I wish you good luck on any work towards that goal.

tfer

unread,
Jan 24, 2020, 3:13:02 PM1/24/20
to leo-editor
Thanks for the wishes John, though it currently is far down  on the list of projects.

It would require permission to use the gylphs, or creation of an equivalent set.

Tom

john lunzer

unread,
Jan 24, 2020, 4:02:10 PM1/24/20
to leo-e...@googlegroups.com
I'm not sure I'd let that hold you up. You could almost certainly do it with a fairly complete set of unicode characters. Specifically: the unicode box drawing characters for all the lines; there are a couple of fancier ones for the top level glyphs; and there is a diamond called a "lozenge" for the if. You'll likely have to make a couple compromises (you're not going to be exactly able to match the while glyphs) but what I've listed should allow you to move past the "artwork" component.
Reply all
Reply to author
Forward
0 new messages