Re: what is the best forum for keeping up with Clojure?

2024-01-10 Thread Laws
Thank you much.

On Wednesday, January 10, 2024 at 1:26:16 AM UTC-5 Sean Corfield wrote:

> The Clojurians Slack is probably the largest and most activity community 
> these days – http://clojurians.net to self-signup and 
> https://clojurians.slack.com for the content – but there's also 
> https://clojureverse.org if you prefer a "forum" over "chat". And there's 
> r/Clojure on Reddit – which also has a handy list of active Clojure 
> communities online in the right hand column.
>
> Also check out this list of resources on the official website: Clojure - 
> Community Resources <https://clojure.org/community/resources>
>
> Sean A Corfield -- (510) 862-3370
> An Architect's View -- https://corfield.org/
> World Singles Networks, LLC. -- https://worldsinglesnetworks.com/ 
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
>
> --
> *From:* clo...@googlegroups.com  on behalf of 
> Laws 
> *Sent:* Tuesday, January 9, 2024 2:46 PM
> *To:* Clojure 
> *Subject:* what is the best forum for keeping up with Clojure? 
>  
> Hi everyone, 
>
> I did a lot with Clojure back 2012-2019, but I've been away from it for 
> several years. Now I'm beginning a big new project in Clojure. I'm curious, 
> where would I go to learn about the newest libraries and projects? There 
> was a time 5 years ago when I knew all of the best and most interesting 
> projects, but nowadays I know very little about the scene. is there any 
> forum where people talk about Clojure and all that is new? 
>
>
> Lawrence Krubner
>
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/clojure/04ea0a28-e263-4af9-93f9-a50295fc1bd0n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/clojure/04ea0a28-e263-4af9-93f9-a50295fc1bd0n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/d935fc6e-3c75-4ef1-ba28-cb0a031fa45en%40googlegroups.com.


Re: what is the best forum for keeping up with Clojure?

2024-01-09 Thread Sean Corfield
The Clojurians Slack is probably the largest and most activity community these 
days – http://clojurians.net to self-signup and https://clojurians.slack.com 
for the content – but there's also https://clojureverse.org if you prefer a 
"forum" over "chat". And there's r/Clojure on Reddit – which also has a handy 
list of active Clojure communities online in the right hand column.

Also check out this list of resources on the official website: Clojure - 
Community Resources<https://clojure.org/community/resources>

Sean A Corfield -- (510) 862-3370
An Architect's View -- https://corfield.org/
World Singles Networks, LLC. -- https://worldsinglesnetworks.com/

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


From: clojure@googlegroups.com  on behalf of Laws 

Sent: Tuesday, January 9, 2024 2:46 PM
To: Clojure 
Subject: what is the best forum for keeping up with Clojure?

Hi everyone,

I did a lot with Clojure back 2012-2019, but I've been away from it for several 
years. Now I'm beginning a big new project in Clojure. I'm curious, where would 
I go to learn about the newest libraries and projects? There was a time 5 years 
ago when I knew all of the best and most interesting projects, but nowadays I 
know very little about the scene. is there any forum where people talk about 
Clojure and all that is new?


Lawrence Krubner

--
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<mailto:clojure+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/04ea0a28-e263-4af9-93f9-a50295fc1bd0n%40googlegroups.com<https://groups.google.com/d/msgid/clojure/04ea0a28-e263-4af9-93f9-a50295fc1bd0n%40googlegroups.com?utm_medium=email_source=footer>.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/IA1PR11MB619378F23198CAD2F5BCEC70F4692%40IA1PR11MB6193.namprd11.prod.outlook.com.


what is the best forum for keeping up with Clojure?

2024-01-09 Thread Laws
Hi everyone,

I did a lot with Clojure back 2012-2019, but I've been away from it for 
several years. Now I'm beginning a big new project in Clojure. I'm curious, 
where would I go to learn about the newest libraries and projects? There 
was a time 5 years ago when I knew all of the best and most interesting 
projects, but nowadays I know very little about the scene. is there any 
forum where people talk about Clojure and all that is new? 


Lawrence Krubner

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/04ea0a28-e263-4af9-93f9-a50295fc1bd0n%40googlegroups.com.


Re: What is this notation? "-a"

2021-12-27 Thread Hank Lenzi
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/d46da6c5-9409-4994-83eb-6cb13aefe7f7n%40googlegroups.com.


Re: What is this notation? "-a"

2021-12-26 Thread William la Forge
https://stackoverflow.com/questions/10846423/is-there-a-clojure-convention-for-naming-private-functions/10853372

On Saturday, December 25, 2021 at 6:53:56 PM UTC-5 hank@gmail.com wrote:

> Hello --
>
> Sometimes I see a notation that uses a prefix "-", as in:
>
> user> (def -a (atom []))
> #'user/-a
>
> Is there a special meaning/convention regarding this use of a hyphen 
> prefix?
> TIA
> -- Hank
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/dd81c045-f6a3-4c31-94ea-1f252e0fa86an%40googlegroups.com.


What is this notation? "-a"

2021-12-25 Thread Hank Lenzi
Hello --

Sometimes I see a notation that uses a prefix "-", as in:

user> (def -a (atom []))
#'user/-a

Is there a special meaning/convention regarding this use of a hyphen prefix?
TIA
-- Hank

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/7512b9ae-2119-43d8-9595-41bcc38caae5n%40googlegroups.com.


Re: What are resources to learn Clojure for beginners in Programming and get better?

2021-11-04 Thread Zeinab Zeitoun
Hello,
I highly recommend https://www.braveclojure.com/

*Zeinab Zeitoun*
Full Stack Developer
+961 70748800 | linkedin.com/in/zeinab-zeitoun
Pure Mathematics | American University of Beirut

<http://linkedin.com/in/zeinab-zeitoun>


On Thu, Nov 4, 2021 at 12:42 PM Hanekawa Tsubasa 
wrote:

> Thank you all, those are all wonderful replies, and they help a lot
>
> On Thursday, November 4, 2021 at 1:59:28 AM UTC+1 lafo...@gmail.com wrote:
>
>> This may seem silly at times, but I think very highly of it as a starting
>> point: https://www.braveclojure.com/
>>
>> Also, I suggest that you shift approaches from time to time. Clojure is
>> unbelievably rich and supports programming methodologies that you've never
>> hear of, as well as all the ones you have previously encountered.
>>
>> Here's a quick access page that provides an index into a lot of basic
>> clojure functions:
>> https://jafingerhut.github.io/cheatsheet/clojuredocs/cheatsheet-tiptip-cdocs-summary.html
>>
>> On Wednesday, November 3, 2021 at 10:07:09 AM UTC-4 shouk...@gmail.com
>> wrote:
>>
>>> As in title,
>>> I am not too good of programmer, best I can do is like, write simple
>>> number guessing game, and I guess that is an elementary thing to even be
>>> able to do..
>>>
>>> So,
>>> My question is, what are good resources to get better at clojure, that
>>> does not require much prior experience?
>>>
>>> And other question while we are at it..
>>> Would be going through specific tutorials, like for example, how to
>>> write simple snake game in clojure, and then playing around with it,
>>> changing things, be a decent approach?
>>>
>>> In advance, I appreciate all replies, thank you.
>>>
>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/92c8557e-3320-4c5a-9818-ab1673be6fe1n%40googlegroups.com
> <https://groups.google.com/d/msgid/clojure/92c8557e-3320-4c5a-9818-ab1673be6fe1n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAEwjH7hB02fNTzfbvsP%2BoE_kXbS3VbbaS8JZsarb%3D3K5dPdNRg%40mail.gmail.com.


Re: What are resources to learn Clojure for beginners in Programming and get better?

2021-11-04 Thread Hanekawa Tsubasa
Thank you all, those are all wonderful replies, and they help a lot

On Thursday, November 4, 2021 at 1:59:28 AM UTC+1 lafo...@gmail.com wrote:

> This may seem silly at times, but I think very highly of it as a starting 
> point: https://www.braveclojure.com/
>
> Also, I suggest that you shift approaches from time to time. Clojure is 
> unbelievably rich and supports programming methodologies that you've never 
> hear of, as well as all the ones you have previously encountered. 
>
> Here's a quick access page that provides an index into a lot of basic 
> clojure functions: 
> https://jafingerhut.github.io/cheatsheet/clojuredocs/cheatsheet-tiptip-cdocs-summary.html
>
> On Wednesday, November 3, 2021 at 10:07:09 AM UTC-4 shouk...@gmail.com 
> wrote:
>
>> As in title,
>> I am not too good of programmer, best I can do is like, write simple 
>> number guessing game, and I guess that is an elementary thing to even be 
>> able to do..
>>
>> So,
>> My question is, what are good resources to get better at clojure, that 
>> does not require much prior experience?
>>
>> And other question while we are at it..
>> Would be going through specific tutorials, like for example, how to write 
>> simple snake game in clojure, and then playing around with it, changing 
>> things, be a decent approach?
>>
>> In advance, I appreciate all replies, thank you.
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/92c8557e-3320-4c5a-9818-ab1673be6fe1n%40googlegroups.com.


Re: What are resources to learn Clojure for beginners in Programming and get better?

2021-11-03 Thread William la Forge
This may seem silly at times, but I think very highly of it as a starting 
point: https://www.braveclojure.com/

Also, I suggest that you shift approaches from time to time. Clojure is 
unbelievably rich and supports programming methodologies that you've never 
hear of, as well as all the ones you have previously encountered. 

Here's a quick access page that provides an index into a lot of basic 
clojure 
functions: 
https://jafingerhut.github.io/cheatsheet/clojuredocs/cheatsheet-tiptip-cdocs-summary.html

On Wednesday, November 3, 2021 at 10:07:09 AM UTC-4 shouk...@gmail.com 
wrote:

> As in title,
> I am not too good of programmer, best I can do is like, write simple 
> number guessing game, and I guess that is an elementary thing to even be 
> able to do..
>
> So,
> My question is, what are good resources to get better at clojure, that 
> does not require much prior experience?
>
> And other question while we are at it..
> Would be going through specific tutorials, like for example, how to write 
> simple snake game in clojure, and then playing around with it, changing 
> things, be a decent approach?
>
> In advance, I appreciate all replies, thank you.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/f4d03588-3153-4f27-a9ca-a3d2370495fen%40googlegroups.com.


Re: What are resources to learn Clojure for beginners in Programming and get better?

2021-11-03 Thread Harold
> My question is, what are good resources to get better at clojure, that 
does not require much prior experience?
>

I learned a lot from, and like to recommend, the 
Koans: http://clojurekoans.com/

> Would be going through specific tutorials, like for example, how to write 
simple snake game in clojure, and then playing around with it, changing 
things, be a decent approach?
>

Sure. At this early stage, you'll benefit from basically anything you do. 
It's important that what you do is fun, because if it's fun you'll keep 
doing it, and if you don't keep doing it, you won't improve.

I'll also mention https://ask.clojure.org/ - a great site for getting 
specific questions answered; and you'll have questions as you go along.

Hope that helps.

Warmly,
-Harold
On Wednesday, November 3, 2021 at 8:07:09 AM UTC-6 shouk...@gmail.com wrote:

> As in title,
> I am not too good of programmer, best I can do is like, write simple 
> number guessing game, and I guess that is an elementary thing to even be 
> able to do..
>
> So,
> My question is, what are good resources to get better at clojure, that 
> does not require much prior experience?
>
> And other question while we are at it..
> Would be going through specific tutorials, like for example, how to write 
> simple snake game in clojure, and then playing around with it, changing 
> things, be a decent approach?
>
> In advance, I appreciate all replies, thank you.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/2f5873b1-8202-41fe-961b-5e3fa2066b5an%40googlegroups.com.


Re: What are resources to learn Clojure for beginners in Programming and get better?

2021-11-03 Thread Jacek Schae
Shameless plug 

When I came to Clojure community this is what I was looking for; a way to 
learn to learn idiomatic Clojure without a lot of prior knowledge. This is 
why I created these:

https://www.learnreagent.com 
https://www.learnreframe.com
https://www.learnreitit.com 
https://www.learndatomic.com

You can get all via subscription to https://clojure.stream

I would recommend to do them in the order I listed them: Reagent > Re-Frame 
> Reitit > Datomic. Reagent course starts from basic concepts - immutable 
data structures, list comprehension, destructuring, threading macros ... 
and the rest builds on top of that.

Every course takes your from zero to having a finished app; including 
deployment. My learning style is learning by doing and all of the courses 
are constructed this way. We build fronted app, or backend REST API ...  if 
this is something that could work for you -- check it out.

Jacek

PS. If you like podcasts -- check out https://clojurescriptpodcast.com I 
talk with community member about libraries (mainly web dev), which should 
serve a learning resource to understand Clojure ecosystem.


On Wednesday, November 3, 2021 at 11:07:09 PM UTC+9 shouk...@gmail.com 
wrote:

> As in title,
> I am not too good of programmer, best I can do is like, write simple 
> number guessing game, and I guess that is an elementary thing to even be 
> able to do..
>
> So,
> My question is, what are good resources to get better at clojure, that 
> does not require much prior experience?
>
> And other question while we are at it..
> Would be going through specific tutorials, like for example, how to write 
> simple snake game in clojure, and then playing around with it, changing 
> things, be a decent approach?
>
> In advance, I appreciate all replies, thank you.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/519614e5-63ee-46f5-bf1b-72c5c2cabdedn%40googlegroups.com.


What are resources to learn Clojure for beginners in Programming and get better?

2021-11-03 Thread Hanekawa Tsubasa


As in title,
I am not too good of programmer, best I can do is like, write simple number 
guessing game, and I guess that is an elementary thing to even be able to 
do..

So,
My question is, what are good resources to get better at clojure, that does 
not require much prior experience?

And other question while we are at it..
Would be going through specific tutorials, like for example, how to write 
simple snake game in clojure, and then playing around with it, changing 
things, be a decent approach?

In advance, I appreciate all replies, thank you.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/4cd7823a-909f-425e-846d-ed1f80b448d6n%40googlegroups.com.


Re: What Emacs framework do you prefer?

2021-08-10 Thread Laws
Thank you, everyone, I'll investigate these suggestions. 

On Monday, August 9, 2021 at 10:50:04 PM UTC-4 Laws wrote:

> I've been away from Clojure for 3 years but I've decided my next project 
> will be pure Clojure. I'm setting everything up on a new MacBook Pro that I 
> just bought. I just installed Emacs and I'm wondering what kind of 
> starter-kit or framework do people prefer nowadays? Does anyone want to 
> either recommend a framework or share an init file that has some 
> customizations for Clojure? 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/3b75dd32-2093-40df-afb9-3a3ca75156b1n%40googlegroups.com.


Re: What Emacs framework do you prefer?

2021-08-10 Thread Zack Teo
If you are looking for a framework for Emacs as a whole - I personally use Doom 
Emacs <https://github.com/hlissner/doom-emacs> - which for the most part, I 
just enable clojure module on. 

Many others seem to use Spacemacs - of which practicalli seems to have some 
guides on here <https://practical.li/spacemacs/>. 

Lastly, there is Prelude 
<https://github.com/bbatsov/prelude/blob/f9fb902185e1f7afabe281a25f5787e69ea7b6c9/doc/modules/clojure.md>
 
which the author of CIDER manages. 

Of course, there's other community managed configurations of Emacs but 
these are the few I frequently encounter - And am aware have specific 
configurations for Clojure.





On Tuesday, August 10, 2021 at 5:18:14 PM UTC+8 Jiacai Liu wrote:

> https://github.com/flyingmachine/emacs-for-clojure
>
> I recommend flyingmachine's config, tailored for clojure 
> development.
> Also his awesome book https://www.braveclojure.com/basic-emacs/
>
> On Tue, Aug 10, 2021 at 10:50:04 AM +0800, Laws wrote:
>
> > I've been away from Clojure for 3 years but I've decided my next 
> > project
> > will be pure Clojure. I'm setting everything up on a new MacBook 
> > Pro that I
> > just bought. I just installed Emacs and I'm wondering what kind 
> > of
> > starter-kit or framework do people prefer nowadays? Does anyone 
> > want to
> > either recommend a framework or share an init file that has some
> > customizations for Clojure?
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/0d26e1e6-96a7-4a55-9571-0382c540349dn%40googlegroups.com.


Re: What Emacs framework do you prefer?

2021-08-10 Thread Jiacai Liu

https://github.com/flyingmachine/emacs-for-clojure

I recommend flyingmachine's config, tailored for clojure 
development.

Also his awesome book https://www.braveclojure.com/basic-emacs/

On Tue, Aug 10, 2021 at 10:50:04 AM +0800, Laws wrote:

I've been away from Clojure for 3 years but I've decided my next 
project
will be pure Clojure. I'm setting everything up on a new MacBook 
Pro that I
just bought. I just installed Emacs and I'm wondering what kind 
of
starter-kit or framework do people prefer nowadays? Does anyone 
want to

either recommend a framework or share an init file that has some
customizations for Clojure?



--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/6112444b.1c69fb81.43c55.6a4cSMTPIN_ADDED_BROKEN%40gmr-mx.google.com.


Re: What Emacs framework do you prefer?

2021-08-10 Thread Oleksandr Shulgin
On Tue, Aug 10, 2021 at 4:50 AM Laws  wrote:

> Does anyone want to either recommend a framework or share an init file
> that has some customizations for Clojure?


https://cider.mx/


Cheers,
--
Alex

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CACACo5RQ1zbeXnHWS03KBwqG6XcQ2Z0D-6ivELg32RVD-0VayQ%40mail.gmail.com.


What Emacs framework do you prefer?

2021-08-09 Thread Laws
I've been away from Clojure for 3 years but I've decided my next project 
will be pure Clojure. I'm setting everything up on a new MacBook Pro that I 
just bought. I just installed Emacs and I'm wondering what kind of 
starter-kit or framework do people prefer nowadays? Does anyone want to 
either recommend a framework or share an init file that has some 
customizations for Clojure? 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/81473f1a-f867-41ef-8dd3-2afd0946c373n%40googlegroups.com.


Re: what is currently considered a good blog engine, written in Clojure?

2020-12-13 Thread lawrence...@gmail.com
Thank you everyone.

On Sunday, December 13, 2020 at 12:05:01 PM UTC-5 stan@gmail.com wrote:

> On 13.12.2020 10:11, Christopher Small wrote:
> > Oz (in addition to being a dataviz tookit) has evolved into the realm of 
> > static site generation 
> > , complete 
> > with live code reloading. Simply
> > 
> > |(require '[oz.core :as oz]) (oz/build! [{:from "site-src/pages" :to 
> > "build"}]) |
> > 
> > This will set up a filesystem watch on the |site-src/pages| directory 
> > (of markdown, or edn/clj files with hiccup), and every time the file 
> > changes will output compiled html to the |build| directory, as well as 
> > update a live view of the most recently edited page.
> > 
> > Note that you can specify multiple such build specifications, in case 
> > different pages need to be rendered differently (e.g. different 
> > template/layout/styling).
> > 
> > |(defn blog-template [hiccup] [:div {:style {:extra :styles}} 
> > [blog-sidebar] hiccup]) (oz/build! [{:from "site-src/pages" :to "build"} 
> > {:from "site-src/blog" :to "build/blog" :template-fn blog-template}]) |
> > 
> > There’s plenty more to say, but I’ll leave it for the docs:
> > 
> > https://github.com/metasoarous/oz#static-site-generation 
> > 
> > 
> > To my knowledge, this is the only static site rendering framework in 
> > Clojure with live-code reloading. I’ve been thinking about extracting 
> > this functionality into a standalone library without all of the data 
> > visualization business, but it’s a bit of an invasive operation. As it 
> > stands, it’s a bit hard to discover these features amidst everything 
> > else Oz provides, so I would appreciate feedback on this.
> > 
> > I you try it out, please let me know how it goes for you.
> > 
> > Thanks
> > 
> > Chris
>
> I'm also using Cryogen Web.
> I had pretty good experience with it.
> It's not as developed as more popular static website generators but for 
> me it is good enough.
> It also received some contributions lately so it should work even better.
>
> I wanted live reload while working on content/themes and wrote this 
> guide on how to integrate it - 
> https://www.ieugen.ro/posts/2020/2020-11-14-live-reload-for-cryogen-web/ .
>
> (The website is is hosted with Cryogen Web 
> https://gitlab.com/ieugen/ieugen-ro ).
>
>
> Thank you for sharing the other options, I did not know about them.
>
> Eugen
>
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/cba779ad-3c87-4b60-80a2-705ff7b517c4n%40googlegroups.com.


Re: what is currently considered a good blog engine, written in Clojure?

2020-12-13 Thread Eugen Stan

On 13.12.2020 10:11, Christopher Small wrote:
Oz (in addition to being a dataviz tookit) has evolved into the realm of 
static site generation 
, complete 
with live code reloading. Simply


|(require '[oz.core :as oz]) (oz/build! [{:from "site-src/pages" :to 
"build"}]) |


