Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Andrew Voron
Good job. First thing that start and running from description in wiki.
It seems like next evolution step in path: pure cljs -> Piggieback -> 
austin -> cljs-start 
May be for newcomers like me it will be good to add some integraional tips 
for emacs(others) editors..

Thx.
Andrew

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: cider status

2013-12-17 Thread Phillip Lord
Gary Johnson  writes:
> As another hacker who lives in Emacs, I found the nrepl -> cider transition 
> to be quite painless. It took me maybe an hour of reading the website docs, 
> installing/uninstalling packages with package.el, and updating the relevant 
> sections of my .emacs.d/init.el file. 

Well, it's an interesting opinion, but in to my mind, "an hour of
reading and updating" != "relatively painless".

> Not to poo-poo on anyone's parade, but it really did seem pretty
> straightforward to me. 

I also had to port my own nrepl dependencies. Only of the unfortunate
things about Emacs is that hook name changes don't get picked up
automatically.

Still, pain in the ass though it was, hopefully, it should be over. I
think changing the name to distinguish between the protocol and the
environment is no bad thing, even if it was hard work.

Phil

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Mimmo Cosenza

> May be for newcomers like me it will be good to add some integraional tips 
> for emacs(others) editors..

I always feel guilty when talking about editors because I use emacs. It seems 
that the top clojurists are pushing people to switch from emacs to something 
more used by younger/front-end programmers. In someway it seems that emacs 
could be felt as an incidental complexity on the path toward Clojure.

I don't know what to say. Perhaps only "use the editor that lets you feel less 
incidental complexities in developing with  CLJ/CLJS". Initially this should be 
your current editor. 

My best
Mimmo














signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Comparing core.async and Reactive Extensions

2013-12-17 Thread Leonardo Borges
Thought not specifically about Rx, this thread talks about core.async
and FRP (of which Rx is an implementation):
https://groups.google.com/forum/#!topic/clojure/jHhwufCjrR8

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Parsing large XML files

2013-12-17 Thread Peter Ullah

Hi all, 

I'm attempting to parse a large (500MB) XML, specifically I am trying to 
extract various parts using XPath. I've been using the examples presented 
here: http://clojure-doc.org/articles/tutorials/parsing_xml_with_zippers.html
and all was going when tested against small files, however now that I am 
using the larger file Fireplace/Vim just hangs and my laptop gets hot then 
I get a memory exception.

I've been playing around with various other libraries such as 
clojure.data.xml and and found that the following works perfectly well for 
parsing... but when I come to search inside root, things start to snarl up 
again.

(ns example.core
  (:require [clojure.java.io :as java.io] 
[clojure.data.xml :as data.xml]
))  

(def large-file "/path-to-large-file")

;; using clojure.data.xml returns quickly with no problems whereas 
clojure.xml/parse from the link above causes problems..
(def root 
  ( -> large-file
   java.io/input-stream
   data.xml/parse
   ))  

(class root) ;clojure.data.xml.Element

Does anyone know a way of searching within root that won't consume the heap?

Forgive me, I'm new to Clojure and these forums, I've searched through 
previous posts but not managed to answer my own question.

Thanks in advance.

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Cedric Greevey
On Tue, Dec 17, 2013 at 5:48 AM, Mimmo Cosenza wrote:

>
> May be for newcomers like me it will be good to add some integraional tips
> for emacs(others) editors..
>
>
> I always feel guilty when talking about editors because I use emacs. It
> seems that the top clojurists are pushing people to switch from emacs to
> something more used by younger/front-end programmers. In someway it seems
> that emacs could be felt as an incidental complexity on the path
> toward Clojure.
>

Calling emacs "incidental complexity" is like calling the North Pole "a bit
nippy this time of year". :)

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Mimmo Cosenza

> Calling emacs "incidental complexity" is like calling the North Pole "a bit 
> nippy this time of year". :)

LOL

mimmo


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [ClojureScript] Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Tim Visher
On Tue, Dec 17, 2013 at 5:48 AM, Mimmo Cosenza  wrote:
> May be for newcomers like me it will be good to add some integraional tips
> for emacs(others) editors..
>
>
> I always feel guilty when talking about editors because I use emacs. It
> seems that the top clojurists are pushing people to switch from emacs to
> something more used by younger/front-end programmers. In someway it seems
> that emacs could be felt as an incidental complexity on the path toward
> Clojure.
>
> I don't know what to say. Perhaps only "use the editor that lets you feel
> less incidental complexities in developing with  CLJ/CLJS". Initially this
> should be your current editor.

The trend that I see (and think is _awesome_!) is encouraging people
to learning just Clojure. There used to be a real attitude that if you
want to use Clojure, you need to use Emacs. That attitude has all but
evaporated ([it's still there though][1]).

I still think most people who've taken the time to grok Emacs say that
it was worth their time as much as taking the time to grok Lisp was,
but it's just not a good idea to learn a new editor and a new language
at the same time.

So I wouldn't encourage anyone, at this point, to switch editors to
learn any language. I would encourage anyone who is not learning a
language to learn Emacs. :)

[1]: https://kotka.de/blog/2013/10/A_bitter_taste.html

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ClojureScript] [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Mimmo Cosenza
> I would encourage anyone who is not learning a
> language to learn Emacs. :)

Well said



signature.asc
Description: Message signed with OpenPGP using GPGMail


[ANN] Buffy, The Byte Buffer Slayer 1.0.0-beta1

2013-12-17 Thread Alex P
Buffy [1][2] is a Clojure library to work with Binary Data, write complete 
binary protocol implementations
in clojure, store your complex data structures in an off-heap chache, read 
binary files and do
everything you would usually do `ByteBuffer`. 

After the initial project announcement, we've got several feature-requests, 
which been addressed by current 
release:

   * Bit fields (masks of on/off bits) 
