Re: Understanding GraalVM and Clojure

2018-04-22 Thread Jacob Goodson
What about multimethod style programming, would that not see a large 
benefit?

On Thursday, April 19, 2018 at 1:55:25 PM UTC-4, 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 c

1.9 is close to 2.0...

2017-12-28 Thread Jacob Goodson
Now that clojure 1.9 is out, will future releases be 1.91, 1.92, etc?

Or, are talks in place for a clojure 2.0?

If there is discussion of clojure 2.0, what would that look like? 

Clojure running on graal, clojure (the people behind it) doing some other 
fantastically amazing thing?

Just curious...

-- 
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: is this macro right?

2015-12-29 Thread Jacob Goodson
It says that a number cannot be cast to a function.

(3 4)

The number 3 is not a function, thus the reason for the error.

On Monday, December 28, 2015 at 3:47:39 AM UTC-5, Mian Pao wrote:
>
>
> http://stackoverflow.com/questions/34448773/is-function-print-has-bug-in-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: equality checking of clojure data structures

2015-06-27 Thread Jacob Goodson
One more thing, is it cheap to hash immutable maps vs mutable ones?

On Saturday, June 27, 2015 at 10:44:44 AM UTC-4, Jacob Goodson wrote:
>
> Thanks.
>
> What about the perf of something like this...
>
> ({{:x 1 :y 2} :point} {:x 1 :y 2})
>
> vs
>
> ({1 2} 1)
>
> and what if the map was mutable as a key?
>
> On Saturday, June 27, 2015 at 10:08:19 AM UTC-4, Andy Fingerhut wrote:
>>
>> (let [foo {:x 1}]
>>   (= foo foo))
>>
>> is fast, because they are identical, and = is fast for things that are 
>> identical.
>>
>> In general, two maps that are = are often not identical.
>>
>> If two maps have different numbers of elements, = should quickly return 
>> false because of the way equiv() is implemented for maps, here: 
>> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L73-L94
>>
>> There is a check whether the maps are the same size, and if not, return 
>> false without checking all key/value pairs.
>>
>> If they have equal number of key/value pairs, then it will iterate 
>> through all key/value pairs of one, checking whether the key of one is 
>> present in the other, and if so, whether their associated values are 
>> equiv() or not.
>>
>> Those checks can be fast if the keys are quickly comparable, and the 
>> values are quickly comparable.
>>
>> If you take one persistent map m1 and remove a few keys and/or add a few 
>> keys to produce m2, then all of the unchanged keys and values they have in 
>> common will be identical, and very quickly comparable.  The slowest part of 
>> comparing them would be comparing their non-identical parts.
>>
>> Andy
>>
>> On Sat, Jun 27, 2015 at 5:01 AM, Jacob Goodson  
>> wrote:
>>
>>> I was wondering something...
>>>
>>> Would (= {:x 1} {:x 1}) be just as fast as (= 1 1) since maps are 
>>> immutable?  The idea is that since clojure data structures are just values 
>>> can they be compared much faster than there mutable counter parts?  Thanks.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with 
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to clojure+u...@googlegroups.com.
>>> For more options, visit https://groups.google.com/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: equality checking of clojure data structures

2015-06-27 Thread Jacob Goodson
Thanks.

What about the perf of something like this...

({{:x 1 :y 2} :point} {:x 1 :y 2})

vs

({1 2} 1)

and what if the map was mutable as a key?

On Saturday, June 27, 2015 at 10:08:19 AM UTC-4, Andy Fingerhut wrote:
>
> (let [foo {:x 1}]
>   (= foo foo))
>
> is fast, because they are identical, and = is fast for things that are 
> identical.
>
> In general, two maps that are = are often not identical.
>
> If two maps have different numbers of elements, = should quickly return 
> false because of the way equiv() is implemented for maps, here: 
> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L73-L94
>
> There is a check whether the maps are the same size, and if not, return 
> false without checking all key/value pairs.
>
> If they have equal number of key/value pairs, then it will iterate through 
> all key/value pairs of one, checking whether the key of one is present in 
> the other, and if so, whether their associated values are equiv() or not.
>
> Those checks can be fast if the keys are quickly comparable, and the 
> values are quickly comparable.
>
> If you take one persistent map m1 and remove a few keys and/or add a few 
> keys to produce m2, then all of the unchanged keys and values they have in 
> common will be identical, and very quickly comparable.  The slowest part of 
> comparing them would be comparing their non-identical parts.
>
> Andy
>
> On Sat, Jun 27, 2015 at 5:01 AM, Jacob Goodson  > wrote:
>
>> I was wondering something...
>>
>> Would (= {:x 1} {:x 1}) be just as fast as (= 1 1) since maps are 
>> immutable?  The idea is that since clojure data structures are just values 
>> can they be compared much faster than there mutable counter parts?  Thanks.
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/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.


equality checking of clojure data structures

2015-06-27 Thread Jacob Goodson
I was wondering something...

Would (= {:x 1} {:x 1}) be just as fast as (= 1 1) since maps are 
immutable?  The idea is that since clojure data structures are just values 
can they be compared much faster than there mutable counter parts?  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.


Re: How to include ... in project.clj

2015-06-04 Thread Jacob Goodson
Thanks, one last question(hopefully)... I have gotten it to pull down the 
sphinx4-core but for some reason it will not pull down the data.

:dependencies [[org.clojure/clojure "1.6.0"]
   [edu.cmu.sphinx/sphinx4-data "1.0-SNAPSHOT"]
   [edu.cmu.sphinx/sphinx4-core "1.0-SNAPSHOT"]]

:repositories [["snapshots-repo" {:url 
"https://oss.sonatype.org/content/repositories/snapshots"}]])


This is the way it looks on the website:


  edu.cmu.sphinx
  sphinx4-data
  1.0-SNAPSHOT

Finally, here is the url itself:

http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4

Thanks!


