Re: Doing Socket IO inside STM transaction

2014-06-17 Thread Gary Trakhman
rue? > > > On Wednesday, June 18, 2014 12:01:42 AM UTC+2, Gary Trakhman wrote: > >> Yea, send uses a fixed threadpool, and send-off uses a growing one, so >> it's more suitable for IO-bound tasks. I don't think there's any >> difference in terms of how

Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-18 Thread Gary Trakhman
Try http://clojuredocs.org/clojure_core/clojure.core/for On Wed, Jun 18, 2014 at 11:56 AM, gvim wrote: > I have a method in Ruby that involves 3-level enumeration and would like > to rewrite it in Clojure. Without asking anyone to do the job :), what is > the best equivalent to this kind of Rub

Re: ClojureScript ^:export defprotocol

2014-06-18 Thread Gary Trakhman
'any problem.. fixed.. by another layer of indirection' You could also just make exportable functions that call the protocols, keeping them more as impl-details, core.cljs does this, and you gain things like varargs (hmm, do protocol-varargs work on cljs? nope: http://dev.clojure.org/jira/browse/C

Re: ClojureScript ^:export defprotocol

2014-06-18 Thread Gary Trakhman
> (more or less directly) using the facilities available in ClojureScript. > > I'll ditch all of this when Apple introduces FunctionalSwift along with > functional APIs, and the Clojure(Swift) compiler targets that new language. > :) > > - Mike > > On Wednesday, June 18

Re: Type of let form

2013-10-04 Thread Gary Trakhman
The definitive authority on what is a special form and what isn't is Compiler.java: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L39 On Fri, Oct 4, 2013 at 2:27 PM, Amrut wrote: > Hello, > > According to this , "let" is a s

Re: Type of let form

2013-10-04 Thread Gary Trakhman
gt; > > > On Fri, Oct 4, 2013 at 2:47 PM, Amrut wrote: > >> Thanks. I went through the checkins and looks like it was changed >> here.<https://github.com/clojure/clojure/commit/3129be6d80d315e3be2f77dadcf7e904fc6015f5> >> This >> was 6 years back. May

Re: boolean java interopt puzzle/bug?!

2013-10-06 Thread Gary Trakhman
Clojure's false and true are Boolean/FALSE and Boolean/TRUE, and for speed reasons (I think) anything that checks for truthiness uses java's ==, which will fail on any new Boolean object. Usually, this isn't a problem, but sometimes it is. You can see that this assumption is pervasive by looking

Re: How to go about 'proving' why dynamically typed languages are better.

2013-10-08 Thread Gary Trakhman
I think there's a case to be made for a theoretical subjectivity. Mathematical purity is nice and elegant, sometimes useful, but 'useful' refers to utility. The ease or the cost of making some valuable change to code in the possibility-space of changes you might make, and the ramifications of tha

Re: Dependency management

2013-10-17 Thread Gary Trakhman
I've used an old version of Archiva, and we currently use Nexus. Nexus was the better experience. On Thu, Oct 17, 2013 at 12:05 PM, Shantanu Kumar wrote: > There are also Archiva[1] and Artifactory[2]. > > [1] http://archiva.apache.org/index.cgi > [2] http://www.jfrog.com/home/v_artifactory_open

Re: road map for clojure?

2013-10-31 Thread Gary Trakhman
Seems to me clojure's went past critical mass in terms of sustainability a long time ago. The ideas are going to be relevant until shared-memory architecture and systems made of those no longer dominate our hardware and thought processes, which is not within the foreseeable future. Maybe 15 years

Re: Why isn't a docstring allowed for defrecord?

2013-10-31 Thread Gary Trakhman
The Java class lifecycle and namespaces/vars are separate sorts of 'resolution contexts', but they're (un)fortunately deeply tied together. On Thu, Oct 31, 2013 at 11:24 AM, Mars0i wrote: > On the other hand, the behavior of Point. might be considered a good thing > (or not): > > user=> (defrec

Re: Resources for learning techniques for isolating pure functions

2013-10-31 Thread Gary Trakhman
Well, though your DB is side-effects, your functions that write to it don't have to be aware of that. That's more a matter of dependency injection, passing components around, and being careful to return a new object from each operation. Once you decouple your components from each other via some k

Re: What are effective ways to debug Clojure code?

2013-11-07 Thread Gary Trakhman
The absolutely most useful thing I reach for time and again is the dbg macro: http://www.learningclojure.com/2010/09/clojure-macro-tutorial-part-i-getting.html (defmacro dbg[x] `(let [x# ~x] (println '~x "=" x#) x#)) My current variation: (defn pprint-str [x] (with-out-str (pp/pprint x))) (d

Re: cider status

2013-11-12 Thread Gary Trakhman
Stable for me, the only outside tool I use that relies on it is ac-nrepl, but switching the hooks over for cider was painless. On Tue, Nov 12, 2013 at 12:35 PM, Norman Richards wrote: > > On Tue, Nov 12, 2013 at 10:22 AM, Phillip Lord < > phillip.l...@newcastle.ac.uk> wrote: >> >> I have tried i

Re: Using xlisp assoc-lists in clojure

2013-11-20 Thread Gary Trakhman
'Relatively bad at lists' ? I think the thing that clojure's intentionally bad at is arbitrary nested mutation, so you're forced to be recursive about things and return values (this is how update-in and assoc-in are implemented), but this has nothing to do with data type. Clojure provides simple

Re: Clojure style

2013-11-25 Thread Gary Trakhman
Yes, I'd consider this bad style, for one, you don't get the arglists metadata showing the names of variables during a repl session. That metadata is on the var, and not the function itself. I'm not familiar with Math/pow's function signature off the top of my head. I would consider it only in t

Re: How would I do this in Clojure?

2013-12-05 Thread Gary Trakhman
This is possible with atoms and refs and such, but I wonder if the use-case can't simply be handled with existing seq functions? This is going against the grain of clojure's FP approach. Since no one's mentioned it yet, if it's possible for the caller of this function to be defined in terms of se

Re: Is Clojure right for me?

2013-12-26 Thread Gary Trakhman
Encapsulation: a) I don't miss it. b) Functions/private-namespaces/maps/deftypes can serve this purpose. Inheritance: Clojure provides ad-hoc hierarchies, which give you the desired tree structure of a type-hierarchy, but it is decoupled from implementation details. You can inherit implementation

Re: Is Clojure right for me?

2013-12-26 Thread Gary Trakhman
"If I were to implement something (complex enough) in C and C++ the differences between my implementations would be far from superficial." Those are both inexpressive in different ways. In my opinion java is closer to lisp than C++, given garbage collection, closures (even faked by objects), refl

Re: Namespaces [was Re: Is Clojure right for me?]

2013-12-27 Thread Gary Trakhman
I can think of a couple more alternatives to consider: ;; Turns out you don't need vars for everything. (let [state {:some :data}] (defn do-stuff [] (func-of state))) ;; Shifts some burden to the client code (defn do-stuff-fn [state] (fn [] (func-of state)) The issue as I see it is a complec

Re: Is Clojure right for me?

2013-12-27 Thread Gary Trakhman
brain-dump TLDR: I like clojure's costs-to-benefits.. and it's successful because it's what the industry needs. I wouldn't say lisp family langs are the 'best' languages, but I would say its tradeoffs maximize the power of the individual, which interests me since I am one :-). Talking about tr

Re: protocols and overloading

2013-12-30 Thread Gary Trakhman
There's been a trend against overuse of inheritance, first with java removing multiple-inheritance and the various private/protected nuanced inheritances, then generally accepted advice like 'prefer composition over inheritance'. Some people were still feeling the pain, and some of those are now u

Re: Migrating from nrepl.el to cider

2013-12-31 Thread Gary Trakhman
I've seen the pprint error on startup often. On Tue, Dec 31, 2013 at 9:47 AM, mwillson wrote: > Folks, > > I've recently migrated to cider on two platforms, Mac OS X (Mavericks) and > Debian Wheezy. With each, I encountered one issue, but different in each > case. If these are worth reporting

Re: some clojure experience

2013-12-31 Thread Gary Trakhman
"hallucinated interfaces" : I like it :-). I think of it as 'data shapes', or implicit contracts. The added value/cost over explicit types is it's open to interpretation and the reader's subjectivity. Let me tell you, when you work with large amounts of uncommented clojure code, the flexibility

