Saturday, October 2, 2010

Problems and their solutions

Search time! Programming language problems and my solutions for them:
Programming language problems
Programmers are stupid -> make them users. (who are even more stupid!)
No paradigm is complete -> continuously invent new ones
Performance -> whole-system optimization
Three programming language problems solved forever (using HQ9+)
Incrementing a register: ++ (implicit stack)
Hello world: "Hello world!"
Quine: "There is no source", so quines are meaningless. But hacking up something legible won't be too hard.
99 bottle of beer on the wall:
bottlefunc = {
  0 -> "No more bottles"
  1 -> "1 bottle"
  x -> x " bottles"
}

99..0 | bottlefunc | {
  x " of beer on the wall, " tolower(x) " of beer;\n"
  (x == 0) ? "Go to the store and buy some more, " x.first " of beer on the wall."
           : "Take one down and pass it around, " tolower(x.next) " of beer on the wall."
}
Important things for a programming language to have
Unicode support: This is all about how you define a character. And, as it turns out in Unicode, there are no characters, there are only code points, integers from 0 to 10FFFF. And there are all sorts of code points that have no resemblance to characters; byte order marks, zero-width spaces, text direction overrides... such a pity that there are no conditional characters to make it Turing-complete!
Anyways, I am certain you see that Unicode is large enough to be put in its own separate library. So that is where Unicode will be, and the language will remain close to the keyboard. (which appears to be close to ASCII)
The problem Self solves
The duality between classes and instances creates a problem. But classes, as depicted in the link, are data structures. So, logically, if removing classes is a good idea, so is removing abstract data types, unions, records, and the other data structures we know and love hate.

No comments:

Post a Comment