Log in

No account? Create an account
Apr. 15th, 2011 @ 03:16 pm Funciton
               ║ Fibo ║                        
        │           ┌───────┴──────┐           
      ┌─┴─╖   ┌───╖ │ ┌───╖  ╔═══╗ │           
    ┌─┤ · ╟───┤ + ╟─┴─┤ + ╟──╢ 1 ║ │           
    │ ╘═╤═╝   ╘═╤═╝   ╘═╤═╝  ╚═══╝ │           
    │   │  ┌────┴─╖ ┌───┴──╖       │           
    │   │  │ Fibo ║ │ Fibo ║ ┌─────┴───┐       
    │   │  ╘════╤═╝ ╘═╤════╝ │      ┌──┴──┐
    │   └┐      │   ┌─┴─╖  ┌─┴─╖  ┌─┴─╖   │
  ╔═╧═╗  └┐     │   │ − ╟──┤ ? ╟──┤ ≤ ║   │
  ║ 2 ║   └┐    │   ╘═╤═╝  ╘═╤═╝  ╘═╤═╝   │
  ╚═╤═╝    └┐   └─────┘      │    ╔═╧═╗   │
    │ ┌───╖ │ ┌───╖  ╔════╗  │    ║ 0 ║   │
    └─┤ − ╟─┴─┤ + ╟──╢ -1 ║  │    ╚═══╝   │
      ╘═╤═╝   ╘═╤═╝  ╚════╝  │            │
   ┌────┴─╖ ┌───┴──╖         │            │
   │ Fibo ║ │ Fibo ║         │            │
   ╘════╤═╝ ╘═╤════╝         │            │
        │   ┌─┴─╖          ┌─┴─╖        ┌─┴─╖
        │   │ + ╟──────────┤ ? ╟────────┤ > ║
        │   ╘═╤═╝          ╘═╤═╝        ╘═╤═╝
        └─────┘              │          ╔═╧═╗
                                        ║ 2 ║

I invented my first esoteric programming language.

It is called Funciton (pronounced: /ˈfʌŋkɪtɒn/).

I posted it to esolangs.org.

The Fibonacci function is shown on the right. None of the functions you see in there (+, >, etc.) are built-in; all of them have an implementation in Funciton. See the article for these declarations.

I need to stop doing useless things like this and get back to real work.
About this Entry
Sep. 19th, 2010 @ 11:37 am I am angry
I am angry so I decided to vent a bit. (Please consider to refrain from commenting until you have read the last sentence, as otherwise you run the risk of making me angrier.)

The trouble is, I don’t really know why I’m angry. All I know is that it has something to do with StackOverflow and the fact that everyone there is stupid beyond description.

And I’m not talking about the people who post beginner’s questions. I don’t have a problem with that. Some people enjoy helping beginners. I also don’t have a problem with questions that are badly phrased — some people just don’t have the writing skills necessary to communicate a problem. I’m not even sure I have the writing skills necessary to phrase my answers clearly, given how often I am not understood.

I also don’t have that much of a problem with people posting answers that are plainly wrong, nonsensical, irrelevant, or otherwise bad. I can leave a comment describing why the answer is bad, and then anyone reading the answer and the comment can make their own decision based on that.

What I do have a problem with is that people are unwilling to accept when their answer is bad. 90% of the time I leave a comment describing a flaw in the answer, the author comes back with a comment trying to handwave away their mistake. In raw amount of work, it would be easier to edit the answer and fix it, but these people are programmers, and programmers have an ego, and being told that you’re wrong hurts that ego. Fixing the answer would be a concession to being wrong, so the path of least resistance is to act as if they were right after all and I was the one that made a mistake.

But the other 10% are not without fault either. While these 10% of people are willing to edit their answer to fix mistakes, they will nonetheless not learn from this mistake. In particular, they will continue to post half-baked, wrong and incomplete answers just to be first. The system rewards this: the earlier you get in with your answer, the more upvotes you get, no matter how wrong the answer is. The good citizen who does their research first and then posts a good, correct and complete answer, loses out because all the people who have seen the question when it came in have given their upvote to the wrong answer and moved on (and will never find out that the answer was wrong).