Re: Future of performant software: cores or memory?

2014-01-01 Thread Gary Trakhman
It depends on your workload and use-cases, and you could fill many textbooks with a discussion of the tradeoffs, but I can think of some rules of thumb that point in clojure's favor. The most essential metric for me to see has been Amdahl's Law: http://en.wikipedia.org/wiki/File:AmdahlsLaw.svg To

Re: Require namespace

2014-01-02 Thread Gary Trakhman
There's a reasonable blog post here on the matter: http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html It's a bit complicated to regurgitate it all in a mailing list response :-). On Thu, Jan 2, 2014 at 8:33 AM, wrote: > > Hi, > > I am a n

Re: Memory usage of basic Luminus web app

2014-01-02 Thread Gary Trakhman
Luminus isn't doing anything bad here, and 180MB is actually pretty small for a clojure heap. I hit the limits of my laptop's 8GB of memory recently while running a number of repls simultaneously, with heaps over 700MB*4 or so. The simplest win for me was to enable the G1 collector by default (wi

Re: Clojure deployment questions w.r.t. jars, clojure source files, compiled class files

2014-01-07 Thread Gary Trakhman
AOT in my experience is a little dicey and complicated. On Tue, Jan 7, 2014 at 7:26 PM, Dave Tenny wrote: > So if I sample some clojure jars in my local maven .m2 directory, most of > the jar files have only clojure code, and a project.clj. > If I look at the org.clojure project there, it has m

Re: Clojure/Luminus memory footprint

2014-01-08 Thread Gary Trakhman
you're still missing some basics about java memory management. In another thread, I mentioned the java VM will take more memory than it needs, that is because it prioritizes throughput over footprint. There are knobs for all of that. It's not clear what's taking so much memory, but it's certainl

Re: Clojure/Luminus memory footprint

2014-01-08 Thread Gary Trakhman
eamClass$WeakClassKey 11% >byte[]11% >int[] 6% > > main: >char[] 24% >byte[] 17% >java.lang.object 14% >java.util.TreeMap$Entry 10% >java.io.ObjectStreamClass$WeakClassKey 10% >int[] 6% > > > Heap size: 366Mb >

Re: Clojure/Luminus memory footprint

2014-01-09 Thread Gary Trakhman
t; reduced the Used Heap figures to 14Mb and 13Mb but I > now see these climbing to new heights while the app is completely idle. JVM > and main are now both using 75Mb each and climbing. This does not inspire > confidence for an app which is sitting idle. > > gvim > > > >

Re: Clojure/Luminus memory footprint

2014-01-09 Thread Gary Trakhman
ure isn't for me. Tuning GC and memory allocation > doesn't seem to be necessary with Elixir on the Erlang VM which borrows a > lot from Clojure yet retains the syntax style of Ruby. > > gvim > > > On 10/01/2014 01:46, Gary Trakhman wrote: > >> Yes, this is

Re: Clojure/Luminus memory footprint

2014-01-09 Thread Gary Trakhman
al to future readers of this thread to consider all the > pros/cons before locking onto a single one (like perceived memory usage). > > Timothy > > > On Thu, Jan 9, 2014 at 8:24 PM, Gary Trakhman wrote: > >> Elixir's pretty neat. Apologies for the jvm :-). >

Re: Good learning resources for Clojure novice but with a long background i programming, both OO and some Fp?

2014-01-10 Thread Gary Trakhman
I loved the 'Joy of Clojure' as my first clojure book, but it was a little over my head at the time I started reading it, so it took subjectively quite a while to internalize everything. Since I didn't need to 'get stuff done' immediately, I think, in the end, it's great to learn things with such

Re: ClojureScript integration with Emacs/Cider ?

2014-01-11 Thread Gary Trakhman
In response to this thread, I've hacked lein-cljsbuild to dump the compiler state, and built a version of autodoc to parse it and generate api docs. I'm trying to figure out how exactly cider and austin will talk to each other so I can make it happen, and I approach that I'm considering now is to

Re: ClojureScript integration with Emacs/Cider ?

2014-01-13 Thread Gary Trakhman
I've released a cljs port of clojure-complete: Here's the mailing list announcement, also inlined. https://groups.google.com/forum/#!topic/clojurescript/Dt1s4laHFXc cljs-complete, A Clojure library designed to auto-complete clojurescript based on cljs compiler state. - With leiningen: [clj

Re: ClojureScript integration with Emacs/Cider ?

2014-01-13 Thread Gary Trakhman
eback has a var that keeps track of repl session state). Ac-nrepl shouldn't be able to eval code, that means it's being coupled to the JVM state, which won't do for cljs or other sorts of repls-on-repls. On Mon, Jan 13, 2014 at 9:03 AM, Gary Trakhman wrote: > I've releas

