This forum is closed to new posts due to low activity and a deluge of spam. It is kept online as a static historical record. If you want to read about or discuss esoteric programming languages, the Esolang wiki is the place to go. An archive of the forum is available.

Non-textual languages debunked (8)

1 Name: Anonymous : 2005-11-07 16:47 ID:RcG1iuyG

The 1L_a programming language is typically loaded from text files.
Here's an example program (prints 'A'):

http://www.esolangs.org/files/1l/src/1l_a/a.1l

I have implemented a "1L_a multiple-mode interpreter" that can run 1L_a programs loaded from both text files and PNG images:

http://www.esolangs.org/files/1l/impl/1l_a_mmi.c

Here's an example (also prints 'A'; the same program as before, in fact):

http://www.esolangs.org/files/1l/src/1l_a/a.1l.png

Loading 1L_a programs from images like this is conformant with the 1L_a specification, even though this method is not mentioned explicitly:

http://www.esolangs.org/files/1l/doc/1l_a105.html

Conclusion: Only implementations can be "non-textual", not languages. Languages that make a big deal out of being loaded from images are overspecified gimmicks.

Discuss!

2 Name: Rune : 2005-11-07 20:11 ID:jLXcC3ve

Well, all computer programs are just strings of bits. Text files, images and such are just ways to make them more friendly to humans.

3 Name: Anonymous : 2005-11-07 20:24 ID:RcG1iuyG

Yes. At least in Piet, the image representation of a program is a natural one. But contrast Braincopter:

http://esoteric.voxelperfect.net/wiki/Braincopter

The way instructions are derived from the image is thoroughly unnatural and arbitrary. It would make more sense to implement a language with the same instructions, specified in a text file, and then consider Braincopter a "filter" for that language, rather than a language itself.

4 Name: Aardwolf : 2005-11-08 01:28 ID:aqb9AQkw

Braincopter and Brainloller are almost identical to Brainfuck (they're a bit more specific here and there). However, they define exactly in what format the code is to be given, so they're a sort of "standard to put brainfuck like code in an image", in my opinion.

They also add the possibility to shorten code by trying to use as many pixels as possible twice (reading vertically and horizontally), something that comes from the way the 1D bf code can be mapped in 2D.

5 Name: Aardwolf : 2005-11-08 01:32 ID:aqb9AQkw

When converting a textual language to an image based one, you still have to specify what colors mean what, so maybe we could define a standard way to convert ascii characters to pixel colors (preferably in such a way that you can easily distinguish each color) and, for 1D languages, 2 standard pixel colors that represent rotate left and rotate right.

Then by using that standard, any text language can be converted to a 2D image exactly the same way as from BF to Brainloller, without having to specify a new "language" for each of the existing languages.

6 Name: Anonymous : 2005-11-08 03:21 ID:RcG1iuyG

Well, let's see. The ASCII printable characters are 33-126; spaces are often also used, and that's 32. 126-32+1 = 95. For the 1D languages, we also need rotate left and rotate right. And for better compression potential, let's have a color for "skip the next instruction". 95+3 = 98. We need 98 colors.

int v(int n, int cl) {
return (7-(n%7)) & (1<<cl) ? ((1+(n/7))*255/14) : 0;
}

int r(int n) { return v(n,2); }
int g(int n) { return v(n,1); }
int b(int n) { return v(n,0); }

int w(int n) {
return (n*53) % 98;
}

char *color(int n) {
static char s[8];
n = w(n+3);
snprintf(s, 8, "#%02x%02x%02x", r(n), g(n), b(n));
return s;
}

void printrow(char *d, char *cl) {
printf("<tr><td>%s</td>", d);
printf("<td bgcolor=\"%s\" width=\"32\"></td></tr>\n", cl);
}

int main(void) {
char c[2] = " ";
printf("<html><body><table>\n");
for (c[0] = ' '; c[0] <= '~'; c[0]++)
printrow(c, color(c[0]));
printrow("(rl)", color(127));
printrow("(rr)", color(128));
printrow("(sk)", color(129));
printf("</table></body></html>\n");
return 0;
}

How's that look?

7 Name: Aardwolf : 2005-11-08 08:46 ID:aqb9AQkw

What about tabs and newlines? I'm sure some languages use those.

8 Name: Anonymous : 2005-11-08 17:16 ID:RcG1iuyG

Oh yeah. Then, for languages that use Tab, make the (sk) color mean Tab, instead of "skip the next instruction." Black is unused and can be newline.

This thread has been closed. You can not post in this thread any longer.