There are some very few good souls on StackOverflow who sometimes answer really difficult questions, and answer them well. I asked a question about type inference as described in the C# language specification, and I knew full well that the only people who could answer that question are people who worked on or with that specification, i.e. people who worked in the Microsoft C# language design team or in the Mono C# community. Of those people, the only one I know to be on StackOverflow is Eric Lippert. And he did find and answer the question.

After the success of that question, I didn’t think much of it to ask another question about the C# language specification, this time about implicit conversions. Unfortunately, Eric Lippert has not yet answered the question, most likely because he didn’t see it — and now it is buried deep in the list of questions, so he will probably never see it. What I got instead was three nonsensical answers from people who clearly haven’t read the specification and/or don’t understand the most basic principles of it — and two of those answers even got an upvote. This makes me angry.

It goes deeper, though. The community at large does not recognise any of these behaviours as a problem. It is pretty obvious to me why: nobody is in it to help anyone (despite overtly claiming so). The people who answer questions do so because it earns them these meaningless reputation points, so they obviously prefer a system that can earn them heaps of those points by giving heaps of amateur answers. The people who make the system (Jeff especially) are in it for making money from ad revenue, and it clearly works. He’s probably making a good fortune from this, and he probably genuinely believes that he’s “making the world a better place” as he so enthusiastically proclaims in his propaganda.

It is not hard to see that StackOverflow does not make the world a better place at all. 99.99% of the questions are completely useless to anyone but the asker (this includes my two questions that I linked to) and dilute any search engine results that would otherwise bring up something useful. The remaining questions are either questions that are too hard for rep-addicted junkies to answer properly, so you end up with a thread full of wrong answers (or, in the best case, no answer at all); or questions that are easy enough to answer, so the answer was already available on the net before StackOverflow. The only questions I’ve seen that could be genuinely useful to someone who found it by googling are questions that have been answered by the asker himself (this includes a question I asked a long time ago about MissingManifestResourceException, which is now the most often viewed, probably because it is a very googlable term indeed). If I had asked the same question somewhere in a forum, I would have posted the same answer there and it would have been just as googlable. (By the way, if you paid attention, you will notice that my answer to that question is a bad one. It covers only my problem, but other answers posted there since have indicated that the same exception can occur in other circumstances. There is no incentive for anyone to consolidate several answers into a single, complete answer, so the thread will remain as fragmented as any forum post would have been.)

The software is full of bugs, too. And Jeff doesn’t care about them. Why would he? It makes him money, that’s probably all that counts. He turns the act of declining bugreports for no reason into a new artform. He is a huge hypocrite, too: he blogs about how the distinction between bug and feature request is useless and is often used “as a wedge against users”, but then he designs meta to have the same distinction, and he goes on to do the same thing with it that he criticised in that entry, except he’s even worse. He redefines “bug” to mean “high-priority problem that affects regular users” (why specifically the minority of regular users? Probably only he understands), insists that everything else should be called a “feature request”, and then assails the users who post bugs as bugs. These people are “strident”, and posting a bug as a bug is “like marking all your outgoing mail as important, a.k.a. crying wolf”. He’s nuts.

I won’t go much more into this because nobody will find this entry interesting to read anyway, but it did help me let off some steam. If you want to help me feel better, try to resist the temptation of arguing any point I made, but instead consider stroking my ego and telling me that I’m right on all counts. :)
About this Entry
Apr. 19th, 2010 @ 01:04 pm About the fixation of syntax to concepts
Coders seem to be unable to distinguish the concepts of a programming language from its syntax. One coder might argue for Python on the grounds that it has certain innovative language features, but another might “refute” this by arguing about the shortcomings of whitespace-based syntax. The two are talking about entirely separate things.

This problem is not helped by the fact that the vast majority of programming languages are built with this coupling fundamentally integrated into the whole design. There is usually no self-contained “runtime” that can just execute the output of any random parser for some random syntax. Maybe in the specific case of Python there is — in fact, I know there is for Perl 6 — but the main point still stands that most programming languages are not designed with this in mind. In particular, a very popular “microlanguage”, namely regular expressions, is universally infected with this assumption. Even the modern .NET architecture still uses the same old crappy regular expression syntax that was originally popularised by Perl, strengthening the belief among the naïve that regular expression syntaxes must necessarily be this arcane and compressed. Thus 21st-century coders still form one camp that argues for regular expressions because they’re powerful, while the other camp argues against them because they’re unreadable and unmaintainable. Both of them are right, and both of them are talking about different things.

