DJMcMayhem / V

A golfing language inspired by everybody's favorite text editor, vim.
77 stars 9 forks source link

Unprintable characters! #2

Closed DJMcMayhem closed 7 years ago

DJMcMayhem commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 7 years ago

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.

ghost commented 7 years ago

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

DJMcMayhem commented 7 years ago

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