This will set up a filesystem watch on the |site-src/pages| directory 
(of markdown, or edn/clj files with hiccup), and every time the file 
changes will output compiled html to the |build| directory, as well as 
update a live view of the most recently edited page.


Note that you can specify multiple such build specifications, in case 
different pages need to be rendered differently (e.g. different 
template/layout/styling).


|(defn blog-template [hiccup] [:div {:style {:extra :styles}} 
[blog-sidebar] hiccup]) (oz/build! [{:from "site-src/pages" :to "build"} 
{:from "site-src/blog" :to "build/blog" :template-fn blog-template}]) |


There’s plenty more to say, but I’ll leave it for the docs:

https://github.com/metasoarous/oz#static-site-generation 



To my knowledge, this is the only static site rendering framework in 
Clojure with live-code reloading. I’ve been thinking about extracting 
this functionality into a standalone library without all of the data 
visualization business, but it’s a bit of an invasive operation. As it 
stands, it’s a bit hard to discover these features amidst everything 
else Oz provides, so I would appreciate feedback on this.


I you try it out, please let me know how it goes for you.

Thanks

Chris


I'm also using Cryogen Web.
I had pretty good experience with it.
It's not as developed as more popular static website generators but for 
me it is good enough.

It also received some contributions lately so it should work even better.

I wanted live reload while working on content/themes and wrote this 
guide on how to integrate it - 
https://www.ieugen.ro/posts/2020/2020-11-14-live-reload-for-cryogen-web/ .


(The website is is hosted with Cryogen Web 
https://gitlab.com/ieugen/ieugen-ro ).



Thank you for sharing the other options, I did not know about them.

Eugen



--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/8b63c87f-e01b-2fea-14bd-b6d8aa3bfe72%40gmail.com.


Re: what is currently considered a good blog engine, written in Clojure?

2020-12-13 Thread Christopher Small


Oz (in addition to being a dataviz tookit) has evolved into the realm of static 
site generation , 
complete with live code reloading. Simply

(require '[oz.core :as oz])

(oz/build! [{:from "site-src/pages" :to "build"}])

This will set up a filesystem watch on the site-src/pages directory (of 
markdown, or edn/clj files with hiccup), and every time the file changes 
will output compiled html to the build directory, as well as update a live 
view of the most recently edited page.

Note that you can specify multiple such build specifications, in case 
different pages need to be rendered differently (e.g. different 
template/layout/styling).

(defn blog-template [hiccup]
  [:div {:style {:extra :styles}}
   [blog-sidebar]
   hiccup])

(oz/build!
  [{:from "site-src/pages" :to "build"}
   {:from "site-src/blog" :to "build/blog" :template-fn blog-template}])

There’s plenty more to say, but I’ll leave it for the docs:

https://github.com/metasoarous/oz#static-site-generation

To my knowledge, this is the only static site rendering framework in 
Clojure with live-code reloading. I’ve been thinking about extracting this 
functionality into a standalone library without all of the data 
visualization business, but it’s a bit of an invasive operation. As it 
stands, it’s a bit hard to discover these features amidst everything else 
Oz provides, so I would appreciate feedback on this.

I you try it out, please let me know how it goes for you.

Thanks

Chris


On Saturday, December 12, 2020 at 8:31:19 PM UTC-8 Sean Corfield wrote:

> I think a lot of people use Cryogen: Simple static sites (cryogenweb.org) 
>  -- I used to use Octopress, based on Jekyll, 
> and switched to Cryogen recently. For the commenting system, I've used 
> Disqus for a long time. And I host on GitHub (via seancorfield.github.io 
> and a custom corfield.org domain).
>
> On Sat, Dec 12, 2020 at 1:53 AM lawrence...@gmail.com <
> lawrence...@gmail.com> wrote:
>
>> Hello everyone. I've been away from the Clojure community for the last 2 
>> years (nowadays I do more managing than programming) but I'm starting a new 
>> blog. I tried to use Wordpress on the theory that it is "easy" and also 
>> because I've been told they fixed their old security flaws, but I installed 
>> the latest version and it was hacked in less than a day, so now I'm feeling 
>> unkindly towards Wordpress. 
>>
>> I'm looking for a blog engine, which can use a database or flat files, I 
>> don't care. 
>>
>> The main thing I need is a working comment system, with an ability on my 
>> side to whitelist particular commenters. Does anything like that exist 
>> written in Clojure?
>>
>> I'm very grateful, if anyone can point me to something that works, and is 
>> reasonably maintained. 
>>
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/clojure/3cb3a068-a916-4bd4-925f-cd71744908dcn%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- https://corfield.org/
> World Singles Networks, LLC. -- https://worldsinglesnetworks.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/45b2e71e-cbe3-486d-a074-37b608103613n%40googlegroups.com.


Re: what is currently considered a good blog engine, written in Clojure?

2020-12-12 Thread Sean Corfield
I think a lot of people use Cryogen: Simple static sites (cryogenweb.org)
 -- I used to use Octopress, based on Jekyll, and
switched to Cryogen recently. For the commenting system, I've used Disqus
for a long time. And I host on GitHub (via seancorfield.github.io and a
custom corfield.org domain).

On Sat, Dec 12, 2020 at 1:53 AM lawrence...@gmail.com <
lawrence.krub...@gmail.com> wrote:

> Hello everyone. I've been away from the Clojure community for the last 2
> years (nowadays I do more managing than programming) but I'm starting a new
> blog. I tried to use Wordpress on the theory that it is "easy" and also
> because I've been told they fixed their old security flaws, but I installed
> the latest version and it was hacked in less than a day, so now I'm feeling
> unkindly towards Wordpress.
>
> I'm looking for a blog engine, which can use a database or flat files, I
> don't care.
>
> The main thing I need is a working comment system, with an ability on my
> side to whitelist particular commenters. Does anything like that exist
> written in Clojure?
>
> I'm very grateful, if anyone can point me to something that works, and is
> reasonably maintained.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/3cb3a068-a916-4bd4-925f-cd71744908dcn%40googlegroups.com
> 
> .
>


-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- https://corfield.org/
World Singles Networks, LLC. -- https://worldsinglesnetworks.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAD4thx9zO5G9%2BK7jV%2BGRkYqLXh4oq%3DEsixYhZOvMkDoueFAuVA%40mail.gmail.com.


Re: what is currently considered a good blog engine, written in Clojure?

2020-12-12 Thread Andrea Richiardi
I like a lot and using perun for www.andrearichiardi.com

The workflow is great but unfortunately work on boot and perun has 
stagnated a bit. Trying to give it a bit of love as we speak! 

On Saturday, December 12, 2020 at 1:52:43 AM UTC-8 lawrence...@gmail.com 
wrote:

> Hello everyone. I've been away from the Clojure community for the last 2 
> years (nowadays I do more managing than programming) but I'm starting a new 
> blog. I tried to use Wordpress on the theory that it is "easy" and also 
> because I've been told they fixed their old security flaws, but I installed 
> the latest version and it was hacked in less than a day, so now I'm feeling 
> unkindly towards Wordpress. 
>
> I'm looking for a blog engine, which can use a database or flat files, I 
> don't care. 
>
> The main thing I need is a working comment system, with an ability on my 
> side to whitelist particular commenters. Does anything like that exist 
> written in Clojure?
>
> I'm very grateful, if anyone can point me to something that works, and is 
> reasonably maintained. 
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/d4f44ff3-4f31-4716-90f3-e20601227fe7n%40googlegroups.com.


what is currently considered a good blog engine, written in Clojure?

2020-12-12 Thread lawrence...@gmail.com
Hello everyone. I've been away from the Clojure community for the last 2 
years (nowadays I do more managing than programming) but I'm starting a new 
blog. I tried to use Wordpress on the theory that it is "easy" and also 
because I've been told they fixed their old security flaws, but I installed 
the latest version and it was hacked in less than a day, so now I'm feeling 
unkindly towards Wordpress. 

I'm looking for a blog engine, which can use a database or flat files, I 
don't care. 

The main thing I need is a working comment system, with an ability on my 
side to whitelist particular commenters. Does anything like that exist 
written in Clojure?

I'm very grateful, if anyone can point me to something that works, and is 
reasonably maintained. 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/3cb3a068-a916-4bd4-925f-cd71744908dcn%40googlegroups.com.


Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-19 Thread Rowan Hargreaves
+1 for at-at. 

I've used it recently and it works well. It 
uses ScheduledThreadPoolExecutor etc under the hood, and it's only 350 
lines of readable code if you want to dig in. 

I have found its interface easy to use. As well as scheduling at specific 
times (the at function) or at regular intervals (every), it has the 
function interspaced which will schedule tasks after a specified delay 
after the previous call to that task has finished.  It also has a way of 
viewing and reseting tasks in the task pool.   

Rowan

On Monday, December 17, 2018 at 8:31:07 PM UTC, Tim Visher wrote:
>
> On Mon, Dec 17, 2018 at 2:54 PM > 
> wrote:
>
>> But at-at has not been updated in 6 years, so I assume it is abandoned. I 
>> have two questions about this:
>>
>
> A common bit of wisdom here in the Clojure community is that time since 
> last update is not always (or even often) a sign of abandonment but instead 
> of stability. If there are many and recent open issues on at-at then maybe 
> it's been abandoned. Or it could just be stable.
>
> Disclaimer, I don't know much about at-at.
>

-- 
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/d/optout.


Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread Laurens Van Houtven
Hi,

On Mon, Dec 17, 2018 at 3:46 PM  wrote:

> Laurens Van Houtven, good ideas, but then I'd also have to write some code
> to catch documents that got lost when a process died while trying to fetch
> a document from S3. If I simply check every 15 minutes, and grab everything
> that has not already been stored in the database, then I automatically
> fetch documents that were dropped due to error. It seems simple. In my
> current case, there is no penalty for fetching the same document twice, but
> it is important that we avoid missing a document.
>

I'm not sure why that makes my suggestions not work: you  create a
CloudWatch Event that just fires every 15 minutes :-) Heck, you can write
one that fires on S3 write, and then another that fires on cloudwatch
errors for when that process dies :-) But I'd probably just use a
CloudWatch event that fires every 15 minute sand run your code as an ECS
Fargate job.

lvh


>
>
> On Monday, December 17, 2018 at 2:59:22 PM UTC-5, Laurens Van Houtven
> wrote:
>>
>> Honestly I'd use CloudWatch Timed Events to kick off a Lambda or ECS
>> Fargate job (which of course you can write in Clojure) assuming you're
>> using AWS yourself anyway. If you don't care about batching maybe even just
>> attach a Lambda to the write-to-S3 bucket itself instead of checking every
>> 15m?
>>
>> If you want to do it in-process, my tool of choice is ztellman's
>> manifold:
>> https://github.com/ztellman/manifold/blob/d67a8c1b9f1268c094895d70dbbf146521f5774b/src/manifold/time.clj
>>
>> On Mon, Dec 17, 2018 at 1:54 PM  wrote:
>>
>>> I'm coming back to Clojure development after a year away. This is a fast
>>> moving community and it is hard to keep up when one is not working on it
>>> full time. I'm dusting off some code I wrote 2 years ago, and trying to
>>> bring all the dependencies up to their current versions.
>>>
>>> I have a function that fetches files from an AWS S3 bucket, every 15
>>> minutes. I had previously used the at-at library for this:
>>>
>>> https://github.com/overtone/at-at
>>>
>>> But at-at has not been updated in 6 years, so I assume it is abandoned.
>>> I have two questions about this:
>>>
>>> 1.) how else do Clojure programmers usually call recurring
>>> functionality?
>>>
>>> 2.) I am ignorant about the JVM, so I'm afraid I have to ask, at a
>>> fundamental level, how does at-at work? I know that if a function calls
>>> itself recurringly, on the JVM, one eventually gets stackoverflow. So how
>>> does at-at make its magic work?
>>>
>>> --
>>> 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/d/optout.
>>>
>> --
> 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/d/optout.
>

-- 
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/d/optout.


Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread Adam Clements
I think iirc that at-at uses scheduledexecutor and is a very simple and
stable library which only does one thing, but does it well and has no
feature requests. I wrote schejulure which does a very similar job but with
cron style time specifications rather than periodic and haven't touched it
for years because it just works and even though it's used in production
nobody has found any issues or needed it to do anything it doesn't already
do. I think the same is probably true of at-at.

Adam

On Mon, 17 Dec 2018, 9:46 pm  James Reeves, that does sound like the right way to go. I'll do that.
>
>
> On Monday, December 17, 2018 at 3:31:01 PM UTC-5, James Reeves wrote:
>>
>>
>> I'd use an executor:
>>
>>   (ns example.main
>> (:import [java.util.concurrent Executors TimeUnit]))
>>
>>   (def scheduler
>> (Executors/newScheduledThreadPool 32))
>>
>>   (defn fetch-files []
>> (println "Fetching files...))
>>
>>   (defn -main []
>> (.scheduleAtFixedRate scheduler ^Runnable fetch-files 15 15
>> TimeUnit/MINUTES))
>>
>> On Mon, 17 Dec 2018 at 20:14,  wrote:
>>
>>> I'm coming back to Clojure development after a year away. This is a fast
>>> moving community and it is hard to keep up when one is not working on it
>>> full time. I'm dusting off some code I wrote 2 years ago, and trying to
>>> bring all the dependencies up to their current versions.
>>>
>>> I have a function that fetches files from an AWS S3 bucket, every 15
>>> minutes. I had previously used the at-at library for this:
>>>
>>> https://github.com/overtone/at-at
>>>
>>> But at-at has not been updated in 6 years, so I assume it is abandoned.
>>> I have two questions about this:
>>>
>>> 1.) how else do Clojure programmers usually call recurring
>>> functionality?
>>>
>>> 2.) I am ignorant about the JVM, so I'm afraid I have to ask, at a
>>> fundamental level, how does at-at work? I know that if a function calls
>>> itself recurringly, on the JVM, one eventually gets stackoverflow. So how
>>> does at-at make its magic work?
>>>
>>> --
>>> 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/d/optout.
>>>
>>
>>
>> --
>> James Reeves
>> booleanknot.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
> 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/d/optout.
>

-- 
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/d/optout.


Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread lawrence . krubner
Laurens Van Houtven, good ideas, but then I'd also have to write some code 
to catch documents that got lost when a process died while trying to fetch 
a document from S3. If I simply check every 15 minutes, and grab everything 
that has not already been stored in the database, then I automatically 
fetch documents that were dropped due to error. It seems simple. In my 
current case, there is no penalty for fetching the same document twice, but 
it is important that we avoid missing a document. 



On Monday, December 17, 2018 at 2:59:22 PM UTC-5, Laurens Van Houtven wrote:
>
> Honestly I'd use CloudWatch Timed Events to kick off a Lambda or ECS 
> Fargate job (which of course you can write in Clojure) assuming you're 
> using AWS yourself anyway. If you don't care about batching maybe even just 
> attach a Lambda to the write-to-S3 bucket itself instead of checking every 
> 15m?
>
> If you want to do it in-process, my tool of choice is ztellman's manifold: 
> https://github.com/ztellman/manifold/blob/d67a8c1b9f1268c094895d70dbbf146521f5774b/src/manifold/time.clj
>
> On Mon, Dec 17, 2018 at 1:54 PM > 
> wrote:
>
>> I'm coming back to Clojure development after a year away. This is a fast 
>> moving community and it is hard to keep up when one is not working on it 
>> full time. I'm dusting off some code I wrote 2 years ago, and trying to 
>> bring all the dependencies up to their current versions. 
>>
>> I have a function that fetches files from an AWS S3 bucket, every 15 
>> minutes. I had previously used the at-at library for this:
>>
>> https://github.com/overtone/at-at
>>
>> But at-at has not been updated in 6 years, so I assume it is abandoned. I 
>> have two questions about this:
>>
>> 1.) how else do Clojure programmers usually call recurring functionality? 
>>
>> 2.) I am ignorant about the JVM, so I'm afraid I have to ask, at a 
>> fundamental level, how does at-at work? I know that if a function calls 
>> itself recurringly, on the JVM, one eventually gets stackoverflow. So how 
>> does at-at make its magic work? 
>>
>> -- 
>> 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/d/optout.
>>
>

-- 
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/d/optout.


Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread lawrence . krubner
James Reeves, that does sound like the right way to go. I'll do that. 


On Monday, December 17, 2018 at 3:31:01 PM UTC-5, James Reeves wrote:
>
>
> I'd use an executor:
>
>   (ns example.main
> (:import [java.util.concurrent Executors TimeUnit]))
>
>   (def scheduler
> (Executors/newScheduledThreadPool 32))
>
>   (defn fetch-files []
> (println "Fetching files...))
>
>   (defn -main []
> (.scheduleAtFixedRate scheduler ^Runnable fetch-files 15 15 
> TimeUnit/MINUTES))
>
> On Mon, 17 Dec 2018 at 20:14, > wrote:
>
>> I'm coming back to Clojure development after a year away. This is a fast 
>> moving community and it is hard to keep up when one is not working on it 
>> full time. I'm dusting off some code I wrote 2 years ago, and trying to 
>> bring all the dependencies up to their current versions. 
>>
>> I have a function that fetches files from an AWS S3 bucket, every 15 
>> minutes. I had previously used the at-at library for this:
>>
>> https://github.com/overtone/at-at
>>
>> But at-at has not been updated in 6 years, so I assume it is abandoned. I 
>> have two questions about this:
>>
>> 1.) how else do Clojure programmers usually call recurring functionality? 
>>
>> 2.) I am ignorant about the JVM, so I'm afraid I have to ask, at a 
>> fundamental level, how does at-at work? I know that if a function calls 
>> itself recurringly, on the JVM, one eventually gets stackoverflow. So how 
>> does at-at make its magic work? 
>>
>> -- 
>> 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/d/optout.
>>
>
>
> -- 
> James Reeves
> booleanknot.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
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/d/optout.


Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread James Reeves
I'd use an executor:

  (ns example.main
(:import [java.util.concurrent Executors TimeUnit]))

  (def scheduler
(Executors/newScheduledThreadPool 32))

  (defn fetch-files []
(println "Fetching files...))

  (defn -main []
(.scheduleAtFixedRate scheduler ^Runnable fetch-files 15 15
TimeUnit/MINUTES))

On Mon, 17 Dec 2018 at 20:14,  wrote:

> I'm coming back to Clojure development after a year away. This is a fast
> moving community and it is hard to keep up when one is not working on it
> full time. I'm dusting off some code I wrote 2 years ago, and trying to
> bring all the dependencies up to their current versions.
>
> I have a function that fetches files from an AWS S3 bucket, every 15
> minutes. I had previously used the at-at library for this:
>
> https://github.com/overtone/at-at
>
> But at-at has not been updated in 6 years, so I assume it is abandoned. I
> have two questions about this:
>
> 1.) how else do Clojure programmers usually call recurring functionality?
>
> 2.) I am ignorant about the JVM, so I'm afraid I have to ask, at a
> fundamental level, how does at-at work? I know that if a function calls
> itself recurringly, on the JVM, one eventually gets stackoverflow. So how
> does at-at make its magic work?
>
> --
> 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/d/optout.
>


-- 
James Reeves
booleanknot.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
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/d/optout.


Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread Tim Visher
On Mon, Dec 17, 2018 at 2:54 PM  wrote:

> But at-at has not been updated in 6 years, so I assume it is abandoned. I
> have two questions about this:
>

A common bit of wisdom here in the Clojure community is that time since
last update is not always (or even often) a sign of abandonment but instead
of stability. If there are many and recent open issues on at-at then maybe
it's been abandoned. Or it could just be stable.

Disclaimer, I don't know much about at-at.

-- 
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/d/optout.


Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread Laurens Van Houtven
Honestly I'd use CloudWatch Timed Events to kick off a Lambda or ECS
Fargate job (which of course you can write in Clojure) assuming you're
using AWS yourself anyway. If you don't care about batching maybe even just
attach a Lambda to the write-to-S3 bucket itself instead of checking every
15m?

If you want to do it in-process, my tool of choice is ztellman's manifold:
https://github.com/ztellman/manifold/blob/d67a8c1b9f1268c094895d70dbbf146521f5774b/src/manifold/time.clj

On Mon, Dec 17, 2018 at 1:54 PM  wrote:

> I'm coming back to Clojure development after a year away. This is a fast
> moving community and it is hard to keep up when one is not working on it
> full time. I'm dusting off some code I wrote 2 years ago, and trying to
> bring all the dependencies up to their current versions.
>
> I have a function that fetches files from an AWS S3 bucket, every 15
> minutes. I had previously used the at-at library for this:
>
> https://github.com/overtone/at-at
>
> But at-at has not been updated in 6 years, so I assume it is abandoned. I
> have two questions about this:
>
> 1.) how else do Clojure programmers usually call recurring functionality?
>
> 2.) I am ignorant about the JVM, so I'm afraid I have to ask, at a
> fundamental level, how does at-at work? I know that if a function calls
> itself recurringly, on the JVM, one eventually gets stackoverflow. So how
> does at-at make its magic work?
>
> --
> 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/d/optout.
>

-- 
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/d/optout.


What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread lawrence . krubner
I'm coming back to Clojure development after a year away. This is a fast 
moving community and it is hard to keep up when one is not working on it 
full time. I'm dusting off some code I wrote 2 years ago, and trying to 
bring all the dependencies up to their current versions. 

I have a function that fetches files from an AWS S3 bucket, every 15 
minutes. I had previously used the at-at library for this:

https://github.com/overtone/at-at

But at-at has not been updated in 6 years, so I assume it is abandoned. I 
have two questions about this:

1.) how else do Clojure programmers usually call recurring functionality? 

2.) I am ignorant about the JVM, so I'm afraid I have to ask, at a 
fundamental level, how does at-at work? I know that if a function calls 
itself recurringly, on the JVM, one eventually gets stackoverflow. So how 
does at-at make its magic work? 

-- 
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/d/optout.


Re: What if ^:const could inline everything before macroexpanssion?

2018-11-07 Thread Didier
Ah right, I see now.

Ya, so it seems macros are fully expanded first, and then constant are 
inlined, and then code is evaled.

So there's really no way to specify a global to be used within a macro 
itself, unless you resolve it explicitly within your macro, using resolve 
or eval, or if you use the reader eval when calling you macro.

On Wednesday, 7 November 2018 02:20:06 UTC-8, juan.facorro wrote:
>
> Sorry, I now understand what you mean.
>
> The unfolding logic that I proposed before was completely missing the fact 
> that the foo macro is not:
>
> (defmacro foo
>   [x]
>   `(+ 10 ~x))
>
> But:
>
> (defmacro foo
>   [x]
>   (+ 10 x))
>
> The following assertion from the previous post is blatantly wrong with the 
> correct macro definition above:
>
>> This tries to macroexpand the expression, which in this case will result in 
>> `(foo bar)` being expanded into `(+ 10 foo)`. 
>
> So when evaluating (foo bar) we do get the exception you mention, of 
> course, since on macroexpansion we are trying to add 10 and the symbol bar
> . 
>
> It is still the case as before though that the macroexpansion of (foo 
> bar)happens 
> before the symbol bar is resolved and analyzed as a constant expression.
>
> Sorry for the mess and confusion.
>
> On Wednesday, November 7, 2018 at 11:04:27 AM UTC+1, juan.facorro wrote:
>>
>> That's strange, this is what I get in the REPL when evaluating that 
>> expression:
>>
>> $ clj
>> Clojure 1.9.0
>> user=> (. clojure.lang.Numbers (add 10 100))
>> 110
>> user=>
>>
>>
>>
>> On Wednesday, November 7, 2018 at 10:01:20 AM UTC+1, Didier wrote:
>>>
>>> Hey, thanks for the deep dive, but I'm not sure I either understand, or 
>>> that it is correct.
>>>
>>> So what we end up with is the equivalent to analyzing the expression `(. 
>>>> clojure.lang.Numbers (add 10 100))`. 
>>>>
>>>
>>> When I run my example, I get:
>>>
>>> ClassCastException clojure.lang.Symbol cannot be cast to java.lang.
>>> Number  clojure.lang.Numbers.add
>>>
>>> When I macroexpand-1 my example, I also get the same ClassCastException.
>>>
>>> But if we follow your step by step, you make it sound like it would work 
>>> and return 110.
>>>
>>> So at which step would this exception be thrown? And why?
>>>
>>>
>>> On Thursday, 15 March 2018 11:11:24 UTC-7, Didier wrote:
>>>>
>>>> I was hoping that ^:const would be able to inline any symbol value and 
>>>> that it would do so before macroexpanssion so that:
>>>>
>>>> (def ^:const bar {:a 100})
>>>>
>>>> (defmacro foo
>>>>   [x]
>>>>   (:a x))
>>>>
>>>> (foo bar)
>>>>
>>>> Would return:
>>>>
>>>> 100
>>>>
>>>> The same way that:
>>>>
>>>> (foo {:a 100})
>>>>
>>>> does.
>>>>
>>>> Then I read that ^:const only inlines primitive values (which 
>>>> disappointed me), but so I thought that this would work:
>>>>
>>>> (def ^:const bar 100)
>>>>
>>>> (defmacro foo
>>>>   [x]
>>>>   (+ 10 x))
>>>>
>>>> (foo bar)
>>>>
>>>> but that also doesn't work.
>>>>
>>>> So now I believe that ^:const inlines after macroexpanssion.
>>>>
>>>> I feel it would be really cool to be able to factor some input to 
>>>> macros into constants, is this something I could open a ticket for, to 
>>>> extend ^:const so it can inline all literal values and also does the 
>>>> inlining before macroexpanssion so that the above would work?
>>>>
>>>

-- 
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/d/optout.


Re: What if ^:const could inline everything before macroexpanssion?

2018-11-07 Thread juan.facorro
Sorry, I now understand what you mean.

The unfolding logic that I proposed before was completely missing the fact 
that the foo macro is not:

(defmacro foo
  [x]
  `(+ 10 ~x))

But:

(defmacro foo
  [x]
  (+ 10 x))

The following assertion from the previous post is blatantly wrong with the 
correct macro definition above:

> This tries to macroexpand the expression, which in this case will result in 
> `(foo bar)` being expanded into `(+ 10 foo)`. 

So when evaluating (foo bar) we do get the exception you mention, of 
course, since on macroexpansion we are trying to add 10 and the symbol bar. 

It is still the case as before though that the macroexpansion of (foo 
bar)happens 
before the symbol bar is resolved and analyzed as a constant expression.

Sorry for the mess and confusion.

On Wednesday, November 7, 2018 at 11:04:27 AM UTC+1, juan.facorro wrote:
>
> That's strange, this is what I get in the REPL when evaluating that 
> expression:
>
> $ clj
> Clojure 1.9.0
> user=> (. clojure.lang.Numbers (add 10 100))
> 110
> user=>
>
>
>
> On Wednesday, November 7, 2018 at 10:01:20 AM UTC+1, Didier wrote:
>>
>> Hey, thanks for the deep dive, but I'm not sure I either understand, or 
>> that it is correct.
>>
>> So what we end up with is the equivalent to analyzing the expression `(. 
>>> clojure.lang.Numbers (add 10 100))`. 
>>>
>>
>> When I run my example, I get:
>>
>> ClassCastException clojure.lang.Symbol cannot be cast to java.lang.Number 
>>  clojure.lang.Numbers.add
>>
>> When I macroexpand-1 my example, I also get the same ClassCastException.
>>
>> But if we follow your step by step, you make it sound like it would work 
>> and return 110.
>>
>> So at which step would this exception be thrown? And why?
>>
>>
>> On Thursday, 15 March 2018 11:11:24 UTC-7, Didier wrote:
>>>
>>> I was hoping that ^:const would be able to inline any symbol value and 
>>> that it would do so before macroexpanssion so that:
>>>
>>> (def ^:const bar {:a 100})
>>>
>>> (defmacro foo
>>>   [x]
>>>   (:a x))
>>>
>>> (foo bar)
>>>
>>> Would return:
>>>
>>> 100
>>>
>>> The same way that:
>>>
>>> (foo {:a 100})
>>>
>>> does.
>>>
>>> Then I read that ^:const only inlines primitive values (which 
>>> disappointed me), but so I thought that this would work:
>>>
>>> (def ^:const bar 100)
>>>
>>> (defmacro foo
>>>   [x]
>>>   (+ 10 x))
>>>
>>> (foo bar)
>>>
>>> but that also doesn't work.
>>>
>>> So now I believe that ^:const inlines after macroexpanssion.
>>>
>>> I feel it would be really cool to be able to factor some input to macros 
>>> into constants, is this something I could open a ticket for, to extend 
>>> ^:const so it can inline all literal values and also does the inlining 
>>> before macroexpanssion so that the above would work?
>>>
>>

-- 
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/d/optout.


Re: What if ^:const could inline everything before macroexpanssion?

2018-11-07 Thread juan.facorro
That's strange, this is what I get in the REPL when evaluating that 
expression:

$ clj
Clojure 1.9.0
user=> (. clojure.lang.Numbers (add 10 100))
110
user=>



On Wednesday, November 7, 2018 at 10:01:20 AM UTC+1, Didier wrote:
>
> Hey, thanks for the deep dive, but I'm not sure I either understand, or 
> that it is correct.
>
> So what we end up with is the equivalent to analyzing the expression `(. 
>> clojure.lang.Numbers (add 10 100))`. 
>>
>
> When I run my example, I get:
>
> ClassCastException clojure.lang.Symbol cannot be cast to java.lang.Number 
>  clojure.lang.Numbers.add
>
> When I macroexpand-1 my example, I also get the same ClassCastException.
>
> But if we follow your step by step, you make it sound like it would work 
> and return 110.
>
> So at which step would this exception be thrown? And why?
>
>
> On Thursday, 15 March 2018 11:11:24 UTC-7, Didier wrote:
>>
>> I was hoping that ^:const would be able to inline any symbol value and 
>> that it would do so before macroexpanssion so that:
>>
>> (def ^:const bar {:a 100})
>>
>> (defmacro foo
>>   [x]
>>   (:a x))
>>
>> (foo bar)
>>
>> Would return:
>>
>> 100
>>
>> The same way that:
>>
>> (foo {:a 100})
>>
>> does.
>>
>> Then I read that ^:const only inlines primitive values (which 
>> disappointed me), but so I thought that this would work:
>>
>> (def ^:const bar 100)
>>
>> (defmacro foo
>>   [x]
>>   (+ 10 x))
>>
>> (foo bar)
>>
>> but that also doesn't work.
>>
>> So now I believe that ^:const inlines after macroexpanssion.
>>
>> I feel it would be really cool to be able to factor some input to macros 
>> into constants, is this something I could open a ticket for, to extend 
>> ^:const so it can inline all literal values and also does the inlining 
>> before macroexpanssion so that the above would work?
>>
>

-- 
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/d/optout.


Re: What if ^:const could inline everything before macroexpanssion?

2018-11-07 Thread Didier
Hey, thanks for the deep dive, but I'm not sure I either understand, or 
that it is correct.

So what we end up with is the equivalent to analyzing the expression `(. 
> clojure.lang.Numbers (add 10 100))`. 
>

When I run my example, I get:

ClassCastException clojure.lang.Symbol cannot be cast to java.lang.Number 
 clojure.lang.Numbers.add

When I macroexpand-1 my example, I also get the same ClassCastException.

But if we follow your step by step, you make it sound like it would work 
and return 110.

So at which step would this exception be thrown? And why?


On Thursday, 15 March 2018 11:11:24 UTC-7, Didier wrote:
>
> I was hoping that ^:const would be able to inline any symbol value and 
> that it would do so before macroexpanssion so that:
>
> (def ^:const bar {:a 100})
>
> (defmacro foo
>   [x]
>   (:a x))
>
> (foo bar)
>
> Would return:
>
> 100
>
> The same way that:
>
> (foo {:a 100})
>
> does.
>
> Then I read that ^:const only inlines primitive values (which disappointed 
> me), but so I thought that this would work:
>
> (def ^:const bar 100)
>
> (defmacro foo
>   [x]
>   (+ 10 x))
>
> (foo bar)
>
> but that also doesn't work.
>
> So now I believe that ^:const inlines after macroexpanssion.
>
> I feel it would be really cool to be able to factor some input to macros 
> into constants, is this something I could open a ticket for, to extend 
> ^:const so it can inline all literal values and also does the inlining 
> before macroexpanssion so that the above would work?
>

-- 
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/d/optout.


Re: What if ^:const could inline everything before macroexpanssion?

2018-11-04 Thread juan.facorro
The compiler seems to currently use the *:const* hint, to know that it 
should return the analyzed expression value for the var (as if it was 
quoted) instead of the *VarExpr* (which would mean a deref at run-time) 
(see here 
<https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L7320>
).

For the code you posted, my understanding of what the compiler does is:

(def ^:const bar 100)
;; `bar` is created with {:const true} metadata attached to it.

(defmacro foo
  [x]
  (+ 10 x))
;; `foo` macro is created with the function body provided. 

(foo bar)

The list expression `(foo bar)` is identified as a seq so it's analyzed as 
one here <;; 
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L7084>
. This tries to macroexpand the expression, which in this case will result in 
`(foo bar)` being expanded into `(+ 10 foo)`. 

This new expression `(+ 10 foo)` gets analyzed as a seq again, but on 
macroexpansion there's nothing to do, so it's unchanged. 

There are some checks for the first form in the seq which include:

   1. Is it `nil`?
   2. Is it  a var (or does it  resolve to a var) with `:inline` metadata 
   specified which applies to the current number of args (here 
   
<https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6922>
   )?
   3. Is it the symbol `fn*`?
   4. Is it any of the special forms?
   5. Otherwise consider it as a function invocation expression.
   
In our example the `+` symbol resolves to the function `clojure.core/+` 
which does have `:inline` metadata for inlining. The inlining works sort of 
like macroexpansion and the `(+ 10 foo)` expression will end up  being `(. 
clojure.lang.Numbers (add 10 foo))` (see here 
<https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L987> 
and here 
<https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L955>
).

This expression gets analyzed as a seq as well.  The `.` is a special form 
(see here 
<https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L118>),
 
but that's not important. What we care about at this point is that the 
compiler hasn't tried to resolved the symbol `foo` so far, it will try to 
do so while parsing this DOT expression here 
<https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L1019>.
 
This will finally result in the `:const` metadata entry being used in here 
<https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L7320>
 and 
the constant expression being returned.

So what we end up with is the equivalent to analyzing the expression `(. 
clojure.lang.Numbers (add 10 100))`. 

The JVM probably includes constant folding optimization, but I doubt it's 
able to figure out that `clojure.lang.Number/add` 
<https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L152>
 
is number addition.

I hope this helps in somw way. It was a fun exercise. :)

Cheers!

On Monday, November 5, 2018 at 12:07:44 AM UTC+1, Didier wrote:
>
> Macroexpansion is given the raw forms that are read, and I think 
>> that's a good thing. Inside a macro you can always call 
>> macroexpand yourself if you want to (or resolve values another 
>> way) but there's no way to "undo" automatic macroexpansion. 
>>
>
> That's a good point. I guess resolving the constant inside the macro still 
> performs the compile time optimization of in-lining.
>
> I guess my question now becomes, when does const actually expands? Or what 
> does it do exactly? In my mind, it is supposed to inline its usage. So does 
> it do so after expansion?
>  
> On Thursday, 15 March 2018 18:15:16 UTC-7, Carlo Zancanaro wrote:
>>
>> On Thu, Mar 15 2018, Didier wrote: 
>> > I feel it would be really cool to be able to factor some input 
>> > to macros into constants, is this something I could open a 
>> > ticket for, to extend ^:const so it can inline all literal 
>> > values and also does the inlining before macroexpanssion so that 
>> > the above would work? 
>>
>> Macroexpansion is given the raw forms that are read, and I think 
>> that's a good thing. Inside a macro you can always call 
>> macroexpand yourself if you want to (or resolve values another 
>> way) but there's no way to "undo" automatic macroexpansion. 
>>
>> As one particular example, how would this work in your world? If 
>> the `bar` is replaced ahead of time in the usage of `l` then it 
>> cannot be shadowed as an identifier. 
>>
>>   (def ^:const bar {:a 100}) 
>>   (defmacro l [name value & body] 
>> `(let [~name ~value] 
>>   ~@body)) 
>>   (l bar 1 
>>  (+ bar 1)) 
>>
>>

Re: What if ^:const could inline everything before macroexpanssion?

2018-11-04 Thread Didier

>
> Macroexpansion is given the raw forms that are read, and I think 
> that's a good thing. Inside a macro you can always call 
> macroexpand yourself if you want to (or resolve values another 
> way) but there's no way to "undo" automatic macroexpansion. 
>

That's a good point. I guess resolving the constant inside the macro still 
performs the compile time optimization of in-lining.

I guess my question now becomes, when does const actually expands? Or what 
does it do exactly? In my mind, it is supposed to inline its usage. So does 
it do so after expansion?
 
On Thursday, 15 March 2018 18:15:16 UTC-7, Carlo Zancanaro wrote:
>
> On Thu, Mar 15 2018, Didier wrote: 
> > I feel it would be really cool to be able to factor some input 
> > to macros into constants, is this something I could open a 
> > ticket for, to extend ^:const so it can inline all literal 
> > values and also does the inlining before macroexpanssion so that 
> > the above would work? 
>
> Macroexpansion is given the raw forms that are read, and I think 
> that's a good thing. Inside a macro you can always call 
> macroexpand yourself if you want to (or resolve values another 
> way) but there's no way to "undo" automatic macroexpansion. 
>
> As one particular example, how would this work in your world? If 
> the `bar` is replaced ahead of time in the usage of `l` then it 
> cannot be shadowed as an identifier. 
>
>   (def ^:const bar {:a 100}) 
>   (defmacro l [name value & body] 
> `(let [~name ~value] 
>   ~@body)) 
>   (l bar 1 
>  (+ bar 1)) 
>
> If you want to factor out things for macros (particularly macros 
> that you don't control) you can try doing so at read time, with 
> something that evaluates at read time, like so: 
>
>   (def bar {:a 100}) 
>   (defmacro foo [x] 
> (:a x)) 
>   (foo #=(eval bar)) ;; => 100 
>
> It's a bit messy, but it draws attention to the fact that there's 
> something unusual happening with evaluation order. 
>
> Carlo 
>

-- 
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/d/optout.


Re: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-08-02 Thread Alex Miller
Also note that if you install clj, you have everything you need to run a 
repl at that point - it embeds an uberjar including tools.deps.alpha, 
clojure, spec, and all the transitive deps needed to run clj, so there are 
no further downloads required (until you start using deps, which inherently 
require downloads).

-- 
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/d/optout.


RE: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-08-02 Thread Alex Miller
I wouldn’t rule out some sort of bundle artifact like this  in the future, but 
the audience for this (that is not better served by installing clj) is quite 
small imo.

That is, the audiences we are serving are something like:

1) people using Clojure for project work - need transitive dep resolution and a 
tool like clj (or lein or boot)

2) tire kickers - just want a repl and no deps initially. If you presume the 
coming existence of clj on windows, and the majority using Mac with brew, this 
is easy now.

3) tire kickers with an aversion to installers (prob Linux) - you can git clone 
and build from the repo in < minute.  Note that as soon as you move out of tire 
kicking, you’re stuck and need a tool.

4) tinkerers - if you want to modify Clojure and make your own builds then you 
need to build yourself 

I’ll contend 1 and 2 are vastly larger groups and 3 sets you up to get stuck 
right when you’re making headway so we should de-emphasize. If you’re in 4, 
then you are already prepared to clone and build things.

For all these reasons (and others, like not wanting to publish a composite 
artifact that can yield problems in combination), we decided not to publish 
something like this for now. We will keep evaluating this as things evolve.

-- 
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/d/optout.


RE: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-08-01 Thread Sean Corfield
But you’d need the Internet to download the “whatever” from clojure.org, so 
what’s the difference between that and an install of `clj` and then running it 
once (which downloads all the necessary bits)… and then you can run it offline 
as often as you want for a basic REPL with no additional dependencies?



And that argument applies to Leiningen and Boot too – you download “something” 
and run it once. Then you can run it again offline and have “Clojure” available.



And, again, you can’t do anything beyond absolute bare bones stuff without 
external dependencies – all the books take you to that point pretty quickly, as 
do the (online) tutorials. You can’t, realistically, learn Clojure without an 
Internet connection.



Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood




From: clojure@googlegroups.com  on behalf of Didier 

Sent: Wednesday, August 1, 2018 10:08:39 PM
To: Clojure
Subject: RE: What Happened to "java -jar clojure.jar hosehead.clj" ?

I think overall, it makes sense to modularize clojure.

