4 ms·
Not sure what "push at Google" means. For full context: the idea to use Prolog came from the project founder. In retrospect, it was a terrible idea, because alm
by hanwenn 3y ago
Not sure what "push at Google" means. For full context: the idea to use Prolog came from the project founder. In retrospect, it was a terrible idea, because almost nobody knows or likes Prolog, and that includes the SWEs at Google both on my team, and the ones configuring Gerrit.
(I run the team that works on Gerrit at Google.)
- ahefner 3y agoI understand in practice that "nobody knows or likes Prolog" is a valid criticism, but was it a sound idea technically?
- bbor 3y agoI'd say "we don't have the human resources to support the development of this system in the long term" to be a pretty valid technical reason. Remember that we're engineers, not scientists -- the goal is efficacy
- hanwenn 3y agoSubmit blocking is not only a feature targeted at admins (they configure how submit criteria), but also for users: users have to know if their change is ready to be submitted. IIRC, The result of a failing Prolog rule was a single string, which would surfaced to the user. It was often impossible for users to understand why that condition triggered and what they could do to address the issue. On a technical level the idea was also flawed. The Prolog interpreter had to be constrained (to avoid infinite loops), with hardcoded recursion limit. This meant that adding one Prolog rule too many could trigger a failure in the interpreter which would then throw 5xx errors and wedge the server.
- YeGoblynQueenne 3y ago>> The Prolog interpreter had to be constrained (to avoid infinite loops), with hardcoded recursion limit. Oh well that sounds like bad coding, definitely. You may run into that sort of problem -infinite recursions- the first few times you code in Prolog but you learn to avoid it, just as you learn to avoid infinite do-while loops etc. Btw, since you mention the server being wedged, a few years ago I was working at a C# shop and there was an incident where _all_ our deployments died because of an infinite iteration. Some code was missing its exit condition from the loop and since this was on our platform which had the common functionality, it affected all our clients. There was a meeting upstairs, inevitably. When the development team head returned from the meeting he told us that he had explained what happened and the upstairs had decided that we should no longer use iteration because it risked going haywire, as we had just seen. The alternative? Use recursion instead. In C#. Obviously nobody ever complied with this stupid idea. But you can bring down a bunch of servers very easily in any language you like. Another time, in the same company, there was an infinite recursion now, created in the web templating language we used, an in-house version of django. That was a bit unexpected. In another job, I got some gentle ribbing from colleagues for sucking up all the juice from the database servers with an inexpertly written SQL script. And so on. I mean, people say sometimes that all that stuff about the halting problem is purely theoretical and so on, but then non-termination bites you in the boogies and you're left with egg on your practically-minded, results-oriented face.
- bjackman 3y ago> You may run into that sort of problem -infinite recursions- the first few times you code in Prolog but you learn to avoid it But almost all of the people configuring Gerrit submit predicates are doing so as their first and only Prolog experience. They are not the authors of Gerrit or even the owners of the server instance.
- YeGoblynQueenne 3y agoIn that case the idea was not flawed "at the technical level", but at the personal level. Like I say in another comment, a good engineer never blames her tools- especially so when PEBKAC, yes? To make yet another analogy, I know almost no C++. If you asked me to write some C++ templates to configure your system, I'd probably make a very big mess. Despite the people saying that they're a bit like unification and so on. I just don't know how to use them. So don't ask me to. And don't ask your users who don't know Prolog to use it. That's a bad project management decision. Also, friendly advice: configuration predicates in Prolog should _never_ _ever_ _ever_ be "rules"; only "facts". That way you don't risk infinite recursions- or run much risk besides. The same goes for any other language I think: don't let the configuration execute arbitrary code or you're in for a surprise, inevitably.
- xlii 3y agoWhat I mean by it: Someone advocated for the solution (it ended up part of a product) and since now it's deprecated those advocacy efforts weren't successful enough to induce adoption. By your words there seemed to be only a single person, but from outsider's viewpoint its impossible to say how big push there was. "Nobody knows or likes Prolog" is exactly the reason why I refrain from using Prolog in professional environment. I can use it, I like it, but unless I have full team of people committed it's an empty effort (even harmful). So yeah, if smart people failed to convince other smart people, there's something wrong with it. And in my view is people don't get to like it because current sources aren't good enough. There is documentation but it's not clear what the target solution scope is (and rarely people professionally implement Sudoku solvers), what the benefits are and what are the success stories.
- YeGoblynQueenne 3y ago>> So yeah, if smart people failed to convince other smart people, there's something wrong with it. Maybe those weren't very smart people, after all? I mean we only have Google's assurances to go by, that they are the place where brilliant people go to feel mediocre etc, but doesn't that sound like a pick-up line, that would put off most people who don't consider themselves dumb? Also: a good engineer never blames her tools.
- tannhaeuser 3y agoSo what is the replacement for Prolog as language for commit rules in Gerrit? Some Java DSL such as Drools, seeing as Gerrit went from Python to Java (and supposedly from gwt to other toolkits since)? Or some ad-hoc scripting for whatever language is used by the codebase managed in Gerrit (such as idk checkstyle for a Java-based project?). The latter case would be kindof understandable since templates/common configs for checkstyle (and alternative systems) are very common. But I'd imagine a Java parser in Drools would be infeasible compared to Prolog, and in any case absolutely unmaintainable. Maybe the problem was that the Java parser wasn't updated for current Java versions? I don't know, since nobody is using Gerrit for self-hosted git management compared to gitlab, bitbucket, and co. Without context, the argument "nobody knows Prolog" is pretty lame tbh, especially coming from Googlers.
- hanwenn 3y agoOne can write conditions using the search query language, see https://gerrit-review.googlesource.com/Documentation/config-submit-requirements.html#examples https://gerrit-review.googlesource.com/Documentation/config-...