7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions
comment 12y ago · link · parent
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.