Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unprintable characters! #2

Closed
DJMcMayhem opened this issue Jun 20, 2016 · 6 comments
Closed

Unprintable characters! #2

DJMcMayhem opened this issue Jun 20, 2016 · 6 comments

Comments

@DJMcMayhem
Copy link
Owner

Right now, V heavily relies upon unprintable characters. For example, this program: http://v.tryitonline.net/#code=AQEBAQEBAQEBAQ&input=MTA

Nobody can tell what this code will do without running it.

This is OK since TIO handles them really well, and they're perfectly visible from in vim, but not everybody will write V code in vim. We should come up with a way to map certain printable unicode characters to the unprintable ones just for convenience so that other users can copy and paste commands from the docs, rather than being forced to write it in vim.

This will also make it easier to tell the flow of the program just by looking at it.

@DJMcMayhem
Copy link
Owner Author

I've already started on fixing this (though I didn't make it very far) with the utf8.py file. Now, we just need to pick the unicode characters we're going to use. Maybe take some inspiration from other esoteric languages that use the full 256 byte space, e.g. seriously, jelly, osabie (can't spell it right) or some others.

The only bytes we need to map to are 0x00-0x1F and 0x80-0x9F, all the other ones are printable (at least from within vim). 0x80-0x9F are not mapped to any commands yet, so it would be better to get 0x00-0x1F first.

@vihanb
Copy link
Collaborator

vihanb commented Jun 20, 2016

I would help but I don't Python ;-; idk, if you could tell me what to do I could help but idk if will be very helpful ;-;

@DJMcMayhem
Copy link
Owner Author

DJMcMayhem commented Jun 20, 2016

Ok. Well, if you really want to help, it would be extremely helpful just to have someone start picking out the characters to use. And then I can take the python from there. Although the python is pretty trivial. Just adding values to a dictionary. The only requirements are

  1. They should be above u+0100, since everything lower is already in use
  2. They should be visible in vim (If you have to :set font specifically, that's OK.)

And then if they can look like the function they represent, that would be even awesomer. For example, backspace is 0x08, and escape is 0x1B. I'm sure there is some unicode symbol that could remotely represent the concept. I'm not very picky about 0x80-0x9F since they aren't even in use internally yet.

@DJMcMayhem
Copy link
Owner Author

Update, I have decided that it makes more sense to use the vim-key descriptions instead of a codepage. That has many advantages in my mind.

  • More readability
  • Easier to learn, since each vim-key description helps explain the mnemonic.
  • Will not increase the byte count, since using the single-byte/unprintable characters is still an option.

@ghost
Copy link

ghost commented Oct 8, 2016

Unicode have symbols for ASCII unprintables: ␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟␡

@DJMcMayhem
Copy link
Owner Author

With the addition of verbose mode this is now a non-issue. Closing now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants