Re: clojure + android

2009-04-07 Thread Remco van 't Veer

On Mon, Apr 6, 2009 at 6:28 PM, Nick Levine  wrote:

> I've been trying to get clojure + android going but without much
> success. In case it's relevant, I'm on Windows (XP) and the java
> version is 1.6.0_13.
>
> I followed http://riddell.us/tutorial/android/android.html and
> http://riddell.us/tutorial/clojure_android/clojure_android.html
> (expect that I'm driving the Android emulator from the command line
> rather than emacs).
>
> I've got the pure Java verison working OK. I've got clojure working OK
> at the command line. When I try the hello-world example in the
> clojure_android tutorial I get a message from the Emulator telling me
> that the application has stopped unexpectedly (and it doesn't say
> hello).
>
> Does anyone know how to debug this? (Other than Eclipse.) Or even:
> what might cause this message?

What does logcat report?  (use "adb logcat" on the commandline or "M-x
android-logcat" if you're using my emacs minor mode).

Remco

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Porting Minilight to Clojure

2009-04-07 Thread Mark Reid

Hi,

In the interests of learning Clojure I thought it would be fun to port
the Minilight renderer to Clojure and write about the steps along the
way. If you're interested you can have a look at my first post here:

   http://mark.reid.name/sap/minilight-clojure-vectors.html

I've not programmed in a Lisp-like before (aside from hacking the
odd .emacs files) and one thing I've noticed is just how flexible this
type of language is. The downside, of course, is that there are many
ways to do things sub-optimally or inelegantly so I welcome any
feedback.

Regards,

Mark.
--
http://mark.reid.name
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: clojure + android

2009-04-07 Thread Remco van 't Veer

I am not sure but I think Java 1.6 is giving you trouble here.  Try
rebuilding the clojure.jar and your application using 1.5 or setting
the target architecture to 1.5 in the build.xml files.  Please make me
a patch if the latter works.


