Re: [ANN] Leiningen template aws-lambda-serverless

2018-06-02 Thread Jason Kapp
Cool. I haven't looked at Lambda for a while. I recall that there was a 
slow startup time issue using a JVM based Lambda so someone was using 
ClojureScript because Node.js had faster startup time. Is startup time an 
issue with this?

On Friday, June 1, 2018 at 9:58:47 AM UTC-6, Juha Syrjälä wrote:
>
> Announcing a Leiningen template for creating Clojure based AWS Lambda 
> projects using Serverless -framework.
> The template sets up a project where you can just add the Clojure code.
>
> Usage:
>
> lein new aws-lambda-serverless my-project
> ... coding ...
> lein uberjar
> serverless deploy --stage dev
>
> References:
> - https://github.com/jsyrjala/aws-lambda-serverless
> - https://serverless.com/
> - https://aws.amazon.com/lambda/
>
> -- 
> Juha Syrjälä
>
>

-- 
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] fun-map: put your code into this map, it turns value when you access it

2018-05-10 Thread Jason Kapp
Cool.

On Thursday, May 10, 2018 at 4:46:31 PM UTC-6, Robert Luo wrote:
>
> Yes. Fun-map can be used like a `graph` in plumbing. It actually has a 
> macro named `fnk` just like plumbing. Both of fun-map and plumbing can link 
> functions toghether by the name of arguments, hence can be used as a 
> dependency injection tool. 
>
> However, the implementation of fun-map is very different from plumbing. 
>
>  - The graph in plumbing is a data structure defined by a map, but need be 
> compiled to a function. While a fun-map is just a plain map, so no 
> compilation there. 
>  - Plumbing allow you compile your computation eagerly or lazily, in fact, 
> it even use another lazy-map library. Fun-map is just map and you can put 
> delay or future in you value for each map entry, so there is not any limit 
> to choose. 
>  - the compiling process can detect cyclical dependency between functions, 
> while in a fun-map there is not such a mechanism yet. 
>  - you can not put a separated value or function in a graph, the 
> compilation process will remove them. In a fun-map you can keep any thing. 
>
> Because fun-map do no pre-computation, it just use clojure function call 
> and map lookup itself, the implementation is very simple. 
>
>

-- 
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] fun-map: put your code into this map, it turns value when you access it

2018-05-10 Thread Jason Kapp
This looks a lot like Prismatic's Plumbing 
library: https://github.com/plumatic/plumbing

