Monday, November 23, 2009

More Monads in Clojure

Another well written tutorial:

http://intensivesystems.net/tutorials/monads_101.html

Posted via email from miner49r

A monad tutorial for Clojure programmers

This is the first of a four part series on monads in Clojure.  Each posting has a link to the next in the series.

http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/

Posted via email from miner49r

Friday, November 20, 2009

Apple's Mistake with the App Store

http://paulgraham.com/apple.html

The way Apple runs the App Store has harmed their reputation with programmers more than anything else they've ever done. Their reputation with programmers used to be great. It used to be the most common complaint you heard about Apple was that their fans admired them too uncritically. The App Store has changed that. Now a lot of programmers have started to see Apple as evil.

Posted via email from miner49r

Apple's Mistake with the App Store

http://paulgraham.com/apple.html

> The way Apple runs the App Store has harmed their reputation with > programmers more than anything else they've ever done. Their > reputation with programmers used to be great. It used to be the most > common complaint you heard about Apple was that their fans admired > them too uncritically. The App Store has changed that. Now a lot of > programmers have started to see Apple as evil.

Posted via email from miner49r

Wide Finder in Clojure

Using Clojure to implement the "Wide Finder", parallel code for grepping log files:

http://technomancy.us/130#c

See the comments for the pmap version:
(ns my-wide-finder
"A basic map/reduce approach to the wide finder using agents.
Optimized for being idiomatic and readable rather than speed.
NOTE: Originally from:
http://technomancy.us/130
but updated to use pmap."
(:use [clojure.contrib.duck-streams :only [reader]]))

(def re #"GET /(\d+) ")

(defn count-line
"Increment the relevant entry in the counts map."
[line]
(if-let [[_ hit] (re-find re line)]
{hit 1}
{}))

(defn my-find-widely
"Return a map of pages to hit counts in filename."
[filename]
(apply merge-with +
(pmap count-line (line-seq (reader filename)))))

http://www.tbray.org/ongoing/When/200x/2009/11/18/Clojure-Parallel-I-O
> Conclusion first: It turns out that Clojure’s concurrency primitives > allow you, with a very moderate amount of uncomplicated code, to > take advantage of parallel hardware and outperform really fast > software when it doesn’t take such advantage.

Posted via email from miner49r

Wide Finder in Clojure

Using Clojure to implement the "Wide Finder", parallel code for grepping log files:

http://technomancy.us/130#c

See the comments for the pmap version:
(ns my-wide-finder "A basic map/reduce approach to the wide finder using agents. Optimized for being idiomatic and readable rather than speed. NOTE: Originally from: http://technomancy.us/130 but updated to use pmap." (:use [clojure.contrib.duck-streams :only [reader]])) (def re #"GET /(\d+) ") (defn count-line "Increment the relevant entry in the counts map." [line] (if-let [[_ hit] (re-find re line)] {hit 1} {})) (defn my-find-widely "Return a map of pages to hit counts in filename." [filename] (apply merge-with + (pmap count-line (line-seq (reader filename)))))

Conclusion first: It turns out that Clojure’s concurrency primitives allow you, with a very moderate amount of uncomplicated code, to take advantage of parallel hardware and outperform really fast software when it doesn’t take such advantage.

Posted via email from miner49r

Thursday, November 12, 2009

The Go Programming Language

Google announces a new programming language: Go.

http://golang.org/

Posted via email from miner49r