Re: Question regarding core.async

2013-11-19 Thread Timothy Baldridge
, then this will happen every time. Instead of using a single channel, have the handler accept a in channel and an out channel. Then put hello into the input and alts!! will take from the output. Also, (put! c hello) is exactly like (go (! c hello)) but it is much faster. Timothy Baldridge On Tue, Nov

Re: Spit seems to use incorrect line terminator on Windoze

2013-11-24 Thread Timothy Baldridge
Anyone can create an account on JIRA and create a ticket. Timothy On Sun, Nov 24, 2013 at 2:19 PM, Cedric Greevey cgree...@gmail.com wrote: On Sun, Nov 24, 2013 at 3:36 PM, Tim Visher tim.vis...@gmail.com wrote: Sounds like a bug to me. You could open a ticket to get further discussion

Re: Spit seems to use incorrect line terminator on Windoze

2013-11-24 Thread Timothy Baldridge
, write a bug report, and do us all a favor. Timothy On Sun, Nov 24, 2013 at 3:10 PM, Cedric Greevey cgree...@gmail.com wrote: Not everyone wants to go to that much trouble just to tell everyone what he already told everyone via this list. On Sun, Nov 24, 2013 at 4:56 PM, Timothy Baldridge

Re: core.async and performance

2013-11-29 Thread Timothy Baldridge
This is all good advice. Also notice that these examples don't really match real life use cases of core.async. Here you only have two threads, where the execution time is dominated by message passing. In most situations you'll have dozens (or hundreds) of gos, with actual work being done in each

Re: core.async and performance

2013-11-30 Thread Timothy Baldridge
There's several ways the performance of this code can be improved. Firstly, these are exactly the same (samantically), but the latter is much faster: (go (! c v)) and (put! c v). Use put! whenever possible. Secondly, the function event uses !! (blocking take), but it's used inside a go later on.

Re: (core.async/go nil) behavior?

2013-12-14 Thread Timothy Baldridge
How do you know where the nil is coming from? Channels never accept nil, so any nil you get from a take is due to the channel bing closed. And yes, returning nil from a go causes the go's channel to close without a put. Timothy On Sat, Dec 14, 2013 at 4:35 PM, Brandon Bloom

Re: Comparing core.async and Reactive Extensions

2013-12-17 Thread Timothy Baldridge
I won't go so far as to tell you which is better as that often comes down to a matter of taste. However, I will explain the technical differences. In this case I'll use my (somewhat limited) knowledge of C# Rx. Scala/Java's Rx may be different. Rx is based on a direct call. We could write a

Re: Comparing core.async and Reactive Extensions

2013-12-19 Thread Timothy Baldridge
You learn something new every day. As this always been the way that Rx worked (the locking part)? I haven't used Rx for several years, so I may be off in my assumptions. Timothy On Thu, Dec 19, 2013 at 9:41 AM, Matthew Podwysocki matthew.podwyso...@gmail.com wrote: You can easily do

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

2013-12-27 Thread Timothy Baldridge
+1 for Stuart's component lib. I've been using it a lot in my day job and it works quite well. It also serves as a reminder not to throw global config values into vars. Building code that works well with the library makes it less natural to put random state values in globals. Timothy On Fri,

Re: protocols and overloading

2013-12-29 Thread Timothy Baldridge
Not mentioned in Cedric's post are two other important things: Protocols can be extended to existing types. For example: (defprotocol IType (type-as-string [x])) (extend-protocol IType String (type-as-string [x] string) Integer (type-as-string [x] integer)) = (type-as-string 42)

Re: protocols and overloading

2013-12-30 Thread Timothy Baldridge
kiuhn...@gmail.com wrote: On Sunday, December 29, 2013 11:30:16 PM UTC+1, Cedric Greevey wrote: On Sun, Dec 29, 2013 at 4:11 PM, Timothy Baldridge tbald...@gmail.comwrote: Not mentioned in Cedric's post are two other important things: Protocols can be extended to existing types

Re: protocols and overloading

2013-12-30 Thread Timothy Baldridge
If the Expression Problem consists in extending classes then non-OOP languages must be excluded because they don't have classes. No offense intended, but that is an incredibly wrong statement. Let's look up the official definition of the expression problem (via wikipedia): The goal is to define

Re: protocols and overloading

