Fabio on Reddit
/It looks like Fabio is doing an AMA (Ask me Anything) on Reddit, and itis most amusing. I’m not sure if it’s him or the Old Spice PR team, but it’s funny either way. Read it in its full glory.
Rants, musings, and [sometimes] useful articles from Greg Taylor.
Rants, musing, and [sometimes] helpful stuff
It looks like Fabio is doing an AMA (Ask me Anything) on Reddit, and itis most amusing. I’m not sure if it’s him or the Old Spice PR team, but it’s funny either way. Read it in its full glory.
I’ve noticed that some people coming from Windows or other backgroundsoften mis-interpret Linux load averages, or don’t understand them at all. Check out this great rough overview post, Understanding Linux CPU Load. While there is, of course, more to it than the article goes over, this will plug some basic knowledge gaps.
I recently stumbled across an article on Hacker News about how oururbanisation tendencies translate really well to the world of Minecraft. Urbanisation in Minecraft details the experience of one of four founding members of a Minecraft server as it sees explosive growth, eventually developing sprawl and resource shortages in centers of population.
While this can’t be taken too scientifically (that’s not really the point), it is a very interesting read. Check the article out on Crafthub.
Today, Google anounced the general availability of its Goprogramming language on App Engine. It will be interesting to see how this pans out, but this very well may be the kind of endorsement needed to catapult the language out into the semi-mainstream. While still young, this language is looking very promising.
My initial tinkerings liken it to a cross between Python, C, and a little bit of Java. Visually, it seems to look the most like Python and C, which is a big plus for someone who loves the syntactical minimalism of Python (not so much C).
While there are certainly going to be some issues right out of the gate, it will be very interesting to watch App Engine and Go evolve separately and together.
One of the big philosophical “pillars” I’ve been building my tinkerPython MUD on is that cold restarts (restart the process, clients are disconnected) should be exceedingly rare. Code re-loading in Python can be challenging, but Allen Short has nailed it with his Exocet module.
The coolest part for me (as it pertains to my game) is as follows:
“Exocet is a new way to load Python modules. It separates the act of naming a dependency from the act of creating a module object. As a result, more than one instance of a module can be created from the same source file.”
As a result of this, we can deal with Python modules as objects, and can easily replace them. This is how it ends up looking for me (lots of things removed for the sake of brevity):
import exocet
# Load the general commands module, stuff it in a variable.
general_cmds = exocet.loadNamed(
'src.game.commands.general',
exocet.pep302Mapper
)
# Add a command to the command table.
self.add_command(general_cmds.CmdLook())
This is an excerpt from my game’s global command table. The general command module is loaded by exocet instead of Python’s regular import statement. Since we’ve tossed the module reference in a variable, the normal rules of Python garbage collection apply.
While my game does this a little differently, running the line that populates general_cmds again would mean that the old general command module’s reference count would drop to zero, hence it would be garbage collected. In its place, you have the newly loaded general commands module with any new code updates. Here is all I’d need to do to re-load the general commands module after some modifications:
import exocet
# Re-load the general commands module, replacing the old one. general_cmds = exocet.loadNamed(
'src.game.commands.general',
exocet.pep302Mapper
)
Of course there had to be a catch, right? I’m still learning how to best use this, but here are a few pointers:
Rants, musings, and [sometimes] informative stuff from Greg Taylor.