Re: ClojureScript integration with Emacs/Cider ?

2014-01-13 Thread Gary Trakhman
asy of setup and good design > decisions. > > -- > Cheers, > Bozhidar > > On Monday, January 13, 2014 at 4:55 PM, Gary Trakhman wrote: > > On talking to Chas, > https://github.com/cemerick/piggieback/issues/22 > > it seems like the right approach is to reify ac-nrepl&

Re: Effects of diving into Clojure

2014-01-14 Thread Gary Trakhman
Maybe don't switch mindset? Write code that looks like idiomatic ruby but has what appears to rubyists as QWAN. I think it's possible and maybe even desirable for bad things to feel more foreign when your understanding increases. On Tue, Jan 14, 2014 at 2:01 PM, gvim wrote: > I recently took t

Re: ClojureScript integration with Emacs/Cider ?

2014-01-18 Thread Gary Trakhman
t it would take to make the display pretty like ac-nrepl, which I had to disable. As soon as this stuff is finalized, I'll package everything up nice and make a first release. On Mon, Jan 13, 2014 at 10:21 AM, Gary Trakhman wrote: > Austin's lein-plugin already manipulates project

Re: Security implications of code is data/data is code

2014-01-21 Thread Gary Trakhman
Not every input is through the reader. For instance, Integer.parse takes a string argument and returns a java object. So there's no security problem there, unless it's a problem with the Integer class itself. Another piece of the puzzle, Clojure needs a way to represent objects and code as data.

Re: ClojureScript integration with Emacs/Cider ?

2014-01-24 Thread Gary Trakhman
n with ClojureScript (my knowledge of it is pretty basic). I > guess this was something to do with piggieback, right? > > -- > Cheers, > Bozhidar > > On Saturday, January 18, 2014 at 8:56 PM, Gary Trakhman wrote: > > Bozhidar, I had to slightly modify cider-interaction.el

Re: Clojure/West 2013 videos?

2013-03-25 Thread Gary Trakhman
I've volunteered on the pycon AV team, in 2009, it's 1000x more work than what you described further up in the thread, a minimum wage worker holding something steady. It requires a lot of coordination, and I think the cost to the conference would be much higher than InfoQ as well. On Monday, M

ANN: no.disassemble, a runtime bytecode disassembler

2013-03-30 Thread Gary Trakhman
I made a little proof of concept last night. You could always look at bytecode that clojure emits in few ways, you can either hack the compiler yourself, or force AOT in your project and use javap. The first approach is a bit intrusive, and the second has a somewhat annoying turnaround time,

Re: ANN: no.disassemble, a runtime bytecode disassembler

2013-03-30 Thread Gary Trakhman
https://github.com/gtrak/no.disassemble/ On Saturday, March 30, 2013 9:06:25 AM UTC-4, Gary Trakhman wrote: > > I made a little proof of concept last night. You could always look at > bytecode that clojure emits in few ways, you can either hack the compiler > yourself, or force

Re: ANN: no.disassemble, a runtime bytecode disassembler

2013-03-31 Thread Gary Trakhman
e anything like that in ritz's code? On Saturday, March 30, 2013 2:31:36 PM UTC-4, Hugo Duncan wrote: > > Gary Trakhman > writes: > > > I made a little proof of concept last night. You could always look at > > bytecode that clojure emits in few ways, you can either hac

Re: Good Clojure style?

2013-04-14 Thread Gary Trakhman
I started writing clojure full-time a year and a half ago. At first, it was a terrifying freedom that I could only write a few lines of code a day, and each line was so packed with meaning it makes your head spin. It took an incredibly long time to understand the terseness of code. Maybe some

