Better HN
topnewbestaskshowjobs
Log inSign up

wireprotocol

7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions

Submissions

comment 12y ago · link · parent

I'm surprised by the comparison to perl6.

Rust is moving very quickly now, but they clearly have a cutoff in sight, and their explicit goal is a stable language spec and standard library for 1.0.

They are also building on LLVM, which gives them a fairly solid base; in contrast to perl6 that was trying to make a multi-language VM while reinventing the language.

comment 12y ago · link · parent

I think it's valuable to show how an "old, traditional"[1] system like postgres can actually be much more flexible and powerful even working in a fashionable environment.

If nothing else, it's a great exercise to make sure that postgres isn't missing out on a real, fundamental use case. Fashionable technologies don't always have something new to offer, but sometimes they help you see something from a new perspective.

[1] Postgres is very non-traditional in many respects, and I personally believe it's revolutionary; but many people perceive it as more traditional.

comment 12y ago · link · parent

I agree in the sense that nobody should re-architect their product around a trend.

But this is different because the postgres architecture is very much capable of great support here, and getting even better. Postgres has the best support for adding in new types, with amazing capabilities around indexing.

I'm not just talking about different kinds of BTrees, I mean real non-scalar indexing strategies like inverted indexes (used for full text, but also great for JSON), similarity matching indexes, unbalanced indexes, spatial indexes, etc.

The author merely wants to use this infrastructure as intended for the JSON use case. Easier said than done, of course, but no architectural compromises need to be made in the process of providing this support.

comment 12y ago · link · parent

Shared state is great as long as you control it.

Databases are a giant blob of shared state, albeit a carefully-managed one. People complain about them all the time, but databases completely take over in huge areas of the application development landscape. There's a reason for that -- consistency is a very powerful simplifying assumption (giant understatement). Getting consistency in erlang may be possible, and of course you can still use a database from erlang, but the philosophy doesn't quite line up.

Databases already offer isolation between transactions. And they naturally work with immutable structures similar to functional programming.

For most applications out there, HA means replicating a database, and when it goes down (which is actually quite rare), you lose a little time doing a failover.

Hot code loading means uploading a PHP file with a new extension and "mv"ing it over the old one. Need schema changes? PostgreSQL offers transactional DDL (e.g. ALTER TABLE).

Any error in the database usually just causes that one transaction for that one request to fail. Any error in the application usually just crashes that one process serving that one request.

Philosophically, using erlang is trading consistency for availability. Given that it's easy to get good availability using normal applications connected to a database, using erlang is somewhat of a niche.

