Live data from Hacker News

What's this programming language?

demo.nithinbekal.com

21–30 of 36 posts

Re: What's this programming language?

#21
post #4

Just tried it out with brainfuck( http://en.wikipedia.org/wiki/Brainfuck )! ++++++++++[>+++++++>++++++++++>+++>+ ++.>+.+++++++..+++.>++. .+++.------.--------.>+.>. XML or django. then again this could be anything. :P

The app depends on highlight.js which currently supports a limited set of languages, and unfortunately, Brainfuck isn't one of them.

http://softwaremaniacs.org/media/soft/highlight/test.html

I wonder what would happen to the accuracy of highlight.js highlightAuto method if more languages were to be supported. Highlight.js recognizes languages based on how many language constructs it can recognize. More languages = more overlap in language constructs, and therefore more likelihood of wrong matches.

Re: What's this programming language?

#25
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}

(APL Code for Conway's Game of Life, taken from Wikipedia) Recognized as Haskell.

This X[⍋X+.≠' ';] is AVRASM or CSS.

UPDATE: It gets better: INTERCAL (the despotic programming language) is recognized as Delphi or SQL. This seems suitable for Delphi ;) (Here's the code: http://cxg.de/_01a19b.htm)

Re: What's this programming language?

#26
post #19

var str="hello world"; This looks like xml. It could also be django, though. I'm not completely sure. //--------------------- How come Django is a programming language?

It's in the same sense that PHP is a programming language -- Django has its own idiomatic templating language with loops and other such constructs. It looks like this:

    {% extends "base.html" %}
    {% block title %}My amazing blog{% endblock %}
    {% block content %}
        {% for entry in blog_entries %}
            {{ entry.title }}
            

{{ entry.body }}

{% endfor %} {% endblock %}
As for why this thing can't recognize "it looks like HTML + JS", I can't answer that for you -- but there should be a family of responses; "HTML + PHP," "HTML + Django", "HTML + JS" etc.

Re: What's this programming language?

#27
I put this:

  with Ada.Text_IO;

  procedure WTF
  is
  
    type X is array (Positive range ) of Integer;

    procedure Print (N: X)
    is
    begin
      for I in N loop
        Ada.Text_IO.Put_Line
          (File => Ada.Text_IO.Standard_Output,
           Item => Integer'Image (N (I));
      end loop;
    end Print;

  begin
    null;
  end WTF;
And it can't recognize Ada :) Even when you use standard library. "This looks like VHDL." "It could also be a VBSCRIPT, though I'm not completely sure"

Re: What's this programming language?

#28
Nice idea, but the quality and/or the breadth of languages it knows about leaves much to be desired.

The first language I tried was Forth. I have yet to find a piece of code that it recognizes as such. For example the example from http://c2.com/cgi/wiki?ExampleForthCode gets a 'VHDL, could also be VBSCRIPT'

My next attempt was PostScript. I copied http://www.science.uva.nl/~robbert/ps/bluebook/program_01.ht... (which starts with the giveaway line "%!PS-Adobe-2.0"), and it says 'RUBY, could also be MEL'

I guess that the thing would look better of with some kind of thresholding that allows it to say 'I don't know, but if I had to guess, I would say RUBY or MEL' instead.

Post reply on HN