“Hello world” quiz answers

Matthew Cosier was the first person to post correct answers to all my Hello, World quiz questions, good work Matthew!  Here are the answers with some details and links:

  1. System.Console.WriteLine(“Hello World!”)
    Visual Basic .NET – note the lack of a semi-colon <grin>
  2. write(‘Hello world’),nl.
    Prolog – an older (but cool) logic programming language.  Prolog makes it incredibly easy to solve certain classes of logic problems (especially constraint satisfaction problems).  Using a domain-specific language like Prolog for a problem it is good at really makes you recognize the value of being a multi-lingual developer.  I’ve heard of one project (scheduling) that took a week or so to build in C++, and a few hours to re-implement in Prolog. Unfortunately, I’m not aware of any commercial-grade .NET implementation, but there is an academic Prolog to C# translator called P#.

  3. std::cout << “Hello World!” << std::endl;
    C++, where Microsoft Visual C++ with managed extensions is of course the .NET implementation.
  4. .” Hello, world!” CR
    Forth – an older (but not cool) low-level programming language.  I was forced to write an assignment in Forth in University – an experienced that helped me to truly appreciate the benefits if higher-level languages <grin>.  Detla Forth .NET is a shareware .NET implementation.
  5. Ada.Text_IO.Put_Line (“Hello, world!”);
    Ada (obviously) – an interesting language which was engineered in the 70s from the ground up (by the US department of defence) for building highly-reliable embedded and real-time systems.  Ada still has a strong following, and I think today’s mainstream languages could benefit a lot from some of the ideas (strong type safety, built-in concurrency support, etc.), championed by Ada.  A# is an academic project to run Ada code on the CLR – although (despite my pride in our product), I wouldn’t suggest you go moving your nuclear missile silo control applications over to running on the CLR <grin>.
  6. ldstr “Hello World!” call void [mscorlib]System.Console::WriteLine(string)
    Common Intermediate Language (CIL/MSIL) – the input to the CLR, and yes IlAsm.exe doesn’t seem to care whether I put a newline in there.
  7. io.put_string(“Hello, world!%N”)
    Eiffel – a modern object-oriented language with an emphasis on reliability through the “design by contract” development philosophy.  In my opinion, there are some very important ideas here (I’m reading Bertrand Meyer’s classic book “Object Oriented Software Construction” now).  Eiffel is one of the CLR’s most important language partners (some aspects of Generics in Whidbey were added largely for the sake of Eiffel).
  8. System.Console.WriteLine(“Hello World!”);
    C# (or J# etc.)
  9. string* s = {yield return “Hello”; yield return “World!”;}; s.{Console.WriteLine(it);};
    Cω (Comega) – An extension to C# from Microsoft Research (based on Xen, X# and polyphonic C#).  Cω adds powerful support for data access (including integrating SQL and XML) and interesting concurrency abstractions.  Expect to see a number of future blog entries here about Cω.
  10. (display “Hello, world!”) (newline)
    Scheme – an older but very simple and elegant functional language.  Every computer-science student should have to write some programs in Scheme (or other variant of Lisp) and read the classic textbook “The Structure and Interpretation of Computer Programs” (sadly, I was permitted to graduate without ever reading this elegant text, but I’ve recently corrected that error in my education).  The Hotdog scheme compiler can target .NET.

 If you’ve read this far, then you might be interested in this catalog of “Hello World” programs.  Sadly, I didn’t find it until after I had written most of my quiz <grin>.  I also like this Programming Languages Timeline, and here is a list of .NET-based language implementations.  Anyone else have any good links like this?


Comments (10)

  1. Hello World in Brainfuck, (c) 2004 Me










  2. Un link interessante su Wikipedia . Il programma più famoso del mondo, scritto in una miriade di linguaggi

  3. Rick Byers says:

    When people start using C# generics for the first time, they are sometimes surprised that they can’t