home comics writing pictures archive about

2015-07-04 - Hello

I’ve recently finished rewriting the code viewer to be a command line application. The main reason for doing this was to make it easier to debug and improve. While making the command line version I changed some things so now I have to port those changes back to the web. Then I can test issues in the command line version and improve both in unison.

A side benefit of the command line version is that I can easily generate formatted code snippets. That means if I wanted to show how to write “Hello” to the console in C# I could just ask the program to format that snippet and then include it in the page like this.

Console.WriteLine("Hello");

Or if I wanted to do it in C.

printf("Hello\n");

Or Java.

System.out.println("Hello");

Or even MS-DOS x86 Assembly

mov ax, 0200h ; DOS function: Write to file or device
mov dl, 48h ; H
int 021h
mov dl, 65h ; e
int 021h
mov dl, 6Ch ; l
int 021h
mov dl, 6Ch ; l
int 021h
mov dl, 6Fh ; o
int 021h
mov dl, 0Dh ; \r
int 021h
mov dl, 0Ah ; \n
int 021h

I’ve started a page to collect some small “Hello” programs. The plan is to add to it as I learn new languages.

Comments: