The Site of a Hundred Languages

Silent film star [Lon Chaney] had the nickname “man of a thousand faces.”  The Try It Out website (tio.run) might well be the site of a hundred languages. Well, in all fairness, they only have 97 “practical” languages, but they do have 172 “recreational languages” but the site of 269 languages doesn’t trip off the tongue, does it? The site lets you run some code in each of those languages from inside your browser.

By the site’s definition, practical languages include things like C, Java, Python, and Perl. There’s also old school stuff like FOCAL-69, Fortran, Algol, and APL. There’s several flavors of assembly and plenty of other choices. On the recreational side, you can find Numberwang, LOLCODE, and quite a few we’ve never heard of.

The site is interesting if you are wanting to compare languages or try out a snippet of code you found online. For practical use, it probably isn’t going to help you much. Some languages lend themselves better than others to the site’s simplistic interface.

When you select a language you’ll go to a page that looks the same no matter which one you chose. You can enter compiler flags and–of course–your code. You can also enter a header and a footer. It isn’t really clear what the advantage of that is over just having one big blob of code. There’s no way to put in additional files like headers, other source files, or anything. Just those three text boxes.

There are separate boxes to provide standard input and command line options to your program. When you press the play button at the top of the page, the output appears in another text area and an area labeled debug give you statistics about the compile, not a way to debug your program. You do get error messages there, though, if there are any.

The site is free from ads and other nonsense other than a call for donations and a plug for their web host on the main page. If you wanted to set something up like this on your own server–perhaps for classroom use–it is open source, so you could. We’d love to see a bunch of old retrocomputer languages set up like this.

If you want a hardware version of one of the more offensively-named recreational languages, there’s an Arduino shield for that. If you use the site to write some killer FOCAL-69 code, perhaps we can interest you in a Raspberry Pi based PDP 8.

