title: Hello world in Prolog
body: <p>I'm tearing my hair out trying to find how to just write a Hello World program in Prolog.  I just want to create a program that runs like so:</p>
  
  <pre><code>&gt; ./hw
  Hello, world!
  &gt;
  </code></pre>
  
  <p>The problem is that every single example I can find works in a REPL, like so:</p>
  
  <pre><code>?- consult(hello_world).
  % hello compiled 0.00 sec, 612 bytes
  
  Yes
  ?- hello_world.
  Hello World!
  
  Yes
  </code></pre>
  
  <p>This is the same even with examples of compiled Prolog: the program still just drops into a REPL.  This is obviously not much use for a "general-purpose" language.  So, how do I write the traditional Hello World?</p>