Re: Clojure on top of ObjC?

2013-04-23 Thread Gary Trakhman
It's already possible via https://github.com/takeoutweight/clojure-scheme Gambit scheme provides objective-C interop. The author demonstrated this stuff at Clojure/West this year. One difference between your proposed approach is it's both compiled and highly optimized. On Tue, Apr 23, 2013 at

Re: Clojure on top of ObjC?

2013-04-23 Thread Gary Trakhman
d as > an embedded scripting language inside an ObjC app. > > On Tue, Apr 23, 2013 at 2:50 PM, Gary Trakhman > wrote: > > It's already possible via > https://github.com/takeoutweight/clojure-scheme > > > > Gambit scheme provides objective-C interop. The au

Re: How to import classes from a runtime-defined ClassLoader?

2013-04-24 Thread Gary Trakhman
There's a lib for this, we've used it in anger, and it seems to work: https://github.com/flatland/classlojure/blob/master/src/classlojure/core.clj On Wed, Apr 24, 2013 at 12:01 AM, tbatchelli wrote: > This worked for me: > > (with-bindings {clojure.lang.Compiler/LOADER dcl} ...) > > (from: > h

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Gary Trakhman
You could come up with definline yourself by thinking about what inlining is and wrapping things in macros, it seems to me the real problem definline solves is to also be able to use the output as a function, which is more about keeping convenience than performance gains. I think the people who wa

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Gary Trakhman
Good vinyls are considered higher quality by audiophiles, because there are less stages in between the mastering and amplification. There is more potential of better performance. It can be considered a real-world case of inlining. On Thu, Apr 25, 2013 at 3:16 PM, Softaddicts wrote: > May I sug

Re: What Slows Down clojure-hadoop?

2013-04-26 Thread Gary Trakhman
this doesn't quite make sense: "Since Clojure is well-known for its concurrency feature, running in the same JVM should be out of question." All the concurrency features built in to clojure are concerned with things that happen in the same process, unless you consider things like 'making it easier

Re: What Slows Down clojure-hadoop?

2013-04-28 Thread Gary Trakhman
We use clojure on hadoop by using the Cascading framework, it would be hard to see the influence of clojure on performance because the code is complicated. But, that means clojure is used mostly to specify the Flow (a DAG construct) that Cascading provides. That's a way to use clojure that doesn'

Re: What Slows Down clojure-hadoop?

2013-04-28 Thread Gary Trakhman
meant to say, uncontended atom swaps are going to be a bit slower than setting a java field, but unless you're doing a ton of them you probably wouldn't notice. On Sun, Apr 28, 2013 at 10:45 AM, Gary Trakhman wrote: > We use clojure on hadoop by using the Cascading framework, it wo

Re: Now *there*'s a machine made for Clojure.

2013-04-28 Thread Gary Trakhman
I think it makes sense to consider cache-coherency and message passing to be on opposite ends of a spectrum, where with message-passing you're explicitly providing the communication protocol and giving more control, and in cache-coherent architectures you're relying on the CPU to do it for you. I

Re: Now *there*'s a machine made for Clojure.

2013-04-28 Thread Gary Trakhman
Amdahl strikes again! I knew this lunch was too tasty to be free. I just thought of another analogy. When I think of something highly concurrent and scalable on the JVM, I think of web request handlers, which effectively use no memory-sharing for domain-specific work, at all, unless there is som

Re: Now *there*'s a machine made for Clojure.

2013-04-28 Thread Gary Trakhman
ng JVM to see if its GC was any > better in this regard? > > Andy > > > On Sun, Apr 28, 2013 at 8:47 AM, Gary Trakhman wrote: > >> Amdahl strikes again! I knew this lunch was too tasty to be free. >> >> I just thought of another analogy. When I think of something hi

Re: memorize-clj

2013-04-28 Thread Gary Trakhman
Clojure has the http://clojuredocs.org/clojure_core/clojure.core/memoize function built-in, as well as https://github.com/clojure/core.memoize for more complicated stuff. On Sun, Apr 28, 2013 at 11:51 PM, Jorge Urdaneta wrote: > Hi, > > I started a library called memorize-clj https://github.com/