But I'm compassionate to the no internet style mindset. So I wonder if there 
could be a download on the clojure.org website which is an uberjar of Clojure 
and it's latest required dependencies? Specifically for such use case.

--
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/d/optout.

-- 
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/d/optout.


RE: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-08-01 Thread Didier
I think overall, it makes sense to modularize clojure.

But I'm compassionate to the no internet style mindset. So I wonder if there 
could be a download on the clojure.org website which is an uberjar of Clojure 
and it's latest required dependencies? Specifically for such use case.

-- 
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/d/optout.


RE: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-31 Thread Sean Corfield
That's one downside, ideally (in my world) spec would be a compile/test time 
dependency - esp. since AFAIK it's not recommended to turn it on at run-time 
for day-to-day operation.

We use clojure.spec extensively in production code so that certainly isn’t 
true. You might not turn on instrumentation for production but spec is far more 
than instrumentation and far more than generative testing.

In addition, clojure.core.specs.alpha leverages clojure.spec.alpha to provide 
“compile-time” specs for macros, which you can argue is not “production” if you 
argue for AOT only – which I’d strongly push back on.

since clojure.jar depends on an alpha, when that comes out of alpha, we'll need 
patch releases of Clojure core.

Not true. You can specify the version of clojure.spec(.alpha) independently of 
the version of Clojure itself. The same is true for clojure.core.specs.alpha. 
That’s part of why spec was split out from Clojure itself: so that it could 
evolve on a separate timeline. It’s how Clojure 1.9.0 went to release without 
spec coming out of alpha and how Clojure 1.10.0 has continued to evolve without 
lock-step against clojure.spec versions.

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

From: Mark Derricutt<mailto:m...@talios.com>
Sent: Monday, July 30, 2018 6:48 PM
To: Clojure<mailto:clojure@googlegroups.com>
Subject: Re: What Happened to "java -jar clojure.jar hosehead.clj" ?


On 31 Jul 2018, at 9:08, Payter Versteegen wrote:

I'd've hoped that clojure wouldn't have become as tightly-coupled with spec 
(for instance), but maybe I just need to read the Rationale page more deeply. 
Dependency hell blows, especially if your work environment is disconnected from 
the global internet.

Welcome to source based dependencies/languages. That's one downside, ideally 
(in my world) spec would be a compile/test time dependency - esp. since AFAIK 
it's not recommended to turn it on at run-time for day-to-day operation.

I wonder if it'd be possible to have no-op versions of spec APIs in clojure.jar 
that are replaced with implementations if you include the actual... 
implementation.

I hit this recently with clojure.osgi and the move to the latest clojure, I had 
to include spec - which, as Sean mentions - is just part of the build process ( 
Maven in this case ), but I did feel dirty about it - since clojure.jar depends 
on an alpha, when that comes out of alpha, we'll need patch releases of Clojure 
core.

Mark
Lover/Loather of static types, and build/deps systems :)


"The ease with which a change can be implemented has no relevance at all to 
whether it is the right change for the (Java) Platform for all time." — Mark 
Reinhold.

Mark Derricutt
http://www.theoryinpractice.net
http://www.chaliceofblood.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt
--
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<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

-- 
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/d/optout.


Re: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-30 Thread Mark Derricutt
On 31 Jul 2018, at 9:08, Payter Versteegen wrote:

> I'd've hoped that clojure wouldn't have become as tightly-coupled with spec 
> (for instance), but maybe I just need to read the Rationale page more deeply. 
> Dependency hell blows, especially if your work environment is disconnected 
> from the global internet.

Welcome to source based dependencies/languages. That's one downside, ideally 
(in my world) spec would be a compile/test time dependency - esp. since AFAIK 
it's not recommended to turn it on at run-time for day-to-day operation.

I wonder if it'd be possible to have no-op versions of spec APIs in clojure.jar 
that are replaced with implementations if you include the actual... 
implementation.

I hit this recently with clojure.osgi and the move to the latest clojure, I had 
to include spec - which, as Sean mentions - is just part of the build process ( 
Maven in this case ), but I did feel dirty about it - since clojure.jar depends 
on an alpha, when that comes out of alpha, we'll need patch releases of Clojure 
core.

Mark
Lover/Loather of static types, and build/deps systems :)

---
"The ease with which a change can be implemented has no relevance at all to 
whether it is the right change for the (Java) Platform for all time."  
Mark Reinhold.

Mark Derricutt
http://www.theoryinpractice.net
http://www.chaliceofblood.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt

-- 
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/d/optout.


signature.asc
Description: OpenPGP digital signature


RE: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-30 Thread Sean Corfield
Right, but the disadvantage is that you're releasing something that's now 
incomplete on its own.

Every non-trivial Clojure program has dependencies so you’re going to be using 
either `clj`/`clojure` shell scripts and `deps.edn`, or else Leiningen or Boot. 
And if you use any of those, the clojure.jar/spec/etc issue is completely 
hidden (and taken care of).

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


From: clojure@googlegroups.com  on behalf of Payter 
Versteegen 
Sent: Monday, July 30, 2018 2:08:12 PM
To: Clojure
Subject: Re: What Happened to "java -jar clojure.jar hosehead.clj" ?

Right, but the disadvantage is that you're releasing something that's now 
incomplete on its own.

I'd've hoped that clojure wouldn't have become as tightly-coupled with spec 
(for instance), but maybe I just need to read the Rationale page more deeply. 
Dependency hell blows, especially if your work environment is disconnected from 
the global internet.

Cheers,
Payter.

On Tuesday, July 24, 2018 at 3:46:43 PM UTC-4, Alex Miller wrote:
We have begun the process of breaking Clojure into more fine-grained modules. 
There is no timeline for this work but we expect this to become more common in 
the future so we have no plans to change this aspect of packaging.

The major benefit is that the modules can be released independently and at a 
faster rate than core itself. For example, newer versions of spec and the core 
specs libs have already been released and can be used now with Clojure 1.9. The 
new clj tool and its tool.deps lib exist to help you put these pieces together.

--
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<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

-- 
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/d/optout.


Re: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-30 Thread Payter Versteegen
Right, but the disadvantage is that you're releasing something that's now 
incomplete on its own.

I'd've hoped that clojure wouldn't have become as tightly-coupled with spec 
(for instance), but maybe I just need to read the Rationale page more 
deeply. Dependency hell blows, especially if your work environment is 
disconnected from the global internet.

Cheers,
Payter.

On Tuesday, July 24, 2018 at 3:46:43 PM UTC-4, Alex Miller wrote:
>
> We have begun the process of breaking Clojure into more fine-grained 
> modules. There is no timeline for this work but we expect this to become 
> more common in the future so we have no plans to change this aspect of 
> packaging.
>
> The major benefit is that the modules can be released independently and at 
> a faster rate than core itself. For example, newer versions of spec and the 
> core specs libs have already been released and can be used now with Clojure 
> 1.9. The new clj tool and its tool.deps lib exist to help you put these 
> pieces together.
>
>

-- 
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/d/optout.


Re: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-24 Thread Alex Miller
We have begun the process of breaking Clojure into more fine-grained modules. 
There is no timeline for this work but we expect this to become more common in 
the future so we have no plans to change this aspect of packaging.

The major benefit is that the modules can be released independently and at a 
faster rate than core itself. For example, newer versions of spec and the core 
specs libs have already been released and can be used now with Clojure 1.9. The 
new clj tool and its tool.deps lib exist to help you put these pieces together.



-- 
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/d/optout.


Re: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-24 Thread Payter Versteegen
Alex,
Thanks for the links.
Digging into the release notes for 1.9.0, I see that:

Note that spec is in alpha state and API compatibility is not guaranteed. 
Also, spec and the specs for the Clojure core API are distributed as 
external libraries that *must be included to use Clojure*.

Emphasis mine as a complaint about the incompleteness of what's at the 
maven repo (linked from clojure.org).

Can the calls to the not-included spec bindings be removed (or checked 
around) in future releases?

Cheers,
Payter.
 
On Tuesday, July 24, 2018 at 11:58:12 AM UTC-4, Alex Miller wrote:

> Hey Payter,
>
> As of Clojure 1.9, parts of Clojure have been pulled out into other repos. 
> The readme has instructions at the top for building a combined local jar 
> from the git repo:
>
> https://github.com/clojure/clojure/blob/master/readme.txt
>
> Or you can use the new Clojure runner clj described at:
>
> https://clojure.org/guides/getting_started
>
> Alex
>
>

-- 
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/d/optout.


What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-24 Thread Alex Miller
Hey Payter,

As of Clojure 1.9, parts of Clojure have been pulled out into other repos. The 
readme has instructions at the top for building a combined local jar from the 
git repo:

https://github.com/clojure/clojure/blob/master/readme.txt

Or you can use the new Clojure runner clj described at:

https://clojure.org/guides/getting_started

Alex

-- 
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/d/optout.


What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-24 Thread Payter Versteegen
Trying to re-acquaint myself with clojure since 1.6.0. Given *hosehead.clj* 
as

(println (+ 1 2 3))

I used to be able to run:

% java -jar clojure-1.6.0.jar hosehead.clj
6

But with *clojure-1.9.0.jar* I'm treated to a *FileNotFoundException* 
looking for *clojure/spec/alpha.clj* in the classpath. I'd only downloaded 
files from the https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0/ 
because 
I'd remember that's all I needed for 1.6.0. Plus, that's what my (old) copy 
of *Practical Clojure* had as an example.

I'm mostly disconnected from the internet, so it's difficult to chase down 
dependencies online in real time.

Is there a way to run 1.9.0 the same super-trivial way that I'd done with 
1.6.0?

Cheers,
Payter.

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-09 Thread Sonny To
Not sure what you mean by minimum but here's instruction on setting up a 
dev environment that works for me
http://lambdakids.stigmergy.systems/2018/6/6/hello-world.blog

my emacs init.el is at https://bit.ly/2z3gtyi 

