Re: Simulations in Clojure/Clojurescript

2018-01-15 Thread Tiago Antão
My $0.02,

I was a very early Clojure adopter, but I stopped using it when Oracle
bought Sun (I left the JVM completely at that time). I am currently using
ClojureScript a lot - for the last 6 months or so, thus not the most
experienced programmer.

Most of my usage is doing scientific simulations (genetics and epidemiology
in my case). I published one simulator in Scala and Java. Done quite a few
in Python+C and currently working in JavaScript + ClojureScript.

My observations here come mostly from my Scala work and my current work in
JS+CLJS.

First observation is that a lot of scientific simulation code is highly
imperative (not saying if that is good or bad), so lots of the mentality in
the field is geared towards that. Still lots of Fortran floating around,
for example.

In many cases performance is really really important. This tends to be CPU
bound, rarely disk or network. Sometimes memory might be a consideration.

My general strategy is to do the computationally expensive core in a lower
level language. For example, my Scala simulator had the core written in
Java. My ClojureScript stuff has a JS core (and in the future will have
parts in C). The Python stuff had C/C++ code.

The higher level language (Scala or ClojureScript) provided the interfaces
to manipulate the lower level code in a declarative, elegant and functional
way (actually DSLish way).

Tiago


On 10 January 2018 at 16:08, Michael Nardell  wrote:

> Greetings :: I am new to Clojure and have not really gotten my feet wet
> with Clojurescript yet. The advice I always give someone when leaning
> programming or a new language is to pick a project that they are interested
> in and dive in. For me, that project would be creating educational
> simulations that model complex systems.
>
> Part of my challenge with this as a project is that it is leading me
> towards programming (at least partially) with objects to model the discrete
> components in these systems. Arguably simulations are one of the domains
> where objects are the right paradigm. The question I pose to the group is
> how to work with objects in Clojure, in a manner that "goes with the grain"
> of the language. Perhaps best to ground my question in a concrete example:
>
> I had created simulations / visualizations of Hubel and Wiesel's model of
> the  center-surround receptive fields in the retina. My past simulations I
> used a collection of objects to model  photo receptors (i.e. rods/cones),
> horizontal, bi-polar cells, connected together to represent the behavior of
> either on-center or off-center receptive fields. Kind of a simple neural
> network. Would like to preserve the object nature of nodes in the network,
> since the nodes have state and should be represented by graphics in a gui.
> Ultimately I would like to move toward a "constructor kit" approach that
> would allow students and teachers to model and simulate a whole variety of
> various systems that can be represented as a network of processes with
> feed-forward and feed-back connections.
>
> Interested to know of any useful examples and guidance for doing objects
> the Clojure/Clojurescript way. Certainly one of the examples I want to look
> at closely is the Ant Hill that Rich Hickey demonstrated.
>
> As is the case with a neophyte - any advice is well appreciated.
>
> Mike
>
> --
> 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.
>



-- 
Tiago Antao
Scientific and HPC programmer
http://tiago.org
https://github.com/tiagoantao/

-- 
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: [ANN] Git Deps for Clojure!

2018-01-15 Thread Kurt Harriger

>
>
>  
>
>> I’d really like a dependency system that makes each dep’s transitive 
>> dependencies only visible to itself, so there would never be any reason to 
>> resolve dependencies.
>>
>
> You need classloader support for this and indeed this is what OSGi and 
> some early versions of the Java module system do. Working in that kind of 
> environment is very constraining. A lot of discipline is required with 
> respect to your interfaces between loaders and in general I think it's way 
> too much of a burden to use as the normal operating mode (which is one 
> reason you don't see it in the Java module system of java 9). It is a good 
> option for systems where you want users to plug in functionality and the 
> scope of those interface points is small and highly controlled.
>

I have run into incompatible transitive dependencies a lot throughout my 
career.  In many cases its not that big a deal but for cross cutting 
libraries such as data serialization etc it can be hard to get all of your 
dependencies to agree on a common version.  Here is a concrete example I 
ran into just today: https://github.com/thheller/shadow-cljs/issues/177 and 
the library that caused the issue is non-other than core.async!

I second the idea of private dependencies.  I have had the displeasure of 
working with OSGI and I think the reason its complex is not so much because 
the required metadata is hard to figure out... the complexity mostly comes  
from the starting, stopping and restarting bundles within a running jvm in 
non deterministic order.  

Another issue is that the dependency metadata needs to be included within 
each jar and since most library authors don't see the value of OSGI they 
don't provide it to users to rebundle the jar with the required metatata. 
This problem is similar to that of cljsjs, most javascript devs do not see 
any value in any significant value is using closure compile over uglyify 
(myself included as externs are a pain to maintain, minified stacktraces 
are useless, and errors are subtle and hard to debug), but the 
clojurescript community does see value in this so they do their best to 
maintain this metadata even if it means rebuilding projects. 

So what is the alternatives:  
1. Don't upgrade (common solution when there are breaking changes)
2. Try to get upstream maintainer to upgrade (most common when changes are 
not breaking and/or maintainer willing to do the work)
3. Fork the upstream project and maintain your own release using the 
desired version
4. Split your app into multiple pieces so they can run in different JVM 
instances (enter the microservice)

I think the idea that everything can use the same version is oversimplified 
and creating microservice shouldn't be necessary just because you can't get 
all your dependencies to agree.

-- 
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: How to check Clojure spec's for macros?

2018-01-15 Thread Dylon Edwards
That helps a lot, thanks!
On Mon, Jan 15, 2018 at 10:54 AM Alex Miller  wrote:

> stest/check does not work with spec'ed macros. In general, most macros
> emit code (in the form of data) and in my experience it's usually either
> not possible or more effort than it's worth to write :ret or :fn specs for
> macros, so in practice I have not found this to be needed.
>
> stest/instrument also doesn't work with macros, although this is somewhat
> replaced by always checking the args on macros during macroexpansion.
>
>
> On Monday, January 15, 2018 at 2:44:01 AM UTC-6, Dylon Edwards wrote:
>>
>> For spec'd functions, you may check them automatically with
>> clojure.test.check.alpha/check.  Is there something similar for spec'd
>> macros?  I can always use test.check to generate unit testing parameters
>> for macros, but is there a way to get that for free with Clojure spec?
>>
>> Regards,
>> Dylon
>>
> --
> 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 a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/RxnwKcha0cE/unsubscribe.
> To unsubscribe from this group and all its topics, 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: Your choice

2018-01-15 Thread Josh Kamau
And you do all this in Clojure ?   ;)