Even the most modern programming languages that compile into a hardware-independent virtual architecture (Java or .NET), are suffering from this problem. One could kind of argue that C#.NET and VB.NET are actually just two different syntaxes for .NET, but in reality they have separate compilers that do similar but not identical things.

How often do you hear programmers argue about the colour schemes used in syntax highlighting? This is rare because everyone can choose their colour scheme for themselves without impacting anyone else. You don’t commit your colour scheme into source control.

I would like to see the next step in the evolution of programming to be one where everyone can use any syntax of their choosing without impacting anyone else. In this world, source code would be parsed into an abstract syntax tree, and it would be this syntax tree that would be shared between developers and checked into source control, so everyone can see everyone else’s work in one’s own preferred syntax. This step is hard because there needs to be universal agreement on the format of such a syntax-tree file so that source-control software can properly display diffs and annotations in the user’s preferred syntax. Once done, debates about “syntax” in a programming language become a thing of the past. People will debate “syntax” about as much as they debate colour schemes today.

But we can go even further. The next step is to do away entirely with parsers. There would instead be source code editors that edit the syntax tree itself. These editors only need to render the tree in the user’s preferred syntax, but they never need to turn plain-text files back into a syntax tree because it is already one. Then we can finally stop thinking of source code as plain text and start visualising and manipulating it graphically.

You may say I’m a dreamer...
About this Entry
Apr. 4th, 2010 @ 08:02 am Punishment for inactivity
It puzzles me that an apparently large proportion of people think that mere inactivity in a volunteer-driven project deserves some kind of punishment. In particular, I’m thinking of sysop status in MediaWiki-based projects such as Wikipedia: there is widespread belief that inactive users should be demoted. Last week I was asked whether I would consent to being demoted on Wiktionary, while today I found out that I have been demoted on another, smaller wiki without having been asked first.

I am finding it hard to follow the logic behind this. All the arguments I’ve seen or heard are a variation of “just in case”: for example, the sysop account could be hijacked and then abused, or the user could return after a long period of absence and then be unfamiliar with changes in policy. Surely in both situations you can still demote the account when it causes trouble, not sooner. Why punish the user for something they haven’t done yet?

Since the arguments given do not make logical sense, there must be another reason people behave this way. I can think of two.

Number one: It is a tradition. Everyone loses their access privileges when they, for example, leave a job or finish university, so they thoughtlessly carry the idea over to a system where it doesn’t apply. I don’t think this explains the large number of people who hold this view.

Number two: The arguments are rationalisations. The behaviour is actually motivated by a goal that is more likely to be achieved when it is not made explicit. The goal I am thinking of is the acquisition of power (influence over people). It is a well-known artifact of the MediaWiki sysop idea that it encourages the formation of an elite group of largely like-minded individuals. Demoting inactive users has three effects that are beneficial for the elite group: one, the group can stay smaller and thus easier to control; two, the members of the group are encouraged to remain active, and thus indirectly encouraged to remain like-minded with the group; and three, the act of demotion provides an opportunity for the demoter to demonstrate his power.

Of course, nobody at Wikipedia realises this, otherwise the whole ridiculous sysop idea would have been abolished a long time ago. In particular, the elite group themselves don’t realise this: they act instinctively, oblivious of the extent to which their reasoning is a rationalisation. They have an incentive not to realise it because otherwise their rationality would force them to reconsider their role in the elite group. Consequently, whenever they read blog entries like this one they have an incentive to laugh it away as if it was ludicrous and obviously false.
About this Entry
Mar. 25th, 2010 @ 09:32 pm Uber-crazy-nuts C# puzzle


Write a C# program which

  • compiles without errors or warnings under some set of compiler options;
  • contains the following sequence of characters: ?>?>[,])??(()=>{;}),},}]<<=!(~+-*++
  • does not contain any string literals or comments
  • it doesn't have to do anything useful
Solution...Collapse )
About this Entry
Oct. 13th, 2009 @ 08:50 pm Quote of the day
[20:49:04] Roman: i'll have some pasta with cheese soon, can't wait :)
[20:49:13] Timwi: Macaroni?
[20:49:24] Roman: no, Edam
[20:49:26] Roman: grated
About this Entry
Jul. 22nd, 2008 @ 01:07 am Tom Lehrer - The Elements - Animation
I made this a few days ago. This took me a total of about 7 or 8 hours to make, most of which was Wednesday 16 July 22:00 until 03:00. The animation was basically complete then, but I added a few finishing touches (like the glowy effect and a better choice of a font) on Thursday.

