Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
aphyr
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
43 ms
·
421.
▲
by
aphyr
14y ago
Don't believe me? Try it: Node.js: https://gist.github.com/3200829 Clojure: https://gist.github.com/3200862 Note that I picked the really small messages here--integers, to give node the best possible serialization advantage. $ tim
422.
▲
by
aphyr
14y ago
Threads and processes both require a context switch, but on posix systems the thread switch is considerably less expensive. Why? Mainly because the process switch involves changing the VM address space, which means a TLB shootdown: all that
423.
▲
by
aphyr
14y ago
On the contrary, I think proper concurrency constructs, including threads, do improve the clarity of programs. Part of the problem in reasoning about threads is a lack of useful primitives. Multithreaded programming in Java? For me, at leas
424.
▲
by
aphyr
14y ago
It's parallel in the same sense that any POSIX program is: Node pays a higher cost than real parallel VMs in serialization across IPC boundaries, not being able to take advantage of atomic CPU operations on shared data structures, etc. At l
425.
▲
by
aphyr
14y ago
Concurrency is more than decomposition, and more subtle than "different pieces running simultaneously." It's actually about causality . Two operations are concurrent if they have no causal dependency between them. That's it, really. f(a
426.
▲
by
aphyr
14y ago
Gotcha. That sounds solid to me; would be a good explanation to put in your feature list. Sounds like your coordinators are authoritative masters for transaction ordering. Does that imply a single-machine limit to throughput in a given dc?
427.
▲
by
aphyr
14y ago
So you require quorum over data centers to stay up? How do you provide transactional consistency between dcs? Multipaxos over blocks of transactions with delayed failure?
428.
▲
by
aphyr
14y ago
Serialized transactions over a broad distribution of keys isn't a huge problem, but you're right: this bodes poorly for hot data. I'm more concerned about their CAP semantics: I'm sorry, but claiming multidc availability and acid transactio
429.
▲
by
aphyr
14y ago
http://zookeeper.apache.org/doc/trunk/recipes.html#sc_leader...
430.
▲
Configuration and Scope: OOP and functional approaches to implicit variables
(aphyr.com)
7 points
by
aphyr
14y ago
|
0 comments
431.
▲
by
aphyr
14y ago
Huh, I find the syntax for literals a breath of fresh air--but I also grew up in languages with rich data structure literals and find the {}, (), [], #"", #{} distinctions make it much easier for me to understand, at a glance, the shape of
432.
▲
by
aphyr
14y ago
The author claims this first article is satire, but in case you were tempted to take it literally, allow me to rebut: Why not simply add support for concurrent programming as a library instead? Clojure's concurrency primitives are libra
433.
▲
by
aphyr
14y ago
That's a really good observation. I think in cases like Clojure, the dynamic problems aren't quite as bad because of the emphasis on immutability: the compiler can readily generate single-assignment forms from let and def bindings. With t
434.
▲
by
aphyr
14y ago
I actually quite like the Haskell and OCaml type systems! I had them in mind while writing my post above. Personally, I dislike type systems which are rigid but weak . Strong compiler verification is awesome in a language like Haskell wh
435.
▲
by
aphyr
14y ago
It depends, really. Clojure's compiler actually does perform static, compile-time type analysis in certain cases, notably on primitives. For a more traditional form of static type analysis, I imagine you'd use the macro system to provide
436.
▲
by
aphyr
14y ago
Luckily, Clojure has a type system. Actually, several of them, which work together: http://clojure.org/protocols http://clojure.org/datatypes http://clojure.org/multimethods http://clojure.org/java_interop#Java%20Interop-Type%20Hints
437.
▲
by
aphyr
14y ago
I'd opt for the TPC workloads on standardized hardware: http://www.tpc.org/tpcc/results/tpcc_price_perf_results.asp
438.
▲
by
aphyr
14y ago
Shared environments with virtualized IO are not good places to run benchmarks.
439.
▲
by
aphyr
14y ago
Begging your pardon, but what are you smoking? SO2 and NOX filtration are great , and significantly reduce emissions (~80% seems to be a common figure cited by FGD and SCR manufacturers), but mercury and radionuclide emissions, especially
440.
▲
by
aphyr
14y ago
The strongest source in the article appears to be Moniz and Kazimi 2009. Not sure if I've tracked down the one they're referring to, but the MIT Nuclear Power Update, on which they are coauthors ( http://web.mit.edu/mitei/research/studies/n
441.
▲
by
aphyr
14y ago
1. Testing is easier without state. I'm trying to illustrate that state and context (and namespaces) are separable. 2. Swapping implementations is easier: would you rather pass a function, or an object with a single function? This tie
442.
▲
by
aphyr
14y ago
As a note, I think this particular variant of SRP is adopted from Java, where there is no concept of a function not bound to an object. You might be tempted to use static methods for plain-old namespaced functions, but there's a second qu
443.
▲
by
aphyr
14y ago
Classes exist to bundle state; if there's no need for state, there often shouldn't be a class in the first place. I tend to use module_fun for that, or just: module Foo def self.some_stateless_method ... end en
444.
▲
by
aphyr
14y ago
Surprised that nobody has mentioned yet: this code is stateful for no reason . There is no need for instance variables, a constructor, an object, or a class at all. It's just a function . Put it in a mixin, as a module function, in a help
445.
▲
by
aphyr
14y ago
Seems to me that a major state university should aim to provide its students with a broad range of fields. Not being able to study German at a public school seems absurd.
446.
▲
by
aphyr
14y ago
Academics is only part of university budgets. Other principal costs include housing, tuition assistance, administration, buildings, grounds, support services, and athletics. Not exactly sure how UVA divvies things up.
447.
▲
by
aphyr
14y ago
Probably.
448.
▲
by
aphyr
14y ago
The prose is ...weak, to say the least Really? I mean sure, on the scale of "everything written in the English language" it may not be top notch, but I think it's one of Stephenson's best crafted works. The allusive density and rhythm of
449.
▲
by
aphyr
14y ago
Yeah, I was reading the same docs with confusion. My coworker cscotta dug down into the source. Oracle's JVM on Linux just calls gettimeofday(), which means System.currentTimeMillis will go all wonky during leap seconds. Ah, documentation.
450.
▲
by
aphyr
14y ago
Calendars are different than time. It's a little hard to think about; maybe this will help: The earth is sort of an inertial reference frame with a single proper time. It isn't exactly, because it's orbiting, in varying gravity, and spinn
More ›