Why the Minecraft community picking YAML as the standard configuration file format was a mistake.

December 8, 2012 at 8:13 PMPhonicUK

This is a mixture of opinion and rant about why YAML is not well suited for the way the Minecraft community uses it, and how bad plugin developers are making the problem worse.

YAML (Yet Another Markup Language) is a relatively new markup language. It's goal is to be human friendly way to serialize data. With YAML you can represent a piece of data that can be understood easily by a piece of software and also easily readable by a human. As something for humans to write however, it's not so great.

Compare the following three snippets:

1)

Joe:
    interests: [video games, movies]
    full name: Joe Bloggs
    age: 25

2)

Joe:
    interests: 
       - 'video games'
       - 'movies'
    'full name': 'Joe Bloggs'
    age: 25

3)

{
  "Joe": {
    "interests": [
      "video games", 
      "movies"
    ], 
    "age": 25, 
    "full name": "Joe Bloggs"
  }
}

So right away there are a number of problems:

  • All three of them represent exactly the same data, yet they look very different. A YAML parser will give the exact same result for all 3 of them.
  • You can't tell just by looking at it whether or not I used tabs or spaces unless you're using a text editor which specifically highlights the difference.
  • You can't mix-and-match certain styles in the same document, even though they may look very similar.
The keen eyed among you will notice that #3 is also valid JSON as well as YAML. Also note that in example #2, you can increase the amount of indentation for Joe's interests to any amount you like, and it's absolutely fine as long as they are both the same. The single quotes are also entirely optional, you could have 'video games' with quotes and movies without quotes and it'd be perfectly valid.
 
The problem is that with so much variation and style, writing proper YAML can get tricky very quickly, especially for larger documents. With something like XML it's harder to go wrong as the format is much more rigid.
 
Largely the community as a whole has settled on the 2nd style shown, and you'd think that'd be the end of it.
 
The remaining problems are not so much down to YAML, but the behaviour of Minecraft plugin developers.
 
A number of plugins, instead of using a full YAML parser - instead have their own parser that only works with a very specific style. They are no longer using YAML but merely a extremely restricted subset.
 
The following are the kind of bad behaviours exhibited by some plugins:
 
  • Mandating certain levels of indentation (2/4 spaces) even though the YAML spec doesn't care as long as it's consistent within the document.
  • Failing for lists if they either do or don't have enclosing single quotes (even though it's valid regardless)
  • Not supporting the square bracket syntax for lists (as seen in example #1)
  • Insisting that strings either don't or do have single quotes around them, despite the spec allowing either (or even for you to mix freely, as you may need to quote integer values that are meant to be strings, but not something that is definitely a string)
  • Requiring that elements are in a certain order (swapping around the age and full name for example causing the plugin to crash)
YAML is a very flexible format, deliberately so because it's made for humans. Yet some plugin developers feel the need to completely throw that out the window.
 
If a more rigid format like XML was used then it seems less likely that developers would be trying to write poor implementations based on the subset of YAML they happen to like.

Posted in: Minecraft | Servers

Tags:

Running Mac OS X 10.8 'Mountain Lion' in VMware ESXi 5

July 30, 2012 at 7:27 PMPhonicUK

Recently I bought a Mac Mini to use as a ESXi rig to host Mac VMs for development purposes.

Getting Lion running in ESXi 5 is a marginally annoying but entirely doable task. However if you try to follow the same steps with Mountain Lion, you'll very quickly get stuck at a "Waiting for root device..." message and find you're going nowhere.

Thankfully it's actually a pretty simple (if inconvenient thing) to work around:

  • Install OS X 10.7 (Lion) in a VM
  • Upgrade 10.7 to 10.8 after it's up and running
  • Done
That's it. Upgrading works, clean install doesn't.
 
Point of note: During the Mountain Lion installation, the screen may go black/white with a small box in it. If this happens just press any key on the keyboard to wake it up again. It's not dead.

Posted in: Servers | VMware

Tags: , , ,

On Windows "8" Server

March 13, 2012 at 8:24 PMPhonicUK

I recently decided to try out the new Windows Server "8" Beta. I can only assume from Microsofts insistence on putting quote marks around the 8 indicates that they intend to change the name at some point and the 8 is purely a nod to the fact it uses the same Metro interface used in Windows 8.

I'm running it in VMware ESXi 5 (With the patch from November, there's a good guide over at virtuallyGhetto on getting it installed) with 2 virtual CPU cores and 8GB of RAM. Despite objections from the installer, you can in fact use the VMware guest OS tools for 2008 R2 quite happily (just run the installer in compatibility mode)

At a first thought, the idea of having the Metro UI on a server operating system sounds incredibly daft. But in practice, it makes very little odds one way or the other.

If you're like me, you use Server 2008/7 primarily by hitting the start key on your keyboard, typing the first few letters of the application you want to run or the setting you want to change, and selecting the item you want from the list of results. In practice this doesn't change much with 8, it just looks different.

The only practical difference is that Settings are shown separately from Apps, and it's not quite clever enough to automatically show you the list of settings when there are results there but no matching apps.

That minor detail aside, it's not a significant impact. The solid colour background means it behaves very nicely over Remote Desktop.

One of the things that did mildly irk me is the lack of the Desktop Experience feature. On previous Windows Server versions this allowed you to enable Aero, which was nice if you either wanted to use the server OS as a development machine / workstation, or to give remote clients the Aero effects when using Remote Desktop services. 

On the subject of the user interface though, it remains characteristically minimal but clearly leans more towards the style found in the rest of Windows 8. The option for a 'classic' user interface (which while missing from Windows 7, remains present in Server 2008 R2) is nowhere to be seen and by all appearances has been completely replaced with this new style with very thick borders...

Amongst the welcome changes though are a new server manager, which has a host of features to make it much more convenient to manage multiple servers.

You can add servers either via Active Directory or just by adding its Hostname/IP. It's very simple and convenient so you'll find no objections here.

I was surprised to find that the IIS manager remains exactly the same. It's the same version of IIS found in 2008 R2 making it look somewhat out of place compared to the new server manager.

 

The new task manager is entirely pleasant, no complaints here. Anyone who's used the 'current' task manager on anything with 8 or more logical processors will attest to how useless it becomes without taking over your entire screen when you want to examine the load on individual cores/processors. It's nice for having a quick glance at going on without having to use the comparatively heavy Resource Monitor (Which like IIS, remains unchanged at the moment)

I'm sure the changes in user interface will prompt the usual truckload of complaints, but I'm hard pressed to find anything actually 'wrong' with the changes. I was expecting to end up on IIS 9 but maybe that's for the final release. If the Beta is at all representative of the direction the final release is moving in then I'm reasonably confident that the result will be decent.

Posted in: Servers

Tags: , , , , , ,