32 thoughts on “The Site of a Hundred Languages

    1. I promote banning all recreational languages.
      Only languages with medical applications should be permitted, and then only under very tight federal oversight.

      Getting caught with a Whitespace script three times should be a life sentence.
      A Whitespace script longer than 1kb should carry a minimum sentence of 15 years.

  1. Tested the C++ interpreter with a simple bog standard hello world program:

    #include
    //include directive may be misinterpreted as a filterable HTML tag on HaD...
    //My first hello world
    class program
    {
    public:
    program()
    { printf("\nHello World");}
    };

    program p;

    int main() { return 0;}

    Yep it works fine.

    1. Forgot, my buggy code is missing a pointless volatile variable:

      volatile int pointless_return_variable=0;

      int main() { return pointless_return_variable;}

      Ah, that’s better.
      Bug free now.

        1. I learnt the cout method from a book, copied it letter for letter into the recommended compiler version and it compiles. Tries it on a slightly newer compiler and I’m aparently not defining cout or that unknown operator "<<" before ";" kind of error appeared.
          I learnt that I can no longer use using std:: on that compiler or any of that era….
          So my cout just got an std:: !!!!
          Then other things broke….. and I stick to using the minimal C++ extras in my “Programs”…. C but with class so to speak

          1. Innuendos and puns not intended.

            Example:
            cout << "\nhello world\n";
            becomes:
            std::cout << "\nhello world\n;

            and at one point I think the requirement went something like:
            std::cout << "\nhello world\n << end;

            or something like that.

          2. As someone else pointed out, either use std:: or do a using namespace std to set the default. Oh. You said the compiler doesn’t let you anymore. Which compiler?

          3. Can’t remember what one, DJGPP was one that worked one version then not the next…
            I think one of the GCC compilers on an Ubuntu release… can’t remember what one, hint:
            The one that was so buggy and glitchy where phantom icons appeared on the gnome like bars and they couldn’t be removed…
            also the compiler couldn’t even compile in a straight line…. seemingly nothing would compile.

            Other buggy distros at that time had not got any GCC or was broken…. Went back to debian for a while longer with kernel 3.2.65.
            I’m writing this now on said Debian+Linux 3.2.65 install until I can afford another 1TB SSD or Maplin halves the SSD price in another sale (I got mine when it became cheaper than anywhere else online at a Maplin sale). Then I can migrate to a more modern OS… likely an Arch-linux compatible OS as Manjaro (Arch based) works fine on my tablet PC (Except PulseAudio).

    2. My long time test program for something new is a hi lo game where it guesses your number. You prompt for the user to guess a number between 1 and 1024. That’s your limits. You guess the midpoint and ask if it is high or low or correct. Then update your limit and go again (unless you were right). Basically, you are binary searching. You’ll get it right in 10 tries or less.

      Forces you to exercise input/output, simple math, and it is mildly amusing.

      1. Here you go (let’s see if the pre tags work in comments — nope… sigh)

        #include <iostream>                                                                             
        #include <cstdlib>                                                                              
                                                                                                        
        // Result of our guess                                                                          
        enum RESULT                                                                                     
          {                                                                                             
            g_high,                                                                                     
            g_low,                                                                                      
            g_correct                                                                                   
          };                                                                                            
                                                                                                        
                                                                                                        
        class guesser                                                                                   
        {                                                                                               
        protected:                                                                                      
          int low;   // current idea of low                                                             
          int high;  // current idea of high                                                            
          int count;  // number of guesses                                                              
        public:                                                                                         
          guesser(int low=1, int high=1024);  // sets range of guessing                                 
          int guess(void);   // give the user a guess                                                   
          int setResult(RESULT r);   // find out how the guess went (returns count)                     
        };                                                                                              
        
        
        guesser::guesser(int low, int high)                                                             
        {                                                                                               
          this->low=low;                                                                                
          this->high=high;                                                                              
          count=1;                                                                                      
        }                                                                                               
                                                                                                        
        int guesser::guess(void)                                                                        
        {                                                                                               
          return (high+low)/2;  // guess in the middle                                                  
        }                    
        
        int guesser::setResult(RESULT r)                                                                
        {                                                                                               
          if (r==g_correct) return count;  // yay!                                                      
          if (r==g_high) high=guess();   // adjust high or low accordingly                              
          if (r==g_low) low=guess();                                                                    
          count++;                                                                                      
        }           
        
        int main(int argc, char *argv[])                                                                                                                                              
        {                                                                                                                                                                             
          guesser g;                                                                                                                                                                  
          std::cout<<"Think of a number from 1-1024\n";                                                                                                                               
          do                                                                                                                                                                          
            {                                                                                                                                                                         
              char res;                                                                                                                                                               
              std::cout<<"I guess your number is "<<g.guess()<>res;                                                                                                                                                          
              switch (res)                                                                                                                                                            
                {                                                                                                                                                                     
                case 'c':                                                                                                                                                             
                case 'C':                                                                                                                                                             
                  std::cout<<"I got it in "<<g.setResult(g_correct)<<" tries!\n";                                                                                                     
                  exit(0);                                                                                                                                                            
                  break;                                                                                                                                                              
                case 'h':                                                                                                                                                             
                case 'H':                                                                                                                                                             
                  g.setResult(g_high);                                                                                                                                                
                  break;                                                                                                                                                              
                case 'l':                                                                                                                                                             
                case 'L':                                                                                                                                                             
                  g.setResult(g_low);                                                                                                                                                 
                  break;                                                                                                                                                              
                default:                                                                                                                                                              
                  std::cout<<"Invalid response, try again!\n";                                                                                                                        
                }                                                                                                                                                                     
            } while (true);                                                                                                                                                           
          return 0;                                                                                                                                                                   
        }       
        
        
        1. error: expected primary-expression before β€˜>’ token
          std::cout<<"I guess your number is "<<g.guess()res;

          Not sure if “” is some crazy shorthand I’m not familiar with, but I got it to work by using:

          std::cout<<"I guess your number is "<<g.guess() << std::endl;
          std::cout <> res;

  2. Ah… no WSL, Waterloo Systems Language. Mind you, it may not fall under practical or recreational as it was a language that the University of Waterloo used to teach program… don’t rightly know if it escaped into anything in production or not.

  3. No BASIC? I’m stunned. Certainly it should be counted among the recreational ones at least. Surely there’s an implementation somewhere they could hook up to this.

  4. Can’t remember what one, DJGPP was one that worked one version then not the next…
    I think one of the GCC compilers on an Ubuntu release… can’t remember what one, hint:
    The one that was so buggy and glitchy where phantom icons appeared on the gnome like bars and they couldn’t be removed…
    also the compiler couldn’t even compile in a straight line…. Here you go (let’s see if the pre tags work in comments — nope… sigh)

    #include <iostream>                                                                             
    #include <cstdlib>                                                                              
                                                                                                    
    // Result of our guess                                                                          
    enum RESULT                                                                                     
      {                                                                                             
        g_high,                                                                                     
        g_low,                                                                                      
        g_correct                                                                                   
      };                                                                                            
                                                                                                    
                                                                                                    
    class guesser                                                                                   
    {                                                                                               
    protected:                                                                                      
      int low;   // current idea of low                                                             
      int high;  // current idea of high                                                            
      int count;  // number of guesses                                                              
    public:                                                                                         
      guesser(int low=1, int high=1024);  // sets range of guessing                                 
      int guess(void);   // give the user a guess                                                   
      int setResult(RESULT r);   // find out how the guess went (returns count)                     
    };                                                                                              
    
    
    guesser::guesser(int low, int high)                                                             
    {                                                                                               
      this->low=low;                                                                                
      this->high=high;                                                                              
      count=1;                                                                                      
    }                                                                                               
                                                                                                    
    int guesser::guess(void)                                                                        
    {                                                                                               
      return (high+low)/2;  // guess in the middle                                                  
    }                    
    
    int guesser::setResult(RESULT r)                                                                
    {                                                                                               
      if (r==g_correct) return count;  // yay!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s