The music is by Tom Lehrer. There are many other videos on YouTube which attempt to animate the same song. Feel free to browse the related videos.

Update: Since a lot of people asked: I used Visual C# to make this. I rendered every frame to a PNG, then generated an AVI using AviSynth and VirtualDub. I rendered my own version at a resolution of 960x720 and encoded it as Xvid. Even at the maximum-quality setting the file is only 54 MB. The crap quality is due to YouTube.
About this Entry
Jun. 28th, 2008 @ 04:10 am Tennis on the Nintendo Game Boy
Recently I stumbled upon a video by YouTube user "SeventhSun" where he plays the old Nintendo Game Boy game Tennis and wins at the best possible score (6:0 6:0) (don't watch this, it's boring).

I noticed that he uses two basic tricks which trigger a bug in the computer player's algorithm most of the time. By that I mean that the computer doesn't hit the ball when it could. I was quickly able to copy these tactics, and it was suddenly very easy to win 6:0 6:0, but it was boring and no longer challenging, so I scrapped those tricks and tried to play more sincerely.

(By the way, I commented on his video to this effect and apparently managed to get him quite angry. He shows off his sky-high self-esteem in a comment he leaves on my user page at YouTube. Do read this, it's hilarious.)

Eventually I managed to beat the computer 6:0 6:0 too, but I couldn't upload it to YouTube because they now have a 10-minute limit while my game was 13 minutes (like SeventhSun's, which he probably uploaded before the limit was introduced). Despite, the game got me totally hooked, and I've been playing it on and off for months now.

I later managed to win in just under 10 minutes. (Don't watch this either. It's slightly less boring, but still.) I did not specifically try to win quickly here, it just so happened that I managed it and so I uploaded it.

After I uploaded that, I stopped recording every game and just played for fun. This was a weird feeling, as I suddenly took a lot more adventurous risks because I no longer cared about losing any particular game. At this point I discovered several ways in which the computer could be beaten quicker, leading me to a new challenge: what is the fastest that I can win 6:0 6:0?

My current record is 6min 28sec, which I achieved earlier today. I'll embed it here for your convenience. (Do watch this, it's worth it. Unless you're not into computer games. But do if you're into sports. Unless you hate imitations. Whatever. Decide for yourself.) Go to the YouTube video page to watch it in full screen mode.

Another possible record that one could try to set would be the least number of lost rallies. That would, of course, encourage careful play and thus produce longer games; yet my speed record here already has only 5 lost rallies (unless I miscounted, in which case please correct me), which is already very hard to top.

(P.S. I wrote this entry because I couldn't sleep.)
About this Entry
Jun. 26th, 2008 @ 11:58 am Lifesign
I'm considering resuming my blogging here at LiveJournal.

I'm not sure what you write about though. Any suggestions?
About this Entry
Apr. 28th, 2007 @ 09:35 pm //
[21:23] Timwi: Can you think of more than three very common cases in which two slashes ('//') might come up in succession? :-) (random quiz)
[21:23] Timwi: (I can think of only three)
[21:25] Roman: i can't even think of three: i can only think of protocol:// and c++ line comments
[21:25] Timwi: OK, wanna know the third one I thought of? :)
[21:26] Roman: mark-up in some wiki? :)
[21:26] Timwi: Hm, that might be another one, but that's not what I'm thinking of :)
[21:26] Roman: what is it?
[21:26] Timwi: s/ <pattern> //; :-)
[21:26] Roman: hehe :)
[21:29] Roman: but you said "very common" :)
[21:30] Timwi: Well, I only said that to prevent you saying things like $empty_string = q//; which is of course possible but ideosyncratic :)
[21:31] Roman: but i wouldn't have thought of that anyway :)
[21:32] Timwi: q// or qq// = empty string, qr// = empty regexp, qw// = empty array :)
[21:33] Timwi: or indeed $var =~ // which
[pne explains in the comments ;-)]
[21:33] Timwi: OK, sorry, I'm in extreme geek mode
[21:33] Roman: yeah
About this Entry