2013-12-30 Thread Timothy Baldridge
, 2013 11:30:16 PM UTC+1, Cedric Greevey wrote: On Sun, Dec 29, 2013 at 4:11 PM, Timothy Baldridge tbald...@gmail.comwrote: Not mentioned in Cedric's post are two other important things: Protocols can be extended to existing types. These are important for the Expression Problem

Re: Parallel http requests

2013-12-31 Thread Timothy Baldridge
http-kit is great, and here's an example of using it with core.async to manage the callbacks: https://github.com/halgari/clojure-conj-2013-core.async-examples/blob/master/src/clojure_conj_talk/core.clj#L361 Timothy On Tue, Dec 31, 2013 at 7:10 AM, Mikera mike.r.anderson...@gmail.comwrote: I'd

Re: core.async - extracting code from a go block

2013-12-31 Thread Timothy Baldridge
A few other things that might help: 1) you can use (put! c val) from inside any function. Sometimes if you want to fire and forget a send, that might be the best option 2) you can wrap the code inside the sub fns inside another go. This isn't as slow as you might think 3) think about using

Re: clojure.zip needs a better way to move nodes

2014-01-02 Thread Timothy Baldridge
clojure.zip needs to be rewritten IMO. It's written in more of a scheme style using vectors. Since then protocols have come out and there's no reason why this can't make use of those. And yes, at the same time new functions could probably be added. I've threatened to re-write this lib several

Re: Core.async, Rules for passing clojure vals to go block

2014-01-03 Thread Timothy Baldridge
Using a def inside a defn really shouldn't be done. Perhaps move the params to a let outside of the s/defn? Or change the def to a let? Timothy Baldridge On Fri, Jan 3, 2014 at 4:18 PM, Timothy Washington twash...@gmail.comwrote: Hey Jason, You were exactly right (which is pretty impressive

Re: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread Timothy Baldridge
Sure, anyone can go and write an emitter using these tools, but this doesn't solve the issues of a good type system, GC, JIT, etc. These tools make it easier to make any Clojure implementation self hosting, but those impls still need a good foundation to build on, and that's the hard part.

Re: clojure.core.async java.lang.IllegalArgumentException

2014-01-07 Thread Timothy Baldridge
Like normal clojure code, gos don't support a recur that jumps out through a try. However, the go macro should be patched to bring that to the attention of the user. Timothy On Tue, Jan 7, 2014 at 2:22 PM, Luc Prefontaine lprefonta...@softaddicts.ca wrote: Just got your email, I remember

Re: Contributors needed for Rouge (Clojure on Ruby)

2014-01-08 Thread Timothy Baldridge
That's actually a major issue for those wanting to use Clojure to work on a RPi or similar low end system. These systems are also so memory constrained, that last I checked, the CLJS compiler wouldn't run too well on them either. Now that doesn't stop people from using Node.js to run CLJS code

Re: Contributors needed for Rouge (Clojure on Ruby)

2014-01-08 Thread Timothy Baldridge
everything, hands down with respect to startup times... Jim On 08/01/14 15:46, Timothy Baldridge wrote: That's actually a major issue for those wanting to use Clojure to work on a RPi or similar low end system. These systems are also so memory constrained, that last I checked, the CLJS compiler

Re: Clojure/Luminus memory footprint

2014-01-09 Thread Timothy Baldridge
Just be aware, that Erlang VM doesn't even come close to the performance of the JVM. For example, Erjang (Erlang on the JVM) runs up to 6000% faster than stock Erlang: http://codemesh.io/slides/kresten-krab-thorup.pdf So it's a trade-off like most things. The JVM takes a bit more memory from the

Re: Am I using core.async/go in an un-clojurish ?

2014-01-13 Thread Timothy Baldridge
they seem to be at first. (and take that number with a big grain of salt). Just some points to ponder. Timothy Baldridge On Mon, Jan 13, 2014 at 6:05 PM, t x txrev...@gmail.com wrote: Hi Stephen, I now understand what you meant. Thanks writing a minimal test case. On Mon, Jan 13, 2014 at 3:34

Re: ! on channels that are not yet closed

2014-01-14 Thread Timothy Baldridge
It's a known problem (putting into a closed channel), and one we have a possible solution for (it's in one of the branches of core.async). I'll bring it up this Friday and see if we can't make some progress on the code. Timothy On Tue, Jan 14, 2014 at 10:43 AM, Ghadi Shayban gshay...@gmail.com

Re: put! on a full channel

