Better HN
topnewbestaskshowjobs
Log inSign up

dustingetz

7,912 karma · joined Sep 11, 2009 (17y ago) · 3,625 submissions

Founder Electric Clojure https://github.com/hyperfiddle/electric

https://twitter.com/dustingetz

Submissions

comment 13y ago · link · parent

The compromise of composabilty is that if you don't already understand the problem domain, you don't know how to structure your code. Frameworks are brilliant for paving a golden path for us to follow - we get to reuse someone elses knowledge and experience, codified into the framework.

A great example is the present state of browser development t. Google "backbone sucks site:news.ycombinator.com" and you find tons of comments from people who struggle with backbone - a supercomposable library, not a framework by design.

Composabilty pays off huge in the long, but you need experienced leadership to wield it.

There's also a happy medium in things like Play Framework, a functional scala framework but designed almost as a collection of composable libraries so you can lean on Plays opinions for most things but since it is designed to be composable (compare to "pluggable", or "extensible") so you can swap different pieces out if you like. That is my experience, at least.

comment 13y ago · link · parent

datomic claims to solve the O/R impedance mismatch -- the "vietnam of computer science"[0] -- which is why datomic matters to application developers.

"... The facts the Storage Service returns never change, so Peers do extensive caching ... Once a Peer's working set is cached, there is little or no network traffic for reads ..." [1, paragraph 4]

this basically means that your reads are VERY fast -- in-memory fast -- which means you can program as if your data wasn't in a database.

[0] http://www.codinghorror.com/blog/2006/06/object-relational-m... [1] http://docs.datomic.com/architecture.html

ps video is only 14 minutes long, worth a watch

comment 13y ago · link · parent

Edit: iPhone posted to root, meant in reply to top voted comment sry!

don't think that's the underlying point at all. A functional Language gives the compiler more room to optimize - the compiler has more information because a functional language let's the programmer express constraints in ways imperative languages can't - the compiler fundamentally knows more and thus can generate better machine code. The productivity benefits of HLLs are secondary to this discussion.

comment 13y ago · link · parent

i don't think i'm confusing anything. Clojure programmers love their persistent data structures, and in a browser environment, the most important data structure - the document model object - is not persistent and cannot be made persistent in a performant manner because it is a native api.

there is ongoing research into dom manipulaton in clojurescript - Conrad Barski presented one approach[1] at Conj 2012 where the dom is mirrored in clojurescript data structures, and then 'synced' with the dom - so that way the imperative ickyness is tucked away in the sync method - it remains to be seen if that can be made fast enough until we get a native persistent interface to the dom.

[1] https://github.com/drcode/webfui

comment 13y ago · link · parent