Re: testing for nil may not be enough

2013-04-29 Thread Gary Trakhman
Why not make the root binding nil? If your decorate function is supposed to handle all vars, then they have to deal with the unbound case as that's part of the contract of vars. If it's a generic thing, then maybe make a multimethod or protocol for it. On Mon, Apr 29, 2013 at 12:17 PM, AtKaaZ

Re: testing for nil may not be enough

2013-04-29 Thread Gary Trakhman
nil. How would you make > it check for bound inside the function? do we need some kind of macro? > > > On Mon, Apr 29, 2013 at 7:23 PM, Gary Trakhman wrote: > >> Why not make the root binding nil? If your decorate function is supposed >> to handle all vars, then they

Re: testing for nil may not be enough

2013-04-29 Thread Gary Trakhman
I'm just passing the > whatever-that-is (value?) like (decorate a) do I need to use a macro inside > the decorate function to check if the passed thing is an unbound var? > > > On Mon, Apr 29, 2013 at 7:31 PM, Gary Trakhman wrote: > >> If you're passing the var it

Re: emacs - how to wean me off the family of Java IDEs

2013-05-02 Thread Gary Trakhman
After a year and a half of use, I still don't know anything about C-h, I've gotten by for a year or so on 'M-x describe-bindings' and more ad-hoc methods of finding stuff out. On Thu, May 2, 2013 at 1:29 PM, Devin Walters wrote: > I agree with you, but personally found that the starter-kit wasn

Re: I tripped out

2013-05-05 Thread Gary Trakhman
We write all these s-exps, but in the end it's just convenient ways to control electricity, and we are Magneto. On Sunday, May 5, 2013, JvJ wrote: > Is anyone else tripped out when they realize that when you write args for > a function you're basically just destructuring an arg vector? It tr

Re: Struggling with encapsulation

2013-05-09 Thread Gary Trakhman
If the interface provides everything that's needed, then there will be no need to dive in? I find attempts to hide that stuff frustrating when I'm a consumer of the code, if I need it, and I acknowledge that implementation details are subject-to-change when I take that risk, so only having somethi

Re: defmethod/require race condition

2013-05-09 Thread Gary Trakhman
Do you have dynamic 'require' statements? Why? Should prefer (ns (:require [])) in non-scripts. As an alternative, if you want to ensure a sane state, I would suggest starting your app from an initialization namespace that requires all the namespaces you might want. On Thu, May 9, 2013 at 5:19 P

Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Gary Trakhman
If there is no one-size fits all solution for your use case, it might become idiomatic to use a protocol or some other polymorphism. One could imagine a version of clojure that has protocols for every core function :). Can you ever have too many cakes to eat them, too? On Monday, May 13, 2013, Me

Re: Need some Advice for my Prolog Project

2013-05-15 Thread Gary Trakhman
I'm just wildly speculating about things I know nothing about, but it might be helpful if you narrow down your design-space. Core.logic does some of the same stuff as prolog, I wonder if you could just parse to it, or if you need something more direct. At any rate, looking at that and clojure's c

Re: idiomatic terminating infinite loops

2013-05-15 Thread Gary Trakhman
A couple of approaches: 1. Stop using compojure's 'defroutes'. Generate routes via 'routes' that close over your service. Try not to do anything that would make this expensive. 2. Pass it along on a request map via some middleware. The relevant principle: lifecycle of your component and usage sh

Re: Why the need for an explicit new operator in Clojure?

2013-05-16 Thread Gary Trakhman
speculating, 'new' might be more convenient for code-gen, in the same way that (. obj func) is more convenient than (.func obj) On Thu, May 16, 2013 at 8:57 AM, Andrew McAuliffe wrote: > Hi. > > My understanding of Java (or jvm) is that you can not call a constructor > without using a new opera

proper clojure hammocks/alternatives

2012-03-12 Thread Gary Trakhman
Seriously considering some kind of apparatus to facilitate hammock-driven-development in the office. Has anyone implemented a hammock in their workspace? How about one of those giant bean bag chairs? Surely there are clojure developers that have done research on this already. Considering: ht

Re: proper clojure hammocks/alternatives

