"Nothing" interpreter/compiler This is an implementation of the Nothing programming language. The language spec is as follows:


  Design philosophy
  
  In the current software industry focus lays on solving complex
  problems by using complicated algorithms. The language "Nothing" was
  created to shift this focus from complex problems towards the
  expectations of the programmer and the user. This way even the most
  complicated programming challenges swiftly disappear as if they never
  have existed before. Basically, the main strengths of the language
  "Nothing" are:
  
  
  to create bug-free and portable software https://esolangs.org/wiki/Nothing
  to shift focus from complex technical solutions towards the expectation of the programmers and users
  
  
  Program structure
  
  Nothing has a very simple and straightforward structure. It is a
  typeless language which does not use any of the known programming
  constructs like loops, choices and the like. It is the only language
  which can be considered 1GL, 2GL, 3GL, 4GL and 5GL all at the same
  time.


What I would like to know:


Does my program conform to the language specs?
Does it follow the design philosophy?
Readability, performance, etc. Any improvements welcome


Source code:

/*
 * A 'Nothing' compiler
 * &lt;http://www.turtle.dds.nl/nothing/&gt;
 * September 2010, RoPe Development Inc.
 *
 * Author: authorname
 */

#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;cstdlib&gt; // EXIT_FAILURE
#include &lt;string&gt; // std::char_traits&lt;char&gt;::eof

int main(int argc, char* argv[])
{
    if (argc &lt; 2)
    {
        std::cerr &lt;&lt; "nothing: fatal error: no input files\n";
        std::cerr &lt;&lt; "compilation terminated.";
        return EXIT_FAILURE;
    }

    std::ifstream program(argv[1]);

    if (!program)
    {
        std::cerr &lt;&lt; "nothing: error: " &lt;&lt; argv[1] &lt;&lt; ": No such file or directory\n";
        std::cerr &lt;&lt; "nothing: fatal error: no input files\n";
        std::cerr &lt;&lt; "compilation terminated.";        
        return EXIT_FAILURE;
    }

    if (program.peek() != std::char_traits&lt;char&gt;::eof())
    {
        std::cerr &lt;&lt; "nothing: fatal error: program is not empty\n";
        std::cerr &lt;&lt; "compilation terminated.";
        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}


Example:

# bash
$ touch helloworld.not
$ ./nothing helloworld.not
$
This line here:


return EXIT_SUCCESS



Is equivalent to this:

return 0;


Which is automatically inserted by the compiler if it isn't found. In short, return EXIT_SUCCESS can be removed.

In addition, a few of your error messages don't include a newline at the end, as seen in this line here, and two other places:


std::cerr &lt;&lt; "compilation terminated.";



I'd just add a newline to the end of the output string to not annoy the user when the program completes/fails, like this:

std::cerr &lt;&lt; "compilation terminated.\n";


Instead of requiring the user to provide a file in the command line arguments, you can just do, well, nothing. This is the language Nothing after all. This means that this piece of code here:


if (argc &lt; 2)
{
    std::cerr &lt;&lt; "nothing: fatal error: no input files\n";
    std::cerr &lt;&lt; "compilation terminated.";
    return EXIT_FAILURE;
}



Can just become this:

if (argc &lt; 2)
{
    return 0;
}


Other than those two nitpicks, there really isn't much else for me to review here. As far as I can tell, you've followed the language specification just fine, and produced some readable code.