the dom is a mutable data structure and the native (fast) dom apis expose mutable interfaces. so dynamic sites (you know, single page html5 apps doing all sorts of client-side dom manipulation) are either going to be slow, or are going to have an imperative core, which is where you need functional programming the most ;(

maybe HTML6 will have native functional dom manipulation and we can rewrite all our favorite javascript libraries to expose functional interfaces. one can dream.

comment 13y ago · link · parent

I speculate they're just trying to de-dup content.

comment 13y ago · link · parent

right now only the turkish government can do MITM - other parties can't.

comment 13y ago · link · parent

Chrome could warn "XYZ CA is scheduled to be marked untrusted in 30 days". The sites large enough to have economic impact if they were unsecured would notice and scramble to get new certs. Other browser vendors would follow. A warning shot is fired paving a path for harsher penalties in the future.

comment 13y ago · link · parent

backbone? magic? backbone is 1534 lines of straightforward, well written, well documented javascript. backbone is about as simple and un-magic as MVC gets, by design.

comment 13y ago · link · parent

let me put it this way - right now, this month, im evaluating stacks for an enterprise-y amazon-y feeling thing. Say $XX million dollar budget, ~100k LOC with ~10 engineers (mostly cranky and old) for 7 months.

i'm not sure if you're freelancing an app as a sole developer, or if you're an early stage startup, or if you work on amazon.com store. and where your project is, in this spectrum, is incredibly relevant context when you're dissing a framework.

comment 13y ago · link · parent

please provide more context about what type of app you're building. searching for "ember sucks site:news.ycombinator.com" and "backbone sucks site:news.ycombinator.com" is evidence enough that this isn't a simple comparison.

comment 13y ago · link · parent

that would couple session to db. Play Framework, for example, is able to provide support for sessions using encrypted cookies, without having to provide adapters to all sorts of potential databases.

comment 13y ago · link · parent

i've worked through this article a couple times and his implementation never really sat well with me, the "with nice syntax for monad comprehensions" bit really obfuscates the implementation.

here's python source to a monadic lisp interpreter, which i wrote to follow along the paper "monad transformers and modular interpreters" [1]. i think this is a much simpler implementation of python monads than provided in the ValuedLessons article. https://github.com/dustingetz/monadic-interpreter

Study of this implementation will teach you why nobody actually uses monads in python for non-toy projects. A literal port of this code to clojure would feel so much more idiomatic and not hacky at all.

here are some smaller code dumps demonstrating the fundamental concepts to that monadic lisp interpreter:

http://www.dustingetz.com/2012/10/02/reader-writer-state-mon... http://www.dustingetz.com/2012/10/07/monads-in-python-identi...

[1] http://haskell.cs.yale.edu/wp-content/uploads/2011/02/POPL96...

comment 13y ago · link · parent

when calling JS code from CLJS, you have to translate arguments that aren't primitives from CLJS datastructures to JS datastructures. (Functional languages implement their datastructures differently than imperative languages.)

here's an example: https://github.com/dustingetz/getz-bootstrap/blob/datomic/sr...

comment 13y ago · link · parent

> legal documents are written precisely to be as hard to misinterpret as possible

legal documents reuse diction that has been ruled on and has court established precedent, which creates a bias towards diction which ended up in court in the first place.

i read that in a HN comment somewhere, sorry, no citation.

comment 13y ago · link · parent

i actually wish there were more blogs that assume this level of background. i know what backbone is, i know what it's competition is, and i want to play with nontrivial working examples without having to figure it out myself from the api docs.

comment 14y ago · link · parent

> Thank you Simon! Facebook is lucky to have you.

anyone have information on this? i hadn't heard and google doesn't appear to know either.

comment 14y ago · link · parent

thanks. all, here's a demo of FRP in the browser from Clojure Conj 2012: http://alandipert.github.com/flapjax-demo/ (https://github.com/alandipert/flapjax-demo/blob/master/src/c...).

comment 14y ago · link · parent

    dependency injection : currying
    factories : type constructor
    decorators : higher order functions
there's nothing wrong with DI and the like. what's wrong is the way it's done in idiomatic java. when you do DI in idiomatic scala, there isn't much of a problem.

comment 14y ago · link · parent

i started learning functional programming with python, it falls apart at ~300 loc which is absurdly low, which makes python basically useless for production FP.

python's data structures are mutable, and mutable data structures necessarily expose a different interface than immutable data structures. using mutable datastructures in immutable style necessarily has severe performance penalties; and to do meaningful stuff you need to use a statement, and you can't put a statement in a python lambda. And Guido thinks lambda's are un-pythonic and a misfeature which he seems to regret [1].

python is a great sandbox for imperative programmers interested in FP, and these are great slides. it's awesome to play with these concepts in a familiar language - thats how i started - but its important to note that FP is just not pythonic, and thus it's probably a mistake to put functional-style python into production.

[1] http://news.ycombinator.com/item?id=3962316

if you are interested in functional python, i wrote about it a bit this year in my blog, because despite all this, python is a nice language for evangelism aimed at imperative developers.

[2] implement generators without yield http://www.dustingetz.com/2012/10/03/implement-python-genera...

[3] easy monads http://www.dustingetz.com/2012/10/07/monads-in-python-identi...

[4] hard monads http://www.dustingetz.com/2012/10/02/reader-writer-state-mon...

[5] peter norvig's Lispy refactored using monads https://github.com/dustingetz/monadic-interpreter

comment 14y ago · link · parent

> They broke the abstraction layers, mess up logic with implementation

your opinion is one i haven't seen before, do you care to elaborate?

comment 14y ago · link · parent

if it's helping notch make money, and its not degrading user experience, why exactly is it mad...?

if lots of cookies is a viable technique, the browser vendors will increase the cookie limit.

Then again, 640k of ram is enough for anyone.

comment 14y ago · link · parent

http://www.infoq.com/presentations/Simple-Made-Easy (this is so fundamental to this topic that it is required watching to even have an opinion on this subject)

http://clojure.org/rationale

http://www.dustingetz.com/2011/05/05/how-to-become-an-expert...

http://www.dustingetz.com/2012/10/07/java-sucks-because-idio...

comment 14y ago · link · parent

TLDR: write better code

functional programmers get to express their ideas as code

imperative programmers are so busy playing whack-a-mole with their bugs that they don't have time to think about new ideas

just look at the research[1] coming out of the <del>Clojure</del> functional programming community - especially Datomic. once you learn how to get your defect rate under control, you have time to explore crazy awesome new ideas

    [1] https://thestrangeloop.com/archive/2011
    [1] https://thestrangeloop.com/archive/2012
edited

comment 14y ago · link · parent

the more extreme code talks tend to have really great slides - in this case slides are a better format than a blog post really because you can direct the audience's attention through the important bits of the code with your slide transitions, as opposed to just throwing gists at them. here's an example from a talk i just gave, the slides came out well imo[1], its basically the material's i'd use to teach my colleagues this stuff.

[1] http://www.dustingetz.com/2012/09/24/StrangeLoop2012-monads-...

really i think it comes down to, for a lot of talks, slides aren't value-add to the audience, they're just a loose outline for the speaker

comment 14y ago · link · parent

here's my version (Strange Loop 2012 slides - Monads in python). A bit simpler, but not as thorough.

http://www.dustingetz.com/2012/09/24/StrangeLoop2012-monads-...

comment 14y ago · link · parent

i wonder if this came from a top-down directive "ship on schedule or don't bother." something like Marissa Mayer said this week[1]. GLHF.

[1] http://www.sfgate.com/technology/businessinsider/article/Mar...

comment 14y ago · link · parent

what plans does google have to curb these false positives triggering actions on people's accounts? sooner or later, the media will tire of these stories, which means google will never notice.

whether google intends it or not, real people rely on google services for income, and losing this income can cause hardship.

comment 14y ago · link · parent

release early release option gives you chances to fix your mistakes before its too late. waterfall works great if you can manage to get your data structures perfect before production. it begins to fail when it becomes prohibitively expensive to fix mistakes after production, where not unexpectedly breaking old code has precedence over deploying new.
1
979899
121