Tag Archives: language

Someone suggested that my Five Eyes Flag would work as a flag for the English language. While this isn’t quite right—any flag for the English language would have to include Ireland, probably South Africa, and arguably many other places (Belize, India, etc.)—it got me thinking what languages could use a flag of their own.

It would have to be a language (officially) spoken in more than one, but not more than a handful of countries. French, Spanish & Arabic are too widely spoken, and there are already a boatload of bad flags for the German language. So I decided to try designing a flag for the Chinese language.

Chinese Language Flag - radial

Chinese is the official language of five polities, symbols from whose flags appear on this flag, atop a color also taken from their flag. In order from left to right, they are Singapore, Macau, Hong Kong, The Republic of China (a.k.a. Taiwan), and The People’s Republic of China (a.k.a. just China). The symbols are arranged in an arc that mirrors the geographic locations of the five in east Asia, from Singapore in the south, to Taiwan off the east coast of mainland China.

Also, note that I said polities and not countries: Macau and Hong Kong are technically not countries but Special Administrative Regions of China, and Taiwan is not widely recognized as a country. There’s lots to be offended about by this flag; not only the animosity between China and Taiwan but the fact, pointed out to me by a friend, that the flag of Taiwan is actually the flag of the KMT, the dominant political party there.

I hereby release this flag into the public domain so it may stoke the flames of many internet flame wars. Enjoy!

There’s no such things as bugs or features

Unless you’ve only ever worked with technical people, you’ve run into the old “is it a bug or is it a feature” argument. Generally, a business person reports something as a bug because it’s not working properly, but the reaction from technical people is that that particular feature just isn’t built yet or that specific detail was not in the original specification. This can be a source of great friction because it usually involves technical people saying the product will take longer than expected to finish. Less often, business will report a problem as a new feature, but the problem is already-built code that is just not functioning properly. This is less contentious because it usually means it’s less work to fix than business originally thought.

Is there a way to eliminate this debate?

Continue reading

Two new projects: German Grammar and Möbius

I’ve been hacking on two new projects in my spare time.

The German Grammar Explorer (mainly the German Declension Explorer) is helping me wrap my head around some of the more complex patterns in the German language. It’s also an experiment in deliberate synæsthesia; It uses a palette of eight colors plus white to color-code similar patterns and related morphosyntax. The idea is to give a general feeling for when the general patterns of the language are broken.

Möbius is a totally useless experiment in binding scroll events and doing funny stuff with them, and experimenting with some newer features of HTML 5 and CSS 3.

Grasping the nuclear fourth rail of Python syntax with both hands and holding on for dear life

In Python vs. Ruby: A Battle to The DeathGary Bernhardt wishes for Ruby-style blocks in Python.

The BDFL has already weighed in on anonymous blocks in Python:

If you want anonymous blocks, by all means use Ruby. Python has first-class callables,1 Ruby has anonymous blocks. Pick your favorite, but don’t whine that neither language has both. It ain’t gonna happen.

This seems to imply that first-class callables and anonymous blocks are mutually exclusive language features, but that’s wrong: JavaScript has the ability to pass callables around like anything else, and it has anonymous functions, which can be used just like Ruby’s anonymous blocks. Does that mean JavaScript is better than Python or Ruby? My feelings about Ruby are indifferent with a chance of rain, but I love Python, so I’ve got to ask: are you going to take this lying down, Python?

I’m not sure Python needs full-blown, Ruby-style anonymous blocks. But it might be good enough to be able to use function definitions as r-values, like JavaScript can. (If you’re not already wearing your tinfoil hat, now might be a good time to put it on.)

This would allow asynchronous code to be written in conceptual order (just like in JavaScript):

do_something_asynchronous(param1, param2, (def callback(result):
    do_something_with_result(result)
))

And it would allow encapsulation of lexical scope inside specific iterations of a loop to be used later when an asynchronous call returns (just like in JavaScript):

for item in results:
    (def single_iteration():
        do_something_asynchronous(param1, item, (def callback(result):
            do_something_with_result_and_item(item, result)
        ))
    )(item)

I’ve even had occasion to want that other Python namespace, class, to operate as an r-value:

class MyConverterClass(BaseConverterClass):
    my_converter_type = (class MyConverterType(float):
        def __str__(self): # a custom __str__ method
            return '%0.2f' % self
    )

In these examples I’ve wrapped their inline definitions in Python’s great syntactical equalizer, the parenthesis. It would be even nicer to be able to leave them off, but I’m sure that this syntax would run headlong into Python’s whitespace-based block definitions, and it would be even more of a train-wreck without parentheses.

I’ve also named the defs and classes. It would also be nice to be able to omit the function or class names if they were unneeded (just like in JavaScript). But anonymous functions, a.k.a. lambdas, are the electric third rail of Python syntax, so anonymous classes would be… I dunno, the nuclear fourth rail?

  1. Thanks to Steve for explaining that by “first-class callable,” GvR means functions that can be passed around and assigned to other variables without being executed. He also pointed out that the reason Ruby’s callables aren’t first-class is because optional parentheses in function calls leave no way to refer to a function without calling it, not because of the existence of anonymous blocks. []

Revolutionary and wrong

What Larry Wall is doing (or has been doing, for the last seven years) with Perl 6 is revolutionary:

There needs to be a universal root language, and ways of warping that universal root language into whatever dialect you like.

It’s incredibly valuable to examine all the ways in which a (programming or natural) language can vary. I’m sure they’re learning a lot that will be useful to language designers everywhere. Perl 6 will undoubtedly be a great tool for quickly prototyping new languages, too.

It’s also wrong for a production language. The last thing I want in a programming language is diversely variable and configurable syntax and semantics. Sitting down to maintain or debug someone else’s Perl 6 sounds like a nightmare. Not only would you have to figure out what they are trying to say, you’d have to figure out what dialect of Perl 6 they were using, and exactly how that dialect works.

For this reason I’d tend to avoid Perl 6 for new projects, nor would I want to join a Perl 6 project mid-stream. If I had to work in Perl 6, the first thing I’d do would be to convince the entire team to stick to the standard dialect (or maybe some other, popular dialect) and never re-configure it.

I doubt we’ll see much traction for Perl 6 outside of research settings. The benefit of picking PHP and Java over Python or Ruby is that it’s easier to find PHP and Java programmers, than it is to find programmers for even the relatively popular Python or Ruby. Trying to find a programmer who knows not just Perl but Perl 6 and your dialect of Perl 6 is going to be even harder.