On Tue, Apr 7, 2009 at 10:46 AM, Nick Levine  wrote:
> Remco,
>
> Thanks for the hint. Log follows.
>
> - nick
>
> On Apr 7, 8:36 am, "Remco van 't Veer"  wrote:
> [...]
>> What does logcat report?  (use "adb logcat" on the commandline or "M-x
>> android-logcat" if you're using my emacs minor mode).
>>
>> Remco
>
> I/ActivityManager(   46): Starting activity: Intent
> { action=android.intent.action.MAIN categories=
> {android.intent.category.LAUNCHER} flags=0x1020 comp={us.riddell/
> us.riddell.TestProject} }
> I/ActivityManager(   46): Start proc us.riddell for activity
> us.riddell/.TestProject: pid=178 uid=10019 gids={}
> I/global  (  178): Apr 7, 2009 8:40:16 AM java.io.BufferedReader
> 
> I/global  (  178): INFO: Default buffer size used in BufferedReader
> constructor. It would be better to be explicit if a 8k-char buffer is
> required.
> D/dalvikvm(  178): GC freed 6199 objects / 298680 bytes in 172ms
> D/dalvikvm(  178): GC freed 7501 objects / 342000 bytes in 170ms
> D/dalvikvm(  178): GC freed 7737 objects / 424952 bytes in 166ms
> W/dalvikvm(  178): VFY: unable to resolve virtual method 6507: Ljava/
> lang/StringBuilder;.append (Ljava/lang/String;)Ljava/lang/
> AbstractStringBuilder;
> W/dalvikvm(  178): VFY:  rejecting opcode 0x6e at 0x0023
> W/dalvikvm(  178): VFY:  rejected Lclojure/core
> $str__2835$fn__2839;.invoke (Ljava/lang/Object;Ljava/lang/Object;)
> Ljava/lang/Object;
> W/dalvikvm(  178): Verifier rejected class Lclojure/core
> $str__2835$fn__2839;
> W/dalvikvm(  178): Exception Ljava/lang/VerifyError; thrown during
> Lclojure/core__init;.
> W/dalvikvm(  178): Exception Ljava/lang/RuntimeException; thrown
> during Lclojure/lang/RT;.
> W/dalvikvm(  178): Exception Ljava/lang/ExceptionInInitializerError;
> thrown during Lus/riddell/TestProject;.
> W/dalvikvm(  178): Class init failed in newInstance call (Lus/riddell/
> TestProject;)
> D/AndroidRuntime(  178): Shutting down VM
> W/dalvikvm(  178): threadid=3: thread exiting with uncaught exception
> (group=0x4000fe68)
> E/AndroidRuntime(  178): Uncaught handler: thread main exiting due to
> uncaught exception
> E/AndroidRuntime(  178): java.lang.ExceptionInInitializerError
> E/AndroidRuntime(  178):        at java.lang.Class.newInstance(Native
> Method)
> E/AndroidRuntime(  178):        at android.app.Instrumentation.newActivity
> (Instrumentation.java:1096)
> E/AndroidRuntime(  178):        at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2061)
> E/AndroidRuntime(  178):        at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2157)
> E/AndroidRuntime(  178):        at android.app.ActivityThread.access$1800
> (ActivityThread.java:112)
> E/AndroidRuntime(  178):        at android.app.ActivityThread$H.handleMessage
> (ActivityThread.java:1581)
> E/AndroidRuntime(  178):        at android.os.Handler.dispatchMessage
> (Handler.java:88)
> E/AndroidRuntime(  178):        at android.os.Looper.loop(Looper.java:123)
> E/AndroidRuntime(  178):        at android.app.ActivityThread.main
> (ActivityThread.java:3739)
> E/AndroidRuntime(  178):        at java.lang.reflect.Method.invokeNative
> (Native Method)
> E/AndroidRuntime(  178):        at java.lang.reflect.Method.invoke
> (Method.java:515)
> E/AndroidRuntime(  178):        at com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:739)
> E/AndroidRuntime(  178):        at com.android.internal.os.ZygoteInit.main
> (ZygoteInit.java:497)
> E/AndroidRuntime(  178):        at dalvik.system.NativeStart.main(Native
> Method)
> E/AndroidRuntime(  178): Caused by:
> java.lang.ExceptionInInitializerError
> E/AndroidRuntime(  178):        at clojure.lang.Namespace.
> (Namespace.java:32)
> E/AndroidRuntime(  178):        at clojure.lang.Namespace.findOrCreate
> (Namespace.java:117)
> E/AndroidRuntime(  178):        at clojure.lang.Var.internPrivate(Var.java:
> 94)
> E/AndroidRuntime(  178):        at us.riddell.TestProject.(Unknown
> Source)
> E/AndroidRuntime(  178):        ... 14 more
> E/AndroidRuntime(  178): Caused by: java.lang.RuntimeException:
> java.lang.ClassNotFoundException: clojure.core__init
> E/AndroidRuntime(  178):        at clojure.lang.RT.(RT.java:290)
> E/AndroidRuntime(  178):        ... 18 more
> E/AndroidRuntime(  178): Caused by: java.lang.ClassNotFoundException:
> clojure.core__init
> E/AndroidRuntime(  178):        at java.lang.Class.classForName(Native
> Method)
> E/AndroidRuntime(  178):        at java.lang.Class.forName(Class.java:191)
> E/AndroidRuntime(  178):        at clojure.lang.RT.loadClassForName(RT.java:
> 1494)
> E/AndroidRuntime(  178):        at clojure.lang.RT.load(RT.java:384)
> E/AndroidRuntime(  178):        at clojure.lang.RT.load(RT.java:366)
> E

Re: clojure + android

2009-04-07 Thread Nick Levine

