Showing posts with label perl. Show all posts
Showing posts with label perl. Show all posts

Thursday, July 21, 2011

New Experiment Language Choices

(edit: I'm still tinkering with the ideas and have started learning Go, but will probably end up doing this project in either python or bash)

My evolving side project is a configuration management suite that:
1.) uses as much of git as possible and sensible
2.) lightweight
3.) simple things must be very fast turnaround to/from thought<->production
4.) all configs (and binaries if you like) versioned bit-for-bit for all time


I'll write more about the overall system design later; I've written a bit of an intro and will post it when I have code to present (here's what I have in mind for fs permissions: gist) I'm implementing some tools now that I've got the branching & config strategy worked out. I could whip out a lot of it in Perl pretty handily, but I suspect it'll be a one-man show forever if I go that route. At work, almost everything is done in Ruby, which I still don't really like much. Plus two of the leading CFM tools are already in Ruby, so I feel like it's time for something different. So, here's what I'm considering and why:
1) Go
  +) generates regular binaries, no VM to maintain on nodes
  +) good C compatibility, already has libgit2 bindings
  +) garbage collected, first-class strings
  +) (yes, +) DNA from C, Erlang, Plan9, and Inferno/Limbo
     e.g.) lightweight processes, channels, goroutines
  -) I'd have to learn from scratch
  -) AFAIK nobody on my team knows/uses it (obscure)
2) C
  +) compiled, works literally everywhere, knows your mom intimately
  +) good match with git, openssl/gnutls, and libgit2
  +) igraph looks neat for smart path & network
  -) manual memory, thread, and process management :(
  -) I'm rusty as the Titanic
3) Perl >=5.8
  +) installed everywhere
  +) I'm good/fast at it, prototype in a couple weeks
  +) many git utilities are written in perl, good match
  -) declining popularity, fractured community
  -) modern libs require too much baggage (e.g. Moose)
  -) XS is the devil, no usable libgit2 bindings
4) Python
  +) installed everywhere I care about
  +) thriving community
  +) I have some experience (though still much slower than perl)
  +) libgit2 bindings exist
  +) some of the git tools are already python
  -) difficult to bundle with zero dependencies outside the git branch
  -) v2.5 -> v3.x transition is in progress, which to choose? (prob 2.7)
5) Java
  +) just kidding!
6) Javascript/NodeJS
  -) I'm not kidding
  +) garbage collected, closures, functional style available, naturally async
  +) growing popularity, modules I'd need are fairly mature (relative to node.js)
  -) rapidly changing ecosystem/interfaces

To be honest, I'm really leaning towards Go right now but it'd add a month or so before I have something useful.

Comments, suggestions? Don't hold back, you know I wouldn't ;)

Saturday, May 19, 2007

Moving sucks.

Well, I'm all moved in to the apartment in San Diego. Almost, that is. My belongings are in the space, but as it goes, it's all still in boxes and it's a daunting task to go through and organize everything. Most importantly, though, I'm missing my wife and pets. In both senses of "missing."

Life the last month has been interesting. My Vehicross blew up. I'm in the process of figuring out what to do with it right now and will probably sell it. It did provide me an excuse to buy a new motorcycle, so I got a brand-new Suzuki V-Strom 650 (a.k.a. the "Wee-Strom"). I enjoyed riding my previous bike, a 1981 Kawasaki 440LTD, but this bike is an absolute dream as far as upgrades go! So, it is really helping fight off the depression that comes with losing a beloved vehicle.

My job is awesome and I'm learning a ton about how to work on a massive scale and how the MMO game industry works. Linux and Perl still shine as the best hammer any guy could have a toolbox full of. I'm blown away by how cool and accessible everybody is at work. I'm so used to the extremely conservative atmosphere, that I still have a hard time adjusting to the relaxed environment.

I'm spending some time reimplementing some tools similar to what I had at my old job because they really did make life better. One is a nice wrapper around CGI::Application and some of its plugins (like Plugin::TT and Plugin::AutoRunmode) to make writing one-off apps very fast and efficient. I looked at Catalyst & co. but they're just too darned much infrastructure for the kinds of apps I'm writing. I also couldn't get a handle on what the future is for Catalyst. It looks like Maypole is pretty much rolled into Catalyst (I could be wrong, so don't quote me). I didn't see anything else compelling out there as far as Perl goes. Django looked good, but I still have a hard time reaching for Python. It's not my usual language bigotry - it's common sense this time. I'm so busy already that taking time to learn another language isn't in the cards right now. I know these things have 20-minute tutorials, but I also have to consider the fact that all the other sysadmins I know, know Perl. Very few know Python or any other language for that matter.

In other Perl-related news, I'm looking for somebody to take over maintenance on Nagios::Object on CPAN. I really enjoyed getting it out there, but it's tough keeping up with the updates to Nagios these days since I don't have any installations that I work on. Just drop a mail to tobert@gmail.com and we'll talk about it. There is a queue of updates that I need to get out but haven't had the time to get them all wrapped up and tested so I can make a release. I guess I'll just have to throw it together and put it out there so people can beat on it...

Wednesday, October 12, 2005

64-bit perl on HP-UX (PARISC or Itanium)

Here's something that took me a few hours to get dialed in. This is all set for linking DBD::Oracle and DBD::Sybase to their respective 64-bit client libraries without hassle. I'm assuming the HP ANSI C compiler is installed. I never even tried with gcc due to some custom extensions that require the HP compiler.


CC=/opt/ansic/bin/cc \
CXX=/opt/aCC/bin/aCC \
CFLAGS="+DD64 +Z -I/opt/perl-5.8/local/include" \
CXXFLAGS=$CFLAGS \
LDFLAGS="-L/opt/perl-5.8/local/lib -L/usr/lib/hpux64" \
PATH=/opt/ansic/bin:/usr/ccs/bin:/opt/perl-5.8/local/bin:/opt/perl-5.8/bin:/usr/bin:/usr/local/bin:/bin:/sbin \
PERL=/opt/perl-5.8/bin/perl \
MAKE=/usr/local/bin/gmake \
./Configure -der \
-A prepend:libswanted='cl pthread ' \
-Dprefix=/opt/perl-5.8 \
-Dinstallprefix=/opt/perl-5.8 \
-Duselargefiles \
-Dusethreads \
-Duse64bitall \
-Dyacc='/usr/local/bin/bison -y' \
-Uusemallocwrap \
-Dcf_by="Al Tobey" \
-Dperladmin='tobert@gmail.com' \
-Dcf_email='tobert@gmail.com'

make
make test
make install

(cd /usr/include; /opt/perl-5.8/bin/h2ph -r -l .)

Wednesday, June 30, 2004

I wrote a couple SNMP plugins for Nagios to check disk space and running processes. They are now in the contrib directory in the Nagios Plugins package.
They both should work on Windows 2000 (and up) and Novell. HP-UX, unfortunately, does not ship with the Host-Resource MIB by default, so I'm using the Net-SNMP daemon at work. It's a little flakey, but gets the job done. SNMP Research provides an extended SNMP daemon for HP-UX and other operating systems that includes the host resource MIB.

I'm also author and maintainer of the Nagios::Object and Nagios::Cmd modules on CPAN.