As I mentioned in Twitter, and on Erlang-Questions, we are getting together for Erlounge Atlanta on Wednesday, March 25, 2009.
The site of the debacle is Manuel's Tavern. 7pm is kickoff. I might be a bit late, so please start without me. Order, drink, talk... wash, rinse, repeat.
I've also learned today that an impromptu Startup Drinks will crash our happy party. The more the merrier.
See you there.
BA
For those of you interested in my Emacs setup for Erlang development (let's face it, who wouldn't be interested in that?), you can find it here:
http://github.com/boorad/emacs/tree/master
Enjoy.
I attended Bar Camp Atlanta this weekend. The event was a blast, but unfortunately I was only able to attend Friday nite. I missed the distributed version control talk, and got my noodle cooked on "Genetic Algorithms in Javascript." I also missed coffee w/ @ivey and @sanjay's Pipes talk. :\
I gave a talk on Erlang and why you should use it. My over/under for attendees was four, but I packed in about 20 people standing room only... not too bad. My slides can be found here.
Poker was great, including the whiskey... although I could have done without a couple of the beats put on me. My playing partners seemed so nice. But put chips in front of them, and cards, and whiskey... they changed real fast. I'll be ready next time.
So I finally got a bit of time to get back to Erlang, and caught up on Kevin Smith's screencasts. Watching him work with flymake enabled reminded me that when I set up his emacs/erlang rig earlier, I never got flymake to work. Well, I finally did, so thought I'd share my changes.
Looking at 'git diff' I see I changed erlang_mode_config.el with my paths to Erlang stuffies:
-(add-to-list 'load-path "/opt/lib/erlang/lib/tools-2.6.1/emacs")
+(add-to-list 'load-path "/opt/local/lib/erlang/lib/tools-2.6.1/emacs")
(require 'erlang-start)
(setq erlang-indent-level 2)
-(add-to-list 'exec-path "/opt/bin")
-(setq erlang-root-dir "/opt")
+(add-to-list 'exec-path "/opt/local/lib/erlang/bin")
+(setq erlang-root-dir "/opt/local/lib/erlang")
Now, on to flymake_config.el, where I had another path change b/c I didn't put things in exactly the same place on my machine.
- (list "~/emacs/flymake/bin/eflymake" (list local-file))))
+ (list "~/dev/erlang/kevsmith/emacs/flymake/bin/eflymake" (list local-file))))
Then, to recompile the .elc files, I ran this:
emacs -q --no-site-file -batch -eval "(add-to-list 'load-path \".\")" -f batch-byte-compile *.el
The same path changes were required in eflymake script, on the top line.
-#!/opt/bin/escript
+#!/opt/local/lib/erlang/bin/escript
Of course, the thing to do would be to modify these files to have one place for these settings to reside, and be more easily customizable for all. But since I have things working, I want to get back to coding. I hope to feel like before this was like 'coding in the dark.' Off to code...
The Metro Atlanta Erlang Users Group, some single digits strong, will meet for the first time on September 20, 2008 at the Brick Store Pub in Decatur, GA. For now, we are planning on meeting at 7pm.
The Brick Store has a fairly amazing beer selection, and they're light on the TV's so we can hopefully avoid the rabid Tech and Dawg football fans. Let's sit upstairs if possible.
Please throw out suggestions for what to talk about in the comments, or we can just get together and meet/drink. I can talk about a project I've got cooking, and my trials with backends, including CouchDB vs. Mnesia. Kevin Smith says he will be there, so we can possibly guide his pragpodcast direction :)
Wifi is a bit iffy. Decatur is blanketed, but I'm not sure if it's free. I believe you need to be a resident. So, that means I'll be calling on my friend who lives over there. Happily, he's at least heard of Erlang.
Oh, and in addition to Erlang, I try to indoctrinate as many as I run into about the hotness of the D Programming Language. You have been warned.
Holy crap. I just realized that for some number of weeks, I've been running OS X 10.5.4, and nothing has blown up. Erlang still works. GDC still bangs out D binaries (note to self to check up on LLVMDC progress), and overall, I haven't had to recompile anything.
Same with iPhone Software Update 2.0 on my horrifically outdated iPhone 1.0 hardware.
More of those type upgrades, please.
I didn't find much out there on PostgreSQL drivers for Erlang. There's one built into jungerl, and one put out by Erlang Consulting, as far as I can tell. I can't stand CVS, there's no package download, and didn't already have jungerl or its 'pgsql' driver anywhere on my local, so I moved on to the Erlang Consulting 'psql' driver, which had a tarball.
after untarring in ~/dev/erlang/psql-0.1.3, I just typed 'make' and the /ebin folder filled nicely (i.e. my Erlang is working)
So, under the /docs folder, in overview.edoc, it said to modify sys.config (a file usually in $ERL_OTP_ROOT/releases/$VERSION) and add in your connection strings like such:
{psql, [{default, {"192.168.1.101", 5432, "dev", "secret", "sql_test"}},
{pools, [{default, 1}]}]}
I now think this is a bit dated, because the following code gave me a bit of a connection error during startup of the driver.
make_dat_files() ->
ensure_started(psql),
Pid = psql:allocate(),
psql:sql_query(Pid, "select * from accounts;").
Config stuffies seem to have moved into the psql.app file in /ebin, but you don't edit that directly. I found ~/dev/erlang/psql-0.1.3/src/psql.app.src, modified for my specific connection settings, and back at the root of the tarball, typed 'make' again. Now, the psql.app file in /ebin had my connection info and I could go about my business.
I'm still very much a newb, but articles like this one would have saved me an hour on this issue, so enjoy.
So after the most recent 10.5.3 Leopard upgrade, I go to fire up the Erlang REPL and I get "Bus error." Evidently this is somewhat common (as noted in #couchdb IRC channel), so I thought I'd just upgrade to a more recent Erlang.
MacPorts barfs on me, so I decide to clean everything and start over. Now with no trace of erlang, couchdb, or couchdb-devel, I start again.
Hitting the megaco flex errors pisses me off, but I find this nice article that helps. Basically, update flex to 2.5.35 or higher before trying erlang on OS X 5.3. Here's a sample of the errors:
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/ _opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R12B-2" && make all " returned error 2
Command output: megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:32: bad character: *
So, given errors surrounding hipe (MacPorts bug, can't find link) I removed it from my install command:
sudo port install erlang -hipe +smp
Cool, now Erlang works. Let's get a new CouchDB from /trunk...
./bootstrap
./configure --with-erlang=/opt/local/lib/erlang/usr/include --prefix=/opt/local
make
sudo make install
Nice. Now I have all of the new reduce hotness.
Joel Reymont has hacked Mnesia around a bit and added a new storage type. In addition to 'ram_copies' and 'disc_copies' node types, Mnesia can now have Amazon S3 nodes (s3_copies).
He hacked the Mnesia internals pretty hard, but (from TFA):
I would say it was worth it, though, as I now can
- lock S3 buckets or "records" using {Bucket, Key}
- update several S3 records in a single transaction
- set up additional s3_copies replicas using mnesia:add_table_copy/3
- ensure that data is only written to S3 once
- have a large cluster of Yaws nodes use a small cluster of "master" Mnesia nodes with s3_copies replicas, thus keeping replication and transaction costs down.
I believe this was contract work, but I think the help he received from Ulf Wiger and others, plus the cruel and unusual punishment of announcing the results to us, is hopefully enough to compel him to release it as open-source at some point. I am certainly interested. Although I will admit that for a small- to mid-sized web app, Amazon EC2 and S3 are not too cost-effective just yet.
A lot of people are asking me why I'm programming in Erlang these days. And yes, I'm talking about the ones who are in the tech world, not my mother and grandmother. Those two are wondering why I don't just use English.
I have read a lot of blog posts and articles recently that led me down this path. Reddit had been, and may still be, hot on Erlang posts. But the teaser article on Pragmatic Programmers for Joe Armstrong's book is the one that I think covers the most bases.
The same inquisitive people ask me if Erlang is used in any PROD apps. Well, does the mobile phone grid for England count? That's where a 2 million line Erlang program is achieving nine 9's reliability. For those of you scoring at home, that's 32ms of downtime per year. Pfft. hacks...
Making a program just about 32 times faster on a 32-core machine is quite appealing. Down in the trenches, though... If Erlang, Yaws (web server), and Mnesia (in-memory and on-disk distributed database) are used to write a Facebook app and the server doesn't melt under all the load, then that's pretty bad-ass. Just in case, I'll try to put the app in Amazon's EC2 so I can drop another Erlang node into place quickly. We'll see...