I have spent some effort learning erlang, and I really like it in many ways. I bought the new book and I like it so far. I have no problem with the syntax and I find it enjoyable to write in (though I haven't written any large programs). There are certain projects where I think erlang would be a great choice, like management and control of a cluster system. Obviously it works for telco-like things, too, but I've never developed anything like that.

comment 12y ago · link · parent

To be fair, he was in a precarious position at the time. Did he make statements like that before the whole thing started?

comment 12y ago · link · parent

It's really hard to keep moving all the way up and down the stack. If you spend a few weeks hacking on a few key low-level routines, that might enable you to write the rest of the code in python and use some library you really want. In turn, that might enable you to release many more innovations faster than you would otherwise, and create something awesome.

But it's hard to remember all of that when you're in the middle of writing some C code so that it can be optimized with vectorized instructions when targeting newer chips.

Hacking is great, but engineering can inspire and enable hacking. How many of these cool startups would be around without gnu/linux/freebsd?

I think the trick is to go to a higher level once a day, or spend more time at a higher level once a week. What is value you will deliver to at least one other person? Are you making real progress getting there; or are you building an endless series of platforms on top of each other without ever having a clear application in mind?

Even if you are working on a generic performance improvement you can still do that. If 10,000 servers are running your software, and you improve performance by 2.5%, then you can measure the value you delivered in terms of power saved per year and it would be a real accomplishment. That will be motivational, and it will also help you choose a better follow-up project to deliver even more.

comment 12y ago · link · parent

Causation does not require 100% determinism. If X causes Y, it means that inducing X will increase the likelihood of Y.

So counterexamples are not disproof. You'd have to construct a lab experiment with enough subjects and measure over a long enough time.

Unfortunately, it's difficult to construct a perfect double-blind study, because people usually know if they are eating sugar or not. Maybe if artificial sweeteners are good enough it might work, or maybe the experiment would still be convincing even if the subjects know.

I'd be interested to see the results of such a study for sugar and heroin. I probably should be able to cite one before I claim it as fact, but I didn't think it was a very controversial claim. I think it's mainly a question of degree.

comment 12y ago · link · parent

Lustig is primarily concerned with fructose (and sucrose, which quickly metabolizes into a 50-50 mix of fructose and glucose).

Carbs in general (ones that metabolize mostly into glucose) have been widely available for a long time. They are also processed in a more "normal" way than fructose.

It might still be a good idea to reduce carbs, but I'm skeptical that the ketogenic diet is healthy.

comment 12y ago · link · parent

I'm sure that both sugar and heroin are fine in moderation.

The problem is that moderate consumption of either is known to cause overconsumption.

So, perhaps not so fine in an environment of abundance.

comment 12y ago · link · parent

With PHP, you upload the code as a new file, "mv" it over the old one, and the next request will pick up the new code.

Not quite as advanced as erlang, but in PHP's target use cases, it is quite effective.

comment 12y ago · link · parent

Is the license the same thing as a medallion?

If they just want to ask someone to pass a test and/or background check, that seems fine. If they refuse to issue one because there is a limit, that works against consumers.

comment 12y ago · link · parent

Uber always sends you an exact map of your route. You can verify the billing yourself or prove to a third party that the billing is miscalculated.

comment 12y ago · link · parent

"And he'd never known anything was wrong."

A change in the benefits to employees that doesn't result in a corresponding adjustment to the books raises a red flag to me, and I'm not an expert at all.

The author was probably giving too much benefit of the doubt to his former CFO. She was probably being a bit lazy and probably tried to be a bit too clever. I'm not saying the cleverness was greed; it may be as simple as wanting to feel like she could really contribute something to the company beyond what an ordinary CFO could do.

But accountants are supposed to be above that. Accounting regulations are there to protect investors from a million kinds of cleverness that have proved disastrous over the past few thousand years.

My only complaint is that the government itself is not held to the same standard of accounting.

comment 12y ago · link · parent

Every company builds a narrative around their products. I don't really see a problem with that. "Big Data" has already been redefined or misinterpreted enough times already, so I don't really think they're doing any additional damage to the terminology.

Personally, I think there are some holes in the story they are telling in general, but this is not one of them. The question I have about their product is: why not just store the JSON in a SQL database, many of which are adding JSON as a native type? Did they really need to reinvent an entire database system? Why not just take postgres and build on that like everyone else does?

comment 12y ago · link · parent

There is a qualitative difference in the way people are analyzing large amounts of data. Data Warehousing typically means fairly traditional typical SQL queries on vast amounts of data; a window function might be considered sophisticated.

Now, technologies that can do much more are becoming more accessible. Graph, time series, path analysis, fraud detection, customer churn analysis, statistical methods, etc.

Disclaimer: I work for a "big data" company that is also a data warehousing company.

comment 12y ago · link · parent

No.

Any example I come up with is going to sound contrived, because it is. Real examples get messy, and just add to the confusion.

But real issues show up due to fundamental problems with "is-a": Even if an X value "is-a" Y value, an X variable is not a Y variable (because it can't hold all objects of type Y). So passing a mutable object reference to a function is fundamentally different than passing an immutable object -- but inheritance hierarchies treat them the same.

You can get around this problem by not using inheritance hierarchies that work that way, or by always using immutable objects (value semantics). But I pretty much consider the Java/C++-style inheritance to be a mess.

comment 12y ago · link · parent

Does static typing have inherent costs?

For instance, there are some desirable properties often present in dynamic languages like hot code loading, or the ability to make code updates independently. Not many statically-typed systems are good at these things, or at least the static typing doesn't work well across boundaries (like a network, etc.).

Can these be reconciled? Can something have all of the benefits of, say, haskell and erlang at once?

comment 12y ago · link · parent

"what is unsound is supporting mutations that alter identity"

EDIT: included code for clarity

I can make essentially the same example with concrete entities that exist in time and space, as well:

    void f1() {
      GasolineVehicle vehicle(myEngine);
      f2(vehicle);
      cout << vehicle.getMPG() << "\n";
    }
    void f2(Vehicle &v) {
      if (...)
        v.setPropulsionDevice(myMotor);
    }
After replacing the engine with a motor, MPG no longer makes sense.

At the time you're writing the Vehicle class, it seems perfectly reasonable to define a setPropulsionDevice() method, and there's no hint that calling it would change the vehicle's identity. Only when you define the subclass does it turn into an identity problem, but then it's too late.

Also, if you think the Circle/Ellipse example is not compelling enough, how would you structure those two classes? Would one inherit from the other, and if so, in which direction?

comment 12y ago · link · parent

"'Dog is-a Mammal' ... actually fairly sound"

I disagree in the context of OOP inheritance.

(This example uses shapes, because the idea of mutating mammals gets a little strange.)

Let's say you have a Circle class and an Ellipse class. A Circle inherits from an Ellipse, of course, because a Circle is-a Ellipse. By specializing as a Circle, we get extra reader methods such as getRadius(). Great.

But what about mutators? For an Ellipse, it may have a mutator called squash() that holds the major axis constant and halves the minor axis. But that leaves us with a problem, because circles can't be squashed while remaining circles.

Let's say we have a program like:

    void f1() {
      Circle myCircle(10.0);
      f2(myCircle);
      cout << myCircle.getRadius() << "\n";
    }
    void f2(Ellipse &e) {
      if (...)
        e.squash();
    }
Inheritance says that f2 must also accept a Circle. But what happens when we try to squash it? We can either throw a runtime error there, or we could let the squash succeed and the getRadius() in f1() will fail.

Although a Circle value is an Ellipse value, a Circle variable is not an Ellipse variable. In fact, inheritance for variables should go in the opposite direction as inheritance for values, because an Ellipse variable can certainly hold a Circle value.

comment 12y ago · link · parent

"Thanks, I updated the post... In Postgres, it behaves as a DELETE without a where clause..."

I think there may still be some confusion. DELETE is an O(n) operation that actually examines the tuples; TRUNCATE is an O(1) operation that doesn't look at any tuples.

comment 12y ago · link · parent

"People arguing that X "is too powerful""

Who is arguing that?

comment 12y ago · link · parent

"So next time when you criticize macros"

I wasn't criticizing macros; I claimed that they don't give you much guidance to any particular convention because you can do anything.

A language without conventions is incomplete, so you need to do something active to bring the conventions about. In other words, the designers of lisp leave conventions as an exercise for the reader and really offer no guidance from the language itself.

Clojure and racket are trying to address that, which is good. I've played around with them a bit, generally found them pleasant, and I hope they succeed (though I did not find anything that would compel me to actually use them for the kinds of things I work on).

It's interesting that you bring up C++. I wonder what your feelings are about people who prefer C over C++?

comment 12y ago · link · parent

Although I largely agree, I think that line of thinking can be taken too far.

One reason I think that is because syntax helps develop conventions and make them obvious. If everything is an s-expr and you can do absolutely anything with macros anywhere, then two programmers might not really be able to communicate even if they are technically using the same language.

comment 12y ago · link · parent

"[TRUNCATE] does, in fact, release the disk space immediately — immediately upon COMMIT"

Technically not, because postgres may still hold an open file handle until the next checkpoint. From a practical standpoint that's not an issue, except that it can cause confusion if you are monitoring disk space very closely.

But you are right that he is pretty far off: there is no need to vacuum and it's an O(1) operation.

comment 12y ago · link · parent

"In Postgres, [TRUNCATE is] a DELETE without a where clause."

That's not true. Although it does obey some transactional semantics to avoid very strange things, it ultimately replaces the underlying files with one empty file.

So, TRUNCATE is an O(1) operation and there is no need to VACUUM after a TRUNCATE.

"Bitmap indexes are awesome, but good luck figuring out how to make them turn on."

They are enabled by default, and I've noticed that the planner is actually pretty aggressive about choosing them, so this one surprised me. There are cases where the planner can't choose a bitmap index scan plan, or maybe where it can but is just way off, but without an example it's hard to explain (or improve) the situation.

comment 12y ago · link · parent

I was already with you on the other points. And, technically, you can look at a relation as a dynamic homogenous map, and that's not wrong per se.

But there seem to be some relevant points left out.

First of all, a relation is a set of tuples. You can say that a set is just the degenerate case of a dynamic homogenous map in which the values are empty and you use only the keys. That seems like a useless generalization though, and more likely to cause confusion than clarity.

Let's say you have a simple relation of person to product: this person has bought this product. It would be awkward to try to group them like: "this person has bought these products" because you could just as well invert it to "this product has been purchased by these people" and there's not a good reason to choose one over the other. Making it arbitrarily asymmetrical just makes it harder to reason about, so that's not a good choice. And neither attribute is unique. So, you are left saying that the key is {person, product} and the value is empty (or "unit", if you prefer).

And yes, that is the key of the relation, so that's not wrong. But what have we gained through this exercise? We are calling a binary relation a "map", but confusingly it's not a map of the first attribute to the second -- it's a map of both attributes to nothing!

You could say that relations representing something more map-like are common enough. But even in that case, it's common to have multiple candidate keys (which can be true even for normalized relations), and it's hard to say what's mapping to what. Again, more confusion than clarity.

I think it's best to just call a relation the set of all tuples which satisfy the relation predicate. That's the model.

comment 12y ago · link · parent

I don't follow how a relation is a "dynamic homogenous map". Can you elaborate?

comment 12y ago · link · parent

But your body constantly repairs, too, right? So maybe it's able to repair a few errors, but gets quickly overwhelmed during a CT scan?

comment 12y ago · link · parent

It's not the grammar footprint that makes it a large change. It's that a lot of people will change the way they write erlang programs now that maps exist.

comment 12y ago · link · parent

http://www.usbr.gov/lc/yuma/facilities/ydp/yao_ydp.html

That says the plant is not currently operating. It also says that it's only "included" in the water sent to Mexico. I don't see any indication that it's used for anything close to the full volume of the Colorado River.

1
656667
87