8 ms·
What's That Programming Language?
- angerman 14y agosomewhere in the upper 70s it starts being undefined... Confused Delphi with Pascal, and then missed Pascal m( Interesting though :D
- jcfrei 14y agocool idea. but add a submit button, or listen for enter key. right now clicking on the language of choice doesnt always work.
- chimeracoder 14y agoI thought that too, but it turns out I was confusing two Lisp dialects. At least on Chrome, as soon as you type the correct name, it continues to the next language.
- Figs 14y agoIt automatically advances when you get the answer right. If it's not advancing, you're probably entering the wrong language (even if you think you're right; there are a lot of similar looking, but obscure languages in there). I agree that it would be nicer if the author made it more obvious as to how it worked though.
- jcfrei 14y agoah, I see. that's why it never worked, apparently I guessed most of them wrong ;)
- mehulkar 14y agoDoesn't work for me on Linuxmint. Can't submit for some reason?
- sebphfx 14y agoI m on Mint and it works.LMDE though. Chrome.
- _delirium 14y agoSame here on Chrome on OSX. Can click "forfeit", but I don't see a "submit" button, and hitting enter doesn't do anything.
- RBerenguel 14y agoThe app clears as soon as it's right. If you are not getting it... Well, there are things that look like Lisp, C or Forth and aren't :/
- banter 14y agoRunning Chrome on OSX, too. If the input text is correct, it is automatically submitted and you move on to the next language sample. If you haven't typed the correct answer, nothing happens and you can either keep guessing or forfeit. Edit: Darn, was beat to it.
- Edootjuh 14y agoIt auto-submits when you type the right language.
- prof_hobart 14y agoI feel this could do with an Easy/Medium/Hard option. I've been programming for about 30 years and I can honestly say I've never heard of Falcon or Piet.
- richbradshaw 14y agoMy guess for Falcon was Eagle, and my guess for Piet was Mondrian... I'm getting there! :)
- dkersten 14y agoI used Falcon for a very short time about a year and a half ago yet I got it wrong... OT: Falcon is actually a pretty interesting little language.
- andrewflnr 14y agoGreat, what I need right now is not to get into another language... Seriously though, thanks for the tip, it does look pretty interesting.
- fullmoon 14y agoThe Lisps sure aren't easy
- jarel 14y agoScore: 30/52 (57.69%) Damn, I thought I was good at this. edit: 46/77 I guess, after 75 it's only undefined (so my score should probably be 46/75)
- dewiz 14y ago"That" is a form that doesnt work on ipad ;) please add a submit button, thanks
- jontro 14y agoWorks for me on ipad
- tomp 14y agoPlease accept the answer "SML" for "Standard ML" as well.
- ajuc 14y agoAgreed.
- jamesjyu 14y agoYes, this got me too :)
- mahmud 14y agoI guessed SML & Ocaml on an option. No dice. Had to forfeit a good score.. it was F# ;-)
- chris_wot 14y agoIt's not called SML at Rosetta Code. See here: http://rosettacode.org/wiki/99_Bottles_of_Beer http://rosettacode.org/wiki/99_Bottles_of_Beer Not sure how they would get around this one.
- chc 14y agoCreate a map of synonyms and run the user's input through it before doing the match?
- adrusi 14y ago38/75 (50.67%)
- ziedaniel1 14y ago40/75 (53.33%) Wow, there are so many languages I still need to try.... I'm proud I got ones like Piet, Io, and Racket, though.
- pepijndevos 14y agoIt seems most people score around 50%, did anyone get a really high score? I like it that you can clearly see several "streams" of syntax. That does make it hard to find the correct C family.
- bitops 14y agoI worked with one person who I think could probably get a pretty high score. He was always talking about crazy esoteric languages that I'd never heard of - but then again, he was working on his own programming language in his spare time. So language enthusiasts or compiler writers would probably score better.
- bruceboughton 14y agoI thought this was going to be a tool where you paste in some code and it tells you which programming languages it could be written in. It would be interesting to see how much code you need to be able to accurately identify the language.
- maybird 14y agoI second that. I'd also love to see a tool which would allow you to provide a binary and tell you what built it.
- Dinoguy1000 14y agoTrID[1] has a number of definitions for various executable files, but it's designed for general-purpose file format identification. PEiD[2] is built specifically for identifying packers, compilers, etc. for PE files, and should therefore be able to identify a far wider array of them (the site claims it detects over 600 PE signatures), but I've never done any checking myself, and the project unfortunately seems to be discontinued. [1] http://mark0.net/soft-trid-e.html http://mark0.net/soft-trid-e.html [2] http://www.peid.info/ http://www.peid.info/
- deleted 14y ago[deleted]
- keeperofdakeys 14y agoBesides certain languages with special keywords, the easiest way would be to send it through syntax checkers iteratively. You could probably have generic "C-style" and "common lisp style" types of checks, then you would have to actually look at api commands. The latter method would be rather problematic.
- isagalaev 14y agoThis is basically what highlight.js does indeed :-)
- jakubw 14y ago
- TazeTSchnitzel 14y agoI felt terrible each time I didn't recognise a language I'd used. Makefiles, Delphi and Batch files, to name three.
- Agathos 14y agoHeh. I've never used Delphi and I got that one. Thank goodness for learning Pascal in high school, I guess. (And reading somewhere that Delphi is related.) I missed Erlang, even though I have a copy of Programming Erlang somewhere. Guess it didn't take.
- dkersten 14y agoI tried guessing Pascal and Modula and a few more for Delphi. I was thinking to myself "what other languages look like Pascal" and in the end gave up. Felt really dumb then when it turned out to be Delphi. The other one where this happened was F#. I tried OCaml and Snandard ML and was thinking "this HAS to be OCaml..." and again, felt silly for not thinking of F#.
- TazeTSchnitzel 14y agoI got Standard ML confused with F#, then when I saw F# I got it right. When I restarted the thing, hoping to get a better score, I thought it was Standard ML... gave up, and found out it was F#. Boy am I smart.
- mihaifm 14y agoI missed a lot of easy ones too. At some point you get bored and just click Forfeit without paying too much attention.
- writetoalok 14y agoAnd I felt sick that I got as high as 25% of them. I think it is better to know just a few of them very well. However the ones I use everyday I got immediately ... What is interesting is so many languages look like C or Lisp or ML or its variants.
- freeazy 14y agoBrainfuck http://i.imgur.com/9DiTe.png http://i.imgur.com/9DiTe.png
- Edootjuh 14y ago21/75. It returns undefined after 75.
- 2ck 14y ago"Oh, you can identify 33 programming languages at a glance? Aren't you clever."
- agumonkey 14y agoAh I hit a bug where the page didnt redraw, I thought they were making a joke saying all languages are the same u__u; Languages never saw before : seed7, whenever. Happy to see my friend COBOL too.
- ajuc 14y agoI got it too, the same code for 5 languages I've never heard about, one after another. I felt ignorant, until it told me it's also valid racket :). int main(){ for(int i = 99; i > 0; i--){ write(i + " bottles of beer on the wall, " + i + " bottles of beer.\n"); write("Take one down and pass it around, " + (i-1) + " bottles of beer on the wall.\n\n"); } write("No more bottles of beer on the wall, no more bottles of beer.\n"); write("Go to the store and buy some more, 99 bottles of beer on the wall.\n"); }
- adir1 14y agoSo I've been doing relatively well, up to 12 and score of 75% - but then I hit TI-BASIC. After I chose it right, the number on the left progressed, but nothing changed in the language itself. After that, kept clicking Forfeit and counter on the left increases (as score naturally goes down), but nothing was displayed where language sample should be. I am on latest Safari on Mac. I CAN HAZ BUG FIXZ, PLZ? But seriously, tons of crazy languages out there - I wonder if it is because we each want to have our own? I know I put together one or two myself, over the years :)
- strager 14y agoSame happened to me at "Bash". Chrome 18 stable, OS X.
- andkerosine 14y agoAuthor here. Sorry for nipping your adventure short, but I caught sight of how fast the logs were scrolling, noted the HN referrer, and decided it'd probably be best to stop requesting the next code block from the server and just store everything client-side. With almost 10k uniques in ~16 hours, I imagine I've gone well over the 750 free dyno hours with this one. Oops...
- adir1 14y agoAwesome work, either way! Very impressive collection of language samples. It would make great post to tell us how you put this together, especially where these code samples were from and anything else of interest. Kudos!
- andkerosine 14y agoHow I wish I could say I speak 70+ programming languages, but alas, they're all from Rosetta Code.[1] I would like to show a variety of "tasks", as the site calls them, but scraping seems like it would be a pain, so I went with the most interesting problem with a solid number of samples. As for the architecture, it's pretty much just a Ruby hash from language to code, and then a bit of CoffeeScript to glue everything together. [1] http://rosettacode.org/wiki/99_Bottles_of_Beer http://rosettacode.org/wiki/99_Bottles_of_Beer
- bitops 14y agoShould be case-insensitive. I put 'awk'.
- vitno 14y ago20%... ouch
- nilium 14y agoI sure missed a lot of those, but at least I got Intercal right. That's probably a bad thing, now that I think about it.
- bitops 14y agoIt'd be fun to see the complete list of languages. I was clicking 'Forfeit' to see if Mercury was included.
- turshija 14y agoYou can see the list of languages in .js file stored in `langs` variable: http://wtpl.heroku.com/js/engine.js http://wtpl.heroku.com/js/engine.js
- andkerosine 14y agoWhat with that link just sitting there out in the open, I want to clarify that it's transpiled CoffeeScript and that the original[1] is far more sane. [1] http://wtpl.heroku.com/js/engine.coffee http://wtpl.heroku.com/js/engine.coffee
- zbowling 14y ago"transpiled" is not a word found in any dictionary I know.
- andkerosine 14y agoLanguage constantly evolves, and I reckon there's certainly enough room for "transpile" somewhere in that process. CS -> JS isn't quite translation (much of it stays the same) and it's hardly compilation (but that seems to be the accepted term), so I feel "transpile" is perfectly suited.
- igorgue 14y agoLisp, Clojure, Racket, Scheme! Every time I saw a Lisp dialect...
- Tyr42 14y agoPlease, if you show me a list of things, let me use my arrowkeys. Also, can you finish more gracefully than giving my undefined?
- zootm 14y agoThat is annoying. Also irritating is the fact that the quiz seems to stop accepting answers after a couple of questions for me; in both Chrome and Firefox so far. I want so desperately to get a score! Edit: Actually, it just turns out (after reading the source) that in some cases it just won't accept the answer if it's wrong. I did the honourable thing and selected "Forfeit", allowing me to continue :)
- andkerosine 14y agoI know auto-accepting only the correct answer is a pretty unorthodox way to do it, but I initially took to making this to familiarize myself with the various syntaxes, and it's the approach I tend to opt for when teaching myself things by rote (notably the Japanese kana and one to ten in all sorts of spoken languages) and it seems to work pretty well. Something about pressing Enter or a "submit" button breaks the neural flow for me; I tend to recall things much more effectively when I become a "constant input stream", for lack of a better phrase. Apologies if it doesn't quite suit you.
- zootm 14y agoIt was more the cases where I was wrong, rather than right. Some feedback indicating that the form could not be submitted, and one needed to press "forfeit", would have been appreciated, if only because it is not the way web forms work. It's a small thing (and I did like it once I realised how it worked) but when doing things in an unusual way a little bit more guidance is required at first. Enjoyed the quiz!
- andkerosine 14y agoBut "undefined" is such a beautiful terminus; what lies beyond the horizon is entirely up to your imagination. : ) Also, I opted for Tab completion instead of arrow keys; it's much faster and far less finicky to implement robustly.
- luv2code 14y agoScore: 75/75 (100.00%) Looking at the source in a programming challenge is still winning, right?
- deleted 14y ago[deleted]
- eddie_the_head 14y agoThe APL font there is rendering strangely for me, it was the first one posed to me and I recognized it, but a lot of the symbols were rendering as unicode letters with umlauts and other errors. edit: I just finished, 63/75
- colinmarc 14y agoThat last language is REALLY concise.
- andkerosine 14y agoWhich do you mean? They're scrambled randomly at the start.
- FreeFull 14y agoI got 20/76 (26.32%) and now all it's displaying is "undefined". I assume this is the end, it would be nice to have a dialog box or something similar say that though.
- ajuc 14y agoThat was surprising: http://en.wikipedia.org/wiki/Chef_(programming_language) http://en.wikipedia.org/wiki/Chef_(programming_language)
- nmb 14y agoI was totally surprised to see that on there too! I love the creator's webcomics too, in high school they were my first introduction to several science/math concepts (the square-cube law and cryptography to name a few). http://www.irregularwebcomic.net/ http://www.irregularwebcomic.net/
- b0rsuk 14y agoI had no idea SNUSP is so whimsical. Brilliant !
- andkerosine 14y agoTo think that Brainfuck * Befunge could be anything but a disaster.
- raverbashing 14y agoThere are real challenges there! Hence 21/76 (27.63%)
- robert_nsu 14y agoApparently I suck pretty bad. I got ML, Ocaml, and F# confused.
- wazoox 14y ago28/75 but I managed to to fail at recognizing bash I use daily, shame on me :)
- ptc 14y agoCheat Code, activated: http://rosettacode.org/wiki/99_Bottles_of_Beer http://rosettacode.org/wiki/99_Bottles_of_Beer
- andkerosine 14y agoThe person on a high score list of one is in both first and last place. Zen to remember.
- olliesaunders 14y ago36/75. I honestly had no idea I knew of so many languages.
- GigabyteCoin 14y agoIs this in almost-alphabetical order? I have clicked "forfeit" approximately 10 times, and all returned languages were AAABABBBCBCCCCC-esque if you know what I mean?
- andkerosine 14y agoThe culprit: Array::shuffle = -> @sort -> 0.5 - Math.random() was just too damned sexy to pass up, but it's apparently pretty bad at distribution. Running it ten times seems to have helped. : )
- pubby 14y agoI think I got every esoteric one correct but knew only a handful of actual languages. Guess I should change my priorities.
- groovy2shoes 14y ago60/75, awww right :) Cool app, it's pretty fun despite a few (seeming) bugs here and there. Some languages in there I've never even heard of... guess I'll have to check them out. At the same time, there are a few I can think of that aren't included... room for expansion, I guess.
- andkerosine 14y agoThe intention, ideally, is to get a system in place that allows for seamlessly adding new languages and "tasks" and open it up.
- el_presidente 14y agoThank you for making me hate lisp more than I did yesterday.
- pardner 14y agoDidn't see APL - did they include it? Maybe it was just so short I missed it.
- andkerosine 14y agoIt's definitely in there, nowhere near as short as the K and Golfscript solutions, though.
- ScottBurson 14y agoWhat? No SNOBOL?
- aufreak3 14y agoIt's not funny that languages such as Joy, AppleScript and Hypercard don't even autocomplete but haXe and xpath do. I was going to suggest putting in all names from "http://hopl.murdoch.edu.au/ http://hopl.murdoch.edu.au/ - "An interactive roster of programming languages" which used to list over 5000 iirc, but that site is now down! :(
- andkerosine 14y agoPopulating the list with answers that are irrelevant almost 99% of the time would be downright cruel.
- jblz 14y agoFun game :) 'Batch file' should accept 'batch,' imo
- gavinpc 14y agoRequires cookies. If it doesn't work at all for you, it may be because you need to whitelist the site. But I wouldn't bother.
- andkerosine 14y agoHaving written it, I can assure you that cookies are not required for it to work, and thus no whitelisting should be necessary. I think you may've had some other problem.
- gavinpc 14y agoMy mistake. It just seems broken because when you press "Enter" on an incorrect answer, nothing happens. I guess I had better luck after enabling cookies.
- nathell 14y ago45/75 (60.00%)