On Apr 7, 8:36 am, "Remco van 't Veer"  wrote:
>[...]
> What does logcat report?  (use "adb logcat" on the commandline or "M-x
> android-logcat" if you're using my emacs minor mode).

I sent Remco the log and he suggested: "I think Java 1.6 is giving you
trouble here.  Try rebuilding the clojure.jar and your application
using 1.5"

I did just that and it worked. Huzzah (and thanks). Probably worth
mentioning this in the tutorial?

One thing though, for the record. With both java versions (1.5 and
1.6) there's a problem with command-line argument order in the
application build:

   dex:
[echo] Converting compiled files and external libraries into
bin/classes.dex...
   [apply]
   [apply] UNEXPECTED TOP-LEVEL EXCEPTION:
   [apply] java.lang.RuntimeException: -JXmx512M: file not found

I have addressed this by commenting out 
under  in the application's build.xml and
changing the last line of android's tools/dx.bin to "call java -
Djava.ext.dirs=%frameworkdir% -Xmx512M -jar %jarpath% %*". This'll do
for me but if anyone wants to suggest a tidier solution then go right
ahead.

- nick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: ANN: Pretty printer is now part of contrib

2009-04-07 Thread BrianS

I use clojure-contrib quite a bit, and I find a lot of value out of
having the clj files in the JAR. First, I find it easier to debug a
project, second there are example CLJ files in the source code on how
to use the libraries, and those are of great interest, and it is much
easier to get to these source files from my IDE if they are in the
JAR.  I understand the value a smaller footprint JAR file, so maybe
there can be a property either set in the ant file or allowed as a
parameter of the build file to allow someone to build the lightweight
version of clojure-contrib if needed? Just the point of view of a
user, not a contributor, of clojure-contrib.

Brian

On Apr 7, 1:37 am, Laurent PETIT  wrote:
> Hi,
>
> 2009/4/6 Tom Faulhaber 
>
> > Another question is whether we should duplicate the classes and
> > the .clj files in the jar or should we just compile all of them. Is
> > there some value to having the source there?
>
> There certainly some value for both scenario : having classes seems an
> absolute requirement for some libraries to work, but having .clj files is
> really interesting for those that want either (show-source) ... in their
> REPL to work (or in IDEs for jumping to a read-only syntax-colored version
> of the source file).
>
> But there is also certainly value in having a build with just the classes ?
> (Though since the whole thing is open source, it's not a problem related to
> rights, but maybe for some platforms such as Android, some people might want
> the lightest possible jar ?)
>
> Regards,
>
> --
> Laurent
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Porting Minilight to Clojure

2009-04-07 Thread Laurent PETIT
Hello Mark,

That's interesting, keep us informed of your progress!

Since you say you welcome any feedback, here are my remarks :

 * namespace names: you could maybe use more qualified names, e.g.
qualifying them maybe with your own reversed namespace ( vec -> com.reid.vec
). Indeed, one of the interests of namespaces is to avoid name clashes, and
it feels to me like creating namespaces of just one segment with such
generic names such as vec may not scale well, even for personal work ?

* you have a file named test/test.clj . The corresponding namespace
declaration should then be (ns test.test ...) instead of (ns test ...).

 * function calls in namespaces : your namespace 'test directly executes a
call. This would be problematic for people using IDEs that automatically
regularly auto-compile or auto-load files to give user error/warning
feedback.
One alternative solution could be to just guard the call against compilation
by checking the value of the *compile-files* global var :
(when-not *compile-files*
  (run-tests 'test.vec))
Another alternative could be to completely get rid of the immediate call to
run-tests and place it instead in a -main method, so that the ns can be used
as an independent executable file:

(ns test
  (:gen-class)
  (:use test.vec)
  (:use clojure.contrib.test-is))

(defn -main [] (run-tests 'test.vec))


HTH,

-- 
Laurent

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: clojure + android

2009-04-07 Thread Emeka
Nick,

I need the steps you took in getting Android working in Windows.


Emeka


On Tue, Apr 7, 2009 at 9:29 AM, Nick Levine  wrote:

>
> On Apr 7, 8:36 am, "Remco van 't Veer"  wrote:
> >[...]
> > What does logcat report?  (use "adb logcat" on the commandline or "M-x
> > android-logcat" if you're using my emacs minor mode).
>
> I sent Remco the log and he suggested: "I think Java 1.6 is giving you
> trouble here.  Try rebuilding the clojure.jar and your application
> using 1.5"
>
> I did just that and it worked. Huzzah (and thanks). Probably worth
> mentioning this in the tutorial?
>
> One thing though, for the record. With both java versions (1.5 and
> 1.6) there's a problem with command-line argument order in the
> application build:
>
>   dex:
>[echo] Converting compiled files and external libraries into
> bin/classes.dex...
>   [apply]
>   [apply] UNEXPECTED TOP-LEVEL EXCEPTION:
>   [apply] java.lang.RuntimeException: -JXmx512M: file not found
>
> I have addressed this by commenting out 
> under  in the application's build.xml and
> changing the last line of android's tools/dx.bin to "call java -
> Djava.ext.dirs=%frameworkdir% -Xmx512M -jar %jarpath% %*". This'll do
> for me but if anyone wants to suggest a tidier solution then go right
> ahead.
>
> - nick
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: clojure + android

2009-04-07 Thread Remco van 't Veer

Please use to clojurehelloandroid wiki on github to document this;

  http://wiki.github.com/remvee/clojurehelloandroid

Thanks,
Remco


On Tue, Apr 7, 2009 at 3:20 PM, Emeka  wrote:

> I need the steps you took in getting Android working in Windows.
>
> On Tue, Apr 7, 2009 at 9:29 AM, Nick Levine  wrote:
>>
>> On Apr 7, 8:36 am, "Remco van 't Veer"  wrote:
>> >[...]
>> > What does logcat report?  (use "adb logcat" on the commandline or "M-x
>> > android-logcat" if you're using my emacs minor mode).
>>
>> I sent Remco the log and he suggested: "I think Java 1.6 is giving you
>> trouble here.  Try rebuilding the clojure.jar and your application
>> using 1.5"
>>
>> I did just that and it worked. Huzzah (and thanks). Probably worth
>> mentioning this in the tutorial?
>>
>> One thing though, for the record. With both java versions (1.5 and
>> 1.6) there's a problem with command-line argument order in the
>> application build:
>>
>>   dex:
>>        [echo] Converting compiled files and external libraries into
>> bin/classes.dex...
>>       [apply]
>>       [apply] UNEXPECTED TOP-LEVEL EXCEPTION:
>>       [apply] java.lang.RuntimeException: -JXmx512M: file not found
>>
>> I have addressed this by commenting out 
>> under  in the application's build.xml and
>> changing the last line of android's tools/dx.bin to "call java -
>> Djava.ext.dirs=%frameworkdir% -Xmx512M -jar %jarpath% %*". This'll do
>> for me but if anyone wants to suggest a tidier solution then go right
>> ahead.
>>
>> - nick
>>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



A large Clojure deployment

2009-04-07 Thread Stuart Sierra

Here:  http://www.altlaw.org/

About 4000 lines of Clojure code, 2500 of Java, powering a web site
with well over a million pages, averaging around 10,000 visitors a
day.

Some of what I'm using:
Restlet
StringTemplate
Solr
Hadoop
Apache Java Commons
markdownj
cpdetector
JRuby

Most of the code is online, GPL'd, at http://github.com/lawcommons

-Stuart Sierra

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A large Clojure deployment

2009-04-07 Thread Sean

Okay wow...  it'll take some time to fully appreciate this.

Can you comment on your hardware stack?  How many servers are you
using?  Is there an RDBMS in there somewhere?

How was deployment?

Looks awesome, thanks for sharing!

On Apr 7, 10:41 am, Stuart Sierra  wrote:
> Here:  http://www.altlaw.org/
>
> About 4000 lines of Clojure code, 2500 of Java, powering a web site
> with well over a million pages, averaging around 10,000 visitors a
> day.
>
> Some of what I'm using:
> Restlet
> StringTemplate
> Solr
> Hadoop
> Apache Java Commons
> markdownj
> cpdetector
> JRuby
>
> Most of the code is online, GPL'd, athttp://github.com/lawcommons
>
> -Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: ANN: Pretty printer is now part of contrib

2009-04-07 Thread Paul Stadig
Isn't it somewhat standard procedure in the Java world (or at least the
Maven world...sorry to bring that up again :)) to distribute with a
clojure-contrib.jar and clojure-contrib-sources.jar, one being only the
compiled classes and the other only being the source files?


Paul

On Tue, Apr 7, 2009 at 8:17 AM, BrianS  wrote:

>
> I use clojure-contrib quite a bit, and I find a lot of value out of
> having the clj files in the JAR. First, I find it easier to debug a
> project, second there are example CLJ files in the source code on how
> to use the libraries, and those are of great interest, and it is much
> easier to get to these source files from my IDE if they are in the
> JAR.  I understand the value a smaller footprint JAR file, so maybe
> there can be a property either set in the ant file or allowed as a
> parameter of the build file to allow someone to build the lightweight
> version of clojure-contrib if needed? Just the point of view of a
> user, not a contributor, of clojure-contrib.
>
> Brian
>
> On Apr 7, 1:37 am, Laurent PETIT  wrote:
> > Hi,
> >
> > 2009/4/6 Tom Faulhaber 
> >
> > > Another question is whether we should duplicate the classes and
> > > the .clj files in the jar or should we just compile all of them. Is
> > > there some value to having the source there?
> >
> > There certainly some value for both scenario : having classes seems an
> > absolute requirement for some libraries to work, but having .clj files is
> > really interesting for those that want either (show-source) ... in their
> > REPL to work (or in IDEs for jumping to a read-only syntax-colored
> version
> > of the source file).
> >
> > But there is also certainly value in having a build with just the classes
> ?
> > (Though since the whole thing is open source, it's not a problem related
> to
> > rights, but maybe for some platforms such as Android, some people might
> want
> > the lightest possible jar ?)
> >
> > Regards,
> >
> > --
> > Laurent
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: ANN: Pretty printer is now part of contrib

2009-04-07 Thread Laurent PETIT
Indeed, it is, in the world of java source files.

And indeed, even in the IDEs, it is possible to have both jars in the
classpath and then gain the same benefits I myself cited above in the
thread.

Maybe I was confused because I made a parallel between java classes <>
native platform code (via JIT) and clojure source file <> native java
classes.

If java classes are not present, clojure behaves as a JIT compiler compiling
clojure text source into java classes.
There is no equivalent functionality (as far as I know, at least in a
standardized way) for distributing native java code along with (or
replacing) java classes.

So I did not relate the debate "should clojure source files be located in
the same jar as their generated classes", because it didn't sound equivalent
to me to the problem "should java source files be located in the same jar as
their generated classes".

Somewhat convoluted, I must confess :-)


It seems to me that clojure core already does what you say : a clojure.jar
and a clojure-src.jar. But then again, it's just for java source, not
clojure source.

Maybe clojure-contrib could be aligned to what clojure core does ?

-- 
Laurent

2009/4/7 Paul Stadig 

> Isn't it somewhat standard procedure in the Java world (or at least the
> Maven world...sorry to bring that up again :)) to distribute with a
> clojure-contrib.jar and clojure-contrib-sources.jar, one being only the
> compiled classes and the other only being the source files?
>
>
> Paul
>
>
> On Tue, Apr 7, 2009 at 8:17 AM, BrianS  wrote:
>
>>
>> I use clojure-contrib quite a bit, and I find a lot of value out of
>> having the clj files in the JAR. First, I find it easier to debug a
>> project, second there are example CLJ files in the source code on how
>> to use the libraries, and those are of great interest, and it is much
>> easier to get to these source files from my IDE if they are in the
>> JAR.  I understand the value a smaller footprint JAR file, so maybe
>> there can be a property either set in the ant file or allowed as a
>> parameter of the build file to allow someone to build the lightweight
>> version of clojure-contrib if needed? Just the point of view of a
>> user, not a contributor, of clojure-contrib.
>>
>> Brian
>>
>> On Apr 7, 1:37 am, Laurent PETIT  wrote:
>> > Hi,
>> >
>> > 2009/4/6 Tom Faulhaber 
>> >
>> > > Another question is whether we should duplicate the classes and
>> > > the .clj files in the jar or should we just compile all of them. Is
>> > > there some value to having the source there?
>> >
>> > There certainly some value for both scenario : having classes seems an
>> > absolute requirement for some libraries to work, but having .clj files
>> is
>> > really interesting for those that want either (show-source) ... in their
>> > REPL to work (or in IDEs for jumping to a read-only syntax-colored
>> version
>> > of the source file).
>> >
>> > But there is also certainly value in having a build with just the
>> classes ?
>> > (Though since the whole thing is open source, it's not a problem related
>> to
>> > rights, but maybe for some platforms such as Android, some people might
>> want
>> > the lightest possible jar ?)
>> >
>> > Regards,
>> >
>> > --
>> > Laurent
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A large Clojure deployment

2009-04-07 Thread David Nolen
Congrats!
Perhaps soon there should be a Projects Using Clojure section on the main
site?

Good way to get the word out that people are using Clojure in the "real
world"

David

On Tue, Apr 7, 2009 at 10:47 AM, Sean  wrote:

>
> Okay wow...  it'll take some time to fully appreciate this.
>
> Can you comment on your hardware stack?  How many servers are you
> using?  Is there an RDBMS in there somewhere?
>
> How was deployment?
>
> Looks awesome, thanks for sharing!
>
> On Apr 7, 10:41 am, Stuart Sierra  wrote:
> > Here:  http://www.altlaw.org/
> >
> > About 4000 lines of Clojure code, 2500 of Java, powering a web site
> > with well over a million pages, averaging around 10,000 visitors a
> > day.
> >
> > Some of what I'm using:
> > Restlet
> > StringTemplate
> > Solr
> > Hadoop
> > Apache Java Commons
> > markdownj
> > cpdetector
> > JRuby
> >
> > Most of the code is online, GPL'd, athttp://github.com/lawcommons
> >
> > -Stuart Sierra
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A large Clojure deployment

2009-04-07 Thread Michael Wood

On Tue, Apr 7, 2009 at 5:40 PM, David Nolen  wrote:
> Congrats!
> Perhaps soon there should be a Projects Using Clojure section on the main
> site?
> Good way to get the word out that people are using Clojure in the "real
> world"

Sounds like a good idea to me.  Maybe a "Powered by Clojure" logo
would also be in order?

-- 
Michael Wood 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A large Clojure deployment

2009-04-07 Thread Stuart Sierra

Hi Sean,

It's deployed on an Ubuntu server on Amazon EC2.  Just one server for
now, but designed to scale to more.  No RDBMS!

I'm not using any Amazon services besides EC2 and S3, but I'm looking
at SQS and SimpleDB.

Deployment was pretty easy; my only problems have been non-Clojure-
related.  For example, system properties set in Ant don't persist into
Log4j, so I have to use a shell script to launch the server.
Restlet's default logging doesn't match Apache's format, so making
AWStats work has been a hassle.

If you're interested in size:
There are ~870,000 documents on the site.
The Lucene/Solr index is ~6 GB.
The HTML content is ~4 GB, compressed.
99% of the pages are static HTML, pre-rendered in a Hadoop job.

-Stuart Sierra


On Apr 7, 10:47 am, Sean  wrote:
> Okay wow...  it'll take some time to fully appreciate this.
>
> Can you comment on your hardware stack?  How many servers are you
> using?  Is there an RDBMS in there somewhere?
>
> How was deployment?
>
> Looks awesome, thanks for sharing!
>
> On Apr 7, 10:41 am, Stuart Sierra  wrote:
>
> > Here:  http://www.altlaw.org/
>
> > About 4000 lines of Clojure code, 2500 of Java, powering a web site
> > with well over a million pages, averaging around 10,000 visitors a
> > day.
>
> > Some of what I'm using:
> > Restlet
> > StringTemplate
> > Solr
> > Hadoop
> > Apache Java Commons
> > markdownj
> > cpdetector
> > JRuby
>
> > Most of the code is online, GPL'd, athttp://github.com/lawcommons
>
> > -Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-07 Thread Stuart Sierra

Yeah, I'm thinking of renaming duck-streams/file to something like
file-str or filename.
-Stuart Sierra

On Apr 7, 1:13 am, samppi  wrote:
> In addition, it's a bad idea to have these two superficially similar
> functions have the same name, "file". If, in the end, both are to be
> kept public, then I think they should at least be given different
> names.
>
> On Apr 6, 10:35 am, Victor Rodriguez  wrote:
>
> > Hello,
>
> > On Mon, Apr 6, 2009 at 10:06 AM, James Reeves
>
> >  wrote:
>
> > ...
> > > The problem with having java-utils/file and duck-streams/file is that
> > > you lose the ability to load both namespaces at the same time without
> > > defining an exception for the file function. This does not seem like
> > > an ideal solution. I think we should choose one or the other, give
> > > them different names, or attempt to merge their functionality.
>
> > IMHO. what you want to avoid is having similar utility functions in
> > different projects.  Thus, duck-streams could just use the version of
> > file of java-utils, or keep its own version private.
>
> > Cheers,
>
> > Victor Rodriguez.
>
> > > - James
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: ANN: Pretty printer is now part of contrib

2009-04-07 Thread Michael Wood

On Tue, Apr 7, 2009 at 5:30 PM, Laurent PETIT  wrote:
[...]
> It seems to me that clojure core already does what you say : a clojure.jar
> and a clojure-src.jar. But then again, it's just for java source, not
> clojure source.
>
> Maybe clojure-contrib could be aligned to what clojure core does ?

Clojure has three files:

clojure.jar - All class files (from Java source and Clojure source)
and also the .clj files.
clojure-sources.jar - Java source code.
clojure-slim.jar - Compiled Java class files and Clojure .clj files.

I think what people have been wondering about is another option.  i.e.
something like clojure.jar, but without the .clj files (except, of
course, clojure-contrib instead of clojure.)

-- 
Michael Wood 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A large Clojure deployment

2009-04-07 Thread Laurent PETIT
Waooh, congrats !

Surely an important step towards demonstrated to our employers the power and
presence of clojure !

Could you elaborate on the rationale behind using java or clojure files ?
In particular, was it more due to a (some) limitation(s) in the current
abilities to generate java from clojure ? Or maybe due to the fact that
certain call to third party java APIs was easier to write with java code
assist in a java editor ? Or was it for performance concerns ? ...

thanks,

-- 
Laurent


2009/4/7 Stuart Sierra 

>
> Here:  http://www.altlaw.org/
>
> About 4000 lines of Clojure code, 2500 of Java, powering a web site
> with well over a million pages, averaging around 10,000 visitors a
> day.
>
> Some of what I'm using:
> Restlet
> StringTemplate
> Solr
> Hadoop
> Apache Java Commons
> markdownj
> cpdetector
> JRuby
>
> Most of the code is online, GPL'd, at http://github.com/lawcommons
>
> -Stuart Sierra
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A large Clojure deployment

2009-04-07 Thread Allen Rohner


> It's deployed on an Ubuntu server on Amazon EC2.  Just one server for
> now, but designed to scale to more.  No RDBMS!
>

Awesome, Congratulations. I was hoping to be the 2nd "famous" Clojure
app, but it looks you beat me to it. :-)

Can you go into detail about what/how you are persisting since you
aren't using an RDBMS?

Allen


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A large Clojure deployment

2009-04-07 Thread Stuart Sierra

There isn't an RDBMS mostly because I have an irrational prejudice
against them.  In this case, the content is mostly static.  The Hadoop
jobs process collection of source documents -- a few dozen GB, a big
ol' mess of PDF, XML, JSON, even WordPerfect! -- and, many hours
later, output two things: 1) the Solr index, and 2) a few million HTML
files.  Everything you see on the site comes from one of those two.
There is no run-time data to persist.