On Monday, July 2, 2018 at 6:41:23 AM UTC+3, Austin Haas wrote:
>
> I don't want to use a package manager with Emacs.
>
> Should I launch a REPL outside of Emacs, then connect to it? Using the CLI 
> tools (i.e., from the command line: clojure -J-Dclojure.server.repl="{:port 
>  :accept clojure.core.server/repl}")?
>
> Can I launch a REPL from within Emacs?
>
> I've been using inf-clojure and clojure-mode with the following elisp in 
> my .emacs:
>
> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/clojure-mode/")
> (require 'clojure-mode)
> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/inf-clojure/")
> (load-file "~/.emacs.d/site-lisp/third-party/inf-clojure/inf-clojure.el")
> (add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)
> (setf inf-clojure-lein-cmd "lein run -m clojure.main")
>
> and C-c C-z to start a REPL, but I get noise in the REPL, including 
> repeated prompts, and (seemingly) random linebreaks in large output.
>
> What's the state of the art for a simple, practical Emacs setup for 
> Clojure?
>

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-08 Thread Austin Haas

Quick update. 

After a reboot, my REPL starts up much faster (~3-4 seconds) than I 
reported above. Sorry for the noise.

I started adding CLJS support to inf-clojure: 
https://github.com/austinhaas/inf-clojure/tree/cljs Some of the problems 
that I reported above were due to inf-clojure only partially working for 
Clojurescript. Some things, like eldoc, were broken because they were 
written with nonportable Clojure code.

I also discovered that occasionally inf-clojure will detect the wrong REPL 
type, which results in some of the other problems I reported above. I filed 
a bug here: https://github.com/clojure-emacs/inf-clojure/issues/151


-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-07 Thread Austin Haas
I've determined that the previously mentioned errors are related to 
incompatibilities with inf-clojure and clojurescript.

I filed a bug, and a workaround, with inf-clojure 
here: https://github.com/clojure-emacs/inf-clojure/issues/150

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-07 Thread Austin Haas

I shouldn't have said that two of those errors were the same. They're 
different, but they both mention unquoted symbols.

Monroe

clojure.lang.ExceptionInfo: Arguments to require must be quoted. Offending 
spec: (symbol (namespace (quote clojure.repl/pst))) at line 1  
{:file "", :line 1, :column 5, :root-source-info {:source-type 
:fragment, :source-form (do (require (symbol (namespace (quote 
clojure.repl/pst (clojure.repl/pst *e))}, :tag :cljs/analysis-error}

inf-clojure

WARNING: Use of undeclared Var cljs.user/Throwable at line 6 
clojure.lang.ExceptionInfo: Assert failed: Argument to resolve must be a 
quoted symbol
(core/and (seq? quoted-sym) (= (quote quote) (first quoted-sym))) at line 4 
 {:file "", :line 4, :column 2, :root-source-info 
{:source-type :fragment, :source-form (try (:arglists (clojure.core/meta 
(clojure.core/resolve (clojure.core/read-string "ClojureScript" (catch 
Throwable t nil))}, :tag :cljs/analysis-error}

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-07 Thread Austin Haas
I tried this, changing node to browser, like so: 

clojure -J-Dclojure.server.repl="{:port ${1:-} :accept 
cljs.server.browser/repl}" -cljs-canary  -m cljs.main -re browser -r

That starts a REPL in my terminal, but when I try to connect to it from 
Emacs, using C-c M-c RET localhost RET , I get the following in my 
Emacs *inf-clojure* buffer:

Process inf-clojure connection broken by remote peer

and the following the terminal REPL:

Exception in thread "Clojure Connection repl 1" java.lang.RuntimeException: 
Unable to resolve symbol: PrintWriter-on in this context, 
compiling:(cljs/core/server.clj:81:29)


On Friday, July 6, 2018 at 4:50:57 PM UTC-7, Andrea Richiardi wrote:
>
> Ok this command will open a socket REPL directly in cljs.user:
>
> clojure -J-Dclojure.server.repl="{:port ${1:-} :accept 
> cljs.server.node/repl}" -R:cljs-canary  -m cljs.main -re node -r
>
> You need the right deps.edn aliases - then you will be able to nc 
> localhost  or inf-clojure-connect to it.
>
> On Friday, July 6, 2018 at 11:18:56 AM UTC-7, Austin Haas wrote:
>>
>> I spent a couple more hours working with Monroe and Figwheel. I still 
>> can't figure out how to use the REPL. After trying to evaluate a few 
>> expressions, Emacs gets completely locked up spewing the following error 
>> message 1000s of times: 
>>
>> clojure.lang.ExceptionInfo: Arguments to require must be quoted. 
>> Offending spec: (symbol (namespace (quote clojure.repl/pst))) at line 1 
>>  {:file "", :line 1, :column 5, :root-source-info 
>> {:source-type :fragment, :source-form (do (require (symbol (namespace 
>> (quote clojure.repl/pst (clojure.repl/pst *e))}, :tag 
>> :cljs/analysis-error}
>>
>> I've switched back to inf-clojure and Figwheel with the following config:
>>
>> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/inf-clojure/")
>> (require 'inf-clojure)
>> (setf inf-clojure-lein-cmd "lein run -m clojure.main")
>> (add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)
>> (add-hook 'inf-clojure-mode-hook #'eldoc-mode)
>>
>> That seems to work, but I see something like this in the minibuffer every 
>> time I move the cursor, with or without eldoc mode enabled:
>>
>> def: (:arglists^[[0m
>>   ^[[36m3^[[0m  ^[[36m(clojure.core/meta^[[0m
>>   ^[[36m4^[[0m  ^[[36m(clojure.core/resolve^[[0m
>>   ^[[36m5^[[0m  ^[[36m(clojure.core/read-string "def")
>>
>> Does "lein run -m clojure.main" create a socket REPL?
>>
>> I followed the instructions for inf-clojure for a "Clojure Command Line 
>> Socket REPL" (
>> https://github.com/clojure-emacs/inf-clojure#clojure-command-line-socket-repl),
>>  
>> but then (fig-start) is not found.
>>
>> I followed the instructions for inf-clojure for a "Leiningen Socket REPL" 
>> (https://github.com/clojure-emacs/inf-clojure#leiningen-socket-repl), 
>> and that produces results like with "lein run -m clojure.main"; it works, 
>> but I get the "eldoc" garbage in the minibuffer. AFAICT, the eldoc problem 
>> doesn't occur until I run (cljs-repl).
>>
>> Any insight greatly appreciated. 
>>
>>
>>
>>
>>

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-07 Thread Austin Haas
Yesterday, I followed the excellent "Clojurescript Quick Start Guide" 
(https://clojurescript.org/guides/quick-start). Everything worked as 
expected. They did a great job of making it as minimal as possible.

After that, I followed the "Emacs and Inferior Clojure Interaction Mode" 
guide (https://clojurescript.org/tools/emacs-inf). That's a nice guide, 
too. I had one issue: the instructions are out of date because inf-clojure 
removed the run-clojure alias for the inf-clojure function. I submitted a 
patch: https://github.com/clojure/clojurescript-site/pull/246

Currently, I'm running with Emacs, inf-clojure, and lein-cljsbuild. It 
seems to be working well. I don't have live code reloading, like Figwheel.

This is the function I'm using in my .emacs to launch the repl: 

(defun cljs-browser-repl ()
  (interactive)
  (inf-clojure "lein trampoline run -m clojure.main repl.clj"))

And the contents of repl.clj:

(require '[cljs.repl :as repl])
(require '[cljs.repl.browser :as browser])  ;; require the browser 
implementation of IJavaScriptEnv
(def env (browser/repl-env :static-dir ["." "out/" "resources/public/"])) 
;; create a new environment
(repl/repl env) ;; start the REPL

Today, for unknown reasons, I'm no longer getting the "def: 
(:arglists^[[0m..." messages in my minibuffer, but instead I'm seeing two 
different errors when I put the cursor in an expression:

WARNING: Use of undeclared Var cljs.user/Throwable at line 6 
clojure.lang.ExceptionInfo: Assert failed: Argument to resolve must be a 
quoted symbol
(core/and (seq? quoted-sym) (= (quote quote) (first quoted-sym))) at line 4 
 {:file "", :line 4, :column 2, :root-source-info 
{:source-type :fragment, :source-form (try (:arglists (clojure.core/meta 
(clojure.core/resolve (clojure.core/read-string "ClojureScript" (catch 
Throwable t nil))}, :tag :cljs/analysis-error}

This usually pops up in the minibuffer as: defn: (core/and (seq? 
quoted-sym)), but fortunately the full message went to the REPL once. Note 
that this is the same error I was when using Monroe instead of inf-clojure.

The other message I see is: 

ReferenceError: planck is not defined
()

which pops up in the minibuffer as: defn: ()

I also got this error once when trying to get the docstring for a var:

WARNING: No such namespace: lumo.repl, could not locate lumo/repl.cljs, 
lumo/repl.cljc, or JavaScript source providing "lumo.repl" at line 1 
WARNING: Use of undeclared Var lumo.repl/doc at line 1 
WARNING: Can't take value of macro cljs.core/declare at line 1 
ReferenceError: lumo is not defined
()

To my knowledge, I'm not using lumo or planck.

Andrea, do you still think these are issues with inf-clojure?

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-06 Thread Andrea Richiardi

>
> That seems to work, but I see something like this in the minibuffer every 
> time I move the cursor, with or without eldoc mode enabled:
>
> def: (:arglists^[[0m
>   ^[[36m3^[[0m  ^[[36m(clojure.core/meta^[[0m
>   ^[[36m4^[[0m  ^[[36m(clojure.core/resolve^[[0m
>   ^[[36m5^[[0m  ^[[36m(clojure.core/read-string "def")
>
> Does "lein run -m clojure.main" create a socket REPL?
>
> I followed the instructions for inf-clojure for a "Clojure Command Line 
> Socket REPL" (
> https://github.com/clojure-emacs/inf-clojure#clojure-command-line-socket-repl),
>  
> but then (fig-start) is not found.
>
> I followed the instructions for inf-clojure for a "Leiningen Socket REPL" (
> https://github.com/clojure-emacs/inf-clojure#leiningen-socket-repl), and 
> that produces results like with "lein run -m clojure.main"; it works, but I 
> get the "eldoc" garbage in the minibuffer. AFAICT, the eldoc problem 
> doesn't occur until I run (cljs-repl).
>
> Any insight greatly appreciated. 
>

Sorry I am guilty of not having read the whole thing - can you please open 
an issue in inf-clojure so that we can track it?

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-06 Thread Andrea Richiardi
Ok this command will open a socket REPL directly in cljs.user:

clojure -J-Dclojure.server.repl="{:port ${1:-} :accept 
cljs.server.node/repl}" -R:cljs-canary  -m cljs.main -re node -r

You need the right deps.edn aliases - then you will be able to nc localhost 
 or inf-clojure-connect to it.

On Friday, July 6, 2018 at 11:18:56 AM UTC-7, Austin Haas wrote:
>
> I spent a couple more hours working with Monroe and Figwheel. I still 
> can't figure out how to use the REPL. After trying to evaluate a few 
> expressions, Emacs gets completely locked up spewing the following error 
> message 1000s of times: 
>
> clojure.lang.ExceptionInfo: Arguments to require must be quoted. Offending 
> spec: (symbol (namespace (quote clojure.repl/pst))) at line 1  
> {:file "", :line 1, :column 5, :root-source-info {:source-type 
> :fragment, :source-form (do (require (symbol (namespace (quote 
> clojure.repl/pst (clojure.repl/pst *e))}, :tag :cljs/analysis-error}
>
> I've switched back to inf-clojure and Figwheel with the following config:
>
> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/inf-clojure/")
> (require 'inf-clojure)
> (setf inf-clojure-lein-cmd "lein run -m clojure.main")
> (add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)
> (add-hook 'inf-clojure-mode-hook #'eldoc-mode)
>
> That seems to work, but I see something like this in the minibuffer every 
> time I move the cursor, with or without eldoc mode enabled:
>
> def: (:arglists^[[0m
>   ^[[36m3^[[0m  ^[[36m(clojure.core/meta^[[0m
>   ^[[36m4^[[0m  ^[[36m(clojure.core/resolve^[[0m
>   ^[[36m5^[[0m  ^[[36m(clojure.core/read-string "def")
>
> Does "lein run -m clojure.main" create a socket REPL?
>
> I followed the instructions for inf-clojure for a "Clojure Command Line 
> Socket REPL" (
> https://github.com/clojure-emacs/inf-clojure#clojure-command-line-socket-repl),
>  
> but then (fig-start) is not found.
>
> I followed the instructions for inf-clojure for a "Leiningen Socket REPL" (
> https://github.com/clojure-emacs/inf-clojure#leiningen-socket-repl), and 
> that produces results like with "lein run -m clojure.main"; it works, but I 
> get the "eldoc" garbage in the minibuffer. AFAICT, the eldoc problem 
> doesn't occur until I run (cljs-repl).
>
> Any insight greatly appreciated. 
>
>
>
>
>

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-06 Thread Andrea Richiardi
Ok try this one:

clojure -J-Dclojure.server.repl="{:port ${1:-} :accept cljs.se}" 
-R:cljs-canary  -m cljs.main -re node -r

and then nc localhost  or inf-clojure-connect to .

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-06 Thread Andrea Richiardi

On Friday, July 6, 2018 at 11:18:56 AM UTC-7, Austin Haas wrote:
>
> I spent a couple more hours working with Monroe and Figwheel. I still 
> can't figure out how to use the REPL. After trying to evaluate a few 
> expressions, Emacs gets completely locked up spewing the following error 
> message 1000s of times: 
>
>
I guess you are pioneering this so don't give up! :D

The problem with socket REPL is that you need to make sure that it is "dumb 
enough". Make sure to read these two - sorry if you've seen it already:

https://github.com/clojure-emacs/inf-clojure#leiningen-socket-repl
https://github.com/clojure-emacs/inf-clojure#caveats

That is why I was trying only cljs.main at some point. Less things 
involved. 

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-06 Thread Austin Haas
I spent a couple more hours working with Monroe and Figwheel. I still can't 
figure out how to use the REPL. After trying to evaluate a few expressions, 
Emacs gets completely locked up spewing the following error message 1000s 
of times: 

clojure.lang.ExceptionInfo: Arguments to require must be quoted. Offending 
spec: (symbol (namespace (quote clojure.repl/pst))) at line 1  
{:file "", :line 1, :column 5, :root-source-info {:source-type 
:fragment, :source-form (do (require (symbol (namespace (quote 
clojure.repl/pst (clojure.repl/pst *e))}, :tag :cljs/analysis-error}

I've switched back to inf-clojure and Figwheel with the following config:

(add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/inf-clojure/")
(require 'inf-clojure)
(setf inf-clojure-lein-cmd "lein run -m clojure.main")
(add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)
(add-hook 'inf-clojure-mode-hook #'eldoc-mode)

That seems to work, but I see something like this in the minibuffer every 
time I move the cursor, with or without eldoc mode enabled:

def: (:arglists^[[0m
  ^[[36m3^[[0m  ^[[36m(clojure.core/meta^[[0m
  ^[[36m4^[[0m  ^[[36m(clojure.core/resolve^[[0m
  ^[[36m5^[[0m  ^[[36m(clojure.core/read-string "def")

Does "lein run -m clojure.main" create a socket REPL?

I followed the instructions for inf-clojure for a "Clojure Command Line 
Socket REPL" 
(https://github.com/clojure-emacs/inf-clojure#clojure-command-line-socket-repl),
 
but then (fig-start) is not found.

I followed the instructions for inf-clojure for a "Leiningen Socket REPL" 
(https://github.com/clojure-emacs/inf-clojure#leiningen-socket-repl), and 
that produces results like with "lein run -m clojure.main"; it works, but I 
get the "eldoc" garbage in the minibuffer. AFAICT, the eldoc problem 
doesn't occur until I run (cljs-repl).

Any insight greatly appreciated. 




-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-06 Thread Austin Haas
This is good, relevant information. Thank you, Andrea.

On Thursday, July 5, 2018 at 4:32:58 PM UTC-7, Andrea Richiardi wrote:
>
>
>
> On Thursday, July 5, 2018 at 1:01:14 PM UTC-7, Austin Haas wrote:
>>
>> Gary, I had tried Figwheel a couple years ago and I had a positive 
>> experience, so that was the next thing I reached for.
>>
>> I just want a practical dev environment, for both Clojure and 
>> Clojurescript. To me, that means simple and stable. I definitely want fewer 
>> things that can go wrong, but if I can install a package by cloning a repo 
>> and adding a few lines of elisp, and it works, I'm happy. I don't care how 
>> complex it is. If it causes my REPL to hang, prints out control characters, 
>> regularly breaks after updates, etc., then I'd rather drop down to 
>> something simpler, with fewer features.
>>
>>  
> There is one more trick though.
>
> The new cljs.main allows you to have a socket repl for ClojureScript. This 
> can then be used with `inf-clojure`. It will not be fancy and probably 
> things will be broken though...the code path has not been seen much love. I 
> did some experimentation and it definitely works - quite smoothly in fact - 
> but I have never have time to make it "production" ready :)
>
> So this does not actually answers the question, just wanted to put it out 
> there - sorry!
>

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-05 Thread Daniel
Luminus has a leiningen template which works out-of-the-box with Cider and 
figwheel. Just (start-fw) and (cljs) inside the repl.

It would be nice if we could have both repls open simultaneously within emacs, 
but everything was super unreliable the last time I tried that.

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-05 Thread Andrea Richiardi


On Thursday, July 5, 2018 at 1:01:14 PM UTC-7, Austin Haas wrote:
>
> Gary, I had tried Figwheel a couple years ago and I had a positive 
> experience, so that was the next thing I reached for.
>
> I just want a practical dev environment, for both Clojure and 
> Clojurescript. To me, that means simple and stable. I definitely want fewer 
> things that can go wrong, but if I can install a package by cloning a repo 
> and adding a few lines of elisp, and it works, I'm happy. I don't care how 
> complex it is. If it causes my REPL to hang, prints out control characters, 
> regularly breaks after updates, etc., then I'd rather drop down to 
> something simpler, with fewer features.
>
>  
There is one more trick though.

The new cljs.main allows you to have a socket repl for ClojureScript. This 
can then be used with `inf-clojure`. It will not be fancy and probably 
things will be broken though...the code path has not been seen much love. I 
did some experimentation and it definitely works - quite smoothly in fact - 
but I have never have time to make it "production" ready :)

So this does not actually answers the question, just wanted to put it out 
there - sorry!

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-05 Thread Andrea Richiardi
There is one more trick though.

The new cljs.main allows you to have a socket repl for ClojureScript. This 
can then be used with `inf-clojure`. It will not be fancy and probably 
things will be broken though...the code path has not been seen much love. I 
did some experimentation and it definitely works - quite smoothly in fact - 
but I have never have time to make it "production" ready :)

On Thursday, July 5, 2018 at 1:01:14 PM UTC-7, Austin Haas wrote:
>
> Gary, I had tried Figwheel a couple years ago and I had a positive 
> experience, so that was the next thing I reached for.
>
> I just want a practical dev environment, for both Clojure and 
> Clojurescript. To me, that means simple and stable. I definitely want fewer 
> things that can go wrong, but if I can install a package by cloning a repo 
> and adding a few lines of elisp, and it works, I'm happy. I don't care how 
> complex it is. If it causes my REPL to hang, prints out control characters, 
> regularly breaks after updates, etc., then I'd rather drop down to 
> something simpler, with fewer features.
>
> For Clojurescript, I've used lein-cljsbuild in the past. That seemed to 
> work well. I know I've connected to a REPL running in the browser before, 
> but I don't remember it being useful enough to bother with. I don't think I 
> knew how to write "reloadable code", then, though.
>
> I would love to hear how people do Clojurescript development today, 
> especially if they aren't using Figwheel.
>
>
>
> On Thursday, July 5, 2018 at 12:07:13 PM UTC-7, Gary Trakhman wrote:
>>
>> I'm not sure the desires for lightweight clojure-emacs integration and 
>> any CLJS integration are yet sympathetic.  Figwheel is a pretty complex 
>> piece of software. For example, see my issue that has been languishing for 
>> almost a year and hints at greater problems with the compiler integration: 
>> https://github.com/bhauman/lein-figwheel/issues/593 .  From my 
>> perspective, this is more due to coupling of the REPL to the compiler 
>> itself than a problem with figwheel.
>>
>> But I was surprised when the thread went in this direction just from 
>> reasons I think someone might want to not use cider, fast startup time, 
>> less stuff to go wrong.  CLJS adds that back unless it's gotten 
>> significantly better since the last time I tried.
>>
>> On Thu, Jul 5, 2018 at 2:19 PM rob  wrote:
>>
>>> If ClojureScript repl integration works smoothly out of the box then 
>>> that's already one reason to use it over Cider...  (This is not a jab at 
>>> Cider, just a statement of fact that Cider's support for ClojureScript 
>>> development has so far been lacking, IME)
>>>
>>>
>>> On Thursday, July 5, 2018 at 10:51:02 AM UTC-7, Austin Haas wrote:


 I tried Monroe, yesterday. It seems to work as advertised. I didn't 
 have any issues. It's nice that "jump to definition" works out of the box. 
 It does not appear to support Eldoc, so no help with function signatures.

 This is the Emacs config I'm currently using: 

 ;;; clojure-mode

 (add-to-list 'load-path 
 "~/.emacs.d/site-lisp/third-party/clojure-mode/")
 (require 'clojure-mode)
 (add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
 (add-hook 'clojure-mode-hook 'paredit-mode)
 (add-hook 'clojure-mode-hook 'hs-minor-mode)
 (add-hook 'clojure-mode-hook #'eldoc-mode)

 ;;; REPL

 ;; Monroe

 (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/monroe/")
 (require 'monroe)
 (add-hook 'clojure-mode-hook 'clojure-enable-monroe)
 (setf monroe-detail-stacktraces 'true)

 I went on to include Figwheel. 

 I created a new project using `lein new figwheel my-project` (which 
 provides the fig-start and cljs-repl functions), and then entered the 
 following commands to set up a Clojurescript dev environment: 

 M-x monroe-nrepl-server-start
 M-x monroe
 (fig-start)
 (cljs-repl)

 On my machine, those 4 steps take about 30 seconds to run. The first 
 takes 18 seconds, and the rest only take about a second each, but the 
 whole 
 process ends up taking close to 30.

 Figwheel seems to work great, but I couldn't figure out how to evaluate 
 code in a library dependency and have it updated in the running system. I 
 can evaluate functions, but the new definitions don't appear to be called 
 by the main code. I might be misunderstanding how this is supposed to 
 work; 
 I don't know if it's a Figwheel issue or a Monroe issue or my mistake. But 
 to work around that, and to fix other issues preventing a clean initial 
 compilation, I had to restart the REPL a few dozen times, which was 
 tedious.

 I'm posting this information in case it is useful to someone else who 
 is trying to discover the current state-of-the-art with running Clojure in 
 Emacs in a straightforward, minimal way. I'm also hoping 

Re: What is the minimal Emacs config for practical Clojure development?

2018-07-05 Thread Austin Haas
Gary, I had tried Figwheel a couple years ago and I had a positive 
experience, so that was the next thing I reached for.

I just want a practical dev environment, for both Clojure and 
Clojurescript. To me, that means simple and stable. I definitely want fewer 
things that can go wrong, but if I can install a package by cloning a repo 
and adding a few lines of elisp, and it works, I'm happy. I don't care how 
complex it is. If it causes my REPL to hang, prints out control characters, 
regularly breaks after updates, etc., then I'd rather drop down to 
something simpler, with fewer features.

For Clojurescript, I've used lein-cljsbuild in the past. That seemed to 
work well. I know I've connected to a REPL running in the browser before, 
but I don't remember it being useful enough to bother with. I don't think I 
knew how to write "reloadable code", then, though.

I would love to hear how people do Clojurescript development today, 
especially if they aren't using Figwheel.



On Thursday, July 5, 2018 at 12:07:13 PM UTC-7, Gary Trakhman wrote:
>
> I'm not sure the desires for lightweight clojure-emacs integration and any 
> CLJS integration are yet sympathetic.  Figwheel is a pretty complex piece 
> of software. For example, see my issue that has been languishing for almost 
> a year and hints at greater problems with the compiler integration: 
> https://github.com/bhauman/lein-figwheel/issues/593 .  From my 
> perspective, this is more due to coupling of the REPL to the compiler 
> itself than a problem with figwheel.
>
> But I was surprised when the thread went in this direction just from 
> reasons I think someone might want to not use cider, fast startup time, 
> less stuff to go wrong.  CLJS adds that back unless it's gotten 
> significantly better since the last time I tried.
>
> On Thu, Jul 5, 2018 at 2:19 PM rob > 
> wrote:
>
>> If ClojureScript repl integration works smoothly out of the box then 
>> that's already one reason to use it over Cider...  (This is not a jab at 
>> Cider, just a statement of fact that Cider's support for ClojureScript 
>> development has so far been lacking, IME)
>>
>>
>> On Thursday, July 5, 2018 at 10:51:02 AM UTC-7, Austin Haas wrote:
>>>
>>>
>>> I tried Monroe, yesterday. It seems to work as advertised. I didn't have 
>>> any issues. It's nice that "jump to definition" works out of the box. It 
>>> does not appear to support Eldoc, so no help with function signatures.
>>>
>>> This is the Emacs config I'm currently using: 
>>>
>>> ;;; clojure-mode
>>>
>>> (add-to-list 'load-path 
>>> "~/.emacs.d/site-lisp/third-party/clojure-mode/")
>>> (require 'clojure-mode)
>>> (add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
>>> (add-hook 'clojure-mode-hook 'paredit-mode)
>>> (add-hook 'clojure-mode-hook 'hs-minor-mode)
>>> (add-hook 'clojure-mode-hook #'eldoc-mode)
>>>
>>> ;;; REPL
>>>
>>> ;; Monroe
>>>
>>> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/monroe/")
>>> (require 'monroe)
>>> (add-hook 'clojure-mode-hook 'clojure-enable-monroe)
>>> (setf monroe-detail-stacktraces 'true)
>>>
>>> I went on to include Figwheel. 
>>>
>>> I created a new project using `lein new figwheel my-project` (which 
>>> provides the fig-start and cljs-repl functions), and then entered the 
>>> following commands to set up a Clojurescript dev environment: 
>>>
>>> M-x monroe-nrepl-server-start
>>> M-x monroe
>>> (fig-start)
>>> (cljs-repl)
>>>
>>> On my machine, those 4 steps take about 30 seconds to run. The first 
>>> takes 18 seconds, and the rest only take about a second each, but the whole 
>>> process ends up taking close to 30.
>>>
>>> Figwheel seems to work great, but I couldn't figure out how to evaluate 
>>> code in a library dependency and have it updated in the running system. I 
>>> can evaluate functions, but the new definitions don't appear to be called 
>>> by the main code. I might be misunderstanding how this is supposed to work; 
>>> I don't know if it's a Figwheel issue or a Monroe issue or my mistake. But 
>>> to work around that, and to fix other issues preventing a clean initial 
>>> compilation, I had to restart the REPL a few dozen times, which was tedious.
>>>
>>> I'm posting this information in case it is useful to someone else who is 
>>> trying to discover the current state-of-the-art with running Clojure in 
>>> Emacs in a straightforward, minimal way. I'm also hoping that people will 
>>> reply with comments and suggested improvements. (FWIW, I've been using 
>>> Emacs full-time for about 20 years, Clojure full-time for about 7 years, 
>>> and Common Lisp for 5+ years before that, so I'm not new to REPL-driven 
>>> development in Emacs.)
>>>
>>>
>>> -- 
>> 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 

Re: What is the minimal Emacs config for practical Clojure development?

2018-07-05 Thread Gary Trakhman
I'm not sure the desires for lightweight clojure-emacs integration and any
CLJS integration are yet sympathetic.  Figwheel is a pretty complex piece
of software. For example, see my issue that has been languishing for almost
a year and hints at greater problems with the compiler integration:
https://github.com/bhauman/lein-figwheel/issues/593 .  From my perspective,
this is more due to coupling of the REPL to the compiler itself than a
problem with figwheel.

But I was surprised when the thread went in this direction just from
reasons I think someone might want to not use cider, fast startup time,
less stuff to go wrong.  CLJS adds that back unless it's gotten
significantly better since the last time I tried.

On Thu, Jul 5, 2018 at 2:19 PM rob  wrote:

> If ClojureScript repl integration works smoothly out of the box then
> that's already one reason to use it over Cider...  (This is not a jab at
> Cider, just a statement of fact that Cider's support for ClojureScript
> development has so far been lacking, IME)
>
>
> On Thursday, July 5, 2018 at 10:51:02 AM UTC-7, Austin Haas wrote:
>>
>>
>> I tried Monroe, yesterday. It seems to work as advertised. I didn't have
>> any issues. It's nice that "jump to definition" works out of the box. It
>> does not appear to support Eldoc, so no help with function signatures.
>>
>> This is the Emacs config I'm currently using:
>>
>> ;;; clojure-mode
>>
>> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/clojure-mode/")
>> (require 'clojure-mode)
>> (add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
>> (add-hook 'clojure-mode-hook 'paredit-mode)
>> (add-hook 'clojure-mode-hook 'hs-minor-mode)
>> (add-hook 'clojure-mode-hook #'eldoc-mode)
>>
>> ;;; REPL
>>
>> ;; Monroe
>>
>> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/monroe/")
>> (require 'monroe)
>> (add-hook 'clojure-mode-hook 'clojure-enable-monroe)
>> (setf monroe-detail-stacktraces 'true)
>>
>> I went on to include Figwheel.
>>
>> I created a new project using `lein new figwheel my-project` (which
>> provides the fig-start and cljs-repl functions), and then entered the
>> following commands to set up a Clojurescript dev environment:
>>
>> M-x monroe-nrepl-server-start
>> M-x monroe
>> (fig-start)
>> (cljs-repl)
>>
>> On my machine, those 4 steps take about 30 seconds to run. The first
>> takes 18 seconds, and the rest only take about a second each, but the whole
>> process ends up taking close to 30.
>>
>> Figwheel seems to work great, but I couldn't figure out how to evaluate
>> code in a library dependency and have it updated in the running system. I
>> can evaluate functions, but the new definitions don't appear to be called
>> by the main code. I might be misunderstanding how this is supposed to work;
>> I don't know if it's a Figwheel issue or a Monroe issue or my mistake. But
>> to work around that, and to fix other issues preventing a clean initial
>> compilation, I had to restart the REPL a few dozen times, which was tedious.
>>
>> I'm posting this information in case it is useful to someone else who is
>> trying to discover the current state-of-the-art with running Clojure in
>> Emacs in a straightforward, minimal way. I'm also hoping that people will
>> reply with comments and suggested improvements. (FWIW, I've been using
>> Emacs full-time for about 20 years, Clojure full-time for about 7 years,
>> and Common Lisp for 5+ years before that, so I'm not new to REPL-driven
>> development in Emacs.)
>>
>>
>> --
> 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/d/optout.
>

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-05 Thread rob
If ClojureScript repl integration works smoothly out of the box then that's 
already one reason to use it over Cider...  (This is not a jab at Cider, 
just a statement of fact that Cider's support for ClojureScript development 
has so far been lacking, IME)

On Thursday, July 5, 2018 at 10:51:02 AM UTC-7, Austin Haas wrote:
>
>
> I tried Monroe, yesterday. It seems to work as advertised. I didn't have 
> any issues. It's nice that "jump to definition" works out of the box. It 
> does not appear to support Eldoc, so no help with function signatures.
>
> This is the Emacs config I'm currently using: 
>
> ;;; clojure-mode
>
> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/clojure-mode/")
> (require 'clojure-mode)
> (add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
> (add-hook 'clojure-mode-hook 'paredit-mode)
> (add-hook 'clojure-mode-hook 'hs-minor-mode)
> (add-hook 'clojure-mode-hook #'eldoc-mode)
>
> ;;; REPL
>
> ;; Monroe
>
> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/monroe/")
> (require 'monroe)
> (add-hook 'clojure-mode-hook 'clojure-enable-monroe)
> (setf monroe-detail-stacktraces 'true)
>
> I went on to include Figwheel. 
>
> I created a new project using `lein new figwheel my-project` (which 
> provides the fig-start and cljs-repl functions), and then entered the 
> following commands to set up a Clojurescript dev environment: 
>
> M-x monroe-nrepl-server-start
> M-x monroe
> (fig-start)
> (cljs-repl)
>
> On my machine, those 4 steps take about 30 seconds to run. The first takes 
> 18 seconds, and the rest only take about a second each, but the whole 
> process ends up taking close to 30.
>
> Figwheel seems to work great, but I couldn't figure out how to evaluate 
> code in a library dependency and have it updated in the running system. I 
> can evaluate functions, but the new definitions don't appear to be called 
> by the main code. I might be misunderstanding how this is supposed to work; 
> I don't know if it's a Figwheel issue or a Monroe issue or my mistake. But 
> to work around that, and to fix other issues preventing a clean initial 
> compilation, I had to restart the REPL a few dozen times, which was tedious.
>
> I'm posting this information in case it is useful to someone else who is 
> trying to discover the current state-of-the-art with running Clojure in 
> Emacs in a straightforward, minimal way. I'm also hoping that people will 
> reply with comments and suggested improvements. (FWIW, I've been using 
> Emacs full-time for about 20 years, Clojure full-time for about 7 years, 
> and Common Lisp for 5+ years before that, so I'm not new to REPL-driven 
> development in Emacs.)
>
>
>

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-05 Thread Austin Haas

I tried Monroe, yesterday. It seems to work as advertised. I didn't have 
any issues. It's nice that "jump to definition" works out of the box. It 
does not appear to support Eldoc, so no help with function signatures.

This is the Emacs config I'm currently using: 

;;; clojure-mode

(add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/clojure-mode/")
(require 'clojure-mode)
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
(add-hook 'clojure-mode-hook 'paredit-mode)
(add-hook 'clojure-mode-hook 'hs-minor-mode)
(add-hook 'clojure-mode-hook #'eldoc-mode)

;;; REPL

;; Monroe

(add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/monroe/")
(require 'monroe)
(add-hook 'clojure-mode-hook 'clojure-enable-monroe)
(setf monroe-detail-stacktraces 'true)

I went on to include Figwheel. 

I created a new project using `lein new figwheel my-project` (which 
provides the fig-start and cljs-repl functions), and then entered the 
following commands to set up a Clojurescript dev environment: 

M-x monroe-nrepl-server-start
M-x monroe
(fig-start)
(cljs-repl)

On my machine, those 4 steps take about 30 seconds to run. The first takes 
18 seconds, and the rest only take about a second each, but the whole 
process ends up taking close to 30.

Figwheel seems to work great, but I couldn't figure out how to evaluate 
code in a library dependency and have it updated in the running system. I 
can evaluate functions, but the new definitions don't appear to be called 
by the main code. I might be misunderstanding how this is supposed to work; 
I don't know if it's a Figwheel issue or a Monroe issue or my mistake. But 
to work around that, and to fix other issues preventing a clean initial 
compilation, I had to restart the REPL a few dozen times, which was tedious.

I'm posting this information in case it is useful to someone else who is 
trying to discover the current state-of-the-art with running Clojure in 
Emacs in a straightforward, minimal way. I'm also hoping that people will 
reply with comments and suggested improvements. (FWIW, I've been using 
Emacs full-time for about 20 years, Clojure full-time for about 7 years, 
and Common Lisp for 5+ years before that, so I'm not new to REPL-driven 
development in Emacs.)


-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-04 Thread Łukasz Korecki
On Tuesday, July 3, 2018 at 4:46:05 PM UTC+1, Austin Haas wrote:
>
> Thanks for the replies. 
>
> I only want a stable REPL, integrated with Emacs, and nothing else. 
>
> Łukasz, why did you switch to Monroe? What do you prefer about it?


If I'm not mistaken inf-clojure works best if you use the socket REPL. 
All our projects have a nREPL server embedded so  Monroe was a better fit 
for my workflow.

Nothing against inf-clojure, it works great!

Łukasz

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-03 Thread Didier
There's also inf-clojure, which is pretty minimal.

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-03 Thread Austin Haas
Thanks for the replies. 

I only want a stable REPL, integrated with Emacs, and nothing else.

Łukasz, why did you switch to Monroe? What do you prefer about it?

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-03 Thread Jérémie Grodziski
I like very much Spacemacs  with the Clojure layer 
 for its 
discoverability and "out of the box" configuration.
Ok it's a kind of a package manager, but once I switch to Spacemacs I've 
never look back.
The tutorial by John Stevenson  
is great.

Le lundi 2 juillet 2018 05:41:23 UTC+2, Austin Haas a écrit :
>
> I don't want to use a package manager with Emacs.
>
> Should I launch a REPL outside of Emacs, then connect to it? Using the CLI 
> tools (i.e., from the command line: clojure -J-Dclojure.server.repl="{:port 
>  :accept clojure.core.server/repl}")?
>
> Can I launch a REPL from within Emacs?
>
> I've been using inf-clojure and clojure-mode with the following elisp in 
> my .emacs:
>
> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/clojure-mode/")
> (require 'clojure-mode)
> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/inf-clojure/")
> (load-file "~/.emacs.d/site-lisp/third-party/inf-clojure/inf-clojure.el")
> (add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)
> (setf inf-clojure-lein-cmd "lein run -m clojure.main")
>
> and C-c C-z to start a REPL, but I get noise in the REPL, including 
> repeated prompts, and (seemingly) random linebreaks in large output.
>
> What's the state of the art for a simple, practical Emacs setup for 
> Clojure?
>

-- 
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/d/optout.


Re: What is the minimal Emacs config for practical Clojure development?

2018-07-03 Thread Daniel Compton
Not sure exactly how minimal you're looking for but I like Prelude
. It's maintained by Bozhidar Batsov,
who also maintains CIDER, so it works well for Clojure development.

On Tue, Jul 3, 2018 at 5:42 PM Łukasz Korecki 
wrote:

> Hi!
>
> I've recently switched to Monroe - https://github.com/sanel/monroe
> Its feature set is quite limited, and it boils down to:
>
> - start a nREPL server
> - connect to it
> - a REPL buffer is created inside of Emacs
> - evaluate forms
>
> I've added a tiny bit of config on my side which adds a Clojure scratch
> buffer
> https://github.com/lukaszkorecki/cult-leader/blob/master/settings/lk/clojure.el#L26-L44
> and that's pretty much it.
>
>
> Łukasz
>
>
> On Monday, July 2, 2018 at 4:41:23 AM UTC+1, Austin Haas wrote:
>>
>> I don't want to use a package manager with Emacs.
>>
>> Should I launch a REPL outside of Emacs, then connect to it? Using the
>> CLI tools (i.e., from the command line: clojure
>> -J-Dclojure.server.repl="{:port  :accept clojure.core.server/repl}")?
>>
>> Can I launch a REPL from within Emacs?
>>
>> I've been using inf-clojure and clojure-mode with the following elisp in
>> my .emacs:
>>
>> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/clojure-mode/")
>> (require 'clojure-mode)
>> (add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/inf-clojure/")
>> (load-file "~/.emacs.d/site-lisp/third-party/inf-clojure/inf-clojure.el")
>> (add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)
>> (setf inf-clojure-lein-cmd "lein run -m clojure.main")
>>
>> and C-c C-z to start a REPL, but I get noise in the REPL, including
>> repeated prompts, and (seemingly) random linebreaks in large output.
>>
>> What's the state of the art for a simple, practical Emacs setup for
>> Clojure?
>>
> --
> 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/d/optout.
>

-- 
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/d/optout.


What is the minimal Emacs config for practical Clojure development?

2018-07-01 Thread Austin Haas
I don't want to use a package manager with Emacs.

Should I launch a REPL outside of Emacs, then connect to it? Using the CLI 
tools (i.e., from the command line: clojure -J-Dclojure.server.repl="{:port 
 :accept clojure.core.server/repl}")?

Can I launch a REPL from within Emacs?

I've been using inf-clojure and clojure-mode with the following elisp in my 
.emacs:

(add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/clojure-mode/")
(require 'clojure-mode)
(add-to-list 'load-path "~/.emacs.d/site-lisp/third-party/inf-clojure/")
(load-file "~/.emacs.d/site-lisp/third-party/inf-clojure/inf-clojure.el")
(add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)
(setf inf-clojure-lein-cmd "lein run -m clojure.main")

and C-c C-z to start a REPL, but I get noise in the REPL, including 
repeated prompts, and (seemingly) random linebreaks in large output.

What's the state of the art for a simple, practical Emacs setup for Clojure?

-- 
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/d/optout.


Re: What if ^:const could inline everything before macroexpanssion?

2018-03-15 Thread Carlo Zancanaro

On Thu, Mar 15 2018, Didier wrote:
I feel it would be really cool to be able to factor some input 
to macros into constants, is this something I could open a 
ticket for, to extend ^:const so it can inline all literal 
values and also does the inlining before macroexpanssion so that 
the above would work?


Macroexpansion is given the raw forms that are read, and I think 
that's a good thing. Inside a macro you can always call 
macroexpand yourself if you want to (or resolve values another 
way) but there's no way to "undo" automatic macroexpansion.


As one particular example, how would this work in your world? If 
the `bar` is replaced ahead of time in the usage of `l` then it 
cannot be shadowed as an identifier.


 (def ^:const bar {:a 100})
 (defmacro l [name value & body]
   `(let [~name ~value]
 ~@body))
 (l bar 1
(+ bar 1))

If you want to factor out things for macros (particularly macros 
that you don't control) you can try doing so at read time, with 
something that evaluates at read time, like so:


 (def bar {:a 100})
 (defmacro foo [x]
   (:a x))
 (foo #=(eval bar)) ;; => 100

It's a bit messy, but it draws attention to the fact that there's 
something unusual happening with evaluation order.


Carlo

--
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/d/optout.


signature.asc
Description: PGP signature


Re: What if ^:const could inline everything before macroexpanssion?

2018-03-15 Thread overtoxic9
if that < is the prefix that's should work or that programs crappy.

-- 
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/d/optout.


What if ^:const could inline everything before macroexpanssion?

2018-03-15 Thread Didier
I was hoping that ^:const would be able to inline any symbol value and that 
it would do so before macroexpanssion so that:

(def ^:const bar {:a 100})

(defmacro foo
  [x]
  (:a x))

(foo bar)

Would return:

100

The same way that:

(foo {:a 100})

does.

Then I read that ^:const only inlines primitive values (which disappointed 
me), but so I thought that this would work:

(def ^:const bar 100)

(defmacro foo
  [x]
  (+ 10 x))

(foo bar)

but that also doesn't work.

So now I believe that ^:const inlines after macroexpanssion.

I feel it would be really cool to be able to factor some input to macros 
into constants, is this something I could open a ticket for, to extend 
^:const so it can inline all literal values and also does the inlining 
before macroexpanssion so that the above would work?

-- 
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/d/optout.


Re: What does the ref *loaded-libs* do?

2018-02-05 Thread Stephen Gilardi
It is there to support the “:reload” and “:reload-all” features of “require” 
and to help separate the concern of loading libs from the concern of tracking 
namespaces.

--Steve

> On Jan 29, 2018, at 6:36 PM, Raymond Huang <12ay.hu...@gmail.com> wrote:
> 
> I was poking around `tools.namespace` and I found it interesting that the 
> implementation of `remove-lib` is:
> 
> ```(defn remove-lib
>   "Remove lib's namespace and remove lib from the set of loaded libs."
>   [lib]
>   (remove-ns lib)
>   (dosync (alter @#'clojure.core/*loaded-libs* disj lib)))
> ```
> 
> 
> I’m wondering if someone can enlighten me to explain why `*loaded-libs*` 
> needs to exist, as opposed to checking `clojure.lang.Namespace` directly?
> 
> This is a question carried over from slack: 
> https://clojurians.slack.com/archives/C03S1KBA2/p151721185721
> -- 
> 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/d/optout.

-- 
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/d/optout.


What does the ref *loaded-libs* do?

2018-02-05 Thread squeegee
It is there to support the “:reload” and “:reload-all” features of “require” 
and to help separate the concern of loading libs from the concern of tracking 
namespaces.

--Steve

-- 
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/d/optout.


Re: what does future do after fn finish ?

2018-02-03 Thread Jacek Grzebyta
HI,

So things works well. In terms of memory usage anyway. I use 50 main
threads (in process-data-by-condition-set) and 20 for replications
(process-growths). However I found that after good performance in the
beginning it slows down rapid and quick. VisualVM shows the threads usage
is poor - mainly they are waiting. Only 1 claypoole thread works + some
lower level threads managed probably by Clojure, etc. CPU usage is poor as
well. I guess the reason is on the lower - Java classes level with IO
operations bottleneck. IMO they are working by blocking. That why I wanted
to separate them. However IO speed operations go down as well.
I've tried async channels but that they were flooded and some data where
lost for some reason.

Regards,
Jacek


On 3 February 2018 at 00:14, Justin Smith <noisesm...@gmail.com> wrote:

> -> is just a list transform performed after reading your code into a list
> data structure containing symbols, and before compiling to byte code - it
> doesn't do anything directly.
>
> On Fri, Feb 2, 2018 at 3:55 PM Jacek Grzebyta <grzebyta@gmail.com>
> wrote:
>
>> OK I found what makes the memory leak.
>>
>> In the project I work with I use a  java Model class which is java
>> Collection proxy/facade for a single transaction. Unfortunately it's not
>> thread safe. In a few places I passed single instance of model into several
>> threads Also I requested the instance with -> which makes new thread as
>> well. I was surprised that -> makes trouble but after thinking that might
>> be expected. Especially that internally the wrapper doesn't do simple
>> mapping - it uses some iterator, etc. Anyway the machinery is fragile. It
>> seems I need to rewrite code and replace all multithreading parts by
>> something simpler.
>>
>>
>>
>> If you want see the stacktrace just look at:
>> https://github.com/jgrzebyta/triple-loader/issues/53
>>
>> On 2 February 2018 at 11:16, Jacek Grzebyta <grzebyta@gmail.com>
>> wrote:
>>
>>>
>>> On 2 February 2018 at 08:34, Niels van Klaveren <
>>> niels.vanklave...@gmail.com> wrote:
>>>
>>>> +1 for Claypoole, it removed the needs of using agents or futures in
>>>> 95% of the cases in my code.
>>>>
>>>>
>>> Thanks a lot. I modify the code using claypoole. I imagine with-shutdown
>>> will close the pool properly after finish all tasks so there is no need to
>>> watch them?
>>>
>>> J
>>>
>>>
>>
>> --
>> 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/d/optout.
>>
> --
> 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/d/optout.
>

-- 
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/d/optout.


Re: what does future do after fn finish ?

2018-02-02 Thread Justin Smith
-> is just a list transform performed after reading your code into a list
data structure containing symbols, and before compiling to byte code - it
doesn't do anything directly.

On Fri, Feb 2, 2018 at 3:55 PM Jacek Grzebyta <grzebyta@gmail.com>
wrote:

> OK I found what makes the memory leak.
>
> In the project I work with I use a  java Model class which is java
> Collection proxy/facade for a single transaction. Unfortunately it's not
> thread safe. In a few places I passed single instance of model into several
> threads Also I requested the instance with -> which makes new thread as
> well. I was surprised that -> makes trouble but after thinking that might
> be expected. Especially that internally the wrapper doesn't do simple
> mapping - it uses some iterator, etc. Anyway the machinery is fragile. It
> seems I need to rewrite code and replace all multithreading parts by
> something simpler.
>
>
>
> If you want see the stacktrace just look at:
> https://github.com/jgrzebyta/triple-loader/issues/53
>
> On 2 February 2018 at 11:16, Jacek Grzebyta <grzebyta@gmail.com>
> wrote:
>
>>
>> On 2 February 2018 at 08:34, Niels van Klaveren <
>> niels.vanklave...@gmail.com> wrote:
>>
>>> +1 for Claypoole, it removed the needs of using agents or futures in 95%
>>> of the cases in my code.
>>>
>>>
>> Thanks a lot. I modify the code using claypoole. I imagine with-shutdown
>> will close the pool properly after finish all tasks so there is no need to
>> watch them?
>>
>> J
>>
>>
>
> --
> 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/d/optout.
>

-- 
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/d/optout.


Re: what does future do after fn finish ?

2018-02-02 Thread Jacek Grzebyta
OK I found what makes the memory leak.

In the project I work with I use a  java Model class which is java
Collection proxy/facade for a single transaction. Unfortunately it's not
thread safe. In a few places I passed single instance of model into several
threads Also I requested the instance with -> which makes new thread as
well. I was surprised that -> makes trouble but after thinking that might
be expected. Especially that internally the wrapper doesn't do simple
mapping - it uses some iterator, etc. Anyway the machinery is fragile. It
seems I need to rewrite code and replace all multithreading parts by
something simpler.



If you want see the stacktrace just look at:
https://github.com/jgrzebyta/triple-loader/issues/53

On 2 February 2018 at 11:16, Jacek Grzebyta <grzebyta@gmail.com> wrote:

>
> On 2 February 2018 at 08:34, Niels van Klaveren <
> niels.vanklave...@gmail.com> wrote:
>
>> +1 for Claypoole, it removed the needs of using agents or futures in 95%
>> of the cases in my code.
>>
>>
> Thanks a lot. I modify the code using claypoole. I imagine with-shutdown
> will close the pool properly after finish all tasks so there is no need to
> watch them?
>
> J
>
>

-- 
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/d/optout.


Re: what does future do after fn finish ?

2018-02-02 Thread Jacek Grzebyta
On 2 February 2018 at 08:34, Niels van Klaveren  wrote:

> +1 for Claypoole, it removed the needs of using agents or futures in 95%
> of the cases in my code.
>
>
Thanks a lot. I modify the code using claypoole. I imagine with-shutdown
will close the pool properly after finish all tasks so there is no need to
watch them?

J

-- 
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/d/optout.


Re: what does future do after fn finish ?

2018-02-02 Thread Niels van Klaveren
+1 for Claypoole, it removed the needs of using agents or futures in 95% of 
the cases in my code.

On Thursday, February 1, 2018 at 9:54:36 PM UTC+1, Alan Thompson wrote:
>
> You may find that using the Claypoole library is the easiest way to handle 
> threadpools:   https://github.com/TheClimateCorporation/claypoole
> Alan
>
> On Thu, Feb 1, 2018 at 11:16 AM, Justin Smith <noise...@gmail.com 
> > wrote:
>
>> yes, that's the idea exactly
>>
>> also, you might want more fine grained control of how much parallelism 
>> occurs (eg. if every thread is writing to the same physical device, you can 
>> often get better throughput by not parallelizing at all, or keeping the 
>> parallelism quite limited - it's worth experimenting) - there are good ways 
>> to control that using ThreadPoolExecutor directly, or using 
>> clojure.lang.PersistentQueue/EMPTY as a control construct, or core.async 
>> channels, or ztellman's manifold library, or the claypoole threading library
>>
>> On Thu, Feb 1, 2018, 03:44 Jacek Grzebyta <grzeby...@gmail.com 
>> > wrote:
>>
>>> Thanks folks. I see now! It should be a list of agents not list of 
>>> futures within agent.  Also any task sent to a agent is processed 
>>> within a thread anyway so I do not need to add future...
>>>
>>> On 1 February 2018 at 02:17, John Newman <joh...@gmail.com 
>>> > wrote:
>>>
>>>> Ah, he's using one agent, I see.
>>>>
>>>> On Jan 31, 2018 9:15 PM, "John Newman" <joh...@gmail.com > 
>>>> wrote:
>>>>
>>>>> Multiple sen-doffs to one agent will serialize it's calls, but 
>>>>> spawning agents on each new task will spawn threads on a bounded thread 
>>>>> pool, I believe.
>>>>>
>>>>> On Jan 31, 2018 8:32 PM, "Justin Smith" <noise...@gmail.com 
>>>>> > wrote:
>>>>>
>>>>>> Doing all the actions via one agent means that the actions are 
>>>>>> serialized though - you end up with no performance improvement over 
>>>>>> doing 
>>>>>> them all in a doseq in one future - the right way to do this tends to be 
>>>>>> trickier than it looks at first glance, and depends on your 
>>>>>> requirements. 
>>>>>> agents, the claypoole library, and reducers are all potentially useful. 
>>>>>> If 
>>>>>> parallelization leads to complex coordination needs, core.async can help 
>>>>>> too.
>>>>>>
>>>>>> On Wed, Jan 31, 2018 at 5:18 PM John Newman <joh...@gmail.com 
>>>>>> > wrote:
>>>>>>
>>>>>>> Agents manage a pool of threads for you. Try doing it without the 
>>>>>>> future call and see if that works (unless you're trying to do something 
>>>>>>> else).
>>>>>>>
>>>>>>> John
>>>>>>>
>>>>>>> On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta <grzeby...@gmail.com 
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Thanks a lot. I will check it tomorrow. 
>>>>>>>>
>>>>>>>> J
>>>>>>>>
>>>>>>>> On 1 Feb 2018 12:12 a.m., "Justin Smith" <noise...@gmail.com 
>>>>>>>> > wrote:
>>>>>>>>
>>>>>>>>> this is exactly the kind of problem code I was describing - 
>>>>>>>>> there's no backpressure on existing future tasks to hold up the 
>>>>>>>>> launching 
>>>>>>>>> of more futures - the work done by the agent calling conj is 
>>>>>>>>> negligible. 
>>>>>>>>> You need to control the size of the pool of threads used, and you 
>>>>>>>>> need to 
>>>>>>>>> impose back-pressure.
>>>>>>>>>
>>>>>>>>> On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <
>>>>>>>>> grzeby...@gmail.com > wrote:
>>>>>>>>>
>>>>>>>>>> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com 
>>>>>>>>>> > wrote:
>>>>>>>>>>
>>>>>>>>>>> On 31 January 2018 at 17

Re: what does future do after fn finish ?

2018-02-01 Thread Alan Thompson
You may find that using the Claypoole library is the easiest way to handle
threadpools:   https://github.com/TheClimateCorporation/claypoole
Alan

On Thu, Feb 1, 2018 at 11:16 AM, Justin Smith <noisesm...@gmail.com> wrote:

> yes, that's the idea exactly
>
> also, you might want more fine grained control of how much parallelism
> occurs (eg. if every thread is writing to the same physical device, you can
> often get better throughput by not parallelizing at all, or keeping the
> parallelism quite limited - it's worth experimenting) - there are good ways
> to control that using ThreadPoolExecutor directly, or using
> clojure.lang.PersistentQueue/EMPTY as a control construct, or core.async
> channels, or ztellman's manifold library, or the claypoole threading library
>
> On Thu, Feb 1, 2018, 03:44 Jacek Grzebyta <grzebyta@gmail.com> wrote:
>
>> Thanks folks. I see now! It should be a list of agents not list of
>> futures within agent.  Also any task sent to a agent is processed
>> within a thread anyway so I do not need to add future...
>>
>> On 1 February 2018 at 02:17, John Newman <john...@gmail.com> wrote:
>>
>>> Ah, he's using one agent, I see.
>>>
>>> On Jan 31, 2018 9:15 PM, "John Newman" <john...@gmail.com> wrote:
>>>
>>>> Multiple sen-doffs to one agent will serialize it's calls, but spawning
>>>> agents on each new task will spawn threads on a bounded thread pool, I
>>>> believe.
>>>>
>>>> On Jan 31, 2018 8:32 PM, "Justin Smith" <noisesm...@gmail.com> wrote:
>>>>
>>>>> Doing all the actions via one agent means that the actions are
>>>>> serialized though - you end up with no performance improvement over doing
>>>>> them all in a doseq in one future - the right way to do this tends to be
>>>>> trickier than it looks at first glance, and depends on your requirements.
>>>>> agents, the claypoole library, and reducers are all potentially useful. If
>>>>> parallelization leads to complex coordination needs, core.async can help
>>>>> too.
>>>>>
>>>>> On Wed, Jan 31, 2018 at 5:18 PM John Newman <john...@gmail.com> wrote:
>>>>>
>>>>>> Agents manage a pool of threads for you. Try doing it without the
>>>>>> future call and see if that works (unless you're trying to do something
>>>>>> else).
>>>>>>
>>>>>> John
>>>>>>
>>>>>> On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta <
>>>>>> grzebyta@gmail.com> wrote:
>>>>>>
>>>>>>> Thanks a lot. I will check it tomorrow.
>>>>>>>
>>>>>>> J
>>>>>>>
>>>>>>> On 1 Feb 2018 12:12 a.m., "Justin Smith" <noisesm...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> this is exactly the kind of problem code I was describing - there's
>>>>>>>> no backpressure on existing future tasks to hold up the launching of 
>>>>>>>> more
>>>>>>>> futures - the work done by the agent calling conj is negligible. You 
>>>>>>>> need
>>>>>>>> to control the size of the pool of threads used, and you need to impose
>>>>>>>> back-pressure.
>>>>>>>>
>>>>>>>> On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <
>>>>>>>> grzebyta@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> On 31 January 2018 at 17:59, Jacek Grzebyta <
>>>>>>>>>> grzebyta@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> I have application with quite intense tripe store populating
>>>>>>>>>>> ~30/40 k records per chunk (139 portions). The data are wrapped 
>>>>>>>>>>> within the
>>>>>>>>>>> future:
>>>>>>>>>>>
>>>>>>>>>>> (conj agent (future (apply task args)))
>>>>>>>>>>>
>>>>>>>>>>>  and that all together is send-off into (agent 

Re: what does future do after fn finish ?

2018-02-01 Thread Justin Smith
yes, that's the idea exactly

also, you might want more fine grained control of how much parallelism
occurs (eg. if every thread is writing to the same physical device, you can
often get better throughput by not parallelizing at all, or keeping the
parallelism quite limited - it's worth experimenting) - there are good ways
to control that using ThreadPoolExecutor directly, or using
clojure.lang.PersistentQueue/EMPTY as a control construct, or core.async
channels, or ztellman's manifold library, or the claypoole threading library

On Thu, Feb 1, 2018, 03:44 Jacek Grzebyta <grzebyta@gmail.com> wrote:

> Thanks folks. I see now! It should be a list of agents not list of futures
> within agent.  Also any task sent to a agent is processed within a
> thread anyway so I do not need to add future...
>
> On 1 February 2018 at 02:17, John Newman <john...@gmail.com> wrote:
>
>> Ah, he's using one agent, I see.
>>
>> On Jan 31, 2018 9:15 PM, "John Newman" <john...@gmail.com> wrote:
>>
>>> Multiple sen-doffs to one agent will serialize it's calls, but spawning
>>> agents on each new task will spawn threads on a bounded thread pool, I
>>> believe.
>>>
>>> On Jan 31, 2018 8:32 PM, "Justin Smith" <noisesm...@gmail.com> wrote:
>>>
>>>> Doing all the actions via one agent means that the actions are
>>>> serialized though - you end up with no performance improvement over doing
>>>> them all in a doseq in one future - the right way to do this tends to be
>>>> trickier than it looks at first glance, and depends on your requirements.
>>>> agents, the claypoole library, and reducers are all potentially useful. If
>>>> parallelization leads to complex coordination needs, core.async can help
>>>> too.
>>>>
>>>> On Wed, Jan 31, 2018 at 5:18 PM John Newman <john...@gmail.com> wrote:
>>>>
>>>>> Agents manage a pool of threads for you. Try doing it without the
>>>>> future call and see if that works (unless you're trying to do something
>>>>> else).
>>>>>
>>>>> John
>>>>>
>>>>> On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta <
>>>>> grzebyta@gmail.com> wrote:
>>>>>
>>>>>> Thanks a lot. I will check it tomorrow.
>>>>>>
>>>>>> J
>>>>>>
>>>>>> On 1 Feb 2018 12:12 a.m., "Justin Smith" <noisesm...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> this is exactly the kind of problem code I was describing - there's
>>>>>>> no backpressure on existing future tasks to hold up the launching of 
>>>>>>> more
>>>>>>> futures - the work done by the agent calling conj is negligible. You 
>>>>>>> need
>>>>>>> to control the size of the pool of threads used, and you need to impose
>>>>>>> back-pressure.
>>>>>>>
>>>>>>> On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <
>>>>>>> grzebyta@gmail.com> wrote:
>>>>>>>
>>>>>>>> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> On 31 January 2018 at 17:59, Jacek Grzebyta <
>>>>>>>>> grzebyta@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> I have application with quite intense tripe store populating
>>>>>>>>>> ~30/40 k records per chunk (139 portions). The data are wrapped 
>>>>>>>>>> within the
>>>>>>>>>> future:
>>>>>>>>>>
>>>>>>>>>> (conj agent (future (apply task args)))
>>>>>>>>>>
>>>>>>>>>>  and that all together is send-off into (agent []).
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> What is "agent"? The first line of code indicates that it's a
>>>>>>>>> local collection shadowing the code function, while the second code 
>>>>>>>>> snippet
>>>>>>>>> indicates that you're using the core agent function.
>>>>>>>>>
>>>>>>>>> Also why are you sending off to an agent?
>>>

Re: what does future do after fn finish ?

2018-02-01 Thread Jacek Grzebyta
Thanks folks. I see now! It should be a list of agents not list of futures
within agent.  Also any task sent to a agent is processed within a
thread anyway so I do not need to add future...

On 1 February 2018 at 02:17, John Newman <john...@gmail.com> wrote:

> Ah, he's using one agent, I see.
>
> On Jan 31, 2018 9:15 PM, "John Newman" <john...@gmail.com> wrote:
>
>> Multiple sen-doffs to one agent will serialize it's calls, but spawning
>> agents on each new task will spawn threads on a bounded thread pool, I
>> believe.
>>
>> On Jan 31, 2018 8:32 PM, "Justin Smith" <noisesm...@gmail.com> wrote:
>>
>>> Doing all the actions via one agent means that the actions are
>>> serialized though - you end up with no performance improvement over doing
>>> them all in a doseq in one future - the right way to do this tends to be
>>> trickier than it looks at first glance, and depends on your requirements.
>>> agents, the claypoole library, and reducers are all potentially useful. If
>>> parallelization leads to complex coordination needs, core.async can help
>>> too.
>>>
>>> On Wed, Jan 31, 2018 at 5:18 PM John Newman <john...@gmail.com> wrote:
>>>
>>>> Agents manage a pool of threads for you. Try doing it without the
>>>> future call and see if that works (unless you're trying to do something
>>>> else).
>>>>
>>>> John
>>>>
>>>> On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta <grzebyta@gmail.com
>>>> > wrote:
>>>>
>>>>> Thanks a lot. I will check it tomorrow.
>>>>>
>>>>> J
>>>>>
>>>>> On 1 Feb 2018 12:12 a.m., "Justin Smith" <noisesm...@gmail.com> wrote:
>>>>>
>>>>>> this is exactly the kind of problem code I was describing - there's
>>>>>> no backpressure on existing future tasks to hold up the launching of more
>>>>>> futures - the work done by the agent calling conj is negligible. You need
>>>>>> to control the size of the pool of threads used, and you need to impose
>>>>>> back-pressure.
>>>>>>
>>>>>> On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <
>>>>>> grzebyta@gmail.com> wrote:
>>>>>>
>>>>>>> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com
>>>>>>>> > wrote:
>>>>>>>>
>>>>>>>>> I have application with quite intense tripe store populating
>>>>>>>>> ~30/40 k records per chunk (139 portions). The data are wrapped 
>>>>>>>>> within the
>>>>>>>>> future:
>>>>>>>>>
>>>>>>>>> (conj agent (future (apply task args)))
>>>>>>>>>
>>>>>>>>>  and that all together is send-off into (agent []).
>>>>>>>>>
>>>>>>>>
>>>>>>>> What is "agent"? The first line of code indicates that it's a local
>>>>>>>> collection shadowing the code function, while the second code snippet
>>>>>>>> indicates that you're using the core agent function.
>>>>>>>>
>>>>>>>> Also why are you sending off to an agent?
>>>>>>>>
>>>>>>>
>>>>>>> I have ~8sec computing task for each input dataset which generates
>>>>>>> those records. After that I write it into disk (in software-specific
>>>>>>> transaction). I just wanted to separate hard computing and io 
>>>>>>> operations. I
>>>>>>> created a side-effect method which is injected together with the dataset
>>>>>>> into a future. The futures are async collected within a list wrapped in
>>>>>>> agent. After the computing the main thread is waiting until all io tasks
>>>>>>> will be finished.
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> At the end of the main thread function I just use await-for and
>>>>>>>>> after that:
>>>>>>>>>
>>>>>

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
Ah, he's using one agent, I see.

On Jan 31, 2018 9:15 PM, "John Newman" <john...@gmail.com> wrote:

> Multiple sen-doffs to one agent will serialize it's calls, but spawning
> agents on each new task will spawn threads on a bounded thread pool, I
> believe.
>
> On Jan 31, 2018 8:32 PM, "Justin Smith" <noisesm...@gmail.com> wrote:
>
>> Doing all the actions via one agent means that the actions are serialized
>> though - you end up with no performance improvement over doing them all in
>> a doseq in one future - the right way to do this tends to be trickier than
>> it looks at first glance, and depends on your requirements. agents, the
>> claypoole library, and reducers are all potentially useful. If
>> parallelization leads to complex coordination needs, core.async can help
>> too.
>>
>> On Wed, Jan 31, 2018 at 5:18 PM John Newman <john...@gmail.com> wrote:
>>
>>> Agents manage a pool of threads for you. Try doing it without the future
>>> call and see if that works (unless you're trying to do something else).
>>>
>>> John
>>>
>>> On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta <grzebyta@gmail.com>
>>> wrote:
>>>
>>>> Thanks a lot. I will check it tomorrow.
>>>>
>>>> J
>>>>
>>>> On 1 Feb 2018 12:12 a.m., "Justin Smith" <noisesm...@gmail.com> wrote:
>>>>
>>>>> this is exactly the kind of problem code I was describing - there's no
>>>>> backpressure on existing future tasks to hold up the launching of more
>>>>> futures - the work done by the agent calling conj is negligible. You need
>>>>> to control the size of the pool of threads used, and you need to impose
>>>>> back-pressure.
>>>>>
>>>>> On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <grzebyta@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com>
>>>>>> wrote:
>>>>>>
>>>>>>> On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I have application with quite intense tripe store populating ~30/40
>>>>>>>> k records per chunk (139 portions). The data are wrapped within the 
>>>>>>>> future:
>>>>>>>>
>>>>>>>> (conj agent (future (apply task args)))
>>>>>>>>
>>>>>>>>  and that all together is send-off into (agent []).
>>>>>>>>
>>>>>>>
>>>>>>> What is "agent"? The first line of code indicates that it's a local
>>>>>>> collection shadowing the code function, while the second code snippet
>>>>>>> indicates that you're using the core agent function.
>>>>>>>
>>>>>>> Also why are you sending off to an agent?
>>>>>>>
>>>>>>
>>>>>> I have ~8sec computing task for each input dataset which generates
>>>>>> those records. After that I write it into disk (in software-specific
>>>>>> transaction). I just wanted to separate hard computing and io 
>>>>>> operations. I
>>>>>> created a side-effect method which is injected together with the dataset
>>>>>> into a future. The futures are async collected within a list wrapped in
>>>>>> agent. After the computing the main thread is waiting until all io tasks
>>>>>> will be finished.
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> At the end of the main thread function I just use await-for and
>>>>>>>> after that:
>>>>>>>>
>>>>>>>> (reduce + (map #(deref %) @data-loading-tasks))
>>>>>>>>
>>>>>>>
>>>>>> As a control, tasks return number of written records.
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>> For some reason I see the happy collecting (see attached screenshot
>>>>>>>> of jconsole).
>>>>>>>>
>>>>>>>
>>>>>>> "happy" = "heap"?
>>>>>>>
>>>>>>

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
Multiple sen-doffs to one agent will serialize it's calls, but spawning
agents on each new task will spawn threads on a bounded thread pool, I
believe.

On Jan 31, 2018 8:32 PM, "Justin Smith" <noisesm...@gmail.com> wrote:

> Doing all the actions via one agent means that the actions are serialized
> though - you end up with no performance improvement over doing them all in
> a doseq in one future - the right way to do this tends to be trickier than
> it looks at first glance, and depends on your requirements. agents, the
> claypoole library, and reducers are all potentially useful. If
> parallelization leads to complex coordination needs, core.async can help
> too.
>
> On Wed, Jan 31, 2018 at 5:18 PM John Newman <john...@gmail.com> wrote:
>
>> Agents manage a pool of threads for you. Try doing it without the future
>> call and see if that works (unless you're trying to do something else).
>>
>> John
>>
>> On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta <grzebyta@gmail.com>
>> wrote:
>>
>>> Thanks a lot. I will check it tomorrow.
>>>
>>> J
>>>
>>> On 1 Feb 2018 12:12 a.m., "Justin Smith" <noisesm...@gmail.com> wrote:
>>>
>>>> this is exactly the kind of problem code I was describing - there's no
>>>> backpressure on existing future tasks to hold up the launching of more
>>>> futures - the work done by the agent calling conj is negligible. You need
>>>> to control the size of the pool of threads used, and you need to impose
>>>> back-pressure.
>>>>
>>>> On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <grzebyta@gmail.com>
>>>> wrote:
>>>>
>>>>> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com>
>>>>> wrote:
>>>>>
>>>>>> On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> I have application with quite intense tripe store populating ~30/40
>>>>>>> k records per chunk (139 portions). The data are wrapped within the 
>>>>>>> future:
>>>>>>>
>>>>>>> (conj agent (future (apply task args)))
>>>>>>>
>>>>>>>  and that all together is send-off into (agent []).
>>>>>>>
>>>>>>
>>>>>> What is "agent"? The first line of code indicates that it's a local
>>>>>> collection shadowing the code function, while the second code snippet
>>>>>> indicates that you're using the core agent function.
>>>>>>
>>>>>> Also why are you sending off to an agent?
>>>>>>
>>>>>
>>>>> I have ~8sec computing task for each input dataset which generates
>>>>> those records. After that I write it into disk (in software-specific
>>>>> transaction). I just wanted to separate hard computing and io operations. 
>>>>> I
>>>>> created a side-effect method which is injected together with the dataset
>>>>> into a future. The futures are async collected within a list wrapped in
>>>>> agent. After the computing the main thread is waiting until all io tasks
>>>>> will be finished.
>>>>>
>>>>>
>>>>>>
>>>>>> At the end of the main thread function I just use await-for and after
>>>>>>> that:
>>>>>>>
>>>>>>> (reduce + (map #(deref %) @data-loading-tasks))
>>>>>>>
>>>>>>
>>>>> As a control, tasks return number of written records.
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>>> For some reason I see the happy collecting (see attached screenshot
>>>>>>> of jconsole).
>>>>>>>
>>>>>>
>>>>>> "happy" = "heap"?
>>>>>>
>>>>>
>>>>> Both. As you can see on attached screenshot the heap usage grows easy
>>>>> until aver. ~2 1/4 G than keep that  for a few minutes. In that moment I
>>>>> stopped. After that starts grow till ~4G with tendency to do jumps a bit
>>>>> more that 4G.
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>>> After seeing the source code of future I suppose that t

Re: what does future do after fn finish ?

2018-01-31 Thread Justin Smith
Doing all the actions via one agent means that the actions are serialized
though - you end up with no performance improvement over doing them all in
a doseq in one future - the right way to do this tends to be trickier than
it looks at first glance, and depends on your requirements. agents, the
claypoole library, and reducers are all potentially useful. If
parallelization leads to complex coordination needs, core.async can help
too.

On Wed, Jan 31, 2018 at 5:18 PM John Newman <john...@gmail.com> wrote:

> Agents manage a pool of threads for you. Try doing it without the future
> call and see if that works (unless you're trying to do something else).
>
> John
>
> On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta <grzebyta@gmail.com>
> wrote:
>
>> Thanks a lot. I will check it tomorrow.
>>
>> J
>>
>> On 1 Feb 2018 12:12 a.m., "Justin Smith" <noisesm...@gmail.com> wrote:
>>
>>> this is exactly the kind of problem code I was describing - there's no
>>> backpressure on existing future tasks to hold up the launching of more
>>> futures - the work done by the agent calling conj is negligible. You need
>>> to control the size of the pool of threads used, and you need to impose
>>> back-pressure.
>>>
>>> On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <grzebyta@gmail.com>
>>> wrote:
>>>
>>>> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com>
>>>> wrote:
>>>>
>>>>> On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> I have application with quite intense tripe store populating ~30/40 k
>>>>>> records per chunk (139 portions). The data are wrapped within the future:
>>>>>>
>>>>>> (conj agent (future (apply task args)))
>>>>>>
>>>>>>  and that all together is send-off into (agent []).
>>>>>>
>>>>>
>>>>> What is "agent"? The first line of code indicates that it's a local
>>>>> collection shadowing the code function, while the second code snippet
>>>>> indicates that you're using the core agent function.
>>>>>
>>>>> Also why are you sending off to an agent?
>>>>>
>>>>
>>>> I have ~8sec computing task for each input dataset which generates
>>>> those records. After that I write it into disk (in software-specific
>>>> transaction). I just wanted to separate hard computing and io operations. I
>>>> created a side-effect method which is injected together with the dataset
>>>> into a future. The futures are async collected within a list wrapped in
>>>> agent. After the computing the main thread is waiting until all io tasks
>>>> will be finished.
>>>>
>>>>
>>>>>
>>>>> At the end of the main thread function I just use await-for and after
>>>>>> that:
>>>>>>
>>>>>> (reduce + (map #(deref %) @data-loading-tasks))
>>>>>>
>>>>>
>>>> As a control, tasks return number of written records.
>>>>
>>>>
>>>>
>>>>>
>>>>>> For some reason I see the happy collecting (see attached screenshot
>>>>>> of jconsole).
>>>>>>
>>>>>
>>>>> "happy" = "heap"?
>>>>>
>>>>
>>>> Both. As you can see on attached screenshot the heap usage grows easy
>>>> until aver. ~2 1/4 G than keep that  for a few minutes. In that moment I
>>>> stopped. After that starts grow till ~4G with tendency to do jumps a bit
>>>> more that 4G.
>>>>
>>>>
>>>>>
>>>>>
>>>>>> After seeing the source code of future I suppose that the memory
>>>>>> (data are kept as #{} set) is not released. The task returns only integer
>>>>>> so I do not think that might cause the problem.
>>>>>>
>>>>>
>>>>> Can you provide more detail? You keep alluding to things that you
>>>>> don't provide code for, such as the sets of data.
>>>>>
>>>>
>>>>
>>>> The code is attached. However the important code is
>>>>
>>>> L123 .
>>>>   (let [;; keeps all data loading futures.
>>>> ;; waiting until all 

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
Agents manage a pool of threads for you. Try doing it without the future
call and see if that works (unless you're trying to do something else).

John

On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta <grzebyta@gmail.com>
wrote:

> Thanks a lot. I will check it tomorrow.
>
> J
>
> On 1 Feb 2018 12:12 a.m., "Justin Smith" <noisesm...@gmail.com> wrote:
>
>> this is exactly the kind of problem code I was describing - there's no
>> backpressure on existing future tasks to hold up the launching of more
>> futures - the work done by the agent calling conj is negligible. You need
>> to control the size of the pool of threads used, and you need to impose
>> back-pressure.
>>
>> On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <grzebyta@gmail.com>
>> wrote:
>>
>>> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com> wrote:
>>>
>>>> On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com>
>>>> wrote:
>>>>
>>>>> I have application with quite intense tripe store populating ~30/40 k
>>>>> records per chunk (139 portions). The data are wrapped within the future:
>>>>>
>>>>> (conj agent (future (apply task args)))
>>>>>
>>>>>  and that all together is send-off into (agent []).
>>>>>
>>>>
>>>> What is "agent"? The first line of code indicates that it's a local
>>>> collection shadowing the code function, while the second code snippet
>>>> indicates that you're using the core agent function.
>>>>
>>>> Also why are you sending off to an agent?
>>>>
>>>
>>> I have ~8sec computing task for each input dataset which generates those
>>> records. After that I write it into disk (in software-specific
>>> transaction). I just wanted to separate hard computing and io operations. I
>>> created a side-effect method which is injected together with the dataset
>>> into a future. The futures are async collected within a list wrapped in
>>> agent. After the computing the main thread is waiting until all io tasks
>>> will be finished.
>>>
>>>
>>>>
>>>> At the end of the main thread function I just use await-for and after
>>>>> that:
>>>>>
>>>>> (reduce + (map #(deref %) @data-loading-tasks))
>>>>>
>>>>
>>> As a control, tasks return number of written records.
>>>
>>>
>>>
>>>>
>>>>> For some reason I see the happy collecting (see attached screenshot of
>>>>> jconsole).
>>>>>
>>>>
>>>> "happy" = "heap"?
>>>>
>>>
>>> Both. As you can see on attached screenshot the heap usage grows easy
>>> until aver. ~2 1/4 G than keep that  for a few minutes. In that moment I
>>> stopped. After that starts grow till ~4G with tendency to do jumps a bit
>>> more that 4G.
>>>
>>>
>>>>
>>>>
>>>>> After seeing the source code of future I suppose that the memory (data
>>>>> are kept as #{} set) is not released. The task returns only integer so I 
>>>>> do
>>>>> not think that might cause the problem.
>>>>>
>>>>
>>>> Can you provide more detail? You keep alluding to things that you don't
>>>> provide code for, such as the sets of data.
>>>>
>>>
>>>
>>> The code is attached. However the important code is
>>>
>>> L123 .
>>>   (let [;; keeps all data loading futures.
>>> ;; waiting until all futures are finished
>>> ;; should be done outside the main loop
>>> data-loading-tasks (agent [])]
>>>
>>> L128
>>> (doseq
>>>  (let [r1 (long operation)]   L133
>>>  (doseq
>>> (let [r2 (v.v. long)]   L155
>>>
>>>   L163   (send-off data-loading-task conj-task)
>>>
>>>  )
>>>  )
>>> )
>>> )
>>>
>>>
>>> I guess first I will move data-loading-tasks list into one of inner
>>> lets. Also I will create within an injecting function a separate abstract
>>> function let inside. The task will populate tmp variable which will be
>>> returned as a future result:
>>>
>>>
>>> L114 (conj agent (future (apply (fn []

Re: what does future do after fn finish ?

2018-01-31 Thread Jacek Grzebyta
Thanks a lot. I will check it tomorrow.

J

On 1 Feb 2018 12:12 a.m., "Justin Smith" <noisesm...@gmail.com> wrote:

> this is exactly the kind of problem code I was describing - there's no
> backpressure on existing future tasks to hold up the launching of more
> futures - the work done by the agent calling conj is negligible. You need
> to control the size of the pool of threads used, and you need to impose
> back-pressure.
>
> On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <grzebyta@gmail.com>
> wrote:
>
>> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com> wrote:
>>
>>> On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com>
>>> wrote:
>>>
>>>> I have application with quite intense tripe store populating ~30/40 k
>>>> records per chunk (139 portions). The data are wrapped within the future:
>>>>
>>>> (conj agent (future (apply task args)))
>>>>
>>>>  and that all together is send-off into (agent []).
>>>>
>>>
>>> What is "agent"? The first line of code indicates that it's a local
>>> collection shadowing the code function, while the second code snippet
>>> indicates that you're using the core agent function.
>>>
>>> Also why are you sending off to an agent?
>>>
>>
>> I have ~8sec computing task for each input dataset which generates those
>> records. After that I write it into disk (in software-specific
>> transaction). I just wanted to separate hard computing and io operations. I
>> created a side-effect method which is injected together with the dataset
>> into a future. The futures are async collected within a list wrapped in
>> agent. After the computing the main thread is waiting until all io tasks
>> will be finished.
>>
>>
>>>
>>> At the end of the main thread function I just use await-for and after
>>>> that:
>>>>
>>>> (reduce + (map #(deref %) @data-loading-tasks))
>>>>
>>>
>> As a control, tasks return number of written records.
>>
>>
>>
>>>
>>>> For some reason I see the happy collecting (see attached screenshot of
>>>> jconsole).
>>>>
>>>
>>> "happy" = "heap"?
>>>
>>
>> Both. As you can see on attached screenshot the heap usage grows easy
>> until aver. ~2 1/4 G than keep that  for a few minutes. In that moment I
>> stopped. After that starts grow till ~4G with tendency to do jumps a bit
>> more that 4G.
>>
>>
>>>
>>>
>>>> After seeing the source code of future I suppose that the memory (data
>>>> are kept as #{} set) is not released. The task returns only integer so I do
>>>> not think that might cause the problem.
>>>>
>>>
>>> Can you provide more detail? You keep alluding to things that you don't
>>> provide code for, such as the sets of data.
>>>
>>
>>
>> The code is attached. However the important code is
>>
>> L123 .
>>   (let [;; keeps all data loading futures.
>> ;; waiting until all futures are finished
>> ;; should be done outside the main loop
>> data-loading-tasks (agent [])]
>>
>> L128
>> (doseq
>>  (let [r1 (long operation)]   L133
>>  (doseq
>> (let [r2 (v.v. long)]   L155
>>
>>   L163   (send-off data-loading-task conj-task)
>>
>>  )
>>  )
>> )
>> )
>>
>>
>> I guess first I will move data-loading-tasks list into one of inner lets.
>> Also I will create within an injecting function a separate abstract
>> function let inside. The task will populate tmp variable which will be
>> returned as a future result:
>>
>>
>> L114 (conj agent (future (apply (fn [] (let [result (apply task args)]
>> result)
>>
>>
>>>
>>> --
>>> James Reeves
>>> booleanknot.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
>>> 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/

Re: what does future do after fn finish ?

2018-01-31 Thread Justin Smith
this is exactly the kind of problem code I was describing - there's no
backpressure on existing future tasks to hold up the launching of more
futures - the work done by the agent calling conj is negligible. You need
to control the size of the pool of threads used, and you need to impose
back-pressure.

On Wed, Jan 31, 2018 at 3:46 PM Jacek Grzebyta <grzebyta@gmail.com>
wrote:

> On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com> wrote:
>
>> On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com>
>> wrote:
>>
>>> I have application with quite intense tripe store populating ~30/40 k
>>> records per chunk (139 portions). The data are wrapped within the future:
>>>
>>> (conj agent (future (apply task args)))
>>>
>>>  and that all together is send-off into (agent []).
>>>
>>
>> What is "agent"? The first line of code indicates that it's a local
>> collection shadowing the code function, while the second code snippet
>> indicates that you're using the core agent function.
>>
>> Also why are you sending off to an agent?
>>
>
> I have ~8sec computing task for each input dataset which generates those
> records. After that I write it into disk (in software-specific
> transaction). I just wanted to separate hard computing and io operations. I
> created a side-effect method which is injected together with the dataset
> into a future. The futures are async collected within a list wrapped in
> agent. After the computing the main thread is waiting until all io tasks
> will be finished.
>
>
>>
>> At the end of the main thread function I just use await-for and after
>>> that:
>>>
>>> (reduce + (map #(deref %) @data-loading-tasks))
>>>
>>
> As a control, tasks return number of written records.
>
>
>
>>
>>> For some reason I see the happy collecting (see attached screenshot of
>>> jconsole).
>>>
>>
>> "happy" = "heap"?
>>
>
> Both. As you can see on attached screenshot the heap usage grows easy
> until aver. ~2 1/4 G than keep that  for a few minutes. In that moment I
> stopped. After that starts grow till ~4G with tendency to do jumps a bit
> more that 4G.
>
>
>>
>>
>>> After seeing the source code of future I suppose that the memory (data
>>> are kept as #{} set) is not released. The task returns only integer so I do
>>> not think that might cause the problem.
>>>
>>
>> Can you provide more detail? You keep alluding to things that you don't
>> provide code for, such as the sets of data.
>>
>
>
> The code is attached. However the important code is
>
> L123 .
>   (let [;; keeps all data loading futures.
> ;; waiting until all futures are finished
> ;; should be done outside the main loop
> data-loading-tasks (agent [])]
>
> L128
> (doseq
>  (let [r1 (long operation)]   L133
>  (doseq
> (let [r2 (v.v. long)]   L155
>
>   L163   (send-off data-loading-task conj-task)
>
>  )
>  )
> )
> )
>
>
> I guess first I will move data-loading-tasks list into one of inner lets.
> Also I will create within an injecting function a separate abstract
> function let inside. The task will populate tmp variable which will be
> returned as a future result:
>
>
> L114 (conj agent (future (apply (fn [] (let [result (apply task args)]
> result)
>
>
>>
>> --
>> James Reeves
>> booleanknot.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
>> 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/d/optout.
>>
> --
> 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

Re: what does future do after fn finish ?

2018-01-31 Thread Jacek Grzebyta
On 31 January 2018 at 18:08, James Reeves <ja...@booleanknot.com> wrote:

> On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com>
> wrote:
>
>> I have application with quite intense tripe store populating ~30/40 k
>> records per chunk (139 portions). The data are wrapped within the future:
>>
>> (conj agent (future (apply task args)))
>>
>>  and that all together is send-off into (agent []).
>>
>
> What is "agent"? The first line of code indicates that it's a local
> collection shadowing the code function, while the second code snippet
> indicates that you're using the core agent function.
>
> Also why are you sending off to an agent?
>

I have ~8sec computing task for each input dataset which generates those
records. After that I write it into disk (in software-specific
transaction). I just wanted to separate hard computing and io operations. I
created a side-effect method which is injected together with the dataset
into a future. The futures are async collected within a list wrapped in
agent. After the computing the main thread is waiting until all io tasks
will be finished.


>
> At the end of the main thread function I just use await-for and after that:
>>
>> (reduce + (map #(deref %) @data-loading-tasks))
>>
>
As a control, tasks return number of written records.



>
>> For some reason I see the happy collecting (see attached screenshot of
>> jconsole).
>>
>
> "happy" = "heap"?
>

Both. As you can see on attached screenshot the heap usage grows easy until
aver. ~2 1/4 G than keep that  for a few minutes. In that moment I stopped.
After that starts grow till ~4G with tendency to do jumps a bit more that
4G.


>
>
>> After seeing the source code of future I suppose that the memory (data
>> are kept as #{} set) is not released. The task returns only integer so I do
>> not think that might cause the problem.
>>
>
> Can you provide more detail? You keep alluding to things that you don't
> provide code for, such as the sets of data.
>


The code is attached. However the important code is

L123 .
  (let [;; keeps all data loading futures.
;; waiting until all futures are finished
;; should be done outside the main loop
data-loading-tasks (agent [])]

L128
(doseq
 (let [r1 (long operation)]   L133
 (doseq
(let [r2 (v.v. long)]   L155

  L163   (send-off data-loading-task conj-task)

 )
 )
)
)


I guess first I will move data-loading-tasks list into one of inner lets.
Also I will create within an injecting function a separate abstract
function let inside. The task will populate tmp variable which will be
returned as a future result:


L114 (conj agent (future (apply (fn [] (let [result (apply task args)]
result)


>
> --
> James Reeves
> booleanknot.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
> 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/d/optout.
>

-- 
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/d/optout.


experiment_result.clj
Description: Binary data


Re: what does future do after fn finish ?

2018-01-31 Thread Justin Smith
As a shot in the dark, a common problem with memory usage and futures that
I have seen is the antipattern of launching a future for each piece of data
in a collection. The problem that occurs is that the code works for small
input collections and a small load of running tasks / requests, but for a
larger input and more requests it uses up the heap easily. Then, a dev
assumes that somehow the future itself is leaking or otherwise taking up
space it shouldn't, when the true problem is that the undbounded creation
of futures happens to exhaust your available memory space. If you aren't
doing such a thing feel free to disregard.

On Wed, Jan 31, 2018 at 10:09 AM James Reeves <ja...@booleanknot.com> wrote:

> On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com>
> wrote:
>
>> I have application with quite intense tripe store populating ~30/40 k
>> records per chunk (139 portions). The data are wrapped within the future:
>>
>> (conj agent (future (apply task args)))
>>
>>  and that all together is send-off into (agent []).
>>
>
> What is "agent"? The first line of code indicates that it's a local
> collection shadowing the code function, while the second code snippet
> indicates that you're using the core agent function.
>
> Also why are you sending off to an agent?
>
> At the end of the main thread function I just use await-for and after that:
>>
>> (reduce + (map #(deref %) @data-loading-tasks))
>>
>> For some reason I see the happy collecting (see attached screenshot of
>> jconsole).
>>
>
> "happy" = "heap"?
>
>
>> After seeing the source code of future I suppose that the memory (data
>> are kept as #{} set) is not released. The task returns only integer so I do
>> not think that might cause the problem.
>>
>
> Can you provide more detail? You keep alluding to things that you don't
> provide code for, such as the sets of data.
>
> --
> James Reeves
> booleanknot.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
> 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/d/optout.
>

-- 
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/d/optout.


Re: what does future do after fn finish ?

2018-01-31 Thread James Reeves
On 31 January 2018 at 17:59, Jacek Grzebyta <grzebyta@gmail.com> wrote:

> I have application with quite intense tripe store populating ~30/40 k
> records per chunk (139 portions). The data are wrapped within the future:
>
> (conj agent (future (apply task args)))
>
>  and that all together is send-off into (agent []).
>

What is "agent"? The first line of code indicates that it's a local
collection shadowing the code function, while the second code snippet
indicates that you're using the core agent function.

Also why are you sending off to an agent?

At the end of the main thread function I just use await-for and after that:
>
> (reduce + (map #(deref %) @data-loading-tasks))
>
> For some reason I see the happy collecting (see attached screenshot of
> jconsole).
>

"happy" = "heap"?


> After seeing the source code of future I suppose that the memory (data are
> kept as #{} set) is not released. The task returns only integer so I do not
> think that might cause the problem.
>

Can you provide more detail? You keep alluding to things that you don't
provide code for, such as the sets of data.

-- 
James Reeves
booleanknot.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
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/d/optout.


what does future do after fn finish ?

2018-01-31 Thread Jacek Grzebyta
Hi,

I have application with quite intense tripe store populating ~30/40 k
records per chunk (139 portions). The data are wrapped within the future:

(conj agent (future (apply task args)))

 and that all together is send-off into (agent []).
At the end of the main thread function I just use await-for and after that:

(reduce + (map #(deref %) @data-loading-tasks))

For some reason I see the happy collecting (see attached screenshot of
jconsole). After seeing the source code of future I suppose that the memory
(data are kept as #{} set) is not released. The task returns only integer
so I do not think that might cause the problem.

Thanks a lot,
Jacek

-- 
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/d/optout.


What does the ref *loaded-libs* do?

2018-01-29 Thread Raymond Huang
I was poking around `tools.namespace` and I found it interesting that the 
implementation of `remove-lib` is:

```(defn remove-lib
  "Remove lib's namespace and remove lib from the set of loaded libs."
  [lib]
  (remove-ns lib)
  (dosync (alter @#'clojure.core/*loaded-libs* disj lib)))
```


I’m wondering if someone can enlighten me to explain why `*loaded-libs*` 
needs to exist, as opposed to checking `clojure.lang.Namespace` directly?

This is a question carried over from 
slack: https://clojurians.slack.com/archives/C03S1KBA2/p151721185721

-- 
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/d/optout.


Re: Port graphs: What would Rich Hickey do?

2018-01-10 Thread Ben Kovitz
On Monday, January 8, 2018 at 12:14:59 AM UTC-5, James Gatannah wrote:
 

> FWIW, I think https://leanpub.com/specter looks extremely interesting. 
> (Or it may be awful...I haven't had a chance to read it yet, much less work 
> through the exercises).
>

Actually, I worked through that ebook last week. (Or at least the version 
of the ebook in Google's cache. Leanpub's web site appears to be down.) 
It's excellent! It didn't go all that far, but it got across the main ideas 
very effectively.

I've been continuing to look at Specter, and the more I've learned, the 
better it's seemed. I have yet to try it myself on anything beyond toy 
examples, though. Currently I'm stumped on how to make a navigator for a 
data structure that doesn't work with 'get' and 'assoc'. There's probably 
still something elementary that I haven't understood yet. I just posted a 
question on the github site:
https://github.com/nathanmarz/specter/issues/241

--
Ben Kovitz
http://pages.iu.edu/~bkovitz/

-- 
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/d/optout.


  1   2   3   4   5   6   7   8   9   10   >