Better HN
topnewbestaskshowjobs
Log inSign up

kachayev

244 karma · joined Oct 28, 2012 (14y ago) · 17 submissions

CTO @ Attendify. Full-time coding in Clojure, part-time coding in Haskell, often wondering in Idris.

Scientifically interested in algebras, personally worried about protocols (including HTTP2 ), working hard on async code correctness verification catching race conditions with dependent types like there's no tomorrow (yeah... Aleph & Netty - I'm looking at your right now ) trying to make a life of communicating system developers better.

Submissions

1.

Does your type system work on you? Refined types in Clojure(speakerdeck.com ↗)

1 points · by kachayev · 8y ago · discuss

2.

Reinventing Haxl: Efficient, Concurrent and Concise Data Access in Clojure(speakerdeck.com ↗)

2 points · by kachayev · 11y ago · discuss

3.

Solving the “N+1 Selects Problem” with Muse(github.com ↗)

9 points · by kachayev · 11y ago · discuss

4.

ClojureScript and React. Moving from Bad to Good(speakerdeck.com ↗)

4 points · by kachayev · 11y ago · discuss

5.

Microservices in Clojure. Lessons learned(speakerdeck.com ↗)

1 points · by kachayev · 11y ago · discuss

6.

Channels Are Not Enough(gist.github.com ↗)

235 points · by kachayev · 12y ago · 221 comments

comment 12y ago · link · parent

Nice question!

It "easy". Cause it takes less characters in your code: you don't need "type classes" of any form, you don't care about liftings etc. You can start from 2-3 lines of code and see immediate result.

But it's really not that "simple", cause without constant thinking about type of each expr it becomes very hard to trace long chains of monad operations very quickly. Plus types are great for verifying that you didn't break anything inside your "do" block (which is painful in dynamic env).

8.

Monadic parser for CSS in Clojure(gist.github.com ↗)

35 points · by kachayev · 12y ago · 3 comments

9.

Deterministic parallel and distributed programming. Quick intro(speakerdeck.com ↗)

1 points · by kachayev · 12y ago · discuss

10.

Monadic parser combinators in Python for FP beginners(speakerdeck.com ↗)

1 points · by kachayev · 12y ago · discuss

11.

Fn.py (functional python library), now with persistent data structures(github.com ↗)

3 points · by kachayev · 12y ago · discuss

12.

Developing social applications platform in Erlang. Lessons learned [slides](speakerdeck.com ↗)

3 points · by kachayev · 13y ago · discuss

13.

Tweetping: beautiful visualisation of Twitter activity in realtime(tweetping.net ↗)

2 points · by kachayev · 13y ago · discuss

comment 13y ago · link · parent

To answer the question when STM is hard to use, you can imaging any case of simulation. Few years ago I worked with engine for real-time brokers trading simulations: thousands of independent players accept different information streams and make deals. Each deal is several steps of negotiations with two-phase commit. Plus different monitoring tools, timers, generators and randomizers.. Whole system was written in Erlang, and you know... two-phase commit is really hard to implement in right way without potential deadlocks and other problems. But it's looks good and "natural" (as to say) in Actors language. I used to try to do something like this with STM and I quickly gave up with mess of unreadable code.

15.

Modern Concurrency: Erlang, Scala, Go, Clojure(kachayev.github.com ↗)

7 points · by kachayev · 13y ago · 2 comments

16.

Fn.py: enjoy functional programming in Python(kachayev.github.com ↗)

2 points · by kachayev · 13y ago · discuss

comment 14y ago · link · parent

This example was given to describe map/reduce pattern, not advice to use it instead of sum:

    reduce(operator.add, map(len, ss))
You know, it's hard to understand new concept. And it's twice harder to explain new concept with sophisticated code examples. So I used as simple code and situations as possible. The same for square_sum - it's easier "to see" functional pattern in map(f,l) than in (f(x) for x in l).

Regarding to debug function and partial function application, - it depends. As for me

    debug = partial(log, "debug")
is easier and meaningfully describe what's actually going on. But here we have only one function, what if you have to create 5-6 same functions? Would you prefer "def" syntax instead of partial? I have one more example of using this pattern in more sophisticated situation - code listing for dictionary binding to list of functions, "partial" looks really naturally.