Live data from Hacker News

Clojure & Python, Side by Side

tin.nu

61–67 of 67 posts

Re: Clojure & Python, Side by Side

#61
post #4

This is pretty cool. I know python well enough to hack my way around it. I'm probably missing something, but now I have to ask: what would be the point in me learning clojure?

This was just discussed on Reddit: http://www.reddit.com/r/Clojure/comments/mhg7c/sell_clojure_...

Re: Clojure & Python, Side by Side

#62
post #31

Earlier quoted context omitted.

While I'd agree Python 2.5 to 2.7 doesn't bring a swath of language features with it... it's a good sign of Jython's slowing/sluggish growth/development. Personally, I want to use a language implementation that will be around and (well!) supported for many years.

None of you three mentioned Python 3.0 to 3.2.

That's because they don't matter to anyone.

Re: Clojure & Python, Side by Side

#63
Side by side assumes that you would write the Clojure solution this way.

But that's not how I (nor, I imagine, any experienced Lisper) would do it. Lisp programmers are not afraid to write compilers in Lisp targeting Lisp. This is not something a Python programmer would consider doing.

I would implement Dan Friedman et al's Scheme constraint solver (cKanren) in Clojure (which can be done in a few hours) so I could solve all sorts of problems, not just Sudoku, in 80 lines of code instead of 200 with very good performance.

Re: Clojure & Python, Side by Side

#64
post #34

In addition to performance metrics, this site has implementations of their benchmarks in all the languages they test. It's not pretty and side-by-side, but it's fascinating. http://shootout.alioth.debian.org/

Make it side-by-side :-)

http://shootout.alioth.debian.org/help.php#twowindows

Re: Clojure & Python, Side by Side

#65
post #31

Earlier quoted context omitted.

None of you three mentioned Python 3.0 to 3.2.

That's because they don't matter to anyone.

It seems common that people don't upgrade to a breaking version of a programming language based on name or distro channel alone. Hence the slow uptake of Python 3 and Perl 6.

Re: Clojure & Python, Side by Side

#66

Side by side assumes that you would write the Clojure solution this way. But that's not how I (nor, I imagine, any experienced Lisper) would do it. Lisp programmers are not afraid to write compilers in Lisp targeting Lisp. This is not something a Python programmer would consider doing. I would implement Dan Friedman et al's Scheme constraint solver (cKanren) in Clojure (which can be done in a few hours) so I could so…

Great, I was wondering what would be an idiomatic way of solving this in Clojure.

Given the addition of core.logic into Clojure 1.3.0, one could even skip the implementation of cKanren. Although to be honest I'm not altogether sure how core.logic measures up to cKanren.

Re: Clojure & Python, Side by Side

#67
post #66

Side by side assumes that you would write the Clojure solution this way. But that's not how I (nor, I imagine, any experienced Lisper) would do it. Lisp programmers are not afraid to write compilers in Lisp targeting Lisp. This is not something a Python programmer would consider doing. I would implement Dan Friedman et al's Scheme constraint solver (cKanren) in Clojure (which can be done in a few hours) so I could so…

Great, I was wondering what would be an idiomatic way of solving this in Clojure. Given the addition of core.logic into Clojure 1.3.0, one could even skip the implementation of cKanren. Although to be honest I'm not altogether sure how core.logic measures up to cKanren.

I'm the main developer of core.logic :) core.logic is simply missing cKanren constraint solving extensions at the moment, but again they won't be hard to add since core.logic is a fairly faithful interpretation of miniKanren (the system which cKanren extends).
Post reply on HN