On Mon, Jan 15, 2018 at 9:11 PM,  wrote:

> 1. We can guarantee the quality of the product.
>
> 2. Fast and safe delivery (INTERNATIONAL)- ( E-mail.. dave joine company
> @ gmail . com  ).
>
> 3. USA ( call/text  (469) 772-0415 or (406) 201 9486 <(406)%20201-9486>-
> WHATSAPP (315) 659 0211 <(315)%20659-0211> ) available for all.
>
> 4. We can provide competitive price for you. The more you buy , the lower
> the price will be.
>
> 5. We are an experienced enterprise of manufacturing various kind of
> Organic intermediates, Our customers come from all parts of the world, had
> a very good cooperation between us.Customer very pleased with our products.
>
> 6.We can provide you stable quality, high purity, good packaging at most
> competitive price. We supply and export high quality and purity research
> # in both large and small quantities…our products is as below:Our
> products are of High purity (above 99%)
>
> --
> 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: How to check Clojure spec's for macros?

2018-01-15 Thread Alex Miller
stest/check does not work with spec'ed macros. In general, most macros emit 
code (in the form of data) and in my experience it's usually either not 
possible or more effort than it's worth to write :ret or :fn specs for 
macros, so in practice I have not found this to be needed.

stest/instrument also doesn't work with macros, although this is somewhat 
replaced by always checking the args on macros during macroexpansion.

On Monday, January 15, 2018 at 2:44:01 AM UTC-6, Dylon Edwards wrote:
>
> For spec'd functions, you may check them automatically with 
> clojure.test.check.alpha/check.  Is there something similar for spec'd 
> macros?  I can always use test.check to generate unit testing parameters 
> for macros, but is there a way to get that for free with Clojure spec?
>
> Regards,
> Dylon
>

-- 
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: How to check Clojure spec's for macros?

2018-01-15 Thread Didier
With macros I believe you get compile time check, ie, static checking. This is 
because the input to a macro is availaible at compile time, so spec just 
validates it on macro-expanssion.

You can use test.check to instrument a generative test to test the expanded 
code too if you want. 

-- 
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.


Best way to include dev-only functions?

2018-01-15 Thread Jonathon McKitrick
I’d like to have a namespace loaded with dev-only versions of some 
functions.

Is there a better way than using environ with ‘require’ and ’ns-resolve’ to 
do this?

-- 
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.


Swirrl are hiring, and yes we use clojure! :-)

2018-01-15 Thread Rick Moynihan
Hi all,

The company are work for are hiring and looking for developers (and yes we
do a lot of Clojure).  See here for the details:

https://medium.swirrl.com/swirrl-is-hiring-ed456c08b78b

R.

-- 
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: How to check Clojure spec's for macros?

2018-01-15 Thread Dylon Edwards
By clojure.test.check.alpha, I meant clojure.spec.test.alpha.  If there's 
not a way to check macros now, is the feature planned?

On Monday, January 15, 2018 at 12:44:01 AM UTC-8, Dylon Edwards wrote:
>
> For spec'd functions, you may check them automatically with 
> clojure.test.check.alpha/check.  Is there something similar for spec'd 
> macros?  I can always use test.check to generate unit testing parameters 
> for macros, but is there a way to get that for free with Clojure spec?
>
> Regards,
> Dylon
>

-- 
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.


How to check Clojure spec's for macros?

2018-01-15 Thread Dylon Edwards
For spec'd functions, you may check them automatically with 
clojure.test.check.alpha/check.  Is there something similar for spec'd 
macros?  I can always use test.check to generate unit testing parameters 
for macros, but is there a way to get that for free with Clojure spec?

Regards,
Dylon

-- 
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.


:npm-deps and transitive dependencies

2018-01-15 Thread Lucas Wiener
Hi,

I have the following clojurescript project dependency setup: X -> Y (X has 
stated Y in :dependencies). Now, I would like Y to depend on a npm 
javascript library Z. Following the guides, I added :npm-deps to one of the 
builds specified in Y. When I build and run Y, everything works fine with 
the new Z dependency. However, building/running project X now fails since 
the dependency Z cannot be found. From what I currently know, there are two 
approaches to get X running again:

1) Specify Z as an :npm-deps also in the project X builds. This is not very 
elegant since the union of all dependencies now cascade to the top level 
projects. Also, this approach would fail when transitive dependencies need 
different versions of the same dependency.
2) Compile Y into a bundle. Then X would depend on the prebuilt bundle of Y 
(which already includes Z). This is not perfect since it requires an extra 
processing step in Y, making lein checkouts a bit more troublesome etc. 
Also, my intuition tells me that this might affect code splitting, 
compilation optimizations, dead code elimination, etc. in a negative way.

Am I missing something?

-- 
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.