"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:
System.Console.WriteLine(“Hello World!”)
Visual Basic .NET - note the lack of a semi-colon <grin>
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#.std::cout << “Hello World!” << std::endl;
C++, where Microsoft Visual C++ with managed extensions is of course the .NET implementation.." 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.
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>.
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.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).System.Console.WriteLine(“Hello World!”);
C# (or J# etc.)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ω.(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
Anonymous
February 08, 2005
Hello World in Brainfuck, (c) 2004 Me
>++++++++>+++++++>++++++++++++>++++>
++++++++++++>+++++++++++>+++++++++++
+>+++++++++++>++++++++++++>+++++++++
+++++>+++>+++++++>++++++++++++>+++++
+++++++++++++++++>++++++++++++>+++++
+++++++++>++++++++++++>+++++++++++++
++++>++++++++++++>+++++++++++>++++++
++++++>+++>+++>++++++++[<]>
[[->++++++++<]>+.>]Anonymous
February 14, 2005
> Anyone else have any good links like this?
http://blogs.ugidotnet.org/nettools/articles/8060.aspxAnonymous
January 26, 2007
Un link interessante su Wikipedia . Il programma più famoso del mondo, scritto in una miriade di linguaggiAnonymous
August 08, 2007
When people start using C# generics for the first time, they are sometimes surprised that they can’tAnonymous
January 14, 2008
PingBack from http://seregaborzov.wordpress.com/2008/01/15/%d0%9d%d0%b5%d1%81%d0%ba%d0%be%d0%bb%d1%8c%d0%ba%d0%be-%d0%b8%d0%bd%d1%82%d0%b5%d1%80%d0%b5%d1%81%d0%bd%d1%8b%d1%85-%d1%81%d1%81%d1%8b%d0%bb%d0%be%d0%ba-%d0%bd%d0%be-%d0%bd%d0%b0%d0%b2%d1%80%d0%b0/Anonymous
January 14, 2008
PingBack from http://seregaborzov.wordpress.com/2008/01/15/some-programming-csharp-links/