https://github.com/clojurewerkz/buffy#bit-type
   * Wrapped buffers (work with existing byte arrays or byte buffers): 
https://github.com/clojurewerkz/buffy#buffer-types
   * Dynamic frames (complex protocol generation and parsing, when you 
can't know the length of payload 
in advance, and need to introspect buffer for parsing, or add hint-fields 
into payload): https://github.com/clojurewerkz/buffy#dynamic-frames

Buffy has been serving us well for recent time, and no major issues were 
revealed. However, until 
it reaches GA, we can't guarantee 100% backward compatibility, although 
we're thought it through
very well and used our best knowledge to make it right.

Buffy is a ClojureWerkz project, same as Monger, Elastisch, Cassaforte, 
Neocons, Meltdown and
many others. 

Let us know what you think!

[1] https://github.com/clojurewerkz/buffy
[2] http://blog.clojurewerkz.org/blog/2013/11/29/introducing-buffy/
[2] http://clojurewerkz.org

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


How do I serve clojure pages with nginx

2013-12-17 Thread Zeynel
I've set up a home server with ubuntu and nginx and I can serve static 
pages. Now I want to add clojure but I am not sure what I need to do. I 
asked the same question in StackOverflow but for some reason it is voted to 
be 
closed: 
http://stackoverflow.com/questions/20632987/how-to-serve-clojure-pages-with-nginx

Can you please direct me to documentation where I can read about this? Some 
issues that I don't understand are: how do I tell nginx that I am using 
clojure? Where do I install clojure, in the server? Where do I create the 
clojure files? Thanks.

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Parsing large XML files

2013-12-17 Thread Ryan Senior
As far as I know, using zippers like that will need the whole XML data
structure to be in memory.  data.xml returns fast because it's lazy (uses
pull parsing).  Until you start traversing down the structure, it won't
parse more of it.  data.xml should also be fully streaming, so it shouldn't
require the full 500 MB XML file in memory unless you're doing something to
require that.

Traversing the structure that data.xml emits directly should not consume
heap, but you wouldn't be able to use XPath.  I've not used it, but there
is an XPath wrapper library here: https://github.com/kyleburton/clj-xpath.
Briefly looking at the code, it looks like it's using DOM parsing, so it
would consume heap. You could bump your max heap (-Xmx from the command
line) if you had the extra memory and weren't worried about the docs
getting larger.

-Ryan


On Tue, Dec 17, 2013 at 4:57 AM, Peter Ullah  wrote:

>
> Hi all,
>
> I'm attempting to parse a large (500MB) XML, specifically I am trying to
> extract various parts using XPath. I've been using the examples presented
> here:
> http://clojure-doc.org/articles/tutorials/parsing_xml_with_zippers.html
> and all was going when tested against small files, however now that I am
> using the larger file Fireplace/Vim just hangs and my laptop gets hot then
> I get a memory exception.
>
> I've been playing around with various other libraries such as
> clojure.data.xml and and found that the following works perfectly well for
> parsing... but when I come to search inside root, things start to snarl up
> again.
>
> (ns example.core
>   (:require [clojure.java.io :as java.io]
> [clojure.data.xml :as data.xml]
> ))
>
> (def large-file "/path-to-large-file")
>
> ;; using clojure.data.xml returns quickly with no problems whereas
> clojure.xml/parse from the link above causes problems..
> (def root
>   ( -> large-file
>java.io/input-stream
>data.xml/parse
>))
>
> (class root) ;clojure.data.xml.Element
>
> Does anyone know a way of searching within root that won't consume the
> heap?
>
> Forgive me, I'm new to Clojure and these forums, I've searched through
> previous posts but not managed to answer my own question.
>
> Thanks in advance.
>
> --
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How do I serve clojure pages with nginx

2013-12-17 Thread Dave Della Costa
I have not done this specifically with Nginx but I suspect you probably
want something like what I set up with Apache + Jetty:

https://github.com/ddellacosta/Clojure-under-Jetty-and-Apache#setting-up-jetty-with-apache-httpd

That is, set up Nginx to act as a proxy for Jetty:

http://nginx.org/en/docs/beginners_guide.html#proxy

One difference with how I would do it these days (vs. what I wrote in
the piece above) is that I would probably simply push out an uberjar
with lein which I would run with Java via an init script--for example,
if using Ubuntu:

http://upstart.ubuntu.com/cookbook/#run-a-java-application

So, I would imagine the basic construction would be something like: ring
app w/jetty or http-kit, packaged as an uberjar (lein uberjar), then set
up to run via an init script (via upstart in your case) on an
alternative port, which is proxied by Nginx as in the link above.

Hope this helps--

DD

(2013/12/17 21:44), Zeynel wrote:
> I've set up a home server with ubuntu and nginx and I can serve static
> pages. Now I want to add clojure but I am not sure what I need to do. I
> asked the same question in StackOverflow but for some reason it is voted
> to be
> closed: 
> http://stackoverflow.com/questions/20632987/how-to-serve-clojure-pages-with-nginx
> 
> Can you please direct me to documentation where I can read about this?
> Some issues that I don't understand are: how do I tell nginx that I am
> using clojure? Where do I install clojure, in the server? Where do I
> create the clojure files? Thanks.
> 
> -- 
> -- 
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> 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
> ---
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Andrew Voron
Well, Im not sure if I expressed myself correctly when asked for tips about 
editor - I thought about how to get Emacs (or may be other editor which 
support nrepl workflow) "work" with cljs-start. Now I see that it works 
good when I'm testing it. I use emacs-live for clojure work with emacs, and 
it seems like all things work not only from emacs clojurescript repl but 
from file - when I type C-x C-e - it evaluates my s-expressions and puts 
result to emacs's status buffer... Could you tell us maybe some other good 
shotcuts and tips that you use in development... I cant for ex. eval the 
whole buffer or reload the namescpace...
   
   What about other editors - I think they should work as far as them 
support nrepl... Personally I tryed Sublime Text 3, but without success...

Ok, I go to play with emacs cljsrepl...

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Lee Spector

On Dec 17, 2013, at 6:01 AM, Cedric Greevey wrote:
> 
> Calling emacs "incidental complexity" is like calling the North Pole "a bit 
> nippy this time of year". :)

The thing is, it's actually possible to have the power of emacs without the 
incidental complexity of currently available emacs versions. It has been done 
before, e.g. with FRED (FRED Resembles Emacs Deliberately, in Macintosh Common 
Lisp). Emacs under the hood, but modern GUI design and usability. 

 -Lee

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Tim Visher
On Tue, Dec 17, 2013 at 8:14 AM, Andrew Voron  wrote:
> Well, Im not sure if I expressed myself correctly when asked for tips about
> editor - I thought about how to get Emacs (or may be other editor which
> support nrepl workflow) "work" with cljs-start. Now I see that it works good
> when I'm testing it. I use emacs-live for clojure work with emacs, and it
> seems like all things work not only from emacs clojurescript repl but from
> file - when I type C-x C-e - it evaluates my s-expressions and puts result
> to emacs's status buffer... Could you tell us maybe some other good shotcuts
> and tips that you use in development... I cant for ex. eval the whole buffer
> or reload the namescpace...

If you're in emacs, and using cider/nrepl.el, then a good place to
look would be:

`M-x help RET m` to see most of the widely useful key bindings for
Clojure and nrepl.el. Also the project pages for those projects list a
lot of the useful key bindings.

To get the complete story, `M-x help RET b` will list every binding.

Specifically, `C-c C-l` tends to load the file.

Evaling the ns form in nrepl.el at least can be done with `M-x
nrepl-eval-ns-form RET` (bound to `C-c C-n` by default).

>What about other editors - I think they should work as far as them
> support nrepl... Personally I tryed Sublime Text 3, but without success...

Vim Fireplace has really good nrepl support.

I believe all the IDEs out there now have really good nrepl support as well.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Tim Visher
On Tue, Dec 17, 2013 at 8:21 AM, Lee Spector  wrote:
> On Dec 17, 2013, at 6:01 AM, Cedric Greevey wrote:
>>
>> Calling emacs "incidental complexity" is like calling the North Pole "a bit 
>> nippy this time of year". :)
>
> The thing is, it's actually possible to have the power of emacs without the 
> incidental complexity of currently available emacs versions. It has been done 
> before, e.g. with FRED (FRED Resembles Emacs Deliberately, in Macintosh 
> Common Lisp). Emacs under the hood, but modern GUI design and usability.

We could all use Aquamacs. :)

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Comparing core.async and Reactive Extensions

2013-12-17 Thread Timothy Baldridge
I won't go so far as to tell you which is better as that often comes down
to a matter of taste. However, I will explain the technical differences. In
this case I'll use my (somewhat limited) knowledge of C# Rx. Scala/Java's
Rx may be different.

Rx is based on a direct call. We could write a simple version of Rx thusly:

(defprotocol IObservable
 (on-next [this val])
 (attach [this obs]))

