Talk:Null program

From Esolang
Jump to navigation Jump to search

I redirected null quine here. I don't think a second article is necessary. --Graue 17:45, 23 Aug 2005 (GMT)

Hmmm, well, whatever.. It was clear in my opinion and probably didn't take much space. Besides, it's not entirely the same thing. :p --User:Keymaker
I agree that they should be merged, but shouldn't the text from Null quine be included in this article then? --Rune 19:36, 23 Aug 2005 (GMT)
Well, include it then. --Graue 06:30, 25 Aug 2005 (GMT)

Another definition or two

The old Cat's Eye page defines "null program" like this:

If a program is a series of instructions, then the null program is a series of zero instructions. The null program has some interesting properties, not the least of which being that it's simultaneously written in many languages and many paradigms...

Having zero instructions isn't the same as the source code being empty. For example, the C program


is a series of zero instructions, and is therefore a null program according to that definition, albeit not according to the definition that's been used in the article.

More generally, there are programs that essentially do nothing, though cannot be objectively said to have zero instructions even if they are the simplest do-nothing program in a given language. I seem to have used "null program" in this sense at some point. Take, for example, Unlambda


or Befunge


both of which you could claim have one instruction, or the more involved LOLA


What do you guys think about the terminology? ISTM the phrase "null program" is ambiguous and we ought to use terms that are more specific.... -- Smjg 22:27, 27 June 2008 (UTC)

In my terminology the null program stands for a program that is completely empty, a string of zero characters. To me programs like the mentioned Befunge program, even if it does nothing but terminates itself, are what I consider as meaningful esoprograms (hehe). So, to me it's only about the program length. But indeed, certain types of programs are lacking terms. Perhaps programs that do nothing yet still have characters in them could be called nonmeaningful programs or something like that. Drawing the line is difficult... Let's say in a language there's instruction "!", which is a NOP. Then program
basically does nothing. Is executing NOP instructions count? Or, if for example a language skips/ignores characters that aren't instructions? And what about comments? Perhaps there should be something general term for this kind of programs, as I suggested a few sentences back. --Keymaker 20:45, 28 June 2008 (UTC)
I think programs that don't have any commands doing anything should be called null programs, and blank files should be called blank programs. If a program consists of just the identity functions, or NOP, or comments, is a null program. Programs with actual commands that do something, even if they never get executed, are non-null programs. An empty file is a blank program (or it might be just invalid, depending on the programming language in use) --Zzo38 21:15, 28 June 2008 (UTC)
So if you add a function to the C example, but keep main empty, then that's a non-null program? Whether it makes sense to count just the identity function depends on the language. In Lazy K, for example, just the identity function (or even the empty program) is the cat program. Indeed, is there a such thing as a null program (in your sense) in languages such as Lazy K and LOLA?
JTAI, this has made me think of another concept: the most trivial program in a given language. This would be the empty program in those languages where it's a legal program, and the identity function in various functional languages, i in Iota, and so on. What do you think? -- Smjg 17:34, 29 June 2008 (UTC)
That is another good concept. --Zzo38 19:14, 29 June 2008 (UTC)
I guess a blank program in Lazy K is a null program because the program doesn't actually do anything. Instead, the interpreter passes the input to the program for processing, processes it and then outputs the result. No processing is done in the Lazy K program, the I/O is separate from the program. This may not apply to other esoteric programming languages though. --Zzo38 20:39, 10 January 2009 (UTC)
What about a Malbolge program that's nothing but NOPs? Some of them would turn into non-NOPs the second time round, I think. --ais523 13:15, 30 June 2008 (UTC)