On Tuesday, May 8, 2018 at 8:36:23 PM UTC-6, Robert Luo wrote:
>
> *Github Link: https://github.com/robertluo/fun-map 
> *
>
> It is a lazy map:
>
> (def m (fun-map {:a 4 :b (delay (println "accessing :b") 10)}))
>
>
> and can also be a future map:
>
> (def m (fun-map {:a (future (do (Thread/sleep 1000) 10))
>  :b (future (do (Thread/sleep 1000) 20))}))
>
>
> or mixed:
>
> (def m (fun-map {:a (future (do (Thread/sleep 1000) 10))
>  :b (delay 20)}))
>
>
> or cascading function calls:
>
> (def m (fun-map {:xs (range 10)
>  :count-keys ^:wrap (fn [m] (count (keys m)))
>  :sum (fnk [xs] (apply + xs))
>  :cnt (fnk [xs] (count xs))
>  :avg (fnk [sum cnt] (/ sum cnt))}))
>
>
> or even a light weight system can be halted in order:
>
> (def system
>   (life-cycle-map
> {:component/a
>  (fnk []
>   (reify java.io.Closeable
> (close [_]
>   (println "halt :a"
>  :component/b
>  (fnk [:component/a]
>(reify java.io.Closeable
>  (close [_]
>(println "halt :b"}))
>
> (touch system) ;;start the system
>
> (halt! system)
>
>

-- 
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: Understanding GraalVM and Clojure

2018-04-19 Thread Jason Kapp
Thank you for this detailed explanation.

On Thursday, April 19, 2018 at 11:55:25 AM UTC-6, tbc++ wrote:
>
> GraalVM does a lot of things, and I think it's important to separate these 
> terms. 
>
> GraalVM - most often this is used to refer to a project that was 
> originally designed to be a implementation of the JVM in Java. So when 
> people ask "does X run on GrallVM" the question is really "does X run in 
> the JVM". Clojure runs on the JVM therefore it runs on GraalVM. I've done 
> this, and it's not that hard to setup. 
>
> Truffle - is an AST interpreter framework that allows for highly dynamic 
> languages to run efficiently on GraalVM. Truffle is valid Java code, so you 
> can run Truffle on a stock JVM, but it's much faster on GraalVM (or on JVM 
> of version >= 9). Notice my use of "highly dynamic" earlier. Surprisingly, 
> Clojure is mostly static, so there's no clear win here to translating 
> Clojure to Truffle. The exception to this is primitive math, and situations 
> that use lots of HOF where Truffle could perhaps offer more localized 
> optimizations that fit into the Clojure programming model. However, you pay 
> for all this with some rather massive startup time penalties. Most examples 
> I've seen show Truffle adding seconds on to the startup time of a language.
>
> SubstrateVM - (aka native-image), SubstrateVM attempts to improve the 
> performance of a Truffle based language by doing image freezing. This 
> method has been used in other languages, and has existed in the PyPy 
> toolchain (RPython) for well over a decade. The idea is that you write an 
> interpreter, then hand SVM a pointer to the start of your interpreter (the 
> main() function). The framework then analyzes the data needed by that 
> function and all the functions it calls. All data required by those 
> functions are also recorded. Then the call graph required to run all these 
> functions is written out (normally to C or C++) and compiled. The 
> side-effect is that all the startup time is removed since the interpreter 
> is "frozen" in a started state. In the terms of Clojure this means that 
> metadata would be serialized as-is, instead of running the code to create 
> that metadata on every startup. 
>
> Polyglot VM - so in truffle you can have multiple type systems, and 
> multiple languages all running on Truffle. The framework then allows cheap 
> interop between these languages. So when GraalVM docs talk about "zero 
> overhead interop" what they mean is that it's possible to inline a Truffle 
> based function inside any other truffle based function. Since Truffle 
> implementations exist for Ruby, Python, LLVM bytecode (think C/C++), 
> JavaScript, etc. It's easy to see how its possible to have all of these 
> languages efficiently calling each other on the same VM. 
>
> It's not all awesome though. By using SubstrateVM you give up Java 
> reflection/interop, or have to find a way to embed a full JVM as a Truffle 
> language (this is being worked on), but every language you add into your 
> SVM image comes at a cost of startup times, memory usage etc. So most of 
> the time SVM images stick to a few languages. TruffleRuby for example only 
> uses Ruby and LLVM (for c interop).
>
> To finish, I think Clojure on Truffle is possible, but it would take a TON 
> of work. Basically most of clojure.lang.RT would need to be rewritten from 
> scratch, and I'm not sure how much more in clojure.lang.* would also need 
> to be rewritten. So the tradeoff is:
>
> A. Current state
> - Good enough performance
> - Fast enough startup (Clojure starts quickly, it's the deps/tooling that 
> are slow)
> - Requires type hinting to avoid reflection
>
> B. Clojure on Truffle
> - More-or-less the same performance 
> - Faster un-type-hinted math
> - (Possibly) Faster transducers/HOF over primitive collections
> - No need for type hints
> - Massive rewrite
> - Huge startup time penalty
> - Requires a modern/uncommon JVM (JVM9+ or GraalVM)
>
> Comparing these side-by-side, it looks to me to be a wash. And because of 
> that I doubt we'll see a TruffleClojure any time soon.
>
> Timothy
>
> On Thu, Apr 19, 2018 at 4:00 AM, Khalid Jebbari  > wrote:
>
>> Hello,
>>
>> Oracle has just announced GraalVM 1.0 release candidate: 
>> https://blogs.oracle.com/developers/announcing-graalvm
>>
>> It mentions a few JVM-based language but not Clojure (maybe just because 
>> of popularity).
>> - Does it mean Clojure is not "compatible" with GraalVM ? 
>> - Does it mean Clojure needs to be reimplemented in terms of GraalVM's 
>> Truffle framework ?
>> - Does it mean Clojure can be run as a native binary with fast startup 
>> time and minimized memory footprint ?
>>
>> If someone with some knowledge could explain to me the relationships 
>> between Clojure and GraalVM ? Bonus points if Alex Miller answers and share 
>> the plans, if any, about their integration/interaction.
>>
>> Thanks a lot in advance. really curious to 

Re: clojure webapp with webpack frontend

2015-11-04 Thread Jason Kapp
There might be something out there but you could write a Leiningen plugin 
that calls out to the shell to run 
webpack. https://github.com/technomancy/leiningen/blob/master/doc/PLUGINS.md

On Saturday, October 31, 2015 at 1:51:49 PM UTC-6, fasfsfgs wrote:
>
> Hi everyone!
>
> I'm new to the clojure and the webpack world so forgive me if I say 
> something stupid.
>
> I'd like to build a webapp using clojure as backend and angular (or any 
> other js framework) as frontend.
> For the frontend part, I'd like to use webpack so I can do a better job 
> providing frontend code ready for production.
>
> My question is if it's possible to use lein and webpack together to create 
> a jar that contains all my production code without having to do things 
> manually like using webpack and then uberjar.
>
> Any help or feedback is appreciated.
> Thanks!
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Clojure in Salt Lake City

2013-09-22 Thread Jason Kapp
Is there anyone out there that is using Clojure(Script) in Salt Lake City 
that would like to meetup?

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


Leiningen repl dependency conflicts clj-http

2013-02-21 Thread Jason Kapp
Ran into some issues with the dependencies that Leiningen's repl adds to 
the my project.  The issues I ran into are very similar to the issues 
discussed in https://github.com/technomancy/leiningen/issues/815 .  Does 
anyone have any work arounds or possibly any info not already in the Github 
issue?

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