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.
So, I had a moment of immense dread and total helplessness. I knew I was screwed and there was nothing I was going to do about it. The moment just after the spoon full of summer squash got into her mouth, her sneeze arrived. I even had to clean off the cover of Learn to Tango with D, as it was near ground zero at the time. Parenting is glamorous. Don't let anyone tell you differently.
I've been trying to steal time to do some long-promised work on dsource.org recently. It was precipitated by stonecobra donating a server for our dedicated use. It's a monster, with dual CPU's, 8GB memory and seriously fast mirrored disks. This will get us out of the virtual host situation that, while an improvement over the duck tape and toothpicks computer and crappy home DSL, still leaves us wanting for more memory.
Along those lines, I would like to be able to not only weather a full site crawl by one of the search engines, but to thrive during it. This means some heavy caching using Tango. stonecobra has offered to help, so that's sweet. We will probably make the interface look a whole lot like memcached so the Django portion of the site is relatively seamless, and then we have to crawl through Trac code for some caching love.
It seems like getting this server has triggered a series of dependencies, but I realize they are of my own doing. For instance, I refuse to install php / mod_php / phpBB on this server... That means that the following needs to be in place:
1. Django registration: done 2. Profile management: almost done (could do it in Django or reuse TracForums) 3. Replace forums, and port all old forums, topics, posts, watch data, etc.: almost done
Pragma has resurfaced with a bit of prodding from me, and picked up TracForums development again. We're both working evenings trying to get it polished, and fit into the new dsource software. Once we do that, we convert all of the existing phpBB forum data into the new db tables, and deploy. /me drools...
Here's a teaser:
Scott Sanders (stonecobra) has published some benchmarks for the shiny new Tango XML work that's been happening. This is what happens when Kris gets involved in some optimization of code. Sick, crazy-fast things start coming out.
For those of you who don't know, Tango is a standard library for the D Programming Language, and is an alternative to Phobos, the out-of-the-box standard library.
I would love to see the other languages like C++ and Java put their best parsers up against this. I think array slicing in D should soundly trounce them.
EDIT: Scott has fixed the graphs to show MB/sec as the metric. I fixed some links in this post.
So, I am trying to install mod_python on my Mac. Seems easy right?
Macintosh:bin brad$ sudo port install mod_python25 ---> Fetching mod_python25 ---> Verifying checksum(s) for mod_python25 ---> Extracting mod_python25 ---> Configuring mod_python25 ---> Building mod_python25 with target all Error: Target org.macports.build returned: shell command " cd [snip] && make all " returned error 2 Command output: Compiling for DSO.
/opt/local/apache2/bin/apxs [snip] libtool: compile: unable to infer tagged configuration libtool: compile: specify a tag with `--tag' apxs:Error: Command failed with rc=65536 . make[1]: *** [mod_python.so] Error 1 make: *** [do_dso] Error 2
Error: Status 1 encountered during processing.
ahem, ok.
The best I can tell, this is due to Leopard and my choice of upgrading to XCode 3.0. The same error haunted me on Apache 2.2.6, and I found this page to solve it. Look for the patch by juho@sooey.com on 1/6/2008. But I couldn't figure out how to fix this for mod_python25. So, I went looking for libtool and apxs. I found it in /opt/local/apache2/bin/apxs and edited it to change:
$ltflags or $ltflags = "--silent";
to
$ltflags or $ltflags = "--silent --tag=CC";
And voila... 'sudo port install mod_python25' works like a charm.
Hope this helps you.
Claire,
Could you please, please, please go to sleep, preferably earlier in the night than you usually do. You see, Mommy and Daddy need their rest.
Well, your mother does. Dad just wants to use the evenings to work on D, Python, & Erlang stuffies. He's fairly settled in his new job, and getting there with his new MacBook Pro.
So, if you could go to sleep earlier in the night, then dsource could make some progress, and then maybe that web framework that Daddy's friends are working on could benefit as well.
Love, Daddy
Here's a brief recap of the events, and time-permitting, I'll go into more detail on some of them.
Day 1
Walter & Andrei talked about the future of D. * Struct ctors/dtors * some functional paradigm support * pure functions, don't modify data that's external, and thus are parallelizable * macros Um... bad-ass :-D
Sean talked about modularization of D, overloading the GC, etc. Clearly this was way above my paygrade, and my head almost exploded on concepts that he eats for breakfast. However, I am hopeful that Walter took a bit of notice of the nice separation and will look to improve his own house on this front.
Kris gave a great talk about slicing, and how holding onto references (slices) of the original hunk of memory instead of creating a whole bunch of temp vars, keeps the GC from thrashing, as well as alleviates the need to allocate new (heap?) memory. His war stories about slow Java programs and how he improved them by avoiding memory allocation and GC thrashing were a great setup for a monster feature in D: slicing. Text processing was an obvious example, but his work on the http server and clustering slice usage were even more powerful examples of this technique. Oh, btw, he did most of this work *three years ago* in Mango. it's just sitting there, waiting for someone to snatch it up w/ all its goodness. Nice to have someone so obsessed with performance on our side.
Gregor and I talked about DSSS and DSource, and how the two will become quite close. dsss net install packages will be created with a Trac admin page and test results for all installed packages. My dsource part was quite fluffy compared to the deeper topics earlier in the day, so I attempted to give stats and status infused with a bit of humor.
In talks with others at the break, my stance on adding only one DSCM, git, was soundly trounced, and I will most likely be adding Mercurial as well. I won't support more than two, but these are well-liked, come out favorably in a couple of comprehensive comparisons, and have Trac plugins. Don't freak out: svn is *not* going away.
Day 2
Kirk presented Pyd with a whole lot of code snippets. He blew through the talk in 15 min, and then was peppered with questions on the concepts. Of particular note, Walter seemed to be digging for compiler enhancements, __traits improvements, and what not, that would make Kirk's life easier. FYI, Pyd is geared toward extending Python with D code when performance is needed.
Don presented some of his work on high performance code generation, akin to Fortran's BLAS lib for linear algebra. Use of D's (admittedly dangerous) metaprogramming facilities, like string mixins, allowed him to get into the deepest loops of the algorithm. The entire talk was accessible for a layperson like me. I'm not so much a physicist, but I did stay at a Holiday Inn Express last nite.
Cristian presented work on his debugger, which looked quite nice. Being able to stop execution and back up a step or two and having the state at that time be preserved could prove useful.
BCS fried even more braincells with his template talk. When you have a slide called 'chained recursion' with code that uses mixins of itself to recurse down, I think it's safe to say there's a wee bit of perversion going on with BCS, DMD, and the lang in general. As an 'app dev' I'm not even going to pretend to have understood slides after this one ;)
I sat out Bartosh's talk on Software Transaction Memory, because I'm currently a 'Smug Erlang Weenie' and all about the message passing. Plus my brain was full.
Walter and Andrei hopped back on the stage last, talking further about the future of the language: * AST macros (as opposed to C/C++ text macros) * new string literal notation * ongoing final/const/invariant work that was distilled down to list processing-like head/tail or car/cdr or first/rest type coverage of all pointer combinations. Given the more robust definition of the problem, the joke was that another year of discussion was needed to 'get it right.' Admittedly, it's important to get it right for parallelism and D world domination in general. * struct inheritance - interface enforcing presence of members * more things that I'll need to be reminded of, when the presentation is posted by braddr.
W. mentioned that all of this could take a year or more to develop, but string literals and const work were already in some semblance of completion.
While the talks were fun, interesting, and brain-taxing, the best part for me was meeting all of you criminals that I had only chatted with online or on the phone. It's quite early (still) in this language's life, but a crazy amount of really smart people are hanging around, and that can only be a good thing.
Finally, Brad Roberts is a rockstar in my book. He organized the whole conference and herded us kittens over and over, leading up to, and during the conference. He was also willing to foot the bill for two lunches, one dinner, and all drinks & snacks during the presentations. Happily, the powers at Amazon.com were so impressed with the obviously "real" and compelling conference being conducted in their building, that they agreed to reimburse Brad and contribute even more than the facilities to the conference. Solid.
Well, that's it for a brief blog post. :-D
Intel open-sourced their TBB product today.
Quoting the article: "The aim of TBB, ..., is to make it easier for coders in C++ to express task-level parallelism"
Pfft. Have these hacks never heard of D? ;) In any case, worth a look, to see if Tango can borrow anything...
Kirk McDonald has been doing a fine job of maintaining the D lexer in Pygments, which is used to highlight syntax in dsource's wiki and code-browser. And he gets some insane turn-around times by the Pygments SVN committers, unless he's one already.
In any case, a mere few hours after Walter had announced the new Traits feature, bringing a bit of compile-time reflection to D, Kirk had the highlighter updated. http://www.dsource.org has been updated with this new version, so start using traits in your code.
|