2012-03-12 Thread Gary Trakhman
w.huggermugger.com/zafu-meditation-cushion.html >> >> Happy Hammocking, >> '(Devin Walters) >> >> >> On Monday, March 12, 2012 at 7:55 PM, Bobby Calderwood wrote: >> >> > http://www.kammok.com/ >> > >> > I haven't tried these

Re: Question about sets

2012-08-14 Thread Gary Trakhman
+1 On Tuesday, August 7, 2012 3:20:44 AM UTC-4, abp wrote: > > I use literals for collection-construction from arbitrary values too. Just > haven't run into that issue. > > So, please: > > Put hash maps and hash sets back to the way they were -- they worked >>> perfectly fine. Use the duplicate

Re: Clojure source code - negligent?

2012-11-23 Thread Gary Trakhman
There's no difference in performance for non-parameterized constructors because parameterization is implemented with erasure, ie the call is the same. It actually looks better to me to have it unparameterized, though if my tooling was complaining as I wrote it, I might be tempted to change the

Re: How to (easily) show the advantages of Clojure

2013-01-16 Thread Gary Trakhman
Here's a quick example of getting all the streets in Baltimore from a 1GB XML file of Maryland map data. I shudder to think of how to do this in java. Takes about 60 seconds to run on my box. https://gist.github.com/4548456 On Wednesday, January 16, 2013 10:08:41 AM UTC-5, Thomas wrote: > >

Final field optimizations

2011-10-28 Thread Gary Trakhman
It looks like this would be relevant to Clojure, seeing as we use final fields all over the place, anyone have any ideas about it? http://www.azulsystems.com/blog/cliff/2011-10-27-final-fields-part-2 -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-28 Thread Gary Trakhman
Please add me to: clojurescript core.logic the web and 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

Re: clojurescript: generating the JavaScript on the fly?

2011-10-28 Thread Gary Trakhman
This is how the browser repl works, though I don't know if it's something to be used in production. Check out: https://github.com/clojure/clojurescript/tree/master/samples/repl -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-31 Thread Gary Trakhman
I think we're just playing it, no? :-) Isn't it really really hard to solve go? On Mon, Oct 31, 2011 at 5:12 PM, Larry Johnson wrote: > Damn, Damn, Damn.  I'm very new to clojure, and joined this forum just a few > weeks ago.  The fact that there are sessions at Clojure Conj  on two of my > pa

Re: Clojure as scripting language in a Java Application

2011-11-03 Thread Gary Trakhman
You can even consider a live scripting facility (while the game's running) with the repl and some api to access your game's state. All of those functions are available. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: Clojure as scripting language in a Java Application

2011-11-03 Thread Gary Trakhman
ven in projects that don't use clojure. On Thu, Nov 3, 2011 at 7:52 PM, Sean Corfield wrote: > On Thu, Nov 3, 2011 at 4:40 PM, Gary Trakhman wrote: >> You can even consider a live scripting facility (while the game's running) >> with the repl and some api to access your

Re: Clojure as scripting language in a Java Application

2011-11-03 Thread Gary Trakhman
http://clojure.github.com/clojure/clojure.main-api.html#clojure.main/repl On Thu, Nov 3, 2011 at 7:56 PM, Gary Trakhman wrote: > For the parent's post, it might be more useful to directly have a repl > instead of connecting to an outside one.  I don't have any ideas > on-han

Re: Clojure as scripting language in a Java Application

2011-11-03 Thread Gary Trakhman
iple sessions, for one), but I wouldn't say that nREPL >> is necessarily preferable for those reasons.  Use the right tool for the >> job. :-) >> >> - Chas >> >> On Nov 3, 2011, at 8:00 PM, Gary Trakhman wrote: >> >> >> >> >> &

Re: Clojure as scripting language in a Java Application

2011-11-03 Thread Gary Trakhman
game scene graph. > > On Nov 4, 5:56 am, Gary Trakhman wrote: >> For the parent's post, it might be more useful to directly have a repl >> instead of connecting to an outside one.  I don't have any ideas >> on-hand about it, but i'm interested in finding out.

Re: Clojure as scripting language in a Java Application

2011-11-03 Thread Gary Trakhman
Just don't get to the end of developing your game in java before you start playing with clojure. You might slap yourself and decide to rewrite it in clojure :-). -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to c

