Ask HN: Most difficult programming language?
Curiosity here.
Lists descending in difficulty would be nice too.
16 comments
What do you mean by "difficult" here? Do esoteric programming languages like Malbolge[1] count?
"Hello World" in Malbolge:
"Hello World" in Malbolge:
('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>a=<M:9[p6tsl1TS/
QlOj)L(I&%$""Z~AA@UZ=RvttT`R5P3m0LEDh,T*?(b&`$#87[}{W
[1]: http://en.wikipedia.org/wiki/MalbolgeIf we're considering esoteric languages, Brainfuck would probably win. :)
"Hello World" in Brainfuck:
"Hello World" in Brainfuck:
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.That depends a bit on how one measures difficulty. Brainfuck is hard to read only because its operators are so limited, and is not that hard to write; for a Turing machine, it is fairly powerful, and it has [ and ] to jump around.
Intercal, IMO, is more difficult, but it would not be that hard to improve on it. For example, one could bring back the joy of delay line memory (http://en.wikipedia.org/wiki/Delay_line_memory) by having some metric for the complexity of a statement, and having the computer skip some statements depending on that complexity. Ideally (for the goal of complicating the language), the complexity of a statement would depend on the runtime values of variables. For example, 'A = B * C' is easy when C=10, a bit harder when it is 11, and harder still when C=13, unless, of course, B equals zero or one. Similarly, 'IF A > 7' is easy when A is <= 3 or >= 20, but hard for intermediate values. Of course, a true language would not use such simple notions of complexity. The complexity of 'A = B * C' should also depend on the number of binary carries (better yet, use a mixed-base number system), and, of course, the delay of 'OUTPUT X' depends not only on the length of X, but also on the question whether this flushes the output buffer.
And, of course, the only way of control flow should be something like Cobol's ALTER, all statements should be executed probabilistically, and the language should be a funge in some weird topology (while at it, change the topology when certain conditions apply (number of statements executed modulo 34567 equals 325, number of 1 bits in variable memory is a prime, it's Monday morning, but not a full moon, etc)
Intercal, IMO, is more difficult, but it would not be that hard to improve on it. For example, one could bring back the joy of delay line memory (http://en.wikipedia.org/wiki/Delay_line_memory) by having some metric for the complexity of a statement, and having the computer skip some statements depending on that complexity. Ideally (for the goal of complicating the language), the complexity of a statement would depend on the runtime values of variables. For example, 'A = B * C' is easy when C=10, a bit harder when it is 11, and harder still when C=13, unless, of course, B equals zero or one. Similarly, 'IF A > 7' is easy when A is <= 3 or >= 20, but hard for intermediate values. Of course, a true language would not use such simple notions of complexity. The complexity of 'A = B * C' should also depend on the number of binary carries (better yet, use a mixed-base number system), and, of course, the delay of 'OUTPUT X' depends not only on the length of X, but also on the question whether this flushes the output buffer.
And, of course, the only way of control flow should be something like Cobol's ALTER, all statements should be executed probabilistically, and the language should be a funge in some weird topology (while at it, change the topology when certain conditions apply (number of statements executed modulo 34567 equals 325, number of 1 bits in variable memory is a prime, it's Monday morning, but not a full moon, etc)
Writing a reasonable program in Brainfuck isn't that hard. Malborge, on the other hand, was specifically designed to be impossible to write useful programs in. IIRC, Brainfuck was designed to be easy to write a compiler for.
From the wikipedia article linked above: "Malbolge was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear. The first Malbolge program was not written by a human being, it was generated by a beam search algorithm designed by Andrew Cooke and implemented in Lisp"... "A correct 99 Bottles of Beer program, which deals with non-trivial loops and conditions, was not announced for seven years".
From the wikipedia article linked above: "Malbolge was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear. The first Malbolge program was not written by a human being, it was generated by a beam search algorithm designed by Andrew Cooke and implemented in Lisp"... "A correct 99 Bottles of Beer program, which deals with non-trivial loops and conditions, was not announced for seven years".
Brainfuck is fairly simple & regular. Malbolge is not; that would make it far more difficult.
I second Brainfuck
I recently read about BANCstar, and it seems like a good contender. 0-9, comma, minus sign and return are the only legal characters in it, and despite that, it's actually used in serious applications.
http://en.wikipedia.org/wiki/BANCStar_programming_language
Here's an article about it:
https://github.com/jloughry/BANCStar
http://en.wikipedia.org/wiki/BANCStar_programming_language
Here's an article about it:
https://github.com/jloughry/BANCStar
BANCStar is a VM. You could program the JVM or .net CIL or any real machine using only octal (0-7 and white space only!) and it would be just as bad. Most people have enough sense not to do that, though.
<insert random language> when used in a badly designed project, maintained by 10+ dev's in 15+ different styles using 20+ different external dependencies written in 25 days.
Seriously: I'd go for befunge or malebolge.
Seriously: I'd go for befunge or malebolge.
Here is my nomination, based on the criteria of having spent significant time in it: RPG-III. The opposite of awesome.
I would much rather program in assembler, such as Sigma-7.
But difficulty is kind of a vector, really.
I would much rather program in assembler, such as Sigma-7.
But difficulty is kind of a vector, really.
Ok, what non esoteric languages would one consider extremely difficult?
I mean, how "extremely difficult" are we talking? So long as it isn't esoteric, it can't be so difficult... otherwise no one would learn it, and it would become by definition esoteric...
I guess "real hard but still non-esoteric" could include * Functional ones like OCaml or Haskell (so I hear... "What are these monads you speak of?") * Super legit ones like C/C++ for systems programming * Rare and majestic ones like Lisp * Ones that require outside math knowledge like Julia or Fortran * Really new ones that don't have many packages / docs / community members yet
I guess "real hard but still non-esoteric" could include * Functional ones like OCaml or Haskell (so I hear... "What are these monads you speak of?") * Super legit ones like C/C++ for systems programming * Rare and majestic ones like Lisp * Ones that require outside math knowledge like Julia or Fortran * Really new ones that don't have many packages / docs / community members yet
Pure binary.