On Thursday, June 4, 2015 at 7:31:12 AM UTC-4, skuro wrote:
>
> Have a look at the sample-project.clj 
> <https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L78>,
>  
> as you can read:
>
> ;; Repositories named "snapshots" and "releases" automatically 
> ;; have their :snapshots and :releases disabled as appropriate.
>
> hence, you should do this way:
>
>   :dependencies [...  [edu.cmu.sphinx/sphinx4-core "1.0-SNAPSHOT"]]
>   :repositories [["snapshots" {:url "
> https://oss.sonatype.org/content/repositories/snapshots"}]]
>
>
> c.
>
> Il giorno mercoledì 3 giugno 2015 18:12:44 UTC+2, Jacob Goodson ha scritto:
>>
>> How would I get this to work?
>>
>> 
>> ...
>> 
>> 
>> snapshots-repo
>> https://oss.sonatype.org/content/repositories/snapshots 
>> <https://www.google.com/url?q=https%3A%2F%2Foss.sonatype.org%2Fcontent%2Frepositories%2Fsnapshots&sa=D&sntz=1&usg=AFQjCNH1ZZwCQETyq4eyLn7b7QP-ypp-lA>
>> false
>> true
>> 
>> 
>> ...
>>
>> Then add sphinx4-core to the project dependencies:
>>
>> 
>>   edu.cmu.sphinx
>>   sphinx4-core
>>   1.0-SNAPSHOT
>>
>>

-- 
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 include ... in project.clj

2015-06-03 Thread Jacob Goodson
I tried this but it did not work...

:dependencies [[org.clojure/clojure "1.6.0"]
   [edu.cmu.sphinx/sphinx4-core "1.0-SNAPSHOT"]
   [edu.cmu.sphinx/sphinx4-data "1.0-SNAPSHOT"]]
:repositories {"snapshots-repo" 
"https://oss.sonatype.org/content/repositories/snapshots"})


On Wednesday, June 3, 2015 at 12:12:44 PM UTC-4, Jacob Goodson wrote:
>
> How would I get this to work?
>
> 
> ...
> 
> 
> snapshots-repo
> https://oss.sonatype.org/content/repositories/snapshots
> false
> true
> 
> 
> ...
>
> Then add sphinx4-core to the project dependencies:
>
> 
>   edu.cmu.sphinx
>   sphinx4-core
>   1.0-SNAPSHOT
>
>

-- 
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 include ... in project.clj

2015-06-03 Thread Jacob Goodson
How would I get this to work?


...


snapshots-repo
https://oss.sonatype.org/content/repositories/snapshots
false
true


...

Then add sphinx4-core to the project dependencies:


  edu.cmu.sphinx
  sphinx4-core
  1.0-SNAPSHOT

-- 
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: ClojureScript 0.0-3211

2015-04-26 Thread Jacob Goodson
Hey David, would you mind replying to this topic?  Thanks!

https://groups.google.com/forum/#!topic/clojure/7oROqb6dGSU

Dang typo!

On Saturday, April 25, 2015 at 7:12:31 PM UTC-4, David Nolen wrote:
>
> You need to make sure some other dependency isn't pulling in a different 
> version of tools.reader.
>
> David
>
> On Sat, Apr 25, 2015 at 11:11 PM, Allen Rohner  > wrote:
>
>>
>>
>> On Saturday, April 25, 2015 at 12:02:08 PM UTC-5, Mike Fikes wrote:
>>>
>>> Hey Tony, try updating the version of Clojure in your project.clj to 
>>> 1.7.0-beta1, which is used by 0.0-3211. 
>>>
>>> (In short, reader/read was given a second arity to allow options to be 
>>> passed, thus supporting #? conditional reading.)
>>
>>
>> I'm seeing the same behavior on 1.7.0-beta2. Yes, I've cleaned.  
>>
>> -- 
>> 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: ANN: ClojureScript 0.0-3211

2015-04-26 Thread Jacob Goodson
Hey Davis, would you mind replying to this topic?  Thanks!

https://groups.google.com/forum/#!topic/clojure/7oROqb6dGSU

On Saturday, April 25, 2015 at 7:12:31 PM UTC-4, David Nolen wrote:
>
> You need to make sure some other dependency isn't pulling in a different 
> version of tools.reader.
>
> David
>
> On Sat, Apr 25, 2015 at 11:11 PM, Allen Rohner  > wrote:
>
>>
>>
>> On Saturday, April 25, 2015 at 12:02:08 PM UTC-5, Mike Fikes wrote:
>>>
>>> Hey Tony, try updating the version of Clojure in your project.clj to 
>>> 1.7.0-beta1, which is used by 0.0-3211. 
>>>
>>> (In short, reader/read was given a second arity to allow options to be 
>>> passed, thus supporting #? conditional reading.)
>>
>>
>> I'm seeing the same behavior on 1.7.0-beta2. Yes, I've cleaned.  
>>
>> -- 
>> 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: maya - A DSL for math and numerical stuff

2015-01-09 Thread Jacob Goodson
Well you just went and took it all the way didn't you? =P

On Thursday, January 8, 2015 at 8:49:30 PM UTC-5, Mikera wrote:
>
> Very nice!
>
> People interested in this topic may also be interested in Expresso, which 
> supports analysis / transformation of mathematically expressions in Clojure:
> https://github.com/clojure-numerics/expresso
>
> Extra features I would personally find interesting in this space:
> - Ability to use array-values expressions (e.g. matrix maths) via 
> core.matrix
> - The ability to simplify / optimise expressions (expresso can do this)
> - The ability to "compile" expressions for different targets (GPU, native, 
> core.matrix implementation stc.)
>
>
>
> On Thursday, 8 January 2015 02:29:10 UTC+8, Divyansh Prakash wrote:
>>
>> maya - A DSL for math and numerical stuff.
>>
>> https://gist.github.com/divs1210/b4fcbd48d7697dfd8850#file-maya
>>
>

-- 
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: maya - A DSL for math and numerical stuff

2015-01-08 Thread Jacob Goodson
It's nice but take it a step further and include the order of operations

On Wednesday, January 7, 2015 at 1:29:10 PM UTC-5, Divyansh Prakash wrote:
>
> maya - A DSL for math and numerical stuff.
>
> https://gist.github.com/divs1210/b4fcbd48d7697dfd8850#file-maya
>

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


C# gets a can of open source

2014-11-19 Thread Jacob Goodson
http://opensource.com/business/14/11/microsoft-dot-net-empower-open-source-communities

What does this mean for clojureclr, arcadia, vsClojure, etc?

Does anyone want to speculate a little?

-- 
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: Mutable local variables

2014-11-10 Thread Jacob Goodson
I like the map suggestion but there are still those times when mutation 
makes for a cleaner hack(imo of course).

On Monday, November 10, 2014 5:44:25 AM UTC-5, Thomas Heller wrote:
>
> @Jacob: If you get too many arguments in a loop I found it best to use a 
> map.
>
> (loop [{:keys [a b c] :as state} a-map]
>   (cond
>(and (= a 1) (= b 2))
>(recur (update state :a inc)) ;; 1.7+ only, otherwise use update-in
>...))
>
> Working with named arguments (vs. positional) is a lot more user-friendly 
> since you don't have to repeat everything all the time.
>
> HTH,
> /thomas 
>
> On Monday, November 10, 2014 8:21:57 AM UTC+1, Jacob Goodson wrote:
>>
>> Sometimes, when writing code that loops with a good bit of branching, it 
>> can be quite annoying to stay immutable.
>>
>> (loop [way 1
>>   too   2
>>   many   3
>>   args 4
>>   makes 5
>>   things  6
>>   annoying 7]
>>   (cond (and (= way 3) (= too 4)) (recur (inc way) you get the point. 
>>  
>>
>> Imagine about 14 different conditions under cond and this thing starts 
>> looking like crap.  I got around this with macros and pattern matching, 
>> however, I do not think that this happens too often for many clojurians. 
>>
>> On Saturday, November 8, 2014 11:49:42 PM UTC-5, Fluid Dynamics wrote:
>>>
>>> I wonder if the OP is aware that you can rebind the same name multiple 
>>> times in a let. For instance
>>>
>>> (let [x something
>>>   y otherthing
>>>   x (if (pred? x y) x (some-func x y))
>>>   x (further (complex (calculations x)))
>>>   ...]
>>>   (do-something-with x))
>>>
>>> No actual mutability, but most of the times that suffices for whatever 
>>> you might use a mutable local for in another language.
>>>
>>> Then there's loop/recur. I'd consider let rebinding and loop/recur long 
>>> before resorting to any sort of mutable. The most significant pain point in 
>>> my experience has been wanting to "smuggle" a side calculation out of some 
>>> closure that has to return something else. The most recent case I ran into 
>>> like that involved (swap! some-atom conj thingy) where the atom held a 
>>> vector, I also wanted to know the new length of the vector, I didn't want 
>>> any race conditions (following up with a (count @some-atom) allowed the 
>>> possibility of the vector changing again in between the swap and the deref, 
>>> but I wanted to know the position of the item just conjed on), and 
>>> dosync/ref seemed like overkill (only the one isolated mutable). I *could* 
>>> have done something like
>>>
>>> (let [c (int-array 1)]
>>>   (swap! some-atom (fn [x] (let [x (conj x thingy)] (aset c 0 (count x)) 
>>> x)))
>>>   (let [c (aget c 0)]
>>> ; work with c
>>> ...))
>>>
>>> but it was unnecessary to use this kluge, for swap! returns not the atom 
>>> itself but the new value that was returned by the passed-in function. So 
>>> all I actually needed was
>>>
>>> (let [c (count (swap! some-atom conj thingy))]
>>>   ...)
>>>
>>> with no mutability besides the atom itself (and in particular no local 
>>> mutability). I've since needed swap!'s return value on another occasion, 
>>> when it was a map, resulting in (get-in (swap! m update-in [k1 k2] f arg1 
>>> arg2) [k1 k2]) to both update the map and have the exact value for the 
>>> sub-key that was updated, as of that update. With maps, it may also be 
>>> possible to store some extra information in the map with a 
>>> ::module-local-keyword without this interfering with anything else, which 
>>> can be pulled out of swap!'s return value, and with several kinds of 
>>> objects you can smuggle extra information out of a closure by adding a 
>>> ::module-local-keyword to the object's *metadata* (in particular, this 
>>> won't perturb the equality semantics of the object, as well as working with 
>>> vectors and several other non-map-like things as well as with records and 
>>> maps. And if you're wanting to return extra information out of an ordinary 
>>> function or a loop where you control how the return value is interpreted, 
>>> you can bind and destructure the return value after making that a short 
>>> vector or a map with several thingys in it

Re: Mutable local variables

2014-11-09 Thread Jacob Goodson
Sometimes, when writing code that loops with a good bit of branching, it 
can be quite annoying to stay immutable.

(loop [way 1
  too   2
  many   3
  args 4
  makes 5
  things  6
  annoying 7]
  (cond (and (= way 3) (= too 4)) (recur (inc way) you get the point.  

Imagine about 14 different conditions under cond and this thing starts 
looking like crap.  I got around this with macros and pattern matching, 
however, I do not think that this happens too often for many clojurians. 

On Saturday, November 8, 2014 11:49:42 PM UTC-5, Fluid Dynamics wrote:
>
> I wonder if the OP is aware that you can rebind the same name multiple 
> times in a let. For instance
>
> (let [x something
>   y otherthing
>   x (if (pred? x y) x (some-func x y))
>   x (further (complex (calculations x)))
>   ...]
>   (do-something-with x))
>
> No actual mutability, but most of the times that suffices for whatever you 
> might use a mutable local for in another language.
>
> Then there's loop/recur. I'd consider let rebinding and loop/recur long 
> before resorting to any sort of mutable. The most significant pain point in 
> my experience has been wanting to "smuggle" a side calculation out of some 
> closure that has to return something else. The most recent case I ran into 
> like that involved (swap! some-atom conj thingy) where the atom held a 
> vector, I also wanted to know the new length of the vector, I didn't want 
> any race conditions (following up with a (count @some-atom) allowed the 
> possibility of the vector changing again in between the swap and the deref, 
> but I wanted to know the position of the item just conjed on), and 
> dosync/ref seemed like overkill (only the one isolated mutable). I *could* 
> have done something like
>
> (let [c (int-array 1)]
>   (swap! some-atom (fn [x] (let [x (conj x thingy)] (aset c 0 (count x)) 
> x)))
>   (let [c (aget c 0)]
> ; work with c
> ...))
>
> but it was unnecessary to use this kluge, for swap! returns not the atom 
> itself but the new value that was returned by the passed-in function. So 
> all I actually needed was
>
> (let [c (count (swap! some-atom conj thingy))]
>   ...)
>
> with no mutability besides the atom itself (and in particular no local 
> mutability). I've since needed swap!'s return value on another occasion, 
> when it was a map, resulting in (get-in (swap! m update-in [k1 k2] f arg1 
> arg2) [k1 k2]) to both update the map and have the exact value for the 
> sub-key that was updated, as of that update. With maps, it may also be 
> possible to store some extra information in the map with a 
> ::module-local-keyword without this interfering with anything else, which 
> can be pulled out of swap!'s return value, and with several kinds of 
> objects you can smuggle extra information out of a closure by adding a 
> ::module-local-keyword to the object's *metadata* (in particular, this 
> won't perturb the equality semantics of the object, as well as working with 
> vectors and several other non-map-like things as well as with records and 
> maps. And if you're wanting to return extra information out of an ordinary 
> function or a loop where you control how the return value is interpreted, 
> you can bind and destructure the return value after making that a short 
> vector or a map with several thingys in it.
>
> Lately I hardly ever find myself feeling the need for any kind of local 
> mutables, and only small amounts of global state (often nothing, or just 
> one atom wrapping a map handled with nesting, update-in, assoc-in, and 
> get-in, though refs and dosync will put in an appearance if a high degree 
> of concurrency is required).
>

-- 
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} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-24 Thread Jacob Goodson
I did this same thing and called it defmatch.  You can use vinyasa to 
inject functions into core through leiningen.  I did that and it allowed me 
to have defmatch anywhere I wanted to have it.  Anyway, I guess someone 
else had this idea lol =P.

-- 
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: Interop nightmare

2014-09-08 Thread Jacob Goodson
Hey Sam.  I too had great difficulty with clojure interop until I became 
more familiar with Java.  I find that it is quite difficult to use clojure 
unless one knows Java, which I believe to be a barrier to new comers.  So I 
suggest that you learn some Java and start trying to hack simple interop 
programs to get the hang of it.

On Sunday, September 7, 2014 10:50:31 PM UTC-4, Sam Raker wrote:
>
> I'm trying to use the Stanford Parser from Clojure, but I don't know 
> hardly any Java, and this is my first time working with the interop stuff. 
> All I want to do is play around with the class in the REPL. I added 
> `[edu.stanford.nlp/stanford-parser "3.4.1"]` to my Lein `project.clj`, and 
> the download seemed to go fine. The documentation is 
> http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/parser/lexparser/LexicalizedParser.html
>  
> for those of you playing at home.
>
> Basically, my efforts have been a total failure. I can `(import 
> edu.stanford.nlp.parser.lexparser.LexicalizedParser)`, but after that, it's 
> just a nightmare of `no matching ctor`, `no matching field`, 
> `NoSuchFieldException` and `expected static field` errors. I can't even 
> initialize anything -- `(def parser (new LexicalizedParser))` gives me the 
> aforementioned `no matching ctor` error.
>
> Like I said before, this is entirely my fault: I don't know Java, I don't 
> know interop, and I Google has failed me. So I turn to you, beloved Clojure 
> community, to correct my ignorance. I'm sure it's not hard, I'm just 
> missing something.
>
>
> Thanks,
> -sam
>

-- 
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: Deploying to Clojars no longer works

2014-07-04 Thread Jacob Goodson
I tried updating to the latest version and it still keeps saying that peer 
is not authenticated.  I cannot upload anything its annoying!  

On Thursday, July 3, 2014 10:02:07 AM UTC-4, Zach Oakes wrote:
>
> Even on the latest version (2.4.0), I've experienced problems in the last 
> three weeks. I believe they've coincided with the site redesign, but they 
> may not be related. I sometimes get "Read timed out" when uploading an 
> artifact. Since deployments aren't atomic, the library or template will be 
> partially uploaded and thus unusable, so I have to increment the version 
> number and try again.
>
> On Thursday, July 3, 2014 3:29:17 AM UTC-4, Adam Clements wrote:
>>
>> Have you tried upgrading leiningen to the latest version? I don't think 
>> you can deploy from old versions, at least that's been a problem for me in 
>> the past. 
>> On 2 Jul 2014 20:55, "Jacob Goodson"  wrote:
>>
>>> I have been deploying the same project to clojars for quite a while 
>>> now(5 months?); for some reason it decided it no longer wanted to work. 
>>>  After giving my pass phrase I get "peer not authenticated".  I have not 
>>> changed computers nor do I have a new internet connection.  Does anyone 
>>> know what the heck I've done to blow it up?
>>>
>>> -- 
>>> 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.


Deploying to Clojars no longer works

2014-07-02 Thread Jacob Goodson
I have been deploying the same project to clojars for quite a while now(5 
months?); for some reason it decided it no longer wanted to work.  After 
giving my pass phrase I get "peer not authenticated".  I have not changed 
computers nor do I have a new internet connection.  Does anyone know what 
the heck I've done to blow it up?

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


Unity 3d and Clojure

2014-04-26 Thread Jacob Goodson
Hey guys I have seen this... 
http://f.cl.ly/items/2T2d340o0k0W2d44212G/clj2.gif

Now, I want to know... has anything developed since?  Is it available to 
all?  

-- 
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: Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
Thanks for the code.

On Friday, March 21, 2014 4:41:34 PM UTC-4, Gary Trakhman wrote:
>
> Check out my collision detection here: 
> https://github.com/gtrak/quilltest/blob/master/src/quilltest/balls.clj#L117
>
> I build a map of collided pairs first, then I run through the whole thing 
> to update the relevant stuff.
>
>
> On Fri, Mar 21, 2014 at 4:37 PM, Raoul Duke 
> > wrote:
>
>> > update them one at a time.  Obviously, I do not want to write something 
>> that
>> > updates the enemies and, after the enemies are fully updated, the 
>> bullets
>> > get updated. I need something that updates enemies while updating the
>> > bullets, at the same time.  Maybe a code example would help?
>>
>> er... i suspect you need to explain better... it doesn't make any
>> sense to me what you are saying. you have to break out what you mean
>> by updating, and why they "obviously" cannot be done sequentially.
>> since, i suspect, that's how most all games have done it since the
>> dawn of 8 bit cpus :-) no?
>>
>> i suspect you are saying you don't want enemies to step beyond a
>> bullet or some such issue. but waving some magic concurrency pixie
>> dust is not a solution, at least if you aren't able to explain how it
>> *would* be a solution.
>>
>> generally in simple simulations you accept a certain finite time step
>> that things jump. and you have to deal with that explicitly e.g. in
>> your collision detection or whatever.
>>
>> --
>> 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: Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
Lol...my goodness...

I am just using this as a learning exercise, I do not need to be lectured 
about how to write a game loop...  I said obviously since that was my 
original request, I am only asking to learn clojure a little better.  I 
could just drop into java and write a serial loop that does this really 
fast but I don't care about that; also, telling me how something was done 
on an 8-bit computer is about as relevant as explaining to me the intricate 
biological reactions involved in elephant defecation.

On Friday, March 21, 2014 4:37:22 PM UTC-4, raould wrote:
>
> > update them one at a time.  Obviously, I do not want to write something 
> that 
> > updates the enemies and, after the enemies are fully updated, the 
> bullets 
> > get updated. I need something that updates enemies while updating the 
> > bullets, at the same time.  Maybe a code example would help? 
>
> er... i suspect you need to explain better... it doesn't make any 
> sense to me what you are saying. you have to break out what you mean 
> by updating, and why they "obviously" cannot be done sequentially. 
> since, i suspect, that's how most all games have done it since the 
> dawn of 8 bit cpus :-) no? 
>
> i suspect you are saying you don't want enemies to step beyond a 
> bullet or some such issue. but waving some magic concurrency pixie 
> dust is not a solution, at least if you aren't able to explain how it 
> *would* be a solution. 
>
> generally in simple simulations you accept a certain finite time step 
> that things jump. and you have to deal with that explicitly e.g. in 
> your collision detection or whatever. 
>

-- 
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: Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
Ok, I don't think I am communicating or/either comprehending correctly...

"it needs to be simultaneous just as far as the atom state-change is 
concerned"

How do I do this?  Once the atom is derefenced I would have access to the 
structures but I need to know how to make sure my code does not 
sequentially update them one at a time.  Obviously, I do not want to write 
something that updates the enemies and, after the enemies are fully 
updated, the bullets get updated. I need something that updates enemies 
while updating the bullets, at the same time.  Maybe a code example would 
help?



On Friday, March 21, 2014 4:15:36 PM UTC-4, Gary Trakhman wrote:
>
> It doesn't need to be simultaneous within the actual update function (the 
> function that's passed in to swap!), it needs to be simultaneous just as 
> far as the atom state-change is concerned.  A faster update function means 
> less contention and restarts.
>
>
> On Fri, Mar 21, 2014 at 4:13 PM, Jacob Goodson 
> 
> > wrote:
>
>> If they were nested what would I use to update them simultaneously? 
>> Futures, then roll a loop that would wait till both are realized?
>>
>>
>> On Friday, March 21, 2014 4:00:03 PM UTC-4, Ben Mabey wrote:
>>
>>>  For coordination of this type you could either a) use refs and the STM 
>>> or b) put them in the same nested datastructure and put them both in an 
>>> atom. The latter approach is what I would recommend and what people 
>>> generally tend to do.  If you go down this route you end up with the entire 
>>> state of your game in a single atom.  The tradeoffs is that you loose the 
>>> ability to observe certain changes at a granular layer and you drive the 
>>> contention to a single point (which has been discussed recently on another 
>>> thread).  On the flip side you end up with a single value that represents 
>>> your application's state that is easy to work with.
>>>
>>> On 3/21/14, 1:42 PM, Jacob Goodson wrote:
>>>  
>>> Say I have two data structures..
>>>
>>> enemies
>>> bullets
>>>
>>> I want to update them like so...
>>>
>>> (some-game-loop
>>> (update enemies)
>>> (update bullets))
>>>
>>> If I wanted to make sure that both structures were getting updated at 
>>> the same time instead of 
>>>
>>> enemies and then bullets; would I use refs here or would I use something 
>>> else?   What if there 
>>>
>>> were many more structures that I wanted to update asynchronously like 
>>> this?  Thanks clojurians!
>>>
>>>  -- 
>>> 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 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: Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
If they were nested what would I use to update them simultaneously? 
Futures, then roll a loop that would wait till both are realized?

On Friday, March 21, 2014 4:00:03 PM UTC-4, Ben Mabey wrote:
>
>  For coordination of this type you could either a) use refs and the STM 
> or b) put them in the same nested datastructure and put them both in an 
> atom. The latter approach is what I would recommend and what people 
> generally tend to do.  If you go down this route you end up with the entire 
> state of your game in a single atom.  The tradeoffs is that you loose the 
> ability to observe certain changes at a granular layer and you drive the 
> contention to a single point (which has been discussed recently on another 
> thread).  On the flip side you end up with a single value that represents 
> your application's state that is easy to work with.
>
> On 3/21/14, 1:42 PM, Jacob Goodson wrote:
>  
> Say I have two data structures..
>
> enemies
> bullets
>
> I want to update them like so...
>
> (some-game-loop
> (update enemies)
> (update bullets))
>
> If I wanted to make sure that both structures were getting updated at the 
> same time instead of 
>
> enemies and then bullets; would I use refs here or would I use something 
> else?   What if there 
>
> were many more structures that I wanted to update asynchronously like 
> this?  Thanks clojurians!
>
>  -- 
> 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.


Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
Say I have two data structures..

enemies
bullets

I want to update them like so...

(some-game-loop
(update enemies)
(update bullets))

If I wanted to make sure that both structures were getting updated at the 
same time instead of 

enemies and then bullets; would I use refs here or would I use something 
else?   What if there 

were many more structures that I wanted to update asynchronously like 
this?  Thanks clojurians!

-- 
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: local mutable state

2014-03-21 Thread Jacob Goodson
Also, you can use straight up java as well inside of loops.  I, sometimes, 
will write a static method, dump the clojure data strcuture over to java, 
mutate like a crazy man, then slap it back into clojure.  I find that loop 
recur are not as elegant as imperative styles of looping(an opinion of 
course).  I think of recursion as a low level operation, it is a outlier in 
clojure where most of the time we swim in an abstraction bliss.  Anyway, I 
find using pattern matching in conjunction with recursion makes it far more 
elegant... https://github.com/clojure/core.match

On Friday, March 21, 2014 7:48:24 AM UTC-4, Andy Smith wrote:
>
> Excellent point... thanks for the insight
>
> On Thursday, 20 March 2014 20:34:47 UTC, tbc++ wrote:
>>
>> Not to mention that this isn't local mutation. You are handing the atom 
>> to a closure that then gets wrapped by lazy-seq and returned. So the atom 
>> may actually sit around for some time.
>>  
>

-- 
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: local mutable state

2014-03-20 Thread Jacob Goodson
You can use proteus with a while loop and be as imperative as you like, 
however, I think the point of 4clojure is to learn the functional approach 
to solving problems(I do not really advocate one over the other honestly; 
multiparadigm ftw)

On Thursday, March 20, 2014 4:35:14 PM UTC-4, Andy Smith wrote:
>
> Also from the proteus link, i read 'these variables cannot escape the 
> local scope; if passed into a function or closed over', which is a problem 
> with code such as in my example I suppose.
>
> I wasnt trying to avoid the functional approach but just being devils 
> advocate. Thanks for your comments.
>
> P.S. This forum is great. Although I keep asking dumb newbie questions, 
> everyone still gives helpful replies, Thanks all...
>

-- 
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: local mutable state

2014-03-20 Thread Jacob Goodson
I suggest using proteus https://github.com/ztellman/proteus for performant 
local mutation.

On Thursday, March 20, 2014 3:34:20 PM UTC-4, Andy Smith wrote:
>
>
> Is is very bad form to use local mutable state to solve problems like :
>
> https://www.4clojure.com/problem/114
>
> i.e. 
>
> (fn [n f xs] (let [c (atom 0)] (take-while #(if (f %) (> n (swap! c inc)) 
> true) xs)))
>
> If so, what is the strongest reason to reject this kind of code? Since its 
> a local atom it ought to be thread-safe right?
>
> Thanks
>
> Andy
>

-- 
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: shenandoah

2014-03-12 Thread Jacob Goodson
I use mutation generously inside of functions.  I do not consider that 
impure at all, pragmatic yes, impure no.  Has anyone used Azul's jvm and 
gotten a big bump in performance?

On Wednesday, March 12, 2014 7:28:44 PM UTC-4, raould wrote:
>
> > pure way or the mutate objects in place way?  I can get great 
> performance 
> > with clojure, no doubt about it, by violating the shat out of functional 
> > programming.  I can not get great performance with the beautiful, pure, 
> > composable, clojure that I desire! 
>
> (personally i think this is a great topic, of great interest to me 
> personally, and if one squints at it and forgets about the "game" 
> aspect, is a very relevant thing in general in terms of defending, 
> improving, being able to use "pure" approaches more often. i'm sure a 
> lot of folks who have heard of fp and pure fp equate it with utterly 
> bad performance, true or not.) 
>
> depending on the structure of your system, clojure's transients might 
> help. maybe. quite often in real games, there are explicit memory 
> pools per game tick. sorta like the autorelease pools in objective-c, 
> say. that's perhaps akin to region based memory management. (the BitC 
> folks pondered and pontificated upon regions for a while, but i don't 
> believe there's any "production quality" language that supports them 
> yet.) 
>
> in general, have there been closer-to-pure-than-mutating high 
> performance apps written ever, in any programming language? and if so, 
> how? could they have been done on a mobile device, or do they only 
> work when you have 4GB of main RAM etc.? 
>
> i've seen examples of "pure" asteroids in Haskell and CAL. J. Hague is 
> one of the standard urls to paste into a discussion like this. 
> http://prog21.dadgum.com/23.html. 
>
> Would things like linear/affine/uniqueness types be a better approach? 
> Personally I think/hope in the long run they would be, because they 
> get us the ability to *safely mutate*. So far I think the only 
> language which is remotely near to something one could use for 
> production, along those lines, is ATS which compiles down to C/++. It 
> might well be possible in Shen, that would be pretty exciting I think. 
>
> sincerely. 
>

-- 
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: shenandoah

2014-03-12 Thread Jacob Goodson
Let me state that, as long as it is a asteroids clone, it is fine.  
However, compared to Java, the performance was much worse(when just playing 
with it and drawing tons of asteroids in opengl).  Also, I do not know what 
you mean when you say that you have tested it... the 

pure way or the mutate objects in place way?  I can get great performance 
with clojure, no doubt about it, by violating the shat out of functional 
programming.  I can not get great performance with the beautiful, pure, 
composable, clojure that I desire!  I have seen many game 

examples in "clojure" where, basically, clojure is just a scripting 
language that wraps java.  It is no problem if this is the case, my 
question has jack crap to do about getting good performance writing 
asteroids.  My question is: Will clojure(the immutable composable side) 

benefit from shenandoah(blasted font) at all?  Can someone who knows a good 
bit about clojure tell me if a more powerful garbage collector would allow 
us clojurians to be more pure or is it something else inherently in 
immutable land that will "never"(it will take a long time) get fixed.

On Wednesday, March 12, 2014 6:53:43 PM UTC-4, James Reeves wrote:
>
> I've done a fair bit of experimentation with writing games in Clojure, and 
> I haven't noticed any major performance issues. If you're getting issues on 
> a 2D asteroids clone, I suspect there might be something inefficient in 
> your code. I find Criterium useful for benchmarking parts of my code in 
> isolation to get an idea of how its running.
>
> - James
>
>
> On 12 March 2014 21:53, Jacob Goodson  >wrote:
>
>> How many people have heard of this GC?  
>> http://www.jclarity.com/2014/02/19/shenandoah-a-new-low-pause-garbage-collection-algorithm-for-the-java-hotspot-jvm/
>>
>> I want to know if this would benefit clojure.  I wrote a small asteroids 
>> game in clojure and the performance was not good.  I stuck to purity when 
>> writing the game, only "mutating" my data after it had passed through a 
>> bazillion pure functions.  I was wondering, would a GC like this one(or 
>> Azul's) make a significant impact so that I, or others, could make games in 
>> a more pure fashion?  I WANT MY EFFIN PURITY!
>>  
>> -- 
>> 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.


shenandoah

2014-03-12 Thread Jacob Goodson
How many people have heard of this GC?  
http://www.jclarity.com/2014/02/19/shenandoah-a-new-low-pause-garbage-collection-algorithm-for-the-java-hotspot-jvm/

I want to know if this would benefit clojure.  I wrote a small asteroids 
game in clojure and the performance was not good.  I stuck to purity when 
writing the game, only "mutating" my data after it had passed through a 
bazillion pure functions.  I was wondering, would a GC like this one(or 
Azul's) make a significant impact so that I, or others, could make games in 
a more pure fashion?  I WANT MY EFFIN PURITY!

-- 
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: Do I have to have knowlegde about Lisp

2014-03-10 Thread Jacob Goodson
Let me rephrase your question to show you something...

Should I learn LISP in order to learn LISP...

Clojure is a dialect of LISP as is common lisp; when you learn Clojure you 
are learning LISP.  Clojure "has its opinions" about how to do its list 
processing, however, all other list processing dialects have theirs as 
well.  Clojure will bend you strongly toward functional programming 
paradigms while common lisp would not really suggest any one paradigm.  
Common Lisp is more of a multi-paradigm language than Clojure is.  Many 
people have thought of common lisp as a functional language but that is not 
true.  One can do functional programming in CL but one can be as imperative 
as they like as well.  Clojure "tries" to steer one away from the 
imperative way of doing things but since Clojure is a LISP it can be bent 
to imperative "nirvana" as well.  The fact is, learning any one dialect 
will teach you LISP, so dive in!

On Monday, March 10, 2014 10:41:12 AM UTC-4, Roelof Wobben wrote:
>
> Hello, 
>
> I like the idea of Clojure but I wonder if I have to know a lot of Lisp to 
> work with Clojure.
>
> What is the best way to go from a absolute beginner to someone who can 
> work with Clojure. 
>
> Roelof
>
>

-- 
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: Recompiling a Java class

2014-01-09 Thread Jacob Goodson
Wow, what amazing timing!  This is exactly what I was looking for, thank 
you very much!

On Thursday, January 9, 2014 3:50:11 AM UTC-5, henry w wrote:
>
> Take a look at this: 
> http://z.caudate.me/dynamic-reloading-of-java-code-in-emacsnrepl/
>
> I havent gotten around to looking into it myself yet but it sounds like 
> what you are after.
>
> On Thursday, January 9, 2014 4:43:07 AM UTC, Jacob Goodson wrote:
>>
>> I created a Java object which I called from a clojure repl... it works 
>> great!  As the project progresses I learn that my well thought out and 
>> amazing object sucks #$%^%$#%^... So I change the object a little then I 
>> recompile the object, expecting to see the updated changes in my repl of 
>> automagical powers... oh no, the object appears to be the same piece of 
>> crap that it was earlier!  Give me interaction or give me death!  
>>
>> Is there a way for me to update java objects without having to restart my 
>> repl?  
>>
>

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


Recompiling a Java class

2014-01-08 Thread Jacob Goodson
I created a Java object which I called from a clojure repl... it works 
great!  As the project progresses I learn that my well thought out and 
amazing object sucks #$%^%$#%^... So I change the object a little then I 
recompile the object, expecting to see the updated changes in my repl of 
automagical powers... oh no, the object appears to be the same piece of 
crap that it was earlier!  Give me interaction or give me death!  

Is there a way for me to update java objects without having to restart my 
repl?  

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


Re: Why is clojure so powerful?

2013-09-06 Thread Jacob Goodson
If you want to see a LISP that has been trying to improve LISP itself then 
I suggest looking at... http://shenlanguage.org/ and more specifically Shen 
has been ported to Java!...https://github.com/artella-coding/Shen.java 

Although, it desperately needs contributions(wink,wink).

On Wednesday, September 4, 2013 5:32:01 PM UTC-4, Tomislav Tomšić wrote:
>
> I suspect, there are numerous possible ways to answer that question. One 
> can ignore it, others would care to offer superficial, "no it isn't", but I 
> guess, few would answer, it is because clojure is the member of the Lisp 
> family of programming languages. Which immediately invites predictable 
> question.
>
>
> Why is Lisp so powerful?
>
> I guesstimate, there are three possible responses on that question. One is 
> to ignore it, second one is to take it as encouragement for further 
> inquiry, and the third one is to say something along the following lines: 
> “It is because of the lists, dummy. Lisp is built on lists.”
>
>
> Very well then, why are lists so powerful?
>
>
> Yes, there is answer(s), but as I hope we all know, every answer opens the 
> door for new questions and problems. In other words, we have an, hopefully 
> clear and self-understandable, answer to why is Lisp so powerful, but we 
> are now facing numerous, previously unimaginable choices and opportunities 
> to improve Lisp further, which is the reason why I am putting this message 
> here, in the group dedicated to the new and continually improving member of 
> Lisp programming family.
>
>
> I hope to solve and clarify as many as I can, but it demands time and 
> other resources, which is why I decided to put answer(s) and reasons for 
> them in a book. It is called “Arrogance of Abstraction”, and it is 
> available through Amazon. Amazon allows, even encourages authors, to put an 
> effort to contact audience. In other words, it will be available for free 
> download from Amazon at following days this month: 2013-09-08 and 
> 2013-09-13. I haven't decided yet at what other days will be available for 
> download. If you have an advice, feel free to put it here.
>
>
> Thank you for your patience
>
> Tomislav Tomsic
>

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


Re: Why is clojure so powerful?

2013-09-06 Thread Jacob Goodson
The people is not a sufficient answer(I am sure you knew that but I had to 
say it anyway).  It is really simple...

1. Homoiconic syntax
2. meta programming facility(macros in the case of clojure but other LISP's 
have gone farther with this than clojure has)

These two "powers" are what draws so many to use LISP.  What were we taught 
in computer science 101?  Was it not that abstraction is the end all, be 
all of computer science?  If it is true that abstraction is king, then 
macros are the divine right, the very 

justification that LISP is the MOST powerful language there is.  You know 
someone is a LISP neophyte when they ask the question, "What features does 
LISP have that language x does not have?".  LISP has all features and no 
features, it is in your hands.  The 

language is so malleable that it can absorb any new abstraction in a 
fraction of time any other language can come up with said abstraction. 
 While absorbing the abstraction, LISP does not need changes to its 
compiler.  During its process of scoffing(laughing at 

other languages mucking around in low-level hell), LISP takes on new 
abstraction with NO RUN TIME PENALTY!  People are adamant in saying that 
their language can abstract as well, but does it cost precious cpu cycles? 
 How long does it take to make these 

abstraction?  Do these abstractions look just like all the other code in 
said language? 

So, with LISP you can have any feature you want or are jealous that any 
other language possesses.  

For a good example of LISP power look at the type system of Shen.  One man 
was able to create a type system on par(or even better) with a type system 
that took a team of respectable academics years of work; Haskell.

TLDR; easy abstraction without cost!

On Wednesday, September 4, 2013 7:29:30 PM UTC-4, Devin Walters (devn) 
wrote:
>
> Battle-tested libraries are nice, and Java has a lot of them. Clojure 
> programmers can use all of them with relative ease. I recently tried 
> Erlang/Elixir and was disappointed in the library ecosystem.
>
> Another answer to why Clojure is powerful is the company it keeps. The 
> people who work on Clojure and its ecosystem (libraries, build tools, blog 
> posts, screencasts, podcasts, conferences, etc.) are a wonderful group of 
> people who have never ceased to amaze me. The creativity, engineering, and 
> generosity. In my life I've seldom been a part of such a vibrant and 
> inspiring community.
>
> I struggle to tap this into my phone without more evidence to support it, 
> but it seems to me that Lisps just seem to attract the right kind of 
> people. Take that on faith or not at all, but I struggle to find a better 
> explanation. The technical explanations are all well and good, but "It's 
> the people, stupid." seems like the best answer I can come up with.
>
> On Sep 4, 2013, at 4:32 PM, Tomislav Tomšić > 
> wrote:
>
> I suspect, there are numerous possible ways to answer that question. One 
> can ignore it, others would care to offer superficial, "no it isn't", but I 
> guess, few would answer, it is because clojure is the member of the Lisp 
> family of programming languages. Which immediately invites predictable 
> question.
>
>
> Why is Lisp so powerful?
>
> I guesstimate, there are three possible responses on that question. One is 
> to ignore it, second one is to take it as encouragement for further 
> inquiry, and the third one is to say something along the following lines: 
> “It is because of the lists, dummy. Lisp is built on lists.”
>
>
> Very well then, why are lists so powerful?
>
>
> Yes, there is answer(s), but as I hope we all know, every answer opens the 
> door for new questions and problems. In other words, we have an, hopefully 
> clear and self-understandable, answer to why is Lisp so powerful, but we 
> are now facing numerous, previously unimaginable choices and opportunities 
> to improve Lisp further, which is the reason why I am putting this message 
> here, in the group dedicated to the new and continually improving member of 
> Lisp programming family.
>
>
> I hope to solve and clarify as many as I can, but it demands time and 
> other resources, which is why I decided to put answer(s) and reasons for 
> them in a book. It is called “Arrogance of Abstraction”, and it is 
> available through Amazon. Amazon allows, even encourages authors, to put an 
> effort to contact audience. In other words, it will be available for free 
> download from Amazon at following days this month: 2013-09-08 and 
> 2013-09-13. I haven't decided yet at what other days will be available for 
> download. If you have an advice, feel free to put it here.
>
>
> Thank you for your patience
>
> Tomislav Tomsic
>  
> -- 
> -- 
> 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 unsub

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-10 Thread Jacob Goodson
Here is where I started... 
http://www.lisperati.com/clojure-spels/casting.html

I personally disagree about being so timid with macros, however, I do not 
code Clojure with a team of other people =P.

The one thing you will find about Clojure is that it slaps a limit on the 
types of macros you can do.  This limit does not necessarily stop you from 
creating amazing things with macros but it is there.  So of the macros that 
you will find in these LISP SPEL books will not be easily recreated in the 
hampered(pampered?) Clojure language.  Clojure was meant to be a more 
corporate friendly, pragmatic language; thus, no reader macros.

On Friday, August 9, 2013 6:21:02 PM UTC-4, Jace Bennett wrote:
>
> Thanks everyone. Good stuff.
>
> I have Let over Lambda, but I didn't glean what I wanted from it (or 
> probably even what it wanted from me). I'll pick up On Lisp. I didn't 
> realize it was focused on macros.
>
> Also, I think Luca has given me a clue. I used code gen techniques long 
> before I started using reflection based techniques. Macros are more like 
> code gen, so I'll think back to those techniques, and search for analogues 
> and maybe even epiphanies. I think I had the ideas of dynamism and DRY 
> complected (sorry, had to). The dynamism will obviously require state. The 
> DRY shouldn't. But in C# I've usually gone dynamic to get dry.
>
> Out of curiousity, where do the defs go? Could one iterate over all the 
> vars in the runtime environment? Would I just get pointers to native code?
>
>
> On Fri, Aug 9, 2013 at 1:04 PM, Andrew Stine 
> 
> > wrote:
>
>> The difficulty with On Lisp when applied to Clojure is that the specific 
>> macros On Lisp demonstrates either depend on state, which Clojure avoids, 
>> or are already present in Clojure core. (if-let is a big one in my book.) 
>> Some of them also run into conflicts with Clojure implicit gensyming. I 
>> don't suggest it for the specific macros it demonstrates, but because it 
>> demonstrates very clearly what they are for, why and where you would use 
>> them, and how, in general, they are used. I also don't write macro much 
>> anymore in Clojure but that's mostly because Clojure has a few macros 
>> already which handle most of the things I would do with them in Common Lisp.
>>
>>
>> On Friday, August 9, 2013 11:13:44 AM UTC-4, Lee wrote:
>>>
>>>
>>> On Aug 9, 2013, at 11:01 AM, Andrew Stine wrote: 
>>>
>>> > For a pretty decent cover of when and how to use macros, On Lisp[1] is 
>>> a pretty good book. It's written mainly for Common Lisp but most of it 
>>> translates to Clojure well enough. I find that for common code, writing 
>>> macros isn't so useful as most of the goods ones are already part of 
>>> clojure.core. But if you ever find yourself in the position where you'd 
>>> really like to have a control structure just for your program, or introduce 
>>> a compile-time code generator, or subtly add a new paradigm to the 
>>> language, a macro is your ticket. 
>>> > 
>>> > 1. http://code.google.com/p/**onlisp/ 
>>>
>>> I think that On Lisp is completely awesome -- one of the best technical 
>>> books of any kind that I've ever read. 
>>>
>>> However, my recollection is that the macro stuff, in particular, doesn't 
>>> translate so well to Clojure because the differences between Common Lisp 
>>> and Clojure macros are pretty fundamental. Or at least that has been my 
>>> impression and I mostly stopped writing macros when I switched from 
>>> Common Lisp to Clojure because I found the differences confusing. Your 
>>> experience may be different but I thought that a warning might be in order. 
>>>
>>>  -Lee 
>>>
>>>
>>>
>>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

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

Robo VM

2013-07-22 Thread Jacob Goodson
I wanted to see if people know/knew about this.  According to the website 
it states that the VM converts JVM bytecode to native... could clojure take 
advantage of this(I assume it can but I would like to hear from people with 
a true understanding if I should be excited or not =P)?

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




Combimouse

2013-04-18 Thread Jacob Goodson
Check it out, please support it if you think it has potential...

http://www.indiegogo.com/projects/combimouse-combination-keyboard-and-mouse?c=home

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




Re: new, macros and "Can't eval locals"

2013-02-16 Thread Jacob Goodson
You need to know something... it's a dialect of LISP, the only limitation 
is you.

On Thursday, February 14, 2013 5:08:57 PM UTC-5, AtKaaZ wrote:
>
> Thank you! I didn't know you could do .newInstance
>
> oh that's a nice trick with eval and list 'new
>
> So it's not impossible after all, thanks Aaron!
> Here's what I got from what you said:
> => *(defmacro mew [cls & restt]
>`(eval (list 'new ~cls ~@restt))
>  )*
> #'runtime.q/mew
> => *(let [a java.lang.RuntimeException]
>(mew a)
>  )*
> #
>
> it makes sense now, using eval at runtime not at compile time as I was 
> trying
>
> and also the newInstance variant:
> => *(defmacro mew [cls & restt]
>`(.newInstance ~cls ~@restt)
>  )*
> #'runtime.q/mew
> => *(let [a java.lang.RuntimeException]
>(mew a)
>  )*
> #
>
>
> Really, thank you Aaron, 
>
>
> On Thu, Feb 14, 2013 at 11:02 PM, Aaron Cohen 
> 
> > wrote:
>
>> Yes, since this is runtime you should use reflection.
>>
>> (let [a java.lang.RuntimeException]
>>(.newInstance a))
>>
>> Alternatively, you can use eval:
>>
>> (let [a java.lang.RuntimeException]
>>   (eval (list 'new a)))
>>
>>
>> On Thu, Feb 14, 2013 at 4:53 PM, AtKaaZ > >wrote:
>>
>>> I figure since new is expecting a class at compiletime, we can never 
>>> pass it a class that we evaluate at runtime(those locals), ergo => 
>>> impossible to macro around "new" like that
>>>
>>> like this => impossible:
>>> *(let [a java.lang.RuntimeException]
>>>  (macro-that-eventually-calls-new a))*
>>>
>>> maybe someone could suggest another way? clojure.reflect ?
>>>
>>>
>>>
>>> On Thu, Feb 14, 2013 at 10:40 PM, AtKaaZ 
>>> > wrote:
>>>
 thanks for the reply,

 => *(defmacro mew [cls & args]
  `(new ~cls ~@args))*
 #'runtime.q/mew
 =>* (let [a java.lang.RuntimeException]
  (mew a)
  )*

 CompilerException java.lang.IllegalArgumentException: Unable to resolve 
 classname: a, compiling:(NO_SOURCE_PATH:2:3) 

 that would be the equivalent macro of what *new* is doing
 it's like
 *(new a)*
 CompilerException java.lang.IllegalArgumentException: Unable to resolve 
 classname: a, compiling:(NO_SOURCE_PATH:2:3) 


 This is the goal:

 The goal is to can write this form:
 =>  *(let [a java.lang.RuntimeException]
  (new a))*

 but I think it's impossible, at least by using "new" it is


 On Thu, Feb 14, 2013 at 10:34 PM, Andy Fingerhut 
 
 > wrote:

>
> On Feb 14, 2013, at 1:27 PM, AtKaaZ wrote:
>
> The goal is to can write this form:
> => *(let [a java.lang.RuntimeException]
>  (new a)
>  )*
> CompilerException java.lang.IllegalArgumentException: Unable to 
> resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) 
>
> attempt with macro:
> =>* (defmacro mew [cls & restt]
>  `(new ~(eval cls) ~@restt)
>  )*
> #'runtime.q/mew
>
>
> This is probably your closest attempt.  Try this variation on the 
> above:
>
> (defmacro mew [cls & args]
>   `(new ~cls ~@args))
>
> user=> (macroexpand-1 '(mew java.lang.RuntimeException))
> (new java.lang.RuntimeException)
>
> Andy
>
>  -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient 
> with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com 
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google 
> Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to clojure+u...@googlegroups.com .
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
>



 -- 
 Please correct me if I'm wrong or incomplete,
 even if you think I'll subconsciously hate it.

  
>>>
>>>
>>> -- 
>>> Please correct me if I'm wrong or incomplete,
>>> even if you think I'll subconsciously hate it.
>>>
>>>  -- 
>>> -- 
>>> 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, s

Re: Google Summer of Code 2013

2013-02-14 Thread Jacob Goodson
I would love to improve upon core.match

On Thursday, February 14, 2013 1:10:29 PM UTC-5, David Nolen wrote:
>
> WOOT!
>
> I'm of course more than happy to mentor any projects around ClojureScript, 
> core.logic, and core.match.
>
> David
>
>
> On Thu, Feb 14, 2013 at 1:03 PM, Daniel Solano Gómez 
> 
> > wrote:
>
>> Hello, all,
>>
>> It's official:  Google Summer of Code 2013 is on.
>>
>> Last year, Clojure was able to get four students who worked on projects 
>> like Typed Clojure, Clojure on Android, Clojure and Lua, and Overtone, and 
>> I'd love to see Clojure be a mentoring organisation again this year.
>>
>> I have created a GSoC 2013 page on the Clojure community wiki <
>> http://dev.clojure.org/display/community/Google+Summer+of+Code+2013>. 
>>  Here you will be able to find the latest information about what's going on 
>> with Clojure's GSoC 2013 effort and how to get involved.
>>
>> Here's some ways you can help:
>>
>> * Let people in your local user groups or university know about Clojure 
>> and GSoC.
>> * If you're going to Clojure/West, attend the GSoC unsession.
>>
>> For students
>>
>> * Start researching project ideas and get involved with the relevant 
>> communities to find mentors.
>>
>> For developers:
>>
>> Does your open source project have a backlog of features to implement? 
>>  GSoC is a great way to draw new contributors to your project.
>>
>> * Post it to the project idea page and become a mentor.
>> * Let people know about GSoC on your project mailing list.
>>
>> I'd like to thank everyone in advance for helping with our GSoC 2013 
>> project.
>>
>> Sincerely,
>>
>> Daniel
>>
>> -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

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




Re: Please help this newbie out!

2013-01-08 Thread Jacob Goodson
Whoops! I changed the code to be more readable, those were my previous 
values...argh!  

I read the documentation over and over and never noticed that...sigh. 
 Thank you for the response.

On Tuesday, January 8, 2013 9:57:13 PM UTC-5, juan.facorro wrote:
>
> I think the code you posted might not be the working code since a, b and c 
> don't seem to exist in it. :P
>
> Check out the docs for the createImage(int, 
> int)<http://docs.oracle.com/javase/7/docs/api/java/awt/Component.html#createImage(int,+int)>method:
>
> *Returns:**an off-screen drawable image, which can be used for double 
> buffering. The return value may be null if the component is not 
> displayable. This will always happen ifGraphicsEnvironment.isHeadless()
>  returns true.*
>
> It seems you have to make the JFrame visible in order to get an image when 
> using that method. 
>
> The following should work:
>
> *(let [frame (doto (JFrame.)*
> *  (.setSize 100 100)*
> *  (.setVisible true))*
> *  height (.getHeight frame)*
> *  width (.getWidth frame)*
> *  image (.createImage frame height width)] *
> *      image)*
>
> Cheers,
>
> Juan
>
> On Tuesday, January 8, 2013 11:38:35 PM UTC-3, Jacob Goodson wrote:
>>
>> (let [frame (doto (JFrame.)
>> (.setSize 100 100))
>>   height (.getHeight a)
>>   width (.getWidth a)
>>   image (.createImage a b c)] 
>>   image)
>>
>> Why does this return nil?
>>
>> 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

Please help this newbie out!

2013-01-08 Thread Jacob Goodson
(let [frame (doto (JFrame.)
(.setSize 100 100))
  height (.getHeight a)
  width (.getWidth a)
  image (.createImage a b c)] 
  image)

Why does this return nil?

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

Dart

2012-08-23 Thread Jacob Goodson
Anyone thinking of targeting dart with 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