2014-01-15 Thread Timothy Baldridge
, we just haven't seen a good use case for that yet. Hope this helps, Timothy Baldridge On Wed, Jan 15, 2014 at 3:45 PM, t x txrev...@gmail.com wrote: Hi, Let c be a channel that is neither dropping nor slidding. Now, furthermore, let c be full. Lastly, suppose (async/put! c

Re: how to check if something is a channel ?

2014-01-17 Thread Timothy Baldridge
Those interfaces are also broken into ReadPort, WritePort and Channel. Each protocol defines (in order), read, write, and close!. So you can check on or all of those for only the ops you need. Note however, anything under clojure.core.async.impl is subject to change without notice in future

Re: Using macro to generate boilerplate keywords

2014-01-17 Thread Timothy Baldridge
perhaps something like: (zipmap (range) (for [octave (range 8) key [C C# D D# ...]] (keyword (str key octave Timothy On Fri, Jan 17, 2014 at 9:21 AM, Kashyap CK ckkash...@gmail.com wrote: Hi, I am exploring javax.sound.midi using

Re: OOP question re: The Language of the System

2014-01-19 Thread Timothy Baldridge
a large codebase using protocols instead of multimethods, I've regretted it. Data all the things...as the saying goes. Timothy Baldridge On Sun, Jan 19, 2014 at 2:55 PM, James Reeves ja...@booleanknot.com wrote: On 19 January 2014 19:55, Brian Craft craft.br...@gmail.com wrote: http

Re: Clojure development laptop battery usage

2014-01-19 Thread Timothy Baldridge
in. Hope this helps, Timothy Baldridge On Sun, Jan 19, 2014 at 7:52 PM, gvim gvi...@gmail.com wrote: Is it likely that a typical Clojure development environment: - LightTable instarepl - Luminus web app running within `lein ring server` will consume significantly more battery power

Re: binding / async / go

2014-01-19 Thread Timothy Baldridge
That works just fine on my box, infact, core.async's test code includes checking that dynamic vars actually work. Timothy On Sun, Jan 19, 2014 at 10:11 PM, t x txrev...@gmail.com wrote: Hi, Consider this piece of code: (binding [*foo* 20] (async/!! (async/go (+ 1 2 *foo*

[core.async] New put api

2014-01-23 Thread Timothy Baldridge
-SNAPSHOT you will need to update all calls to put!. I'm sorry about this, but there's really no other way to get these changes into the api. Please let me know about any bugs you find in the current 0.1.0-SNAPSHOT. Thanks, Timothy Baldridge -- -- You received this message because you

Re: semantics of ! on closed channels

2014-01-23 Thread Timothy Baldridge
the core.async source and doing lein install from the directory. I just sent an email to this mailing list that explains these changes and the updated semantics. I hope this helps, Timothy Baldridge On Thu, Jan 23, 2014 at 5:53 AM, Meikel Brandmeyer (kotarak) m...@kotka.dewrote: Hi

Re: semantics of ! on closed channels

2014-01-23 Thread Timothy Baldridge
the code state defined by this commit: ? https://github.com/clojure/core.async/commit/76b25bf91c670b0c3542ed9cb687ff29fb2183a7 (I tried 0.1.0-SNAPSHOT but it appears not updated yet.) On Thu, Jan 23, 2014 at 6:07 AM, Timothy Baldridge tbaldri...@gmail.comwrote: t x, these change you suggest

Re: [core.async] New put api

2014-01-23 Thread Timothy Baldridge
. I think it's a good change (even tho' it breaks any code that uses put! and expects it to throw an exception). Sean On Jan 23, 2014, at 6:05 AM, Timothy Baldridge tbaldri...@gmail.com wrote: I'm looking for some feedback on recent changes Rich and I have made to core.async: I merged

Re: semantics of ! on closed channels

2014-01-23 Thread Timothy Baldridge
Umwat? On Jan 23, 2014 7:17 PM, Cedric Greevey cgree...@gmail.com wrote: [meta, but about something apparently triggered by the message, from this thread, that I'm quoting] Why did reading this post cause gmail to go bonkers? I saw this thread had new articles since earlier today,

Re: semantics of ! on closed channels

2014-01-23 Thread Timothy Baldridge
of some sort, or was it just a prank, or even a known software bug somewhere?) On Thu, Jan 23, 2014 at 9:20 PM, Timothy Baldridge tbaldri...@gmail.comwrote: Umwat? On Jan 23, 2014 7:17 PM, Cedric Greevey cgree...@gmail.com wrote: [meta, but about something apparently triggered

Re: ANN: clojure-objc

2014-01-25 Thread Timothy Baldridge
What's the performance of this code like? I'd be interested in seeing how performance on Clojure data structures compares. In my experiments with reference counting and highly polymorphic code, getting much faster than languages like Python was quite hard. Without a more dedicated optimizer that

Re: Clojure development laptop battery usage

2014-01-25 Thread Timothy Baldridge
MBP = Mac Book Pro MBA = Mac Book Air On Sat, Jan 25, 2014 at 9:12 PM, greybird m...@greybird.com wrote: In case it helps, I've also seen this CPU eating problem. I'm using: REPL-y 0.1.9 Clojure 1.5.1. I don't know what you guys mean by MBP and MBA. --mark -- -- You received this

Re: Clojure development laptop battery usage

2014-01-25 Thread Timothy Baldridge
It's not true. All memory has to be kept active at all times. Now you may experience less battery usage due to the GC having to run more often, but that's not exactly a memory usage problem. Not to mention that the OS will almost always use all free ram for disk caches and the like. On Sat,

Re: (async/go (async/chan)) gc ?

2014-01-30 Thread Timothy Baldridge
The key thing to remember in all questions of core.async GC is that there is no global blocked gos queue. Instead, the blocked gos are attached directly to the channel. When the channel is GC'd all attached gos are GC'd as well. So in this case, it's actually even simpler.the go never blocks.

Re: When should I use non-blocking ! / threads and blocking !! / goroutines with clojure core.async

2014-01-30 Thread Timothy Baldridge
To quote Jozef it can happen all in one thread. This is somewhat true, there are some rare situations where this can happen, but it is fairly rare. Many times putting a value into a channel will mean that the callback on the other end of the channel needs to be dispatched. In that case Mauricio

Re: soft question: should remote channels appear like local channels

2014-01-31 Thread Timothy Baldridge
A quick thought...there really isn't much of a difference between a failing network connection and a (chan (dropping-buffer 1024)) Both may (or may not) drop information that you put into them, but also, both can be expected to work normally as long as certain conditions hold. Namely, the net

Re: map semantics

2014-02-08 Thread Timothy Baldridge
the input and output data structures to drive how processing is handled. http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html And as the article states, reducers use(s) regular data structures, not 'parallel collections' or other OO malarkey Timothy

Re: cljs, binding, async/go

2014-02-09 Thread Timothy Baldridge
Gos work with bindings on CLJ, CLJs biding support is different enough that it doesn't currently work with gos. Timothy On Sun, Feb 9, 2014 at 7:33 AM, t x txrev...@gmail.com wrote: Hi, ## Consider this block of code: (defn init [] ;; called from window.onload (def ^:dynamic *dvar*)

Re: [ANN] Clojure 1.6.0-beta1

2014-02-14 Thread Timothy Baldridge
+1 to everything Dom Kiva-Meyer said. On Fri, Feb 14, 2014 at 2:13 PM, Andrey Antukh n...@niwi.be wrote: Awesome! Thanks! 2014-02-14 21:47 GMT+01:00 Daniel doubleagen...@gmail.com: Thanks to everyone involved! On Friday, February 14, 2014 1:04:09 PM UTC-6, Alex Miller wrote: Clojure

Re: weird bug with cljs.core.async + macros

2014-02-18 Thread Timothy Baldridge
I'm unable to decipher from these examples exactly what is expected and what is going on. Can someone write me a concise 1 paragraph description of the problem. Something like: When a case is emitted from a macro into the body of a go, . happens I think it's probably something related to how

Re: weird bug with cljs.core.async + macros

2014-02-18 Thread Timothy Baldridge
When a macro expands to case inside of a go-block, it appears that the _ELSE_ clause of the case is always run. (Even after a previous clause has matched.) Thanks, I'll get a test in the project for this, it'll probably be fixed in the next alpha release. Until then, cond or condp might work?

Re: weird bug with cljs.core.async + macros

2014-02-18 Thread Timothy Baldridge
Firstly, I think you over estimate the cost of an if. Ifs are very very fast, especially if you are doing identical? checks (like a case is doing). A simple pointer comparison such as (keyword-identical? :foo :foo) is going to be way faster than a hashmap lookup. Secondly, ifs are very JIT

Re: why Clojure/Lisp is so fast

2014-02-18 Thread Timothy Baldridge
Clojure IMO is not truly dynamic, at least not to the extent of Python/Ruby. I like to refer to Clojure as a dynamic enough language. For example, once defined, types cannot be modified by adding new members (deftype that is). If you want to add a new field to a deftype in Clojure, you have to

Re: core.async as a rate-limiter

2014-02-19 Thread Timothy Baldridge
Yes, this pattern is pretty common. Create the timeout first, then do some work, then take from the timeout to wait for the remaining time. Looks good to me. Timothy On Wed, Feb 19, 2014 at 10:27 AM, Kris Jenkins krisajenk...@gmail.comwrote: Hey folks, Can someone sanity check this for me,

Re: Clojure performance question

2014-03-02 Thread Timothy Baldridge
How are you running these tests? The correct way to benchmark such things is via a real benchmark framework (such as criterium) then compile your clojure app to a jar (perhaps via lein uberjar) and finally run it via a bare java invocation: java -jar my.jar. Lein for example sometimes uses

Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Timothy Baldridge
You can take the CSP out of core.async, but then it really isn't the same thing. Your version with promises still allows for async, but in the process removes most of the benefits of CSP. Timothy Baldridge On Tue, Mar 11, 2014 at 12:29 PM, Ben Mabey b...@benmabey.com wrote: I've also ran

Re: jquery/$ in cljs

2014-03-12 Thread Timothy Baldridge
I think this should work: (.bullet js/$ arg1 arg2) Although this might not work with advanced compilation. In that case you may need to provide extra info to the CLJS compiler to keep .bullet from getting renamed. Timothy On Wed, Mar 12, 2014 at 11:14 AM, t x txrev...@gmail.com wrote: Hi,

Re: Help a Startup use Clojure!

2014-03-12 Thread Timothy Baldridge
This case study from Roomkey.com is a awesome starting place for a conversation: http://www.colinsteele.org/post/23103789647/against-the-grain-aws-clojure-startup http://www.colinsteele.org/post/27929539434/60-000-growth-in-7-months-using-clojure-and-aws Timothy On Wed, Mar 12, 2014 at 6:47

Re: core.async is very slow for some cases, what to do?

2014-03-13 Thread Timothy Baldridge
Instead (! channel) (! channel val) you do (! (take! channel)) (! (put channel val)). That would make channels even slower, not to mention that it would probably completely break interaction with alts!. I'm not saying it absolutely couldn't be done, I just don't see a need for it. core.async is

Re: STM and persistent data structures performance on mutli-core archs

2014-03-13 Thread Timothy Baldridge
I talked to Martin after a CodeMesh, and had a wonderful discussion with him about performance from his side of the issue. From his side I mean super high performance. You have to get a bit of background on some of his work (at least the work he talks about), much of what he does is high

Re: Calling from a macro to a private macro

2014-03-17 Thread Timothy Baldridge
Don't use private vars. Instead move the macro to a sub namespace called internals or impl or something like that and make it public. Prefer trusting your users instead of limiting them. my $0.02 Timothy On Mon, Mar 17, 2014 at 11:33 AM, Yoav Rubin yoavru...@gmail.com wrote: I'm familiar

Re: Calling from a macro to a private macro

2014-03-17 Thread Timothy Baldridge
The problem is in the way lisp compilers work. Example: The public macro gets analyzed first and runs, and emits the code required to call the private macro. Then the compiler analyzes the output of the first macro and discovers that the code now calls a new macro. It analyzes this code and finds

Re: [GSoC] Mentor for self-hosting ClojureScript compiler project?

2014-03-18 Thread Timothy Baldridge
large code sizes as the minification provided by google closure is a major boon to performance. Just some thoughts Timothy Baldridge On Tue, Mar 18, 2014 at 12:42 AM, Max Kreminski maxkremin...@gmail.comwrote: Hello all, I'm applying to GSoC this year, and I'm interested in taking

Re: local mutable state

2014-03-20 Thread Timothy Baldridge
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. On Thu, Mar 20, 2014 at 2:26 PM, James Reeves ja...@booleanknot.com wrote: There are a few reasons to reject

Re: rant / cljs in cljs ? :-)

2014-03-21 Thread Timothy Baldridge
are you using lein cljsbuild auto ? That's what I use, and I get about 1-3 sec recompile times for stuff that uses core.async. Timothy On Fri, Mar 21, 2014 at 12:48 AM, t x txrev...@gmail.com wrote: Hi, * I'm already using: :incremental true :compiler { :optimizations :none } *

Re: Unexpected core.async timeout behaviour

2014-03-28 Thread Timothy Baldridge
This is a caused by an interesting interaction of two things: 1) channels can have no more than 1024 pending takes at a time. and 2) (timeout) caches it's return value for a given ms + window size of time. At the moment, window is about 5-10ms. This error message is normally the result of a bug.

Re: Lazy evaluation

2014-04-01 Thread Timothy Baldridge
The question is replace them with what? I remember with not so fond memories the days of using IEnumerable in C#, there was no immutability and no caching. So if you created a massive chain of data and iterated over it twice you would have to execute the entire chain of functions twice. With

Re: remove first?

2014-04-02 Thread Timothy Baldridge
I don't know of anything built-in, but this should do the trick: (defn remove-first [f [head tail]] (if (f head) tail (cons head (lazy-seq (remove-first f tail) Timothy On Wed, Apr 2, 2014 at 1:44 PM, Christopher Howard cmhowa...@alaska.eduwrote: Is there some like remove,

Re: Changing a value in let

2014-04-04 Thread Timothy Baldridge
This is not modifying the value it's creating a new scope with a new version of x. The binding above is shorthand for: (let [x 3] (let [x 42] (println x)) (println x)) ;; prints: 42 3 Timothy On Fri, Apr 4, 2014 at 10:23 AM, Plínio Balduino pbaldu...@gmail.comwrote: Hi there I

Re: Changing a value in let

2014-04-04 Thread Timothy Baldridge
is shadowing the first, there's no way to access the first value, right? Plínio On Fri, Apr 4, 2014 at 1:26 PM, Timothy Baldridge tbaldri...@gmail.comwrote: This is not modifying the value it's creating a new scope with a new version of x. The binding above is shorthand for: (let [x 3] (let

Re: alternative syntax for Clojure? Haskell?

2014-04-05 Thread Timothy Baldridge
I find Haskell syntax completely unreadable. Just saying On Apr 5, 2014 11:36 AM, Travis Wellman twell...@gmail.com wrote: When I started learning Haskell after a year or more of Clojure, the syntax was refreshing, and I found myself wishing I could write Clojure with Haskell syntax.

Re: Core.async nil on unclosed channels

2014-04-07 Thread Timothy Baldridge
This is a interesting side-effect of the way that map is implemented. Internally map is not actually using channels, but is using the channel protocols. It's creating something that looks like a ReadPort, but before handing values to callbacks it applies a function to the value. So map doesn't

Re: Core.async nil on unclosed channels

2014-04-07 Thread Timothy Baldridge
But yes, we should probably at least put a note in the docs for map stating returning nil from the mapping function can result in undefined behavior. Or add an assert somewhere perhaps. Timothy On Mon, Apr 7, 2014 at 9:36 AM, James Reeves ja...@booleanknot.com wrote: This looks like a bug to

Re: Core.async nil on unclosed channels

2014-04-07 Thread Timothy Baldridge
That's the case with clojure.core.map as well, don't consume the lazy seq the side effects aren't run...in short, map is not for side effects. On Mon, Apr 7, 2014 at 11:32 AM, Alejandro Ciniglio skiae...@gmail.comwrote: Yeah, that seems to be the best practice that's promoted as well. Another

Re: Core.async nil on unclosed channels

2014-04-07 Thread Timothy Baldridge
that constantly tries to read from the output channel? On Apr 7, 2014, 1:39 PM, Timothy Baldridge wrote: That's the case with clojure.core.map as well, don't consume the lazy seq the side effects aren't run...in short, map is not for side effects. On Mon, Apr 7, 2014 at 11:32 AM, Alejandro

Re: true lightweight threads on clojurescript?

2014-04-08 Thread Timothy Baldridge
What is going to fulfill a promise? How will you know when a promise is fulfilled. In a single threaded VM like JS you're stuck with callbacks. Nothing short of full program transformation will give you any better experience than core.async. A good way to look at it is this...if you do this in

Re: true lightweight threads on clojurescript?

2014-04-09 Thread Timothy Baldridge
, Apr 9, 2014 at 9:39 AM, t x txrev...@gmail.com wrote: I believe https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7 suffices. However, it's currently Firefox only and no Chrome. On Tue, Apr 8, 2014 at 8:51 PM, Timothy Baldridge tbaldri...@gmail.com wrote: What

Re: true lightweight threads on clojurescript?

2014-04-09 Thread Timothy Baldridge
. On Wed, Apr 9, 2014 at 9:39 AM, t x txrev...@gmail.com wrote: I believe https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7 suffices. However, it's currently Firefox only and no Chrome. On Tue, Apr 8, 2014 at 8:51 PM, Timothy Baldridge tbaldri...@gmail.com

Re: Using parallellisation

2014-04-10 Thread Timothy Baldridge
Some would also argue that any parallelism system is going to slow down code as trivial as this. Never underestimate the power of properly optimized single threaded code :-). But yes, futures are the way to go if you want to execute a given expression on a different thread. On Thu, Apr 10, 2014

Re: What's clojure killer app? I don't see any.

2014-04-19 Thread Timothy Baldridge
When people say killer app what they mean is silver bullet. The problem with silver bullets, is while they are quite exceptional at killing vampires, they are often somewhat subpar when it comes to dispatching other monsters of the night, such as ogres. Or at least so I've been told by my friends.

Re: What's clojure killer app? I don't see any.

2014-04-19 Thread Timothy Baldridge
I have dozen colleagues that can't foster clojure because they want a language with tools that fits every day. Can you explain this statement? I'm not sure I understand. I haven't touched any language but Clojure for every day work in months (years?). I can write a game in Clojure, I can write

Re: What's clojure killer app? I don't see any.

2014-04-19 Thread Timothy Baldridge
But something or some things that mostly pushes people to use the language. If that's the case, then building cool stuff is probably the correct answer. And in that case, this probably applies quite well to Clojure: http://paulgraham.com/avg.html On Sat, Apr 19, 2014 at 3:24 PM, Paulo Suzart

Re: What's clojure killer app? I don't see any.

2014-04-19 Thread Timothy Baldridge
wrote: Yes. That's the point. You are taking about a bunch of wrappers. They are not bad, but will not make these people to move their asses from java. Even if they can introduce clojure in their tools set. Thanks On 19 Apr 2014 18:09, Timothy Baldridge tbaldri...@gmail.com wrote: I have

Re: Rich Hickey Video - unit conversion language

2010-06-21 Thread Timothy Baldridge
On Mon, Jun 21, 2010 at 6:46 AM, Julian juliangam...@gmail.com wrote: Rich Hickey made reference in one of his videos to a language that could convert between all different kinds of units and dimensions. Does anybody recall what that was? google is thy friend:

Re: Rich Hickey Video - unit conversion language

2010-06-21 Thread Timothy Baldridge
BTW...his documentation is just awesome...read the section on Superman is a slacker for a good laugh. Timothy On Mon, Jun 21, 2010 at 6:46 AM, Julian juliangam...@gmail.com wrote: Rich Hickey made reference in one of his videos to a language that could convert between all different kinds of

STM style disk persistance

2010-06-22 Thread Timothy Baldridge
in countless situations. So has anyone tried this? If not, I may just give it a whirl, and others would be welcome to help. Timothy Baldridge -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs

Re: STM style disk persistance

2010-06-23 Thread Timothy Baldridge
at 3:26 PM, Daniel Werner daniel.d.wer...@googlemail.com wrote: On Jun 22, 7:57 pm, Timothy Baldridge tbaldri...@gmail.com wrote: system it uses. Has anyone tried marrying the two system systems to create a truly persistent data primitive where any updates to a map is written to the disk

Re: the joys of lisp

2010-06-28 Thread Timothy Baldridge
1. a string/text type *cough * Erlang *cough * Tim -- 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.

Re: the joys of lisp

2010-06-29 Thread Timothy Baldridge
a good or bad example of this? On Jun 27, 1:11 pm, Timothy Baldridge tbaldri...@gmail.com wrote: 1. a string/text type *cough * Erlang *cough * -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: iOS and Windows RT support?

2013-01-22 Thread Timothy Baldridge
You could take a look at ClojureCLR, I'm not sure if it runs on RT though. That being said, Metro has a JS API, so why not write Metro apps in ClojureScript? Timothy On Tue, Jan 22, 2013 at 10:55 AM, MC Andre andrew.penneba...@gmail.comwrote: What's the state of iOS and Windows RT support for

Re: Natively Compiled Clojure

2013-01-25 Thread Timothy Baldridge
The important question to ask yourself (and I'll cover this in my talk), is why do you want native Clojure? A native implementation of Clojure will fail to deliver on several fronts: Interop with systems - Java has one of the biggest ecosystems on the planet Performance - The JVM JIT and GC are

Re: Natively Compiled Clojure

2013-01-27 Thread Timothy Baldridge
have you hit with Clojure/ClojureScript that you think could be resolved with a native Clojure implementation? Timothy Baldridge On Sun, Jan 27, 2013 at 4:32 PM, Paul deGrandis paul.degran...@gmail.comwrote: Additionally, you might also consider ClojureScript itself. With a little work you

Re: Clojure - Python Style suggestion

2013-02-04 Thread Timothy Baldridge
Parens actually don't complect, they have a very very clear meaning. They organize functions and arguments. Let's take one line from your example: filter smaller xs Sois that the python equivalent to which of these? filter(smaller(xs)) filter(smaller, xs) filter(smaller(), xs())

Re: Puzzle with lazy sequences

2013-02-05 Thread Timothy Baldridge
Hi Thanks for the super fast response, Still a little confused. If coll is set to nil before reduce is called, then what is reduce called with? Remember, the JVM is a stack machine (before the JIT is run). So the code produced is something like this: push coll push nil pop-into coll call-fn

Re: Easier imperative-style programming

2013-02-11 Thread Timothy Baldridge
Some swear by monads, others (like myself) tend to swear at them. I would suggest breaking the code apart a bit more. From the looks of it, you're writing something like a game. The first 4 clauses could be redone as something like this: (def dirs {:left [-10 0] :up [0 -10] :right [0 10]

Re: How to Process Files in Background

2013-02-11 Thread Timothy Baldridge
For that, look up Executors in Java. They'll have exactly what you are looking for. Create a new fixed sized executor: http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Executors.html They expect Runnable objects, but clojure Fns implement Runnable, so you can simply pass the

Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-12 Thread Timothy Baldridge
This sort of pattern is used quite a lot in clojure (even in core): (let [data (if (string? data) (read-string data) data) data (if (string? (first data)) (first data) (next data)) data (if (string? (first data)) (first data) (next data))] data) Throwing exceptions on overridden

Re: Why is this so difficult?

2013-02-14 Thread Timothy Baldridge
Can you explain a bit more? What do you find difficult about Leinigen? Thanks, Timothy On Thu, Feb 14, 2013 at 11:42 AM, BJG145 benmagicf...@gmail.com wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Timothy Baldridge
-compilation. And the compilation speed isn't anything to boast about (from what I've heard). Timothy Baldridge On Wed, Feb 27, 2013 at 10:03 AM, Marko Topolnik marko.topol...@gmail.comwrote: On Wednesday, February 27, 2013 5:17:16 PM UTC+1, Luc wrote: There's no magic. You cannot win on all fronts

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Timothy Baldridge
/PHP, etc. Timothy On Wed, Feb 27, 2013 at 10:13 AM, Timothy Baldridge tbaldri...@gmail.comwrote: Luc makes a good point. And that's one thing that I love about Clojure. It is possible to have (more or less) the same language on different platforms with different trade-offs, with little effort

Re: LoL which style for Clojure

2013-03-22 Thread Timothy Baldridge
The question should probably be asked: is there a benefit in a given situation to having the let be outside the scope of the defn? I would argue that most times it is not, and putting the let outside the function clutters the code and makes it harder to see the functions defined in the namespace.

Re: Clojure/West 2013 videos?

2013-03-25 Thread Timothy Baldridge
+1 to what Michael said. Once the videos do start rolling in, InfoQ will have at least one Clojure video on the front page for months on end. I once said to a friend after Clojure/West last year,InfoQ? Oh! You mean the Clojure Channel. On Mon, Mar 25, 2013 at 10:19 AM, Michael Klishin

Re: Sweet-expressions

2013-03-25 Thread Timothy Baldridge
(first | first coll) ; (first (first coll)) (count | first | second coll) ; (count (first (second coll))) (nth % 2 | first coll) ; (nth (first coll) 2) How is this better than the threading macro? (- coll first first) (- coll second first count) (- coll first (nth 2)) Timothy Baldridge

Re: [ANN] Amazonica: Clojure client for the entire AWS api

2013-03-26 Thread Timothy Baldridge
, but if I wanted more performance it seems like this library would cause me some problems. Besides that, I love the idea of an auto generated lib. Timothy Baldridge On Tue, Mar 26, 2013 at 12:18 PM, Michael Cohen mcohe...@gmail.com wrote: Thanks for the comments. I've made the suggested changes

  1   2   3   4   5   6   7   8   9   >