Re: Simple Made Easy - Any Examples?

2011-11-04 Thread Gary Trakhman
I think it's probably harder to actually show 'best practice' in a lisp than say a language like java. The notion of a design pattern can always be abstracted away with functions or macros. So, the examples I've seen so far are very small scale, eg: use lazy seqs and function composition inst

Re: Clojure Conj extracurricular activities spreadsheet

2011-11-04 Thread Gary Trakhman
I can offer my personal projector if it's needed. -- 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. T

Re: Question:Multi-Core processor affinity for load balancing Clojure Web apps

2011-11-06 Thread Gary Trakhman
it seems like the only difference would be 4 garbage collectors working on smaller heaps, however there would be much more memory overhead that way. I assume if you can load-balance your app like that, that it is stateless, and won't use a whole bunch of static memory. You might do better wit

Re: question about cons function

2011-11-08 Thread Gary Trakhman
One of the best ways to learn clojure is to take a look at the minimal and excellent source code: http://clojuredocs.org/clojure_core/clojure.core/cons (def ^{:arglists '([x seq]) :doc "Returns a new seq where x is the first element and seq is the rest." :added "1.0" :static true

Re: question about cons function

2011-11-08 Thread Gary Trakhman
this may help: http://stackoverflow.com/questions/3008411/clojure-seq-cons-vs-list-conj -- 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 - ple

Re: Clojure Conj extracurricular activities spreadsheet

2011-11-10 Thread Gary Trakhman
confirmed tonight -- 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, s

Re: Use of eval

2011-11-18 Thread Gary Trakhman
My speculation is that the eval is required in the case that commons-logger is not in the classpath. The code wouldn't compile without it. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com

Re: Use of eval

2011-11-18 Thread Gary Trakhman
I get this when i try it in a blank project, removing the eval and the quote: Unknown location: error: java.lang.ClassNotFoundException: org.apache.commons.logging.Log core.clj:16:8: error: java.lang.ClassNotFoundException: org.apache.commons.logging.Log (core.clj:16) Compilation failed.

Re: Use of eval

2011-11-22 Thread Gary Trakhman
ou are probably removing try/catch as well. ClassNonFoundException is > expected and silenced with catch. > > (defn cl-factory >  "Returns a Commons Logging-based implementation of the > LoggerFactory > protocol, or >  nil if not available." >  [] >  (try >

Re: Use of eval

2011-11-22 Thread Gary Trakhman
Also I think this line doesn't actually do anything: (Class/forName "foo.bar") It will effectively just ask the classloader to load the class. You removed more than the eval in your referenced code, you removed the code that did anything. That code needs to be there. It's eval'd because it

Re: Proper parallelism?

2011-11-22 Thread Gary Trakhman
Clojure futures use the send-off thread-pool (unbounded), which is defined like this: from Agent.java: final public static ExecutorService soloExecutor = Executors.newCachedThreadPool(createThreadFactory("clojure-agent-send-off-pool-%d", sendOffThreadPoolCounter)); So, it's using executors.

Baltimore Functional Programming

2011-11-28 Thread Gary Trakhman
Any Baltimore guys around? I'm interested in starting a FP meetup where we can give talks and learn together and such. -- 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

Re: Baltimore Functional Programming

2011-11-28 Thread Gary Trakhman
Sweet, man. I'm looking to see if any of these guys might be interested, http://beehivebaltimore.org/ They have a javascript meetup there and their mailing list shows some interest in clojure, haskell and erlang. So we would need to find at least like 5 people that'd be interested and a plac

Re: [ANN] Avout: Distributed State in Clojure

2011-11-29 Thread Gary Trakhman
The issue with transactions not overlapping with in-memory ones implies some separation to deal with distributed coordination, I think. Are there any guidelines or interesting papers on how to create an effective distributed architecture with these semantics? -- You received this message beca

Re: Baltimore Functional Programming

2011-11-30 Thread Gary Trakhman
Awesome, so it looks like there will be enough people to make this happen. I've been in touch with beehive about using their space. I'm considering whether or not to use meetup.com to organize everything, but I think for now I'll put together a simple wordpress/google-groups thing and follow-u

<    1   2   3   4   5   >