(defn filter [f]
  (let [a (atom #{})]
(reify IObservable
  (on-next [this val]
(when (f val)
  (doseq [i @a]
(on-next i val
  (attach [this obs]
(swap! a conj obs)


As you can see, each parent in the tree directly calls the child via the
on-next (or on-error and on-exit in a real Rx impl). Thus it's pretty
simple to run something like this without a thread pool or dispatcher. But
what happens if calling on-next throws an exception? In that case the error
bubbles up the wrong way. That is to say, the data goes down the data graph
while errors go the opposite way. C# Rx has some code to handle things like
this and populate errors the right way.

In addition it can be possible for multiple threads to be executing on-next
at the same time. It all depends on the semantics of whatever is calling
the top level on-next.

Core.Async on the other hand is based on two primitives: channels (queues)
and processes. Errors are never propagated unless specified by the user.
And thread pools/dispatchers are almost always required. With core.async we
could implement filter thusly:

(defn filter [f in-c out-c]
  (go-loop []
(when-let [v (! out-c v)

Here we accept the input and output channels as arguments and then create a
process that connects the two. Since the go-loop is a single thread only
one message is in-flight in the body of this go at a single time. If we
want more parallelism, we simply call this filter function multiple times
to create multiple gos.

So that's the difference. Rx creates graphs of objects, while Core.Async
(and CSP in general) creates graphs of processes connected by queues. CSP
seems a bit more general to me, but many would probably disagree with me on
that one.

Timothy


On Mon, Dec 16, 2013 at 9:09 PM, Michal Till  wrote:

> Hello,
>
> I seem to be a little bit confused when comparing core.async to the so
> called Reactive Extensions (Rx). They seem to tackle similar problem of
> async-icity, so I wonder what are the principal differences and in what
> cases is one preferred over the other. Can someone please explain?
>
> Regards,
> Michal
>
> --
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Philadelphia SICP Study Group starting Feb 5th

2013-12-17 Thread Steve Shogren
Quite a few in the Philadelphia area expressed interest in having a study 
group around the excellent book Structure and Interpretation of Computer 
Programs, and so here it is!

http://www.meetup.com/Clojadelphia/events/155920672/

But, SICP is in Scheme, right? What does that have to do with Clojure? In 
about five seconds, I found two great posts explaining the benefits of SICP 
for the Clojure programmer: Why 
Clojureby Bob 
Martin, and Advice 
to a Newbie on 
learningclojure.com.

For a bit of marketing from me on why you should care about an old musty 
Scheme book: the book itself is is massive in scope, so it would be hard to 
list all the things it covers (hence the need for a study group). For 
example, there is a section in chapter 2 that has you write all the core 
functional abstractions: map, filter, reduce, etc entirely from just 
functions and lambdas. I thought I understood those abstractions, but it 
wasn't until I made them from scratch that they really clicked. 
Additionally, a later section shows how different data structures can be 
made to work with those abstractions, which is fundamental to how ISeq in 
Clojure works.

The book eventually goes on to have to write your own interpreter, and if 
the table of contents is accurate, your own compiler (I have only finished 
Chap 2 so far). It shows you how to add OO-like benefits to Scheme: 
polymorphism, data "type" checking, etc. with just built in language 
constructs.

SICP is not for the faint of heart, but it will turn you into a much better 
developer.

If you are up for the challenge, I would like to try to get through the 
whole book in one year, as suggested by the author of learningclojure.com. 
There are 356 exercises, and each one is there to teach you something 
valuable that you will need to complete the next section.

If you are interested, please come sign up and RSVP.

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Lee Spector

On Dec 17, 2013, at 8:24 AM, Tim Visher wrote:

> On Tue, Dec 17, 2013 at 8:21 AM, Lee Spector  wrote:
>> On Dec 17, 2013, at 6:01 AM, Cedric Greevey wrote:
>>> 
>>> Calling emacs "incidental complexity" is like calling the North Pole "a bit 
>>> nippy this time of year". :)
>> 
>> The thing is, it's actually possible to have the power of emacs without the 
>> incidental complexity of currently available emacs versions. It has been 
>> done before, e.g. with FRED (FRED Resembles Emacs Deliberately, in Macintosh 
>> Common Lisp). Emacs under the hood, but modern GUI design and usability.
> 

Certainly a step in the right direction, IMHO, but from what I recall from the 
last time I checked (and seem to have confirm from a quick new check) setup and 
integration with Clojure are non-trivial. I haven't had the full experience 
because I never made it over this setup-usability hurdle. Also, the mac-only 
thing is less than ideal and it should be possible to do something similar in a 
cross-platform way, although to be fair FRED was also mac only.

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Philadelphia SICP Study Group starting Feb 5th

2013-12-17 Thread Paul L. Snyder
On Tue, 17 Dec 2013, Steve Shogren wrote:

> Quite a few in the Philadelphia area expressed interest in having a study 
> group around the excellent book Structure and Interpretation of Computer 
> Programs, and so here it is!
> 
> http://www.meetup.com/Clojadelphia/events/155920672/

Any chance of a meeting date *other* than the first Wednesday of the month?
It conflicts with the Philly Linux Users Group.

This schedule doesn't have everything, but it often helpful when avoiding
conflicts with other technical groups:

  http://technical.ly/philly/events/

Paul

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Philadelphia SICP Study Group starting Feb 5th

2013-12-17 Thread Tim Visher
Hi Paul,

On Tue, Dec 17, 2013 at 9:26 AM, Paul L. Snyder
 wrote:
> On Tue, 17 Dec 2013, Steve Shogren wrote:
>
>> Quite a few in the Philadelphia area expressed interest in having a study
>> group around the excellent book Structure and Interpretation of Computer
>> Programs, and so here it is!
>>
>> http://www.meetup.com/Clojadelphia/events/155920672/
>
> Any chance of a meeting date *other* than the first Wednesday of the month?
> It conflicts with the Philly Linux Users Group.
>
> This schedule doesn't have everything, but it often helpful when avoiding
> conflicts with other technical groups:
>
>   http://technical.ly/philly/events/

Good point! :)

Best thing I could recommend would be to comment on the Meetup. If
enough people say they can't make then I'm sure we can change it up.
And localizing the responses on the Meetup page probably would give
the most visibility to the most relevant people.

Thanks in advance!

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How do I serve clojure pages with nginx

2013-12-17 Thread Zeynel
Yes, this is helpful. I think this will be a good starting point for me 
once I read the references that you gave. I also heard about Immutant and 
I'm investigating it but do you think it may be helpful? I am not sure at 
this point exactly what it does. Thanks.

On Tuesday, December 17, 2013 9:02:19 AM UTC-4, David Della Costa wrote:
>
> I have not done this specifically with Nginx but I suspect you probably 
> want something like what I set up with Apache + Jetty: 
>
>
> https://github.com/ddellacosta/Clojure-under-Jetty-and-Apache#setting-up-jetty-with-apache-httpd
>  
>
> That is, set up Nginx to act as a proxy for Jetty: 
>
> http://nginx.org/en/docs/beginners_guide.html#proxy 
>
> One difference with how I would do it these days (vs. what I wrote in 
> the piece above) is that I would probably simply push out an uberjar 
> with lein which I would run with Java via an init script--for example, 
> if using Ubuntu: 
>
> http://upstart.ubuntu.com/cookbook/#run-a-java-application 
>
> So, I would imagine the basic construction would be something like: ring 
> app w/jetty or http-kit, packaged as an uberjar (lein uberjar), then set 
> up to run via an init script (via upstart in your case) on an 
> alternative port, which is proxied by Nginx as in the link above. 
>
> Hope this helps-- 
>
> DD 
>
> (2013/12/17 21:44), Zeynel wrote: 
> > I've set up a home server with ubuntu and nginx and I can serve static 
> > pages. Now I want to add clojure but I am not sure what I need to do. I 
> > asked the same question in StackOverflow but for some reason it is voted 
> > to be 
> > closed: 
> http://stackoverflow.com/questions/20632987/how-to-serve-clojure-pages-with-nginx
>  
> > 
> > Can you please direct me to documentation where I can read about this? 
> > Some issues that I don't understand are: how do I tell nginx that I am 
> > using clojure? Where do I install clojure, in the server? Where do I 
> > create the clojure files? Thanks. 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> > Note that posts from new members are moderated - please be patient with 
> > your first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com  
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
> > --- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to clojure+u...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How do I serve clojure pages with nginx

2013-12-17 Thread Toby Crawley
>From an HTTP perspective, Immutant will behave similarly to Jetty - you
would need to use Nginx as a proxy.

Where Immutant differs from Jetty is when your application needs services
beyond the web: scheduled jobs, messaging, XA transactions,
etc. Immutant bundles those services and simplifies clustering them when
you need horizontal scalability.  

If your clojure app just handles HTTP requests and doesn't need any of
the extra features provided by Immutant, then using Immutant won't give
you much more than Jetty.

Zeynel writes:

> Yes, this is helpful. I think this will be a good starting point for me 
> once I read the references that you gave. I also heard about Immutant and 
> I'm investigating it but do you think it may be helpful? I am not sure at 
> this point exactly what it does. Thanks.
>
> On Tuesday, December 17, 2013 9:02:19 AM UTC-4, David Della Costa wrote:
>>
>> I have not done this specifically with Nginx but I suspect you probably 
>> want something like what I set up with Apache + Jetty: 
>>
>>
>> https://github.com/ddellacosta/Clojure-under-Jetty-and-Apache#setting-up-jetty-with-apache-httpd
>>  
>>
>> That is, set up Nginx to act as a proxy for Jetty: 
>>
>> http://nginx.org/en/docs/beginners_guide.html#proxy 
>>
>> One difference with how I would do it these days (vs. what I wrote in 
>> the piece above) is that I would probably simply push out an uberjar 
>> with lein which I would run with Java via an init script--for example, 
>> if using Ubuntu: 
>>
>> http://upstart.ubuntu.com/cookbook/#run-a-java-application 
>>
>> So, I would imagine the basic construction would be something like: ring 
>> app w/jetty or http-kit, packaged as an uberjar (lein uberjar), then set 
>> up to run via an init script (via upstart in your case) on an 
>> alternative port, which is proxied by Nginx as in the link above. 
>>
>> Hope this helps-- 
>>
>> DD 
>>
>> (2013/12/17 21:44), Zeynel wrote: 
>> > I've set up a home server with ubuntu and nginx and I can serve static 
>> > pages. Now I want to add clojure but I am not sure what I need to do. I 
>> > asked the same question in StackOverflow but for some reason it is voted 
>> > to be 
>> > closed: 
>> http://stackoverflow.com/questions/20632987/how-to-serve-clojure-pages-with-nginx
>>  
>> > 
>> > Can you please direct me to documentation where I can read about this? 
>> > Some issues that I don't understand are: how do I tell nginx that I am 
>> > using clojure? Where do I install clojure, in the server? Where do I 
>> > create the clojure files? Thanks. 
>> > 
>> > -- 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> > Groups "Clojure" group. 
>> > To post to this group, send email to clo...@googlegroups.com 
>> > Note that posts from new members are moderated - please be patient with 
>> > your first post. 
>> > To unsubscribe from this group, send email to 
>> > clojure+u...@googlegroups.com  
>> > For more options, visit this group at 
>> > http://groups.google.com/group/clojure?hl=en 
>> > --- 
>> > You received this message because you are subscribed to the Google 
>> > Groups "Clojure" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> > an email to clojure+u...@googlegroups.com . 
>> > For more options, visit https://groups.google.com/groups/opt_out. 
>>
>
> -- 


-- 
Toby Crawley
http://immutant.org | http://torquebox.org

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How do I serve clojure pages with nginx

2013-12-17 Thread Zeynel
Great, thanks. In that case I'll concentrate on Jetty.

On Tuesday, December 17, 2013 11:51:42 AM UTC-4, Toby Crawley wrote:
>
> From an HTTP perspective, Immutant will behave similarly to Jetty - you 
> would need to use Nginx as a proxy. 
>
> Where Immutant differs from Jetty is when your application needs services 
> beyond the web: scheduled jobs, messaging, XA transactions, 
> etc. Immutant bundles those services and simplifies clustering them when 
> you need horizontal scalability.   
>
> If your clojure app just handles HTTP requests and doesn't need any of 
> the extra features provided by Immutant, then using Immutant won't give 
> you much more than Jetty. 
>
> Zeynel writes: 
>
> > Yes, this is helpful. I think this will be a good starting point for me 
> > once I read the references that you gave. I also heard about Immutant 
> and 
> > I'm investigating it but do you think it may be helpful? I am not sure 
> at 
> > this point exactly what it does. Thanks. 
> > 
> > On Tuesday, December 17, 2013 9:02:19 AM UTC-4, David Della Costa wrote: 
> >> 
> >> I have not done this specifically with Nginx but I suspect you probably 
> >> want something like what I set up with Apache + Jetty: 
> >> 
> >> 
> >> 
> https://github.com/ddellacosta/Clojure-under-Jetty-and-Apache#setting-up-jetty-with-apache-httpd
>  
> >> 
> >> That is, set up Nginx to act as a proxy for Jetty: 
> >> 
> >> http://nginx.org/en/docs/beginners_guide.html#proxy 
> >> 
> >> One difference with how I would do it these days (vs. what I wrote in 
> >> the piece above) is that I would probably simply push out an uberjar 
> >> with lein which I would run with Java via an init script--for example, 
> >> if using Ubuntu: 
> >> 
> >> http://upstart.ubuntu.com/cookbook/#run-a-java-application 
> >> 
> >> So, I would imagine the basic construction would be something like: 
> ring 
> >> app w/jetty or http-kit, packaged as an uberjar (lein uberjar), then 
> set 
> >> up to run via an init script (via upstart in your case) on an 
> >> alternative port, which is proxied by Nginx as in the link above. 
> >> 
> >> Hope this helps-- 
> >> 
> >> DD 
> >> 
> >> (2013/12/17 21:44), Zeynel wrote: 
> >> > I've set up a home server with ubuntu and nginx and I can serve 
> static 
> >> > pages. Now I want to add clojure but I am not sure what I need to do. 
> I 
> >> > asked the same question in StackOverflow but for some reason it is 
> voted 
> >> > to be 
> >> > closed: 
> >> 
> http://stackoverflow.com/questions/20632987/how-to-serve-clojure-pages-with-nginx
>  
> >> > 
> >> > Can you please direct me to documentation where I can read about 
> this? 
> >> > Some issues that I don't understand are: how do I tell nginx that I 
> am 
> >> > using clojure? Where do I install clojure, in the server? Where do I 
> >> > create the clojure files? Thanks. 
> >> > 
> >> > -- 
> >> > -- 
> >> > You received this message because you are subscribed to the Google 
> >> > Groups "Clojure" group. 
> >> > To post to this group, send email to 
> >> > clo...@googlegroups.com 
>
> >> > Note that posts from new members are moderated - please be patient 
> with 
> >> > your first post. 
> >> > To unsubscribe from this group, send email to 
> >> > clojure+u...@googlegroups.com  
> >> > For more options, visit this group at 
> >> > http://groups.google.com/group/clojure?hl=en 
> >> > --- 
> >> > You received this message because you are subscribed to the Google 
> >> > Groups "Clojure" group. 
> >> > To unsubscribe from this group and stop receiving emails from it, 
> send 
> >> > an email to clojure+u...@googlegroups.com . 
> >> > For more options, visit https://groups.google.com/groups/opt_out. 
> >> 
> > 
> > -- 
>
>
> -- 
> Toby Crawley 
> http://immutant.org | http://torquebox.org 
>

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Brambling: Datomic (Schema) Migration library/toolkit for Clojure

2013-12-17 Thread Daniel Higginbotham
Thanks for open sourcing this! I'm not sure I'm understanding what it does 
correctly. It looks like it installs new attributes and creates the 
transactions needed to update existing entities? Is that right?

So in the README example, the idea is that  you're changing :message/action 
from a string to a long, and migrate-action-to-number ensures that the 
attribute gets converted for existing entities?

Thanks!
Daniel


On Friday, November 8, 2013 8:22:44 PM UTC-5, Christopher Allen wrote:
>
> https://github.com/bitemyapp/brambling/
>
> This is a very early point in time for the library, (alpha), but it has 
> already been useful at work so I figured I would get it out there to see 
> what bits people did and didn't care about.
>
> Why this exists:
>
> As with any historical database you have to migrate the transaction log in 
> addition to the "current" state of the universe. Conveniently, Datomic 
> makes querying at arbitrary points of time rather easily. Less 
> conveniently, there's no map/reduce sugar for performing migrations so I 
> needed to put together a toolkit to handle reducing over the origin tx-log, 
> carrying over entity identities consistently (old -> tempid -> new), and 
> translating the transactions with the new schema being first at the head of 
> the destination.
>
> There are some pretty serious limitations (incremental migrations 
> principally) but I don't think they're showstoppers, and like I said, this 
> has already been useful for migrating production data.
>
> Let me know if you have any questions!
>
> --- Chris
>
>

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Mimmo Cosenza
Hi Andrew, 
just remember that cljs-start is for pure CLJS project only. 

Few weeks ago I started working on a similar lein template for mixed CLJ/CLJS 
projects which have different requirement. then I stopped because of work 
overload on other projects. 

On the mixed cli/cljs path the luminoso-template took an interesting approach

https://github.com/magomimmo/luminus-template

In my mind I think about something like a pair composed by of a lein template 
and a lein plugin. 

The template should serve to create new mixed clj/cljs projects and the plugin 
should serve to easily manage the project itself.

I would be even better to absorb the awesome  stuff my Stuart Sierra and jig, 
then absorb stuff regarding continuos development, integration and deployment 
to try to minimize any incidental complexities caused by the used tools. 

A kind of reference sample could http://yeoman.io/

But we should do it better :-)

I final note. Apparently I'm  the only one using profiles.clj file local to the 
project. When I'm alone I'm alway worried to be on the wrong path. I still 
think that the profiles.clj local to the project is at the moment the best way 
to keep separated the complexity of the developer view of the project from the 
user view of the project. Hope not to be wrong in this approach. 

Any comment about this is very welcome

mimmo


On Dec 17, 2013, at 2:14 PM, Andrew Voron  wrote:

> Well, Im not sure if I expressed myself correctly when asked for tips about 
> editor - I thought about how to get Emacs (or may be other editor which 
> support nrepl workflow) "work" with cljs-start. Now I see that it works good 
> when I'm testing it. I use emacs-live for clojure work with emacs, and it 
> seems like all things work not only from emacs clojurescript repl but from 
> file - when I type C-x C-e - it evaluates my s-expressions and puts result to 
> emacs's status buffer... Could you tell us maybe some other good shotcuts and 
> tips that you use in development... I cant for ex. eval the whole buffer or 
> reload the namescpace...
>
>What about other editors - I think they should work as far as them support 
> nrepl... Personally I tryed Sublime Text 3, but without success...
> 
> Ok, I go to play with emacs cljsrepl...
> 
> -- 
> -- 
> 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
> Note that posts from new members are moderated - please be patient with your 
> first post.
> 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
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


NPE in print-stack-trace

2013-12-17 Thread Dmitry Groshev
I've managed to get an NPE in print-stack-trace: 
https://gist.github.com/si14/e8d22913d21933d12ef1

It seems highly counter-intuitive to me that this function can throw NPEs. 
I thought it's intended to be used in "catch" clauses; does it mean that I 
should wrap some catches in their own try-catches?

Anderkent in #clojure suggested that the cause of this NPE is an exception 
without stacktrace, similar to ones discussed here: 
http://jawspeak.com/2010/05/26/hotspot-caused-exceptions-to-lose-their-stack-traces-in-production-and-the-fix/
 If 
this is the case, the situation is even worse, because it's hard to foresee 
this optimization.

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Comparing core.async and Reactive Extensions

2013-12-17 Thread Brian Craft


On Tuesday, December 17, 2013 5:33:10 AM UTC-8, tbc++ wrote:
>
> Core.Async on the other hand is based on two primitives: channels (queues) 
> and processes. Errors are never propagated unless specified by the user. 
> And thread pools/dispatchers are almost always required. 
>

Seems like it's more subtle than this, since it is supported in 
clojurescript, where threads are not available?

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: NPE in print-stack-trace

2013-12-17 Thread Andy Fingerhut
You might be hitting a bug in Clojure 1.5.1 where it incorrectly attempts
to access elements in an empty stack trace, which I have seen occur.  This
should be fixed in Clojure 1.6.0 alpha releases:
http://dev.clojure.org/jira/browse/CLJ-1102

Andy


On Tue, Dec 17, 2013 at 9:14 AM, Dmitry Groshev wrote:

> I've managed to get an NPE in print-stack-trace:
> https://gist.github.com/si14/e8d22913d21933d12ef1
>
> It seems highly counter-intuitive to me that this function can throw NPEs.
> I thought it's intended to be used in "catch" clauses; does it mean that I
> should wrap some catches in their own try-catches?
>
> Anderkent in #clojure suggested that the cause of this NPE is an exception
> without stacktrace, similar to ones discussed here:
> http://jawspeak.com/2010/05/26/hotspot-caused-exceptions-to-lose-their-stack-traces-in-production-and-the-fix/
>  If
> this is the case, the situation is even worse, because it's hard to foresee
> this optimization.
>
> --
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: instaparse (1.2.4) perfomance issue a long string to parse

2013-12-17 Thread Mark Engelberg
Thanks for this.  It's always useful to see examples of parsers that aren't
performing as well as expected.

On my machine, using the latest version (1.2.13), your parser processes
your text file (which appears to have three bogus bytes at the front of the
file which I needed to edit out), I'm getting about 8 seconds.  That's not
necessarily meaningful -- I could just have a faster computer.

My first thought is that by treating the ands and ors as binary connectives
only, you get a very deeply nested data structure.

(sudoku-parser "c1|c2|c3|c4|c5")
([:and [:and [:and [:and [:atom "c1"] [:atom "c2"]] [:atom "c3"]] [:atom
"c4"]] [:atom "c5"]])

Perhaps it would be more efficient (and easier to process the resulting
trees) if you allowed these connectives to take multiple subexpressions.
Also, it looks like maybe you have & and | reversed from their usual
interpretation.  Was that intentional?

Here's a sample of how one might allow multiple subexpressions within & and
|:

 = unary | binary
atom = #'c[0-9]*'
not = <'!'> atom
 = atom | not | <'('> expr <')'>
 = and | or
and = unary (<'&'> unary)+
or = unary (<'|'> unary)+

The above example puts & and | back to the usual interpretation.  Also, I
leverage the fact that in your data, ! only precedes atoms.  If you want a
more general interpretation of !, then:
not = <'!'> unary
does the trick.

This gives you:

(sudoku-parser2 "c1|c2|c3|c4|c5")
([:or [:atom "c1"] [:atom "c2"] [:atom "c3"] [:atom "c4"] [:atom "c5"]])

which is cleaner to work with and cuts the parsing time in half.

I'd be interested in seeing the grammar for the JavaCC parser that runs
faster.  Also, does the JavaCC parser build the corresponding data
structure, or simply check that the string fits the grammar?

If possible, let's follow up on the instaparse mailing list:
https://groups.google.com/forum/#!forum/instaparse

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Meta-eX: Power to Complect (featuring Rich Hickey)

2013-12-17 Thread Samuel Aaron

On 16 Dec 2013, at 22:48, Timothy Washington  wrote:

> Lol, very cool :) 

Haha, thanks. The best is definitely still to come though. 2014 should be a 
good year for Meta-eX and live coding with Clojure.

Sam

---
http://sam.aaron.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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: cider status

2013-12-17 Thread Bozhidar Batsov
Good news for the Marmalade users here!

Nic Ferrier has fixed the package upload problem that plagued cider 0.4 and 
it’s now available for installation from there.  

--  
Cheers,
Bozhidar


On Tuesday, December 17, 2013 at 12:31 PM, Phillip Lord wrote:

> Gary Johnson mailto:gwjoh...@uvm.edu)> writes:
> > As another hacker who lives in Emacs, I found the nrepl -> cider transition 
> >  
> > to be quite painless. It took me maybe an hour of reading the website docs, 
> >  
> > installing/uninstalling packages with package.el, and updating the relevant 
> >  
> > sections of my .emacs.d/init.el file.  
> >  
>  
>  
> Well, it's an interesting opinion, but in to my mind, "an hour of
> reading and updating" != "relatively painless".
>  
> > Not to poo-poo on anyone's parade, but it really did seem pretty
> > straightforward to me.  
> >  
>  
>  
> I also had to port my own nrepl dependencies. Only of the unfortunate
> things about Emacs is that hook name changes don't get picked up
> automatically.
>  
> Still, pain in the ass though it was, hopefully, it should be over. I
> think changing the name to distinguish between the protocol and the
> environment is no bad thing, even if it was hard work.
>  
> Phil  

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] clojure.java.jdbc 0.3.0 "gold" release

2013-12-17 Thread Sean Corfield
The Clojure contrib library that provides a thin wrapper around JDBC.

For Leiningen:

[org.clojure/java.jdbc "0.3.0"]

Changes since RC1:

* Ensure canonical Boolean to workaround strange behavior in some JDBC
drivers JDBC-84.
* Rename recently introduced test to ensure unique names JDBC-83.
* Rename unused arguments in protocol implementation to support Android JDBC-82.
* Correctly handle empty param group sequence in execute! (which only
seemed to affect SQLite) JDBC-65.

For some background on the overall changes of 0.3.0 compared to 0.2.3,
read my blog post, which includes links to the detailed change log,
the reference documentation, and the soon-to-be-updated** Clojure
Documentation Site section on java.jdbc:

http://corfield.org/blog/post.cfm/clojure-java-jdbc-0-3-0-released

** Many changes are already in the CDS Github repo, the site just
needs to be re-generated from source.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Parsing large XML files

2013-12-17 Thread Matching Socks
On general Java principles, you can "stream" a large XML file with either 
SAX or StAX and pluck what you like from it without wasting memory on the 
rest.  If the file is a long series of small sections that could be 
examined separately, you might use SAX to partition the file and then 
subject each section to orthodox methods.  Or here's a small library that 
pulls a lazy sequence of stuff (Clojure data structures) from a file using 
StAX:

   https://github.com/pbwolf/drainclog


-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Comparing core.async and Reactive Extensions

2013-12-17 Thread Ben Mabey

On 12/17/13, 6:33 AM, Timothy Baldridge wrote:
I won't go so far as to tell you which is better as that often comes 
down to a matter of taste. However, I will explain the technical 
differences. In this case I'll use my (somewhat limited) knowledge of 
C# Rx. Scala/Java's Rx may be different.


Rx is based on a direct call. We could write a simple version of Rx 
thusly:


(defprotocol IObservable
 (on-next [this val])
 (attach [this obs]))

(defn filter [f]
  (let [a (atom #{})]
(reify IObservable
  (on-next [this val]
(when (f val)
  (doseq [i @a]
(on-next i val
  (attach [this obs]
(swap! a conj obs)


As you can see, each parent in the tree directly calls the child via 
the on-next (or on-error and on-exit in a real Rx impl). Thus it's 
pretty simple to run something like this without a thread pool or 
dispatcher. But what happens if calling on-next throws an exception? 
In that case the error bubbles up the wrong way. That is to say, the 
data goes down the data graph while errors go the opposite way. C# Rx 
has some code to handle things like this and populate errors the right 
way.


In addition it can be possible for multiple threads to be executing 
on-next at the same time. It all depends on the semantics of whatever 
is calling the top level on-next.


Core.Async on the other hand is based on two primitives: channels 
(queues) and processes. Errors are never propagated unless specified 
by the user. And thread pools/dispatchers are almost always required. 
With core.async we could implement filter thusly:


(defn filter [f in-c out-c]
  (go-loop []
(when-let [v (! out-c v)

Here we accept the input and output channels as arguments and then 
create a process that connects the two. Since the go-loop is a single 
thread only one message is in-flight in the body of this go at a 
single time. If we want more parallelism, we simply call this filter 
function multiple times to create multiple gos.


So that's the difference. Rx creates graphs of objects, while 
Core.Async (and CSP in general) creates graphs of processes connected 
by queues. CSP seems a bit more general to me, but many would probably 
disagree with me on that one.


Having used both I would agree that CSP is more general and when you 
need to do custom logic it tends to be easier, IME, than Rx. Another key 
difference is that Rx is only about one way communication within a 
single subscription.  Once you need to have bi-directional communication 
CSP is a better tool for the job.


-Ben

--
--
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Clojure IDE for OS X

2013-12-17 Thread Timothy Washington
Looks like a great effort. I wish you much success.

Tim Washington
Interruptsoftware.com 


On Sun, Dec 15, 2013 at 6:21 PM, Nikki Degutis wrote:

> It's called Leviathan. You should check it out here,
>
> https://github.com/sdegutis/Leviathan
>
> Go ahead and click the link, it's totally not a virus.
>
> Thanks,
> Team Degutis. :)
>
>

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Parsing large XML files

2013-12-17 Thread danneu
Good question. Every lib that came to mind when I saw 
clojure.data.xml/parse's
tree of Elements {:tag _,
:attrs _, :content _} only works on zippers which apparently sit in memory.

One option is to use `clojure.data.xml/source-seq` to get back a lazy 
sequence
of Events {:type _, :name _, :attrs _, :str _} where the event :name is 
either
:start-element, :end-element, or :characters.

For example, "Hello" would parse into the events
[:start-element "strong"], [:characters "Hello"], [:end-element "strong"]. 
You
could use loop/recur to manage state as your consume the sequence.

That's actually how I'm used to working with SAX parsers anyways. Here are 
some
naive Ruby examples if it's new to you: 
https://gist.github.com/danneu/3977120.

Of course, I imagine the ideal solution would involve some way to express 
selectors on the
Element tree like I'm used to doing with raynes/laser on zippers: 
https://github.com/Raynes/laser/blob/master/docs/guide.md#screen-scraping.


On Tuesday, December 17, 2013 4:57:32 AM UTC-6, Peter Ullah wrote:
>
>
> Hi all, 
>
> I'm attempting to parse a large (500MB) XML, specifically I am trying to 
> extract various parts using XPath. I've been using the examples presented 
> here: 
> http://clojure-doc.org/articles/tutorials/parsing_xml_with_zippers.html
> and all was going when tested against small files, however now that I am 
> using the larger file Fireplace/Vim just hangs and my laptop gets hot then 
> I get a memory exception.
>
> I've been playing around with various other libraries such as 
> clojure.data.xml and and found that the following works perfectly well for 
> parsing... but when I come to search inside root, things start to snarl up 
> again.
>
> (ns example.core
>   (:require [clojure.java.io :as java.io] 
> [clojure.data.xml :as data.xml]
> ))  
>
> (def large-file "/path-to-large-file")
>
> ;; using clojure.data.xml returns quickly with no problems whereas 
> clojure.xml/parse from the link above causes problems..
> (def root 
>   ( -> large-file
>java.io/input-stream
>data.xml/parse
>))  
>
> (class root) ;clojure.data.xml.Element
>
> Does anyone know a way of searching within root that won't consume the 
> heap?
>
> Forgive me, I'm new to Clojure and these forums, I've searched through 
> previous posts but not managed to answer my own question.
>
> Thanks in advance.
>

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.