When I need a DB, I'll probably use Amazon SimpleDB.

By the way, I've been using Clojure for the Hadoop/back-end code for
over a year.  The front-end used to be Ruby on Rails, I switched it to
Clojure a few months ago.

-Stuart


On Apr 7, 3:11 pm, Allen Rohner  wrote:
> > It's deployed on an Ubuntu server on Amazon EC2.  Just one server for
> > now, but designed to scale to more.  No RDBMS!
>
> Awesome, Congratulations. I was hoping to be the 2nd "famous" Clojure
> app, but it looks you beat me to it. :-)
>
> Can you go into detail about what/how you are persisting since you
> aren't using an RDBMS?
>
> Allen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A large Clojure deployment

2009-04-07 Thread Stuart Sierra

The java files were just stuff I'd already written in Java that I
didn't feel like rewriting.

-Stuart


On Apr 7, 12:35 pm, Laurent PETIT  wrote:
> Waooh, congrats !
>
> Surely an important step towards demonstrated to our employers the power and
> presence of clojure !
>
> Could you elaborate on the rationale behind using java or clojure files ?
> In particular, was it more due to a (some) limitation(s) in the current
> abilities to generate java from clojure ? Or maybe due to the fact that
> certain call to third party java APIs was easier to write with java code
> assist in a java editor ? Or was it for performance concerns ? ...
>
> thanks,
>
> --
> Laurent
>
> 2009/4/7 Stuart Sierra 
>
>
>
> > Here:  http://www.altlaw.org/
>
> > About 4000 lines of Clojure code, 2500 of Java, powering a web site
> > with well over a million pages, averaging around 10,000 visitors a
> > day.
>
> > Some of what I'm using:
> > Restlet
> > StringTemplate
> > Solr
> > Hadoop
> > Apache Java Commons
> > markdownj
> > cpdetector
> > JRuby
>
> > Most of the code is online, GPL'd, athttp://github.com/lawcommons
>
> > -Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: clojure + android

2009-04-07 Thread Onorio Catenacci



On Apr 7, 5:29 am, Nick Levine  wrote:
> On Apr 7, 8:36 am, "Remco van 't Veer"  wrote:
>
> >[...]
> > What does logcat report?  (use "adb logcat" on the commandline or "M-x
> > android-logcat" if you're using my emacs minor mode).
>
> I sent Remco the log and he suggested: "I think Java 1.6 is giving you
> trouble here.  Try rebuilding the clojure.jar and your application
> using 1.5"
>
> I did just that and it worked. Huzzah (and thanks). Probably worth
> mentioning this in the tutorial?
>
> One thing though, for the record. With both java versions (1.5 and
> 1.6) there's a problem with command-line argument order in the
> application build:
>
>    dex:
>         [echo] Converting compiled files and external libraries into
> bin/classes.dex...
>        [apply]
>        [apply] UNEXPECTED TOP-LEVEL EXCEPTION:
>        [apply] java.lang.RuntimeException: -JXmx512M: file not found
>
> I have addressed this by commenting out 
> under  in the application's build.xml and
> changing the last line of android's tools/dx.bin to "call java -
> Djava.ext.dirs=%frameworkdir% -Xmx512M -jar %jarpath% %*". This'll do
> for me but if anyone wants to suggest a tidier solution then go right
> ahead.
>
Hi Nick,

I realize this isn't exactly the same issue you saw but you might want
to take a look at it anyway.  I did run into this issue with the Mac
OSX version of the Android 1.1 r1 SDK.



--
Onorio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: New release of the enclojure plugin is up.

2009-04-07 Thread CuppoJava

I'm just wondering if anyone who's tried this and the IntelliJ plugin
can comment on how they compare.

I'm wondering if Enclojure has some basic s-exp functions, like
Surround-With-().
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Fixing Documentation Errors

2009-04-07 Thread David Sletten

What is the mechanism for reporting errors in documentation?

For instance, the doc string is in the wrong place for 'rational?'.  
And 'quot' and 'rem' take parameters 'num' and 'div', but the  
documentation talks about "denominators" rather than divisors.

Aloha,
David Sletten


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Clojure on Google AppEngine

2009-04-07 Thread John D. Hume

As predicted, Google has now released Java support for AppEngine. I
was lucky enough to get an early look, which I dedicated entirely to
Clojure.

Here's a writeup:
http://elhumidor.blogspot.com/2009/04/clojure-on-google-appengine.html

Have fun!
-hume.
-- 
http://elhumidor.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Clojure on Google AppEngine

2009-04-07 Thread David Nolen
Very exciting, thanks for the excellent and informative writeup.

On Wed, Apr 8, 2009 at 12:41 AM, John D. Hume wrote:

>
> As predicted, Google has now released Java support for AppEngine. I
> was lucky enough to get an early look, which I dedicated entirely to
> Clojure.
>
> Here's a writeup:
> http://elhumidor.blogspot.com/2009/04/clojure-on-google-appengine.html
>
> Have fun!
> -hume.
> --
> http://elhumidor.blogspot.com/
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Will Clojure work on AppEngine?

2009-04-07 Thread Robin B

Tonight Google officially announced JVM support for AppEngine: http://ru.ly/Z2
JRuby on Rails is working and Clojure/Compojure works too: http://ru.ly/74

Unfortunately threading is restricted on GAE/J.

Robin

On Mar 27, 9:44 am, Robin B  wrote:
> Google will officially announce Java support for AppEngine at the end
> of May at Google IO:  http://ru.ly/T6 Clojure web apps will have
> access to BigTable and be able to auto-scale based on load.  Clojure
> in the cloud!
>
> Robin
>
> On Feb 2, 2:35 pm, Mark Derricutt  wrote:
>
> > I wonder if the Classloader issues that currently affect OSGi would impact
> > an app-enginestyle deployment scenario as well.  My understanding of the
> > issue is that each different classloader would pick up its own RT and
> > compile/generate up different versions of the core classes under each
> > classloader.  ( I'm willing to be totally corrected here, I'm still very new
> > to clojure, and the issues we're seeing under OSGi ).
>
> > ...and then Buffy staked Edward.  The End.
>
> > On Tue, Feb 3, 2009 at 8:26 AM, Robin  wrote:
>
> > > I am not an expert on the JVM, but I think Google's runtime will
> > > disallow uploading precompiled bytecode (jar).  The assumption is that
> > > if you can compile it on their servers, then it is legal and therefore
> > > safe. I hope they allow the use of ASM library.
>
> > > Obviously this is speculation, but can you foresee any corner cases
> > > where Clojure's use of ASM might be considered 'unsafe' by Google?
>
> > > Thanks,
>
> > > Robin
>
> > > On Jan 29, 9:33 am, Rich Hickey  wrote:
> > > > On Jan 27, 2:44 pm, Robin  wrote:
>
> > > > > Under a huge assumption that Google will soon announce a 'Java
> > > > > compatible' runtime forAppEngine.  Could Clojure work out of the
> > > > > box?  Would Clojure's dynamic generation of ASM/bytecode pose a
> > > > > security problem for a generic sandboxed environment?  If expected
> > > > > conflicts exist, what kind of adaptation would it take to port
> > > > > Clojure?
>
> > > > I imagine ahead-of-time compiled Clojure code would pose the least
> > > > challenge, at it requires no custom classloader or dynamic bytecode.
> > > > Currently, AOT is enabling both untrusted applets and conversion for
> > > > Android/Dalvik.
>
> > > > As far as dynamic bytecode, that has a lot to do with the sandbox.
>
> > > > Rich
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Olabani says google testing Clojure for appengine

2009-04-07 Thread BerlinBrown

http://olabini.com/blog/tag/gae/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---