I hate doing system administration because I can’t remember any of the obscure tools or options required to accomplish any tasks. What I need is a tool that can diagnose my computer and automatically perform a sequence of actions to fix my problem. This should be a simple problem for an AI planner. I need to gather information about the computer and add it to the planner’s memory as an initial world state. Then I need a library of if-then STRIPS-style actions that can execute some command to move my computer closer to the goal state (and undo it if it fails). This sounds difficult, so for now I can just model the environment by encoding the initial state by hand and printing actions out (e.g. “1) run netstat. 2) run ifconfig”). Someone must have done this before, but I can’t find anything. It is interesting to note that package management tools (apt, rpm) are (I think) ad-hoc, vastly simplified planners. [edit: this guy used Debian's package management system to solve Sudoku puzzles.]
Archive for July, 2008
SysAdmin with AI Planning tools
July 30, 2008Generic functions for R6RS Scheme
July 25, 2008I’ve been tinkering with Ikarus Scheme, an optimizing compiler for R6RS. I’ve ported Scheme48’s elegantly simple implementation of generic functions to R6RS, and perverted it with some “improvements”: it now does zero allocation during a method call and it uses Dylan’s semantics for method selection. My goal is to get to predicate dispatching like JPred. Generic functions work by adding new methods to a global generic function object when the library is loaded. This worked because Scheme48 assumes that loading a library is just like loading it into the interpreter: all top-level expressions are evaluated. Unfortunately, R6RS does not specify when top-level expressions are evaluated, and Ikarus chooses to evaluate only when the library is first used. This means I have to explicitly call some function in each library (“init-static-expressions!”) to trigger evaluation. That sucks. On the other hand, my implementation sucks because I was only loading libraries for their side-effect on generics, while exporting nothing. It looks so weird it must be wrong.
Use more oil to save the environment
July 22, 2008Thomas Friedman has yet another column on reducing our use of oil and other dirty energy sources. Al Gore gave a speech on the same theme. Though I agree with the gist of these ideas, I think there might be an unintended side-effect that could worsen the global climate. Consider just oil. There’s a vast amount of oil still in the ground. It won’t stay in the ground; someone is going to buy it and use it. Whenever anyone uses oil, some pollutants will escape. So the only question is how much of these pollutants will spoil our environment. Will it be big plumes of smoke from Chinese and Indian cars? Or will it be smaller puffs of pollutants from relatively cleaner American and European cars? If Friedman and Gore succeed in reducing America’s use of oil, the price of oil will drop dramatically; therefore, China and India will face no economic pressure to switch to more expensive, cleaner fuels. They will gobble up all that oil and spew out more pollutants than comparable American cars. Ironically, reducing America’s dependence on oil will actually increase car pollution and, therefore, global climate change.
I can think of two crazy solutions. One: subsidize gasoline in the US and require car makers to vastly reduce emissions. This will drive up the global price of oil to astronomical levels, forcing all other countries to switch to alternative fuels. While we drive around in ultra-clean 10mpg SUVs, everyone else will take a clean electric bus to work. Second: go ahead and switch to clean energy technology in the US. To coerce other countries to do the same, raise tariffs on their imports as a kind of global carbon tax. With that tariff income, subsidize (or give away free) clean energy technology to all other countries. As they use more clean tech, tariffs on their products go down. Basically, we’re using our vast economic power to impose a carbon tax on the world and bribe reluctant countries to move to clean energy tech. Both of these crazy ideas will reduce global carbon emissions, which is the whole point, right? Someone else will have to handle the politics.