HNHacker News
TopNewBestAskShowJobs

hp

730 karma · joined November 11, 2010

http://ometer.com/
submissionscomments
hp··on HOCON – Human-Optimized Config Object Notation
there's also a little blurb at https://github.com/typesafehub/config#rationale-for-supporte...
hp··on HOCON – Human-Optimized Config Object Notation
I think this is reasonable in some contexts but it depends. Often the configuration is done by a different person or in a different context than the development. The configure-er may or may not be a programmer and the deployment environment may or may not have xyz programming language available, etc.

The JSON superset aspect nicely supports spitting out JSON from a script when people want to do it that way.

HOCON is nice when for example you just want to sub in a couple of env variables or avoid a little cut-and-paste.

hp··on HOCON – Human-Optimized Config Object Notation
https://blog.ometer.com/2015/09/07/json-like-config-a-spectr...

I wrote HOCON and also the above comparison post.

hp··on HOCON – Human-Optimized Config Object Notation
I designed the HOCON format.

Here is my take on the why not JSON / why not YAML questions: https://blog.ometer.com/2015/09/07/json-like-config-a-spectr...

Short answer is "UX"

There's also a historical reason, Play Framework and Akka had both invented ad hoc formats, HOCON replaced both. The ad hoc formats added things like includes and substitutions but in regex-hack type of ways. So HOCON was cleaning those older parsers up with a single actually-documented format.

hp··on How to Write Portable C Without Complicating Your Build
You can run pkg-config yourself, the m4 macros are just for convenience. Look at the shell the macros expand to to see how to do it.

Though I don't see the point in reinventing your own build system, exactly. Some people I trust seem to be getting into Meson these days but I havent tried it.

hp··on What Killed the Linux Desktop (2012)
I agree. Many mistakes would have been fine if there was a compelling reason for users to switch. Linux has been successful when it found a greenfield space: Android, Chromebook, x86 servers. The open source aspect isn't magic, it won't make "clone knockoff in an existing space" into an interesting product.

This was the root cause, "a new desktop" presupposes the existing product category "desktop" which was a solved problem and a mature market. Runaway marketshare required NEW categories.

ABI compat and hardware support are hygiene features; they can slow adoption, but solving them doesn't motivate adoption. Linux needed the motivator; that would have then funded solving the hygiene stuff - just as it has, at least well enough, for x86 servers, Android, and Chromebook.

I don't say this with 20/20 hindsight either. I made this point loudly both inside GNOME and inside Red Hat back in the day. We even had chromebook-type proposals. But the Linux companies at that time were too small and server-focused to undertake such things, and once ipad/chromebook/android were out, there wasn't an obvious opportunity anymore for "Linux" proper.

Still, "Linux desktop" continues to work well for me and millions of other developers daily and I think it's very good for a dev workstation, as long as you buy hardware with OEM-developed open drivers (which mostly means Intel parts).

A lot of people who find it doesn't work for them are doing the equivalent of running OS X on non-Apple hardware with hacks to modify the finder, and surprise it's buggy. Granted, in the Linux world it isn't so clear what the "supported configuration" is. But think boring: default config of a major distribution with all open source drivers...

hp··on The Linux 2.5, Ruby 1.9 and Python 3 release management anti-pattern
Yep. it works well. https://wiki.gnome.org/ReleasePlanning/TimeBased
hp··on Liblfds, a portable, license-free, lock-free data structure library written in C
Legally "all rights reserved" is the default, until/unless you follow the legally appropriate ceremony to disable it. If you get the ceremony wrong in some way then you're back to "all rights reserved" in practice, regardless of intent.

CC0 contains the lawyer-developed appropriate ceremony to do what you want here, including handling weird jurisdictions. The way you've phrased it will confuse the lawyers and may or may not "work" legally speaking.

There are instructions on the CC site about how to apply CC0 to a project. CC0 was developed for precisely this purpose.

hp··on Is license-free a good idea?
This "license-free" text is a lot of needless confusion that will only serve to complicate anyone's life who needs to show this to a lawyer.

The project could avoid the term "license free" and follow the guidelines for applying CC0 here for example: https://wiki.creativecommons.org/wiki/CC0_FAQ#How_do_I_apply...

The CC0 dedication itself is available in summary form https://creativecommons.org/publicdomain/zero/1.0/ and full legal form https://creativecommons.org/publicdomain/zero/1.0/legalcode

CC0's full legal form includes a "fallback license" in jurisdictions where public domain isn't permitted.

A piece of software can be public domain (which does mean you don't need a license to use/modify/redistribute it), or it can have a permissive license, or a choice of multiple licenses.

If "license free" means public domain, use the proper term, and use the suggested text from CC0 (written with a lawyer's help).

If "license free" means there's a choice of licenses, then offer a choice of licenses.

If something is not public domain, then "there is no license" normally means the default license, which is "all rights reserved" - everything is prohibited. For that reason, the term "license free" kind of implies the opposite of what this project intends.

Don't reinvent the legal wheel... especially when the CC0 dedication is already the exact thing you want to say.

hp··on Ask HN: What are examples of GitHub repositories with high code quality?
Seconded, it's a clean well-documented API with an implementation that's easy to read.
hp··on Why I'm Choosing C++
If you need a bunch of library features not found in the C standard, you could switch languages or you could ... use a library. "Use language builtin hash table or write your own hash table" are not the only two options as this article suggests!

Quite a few hash tables out there, and very complete standard-library-like utility libraries too. (aside: failure to use one of these is a major cause of bad, bug-ridden C code, containing for example calls to dangerous old-school string API from the standard library. If your C is of any size and you don't have a good string abstraction you are doing it wrong.)

There are lots of circumstances where I'd use something besides C, for sure. But if I was using C for a good reason, and needed a hash table, in most cases I would not write my own.

hp··on Autotools Mythbuster
Historically they have supported a lot of things the others didn't or didn't easily support: cross-compilation, changing the prefix/libdir/datadir, creating tarballs, "distcheck" to automatically check the tarball works, libtool, etc. Also lots of Linux tools are built around autotools, for example it's much much easier to rpm-ify or deb-ify an autotools tarball. Another example, there's gettext integration for autotools, automated tools for translators might rely on autotools, etc.

I'm probably listing the tip of the iceberg as far as network effects. In the Linux/Unix world, autotools is (or at least historically was) what everything and everybody knows how to deal with, and non-autotools is annoyingly nonstandard.

Your gyp link there says for example that its main goal is IDE support; a total non-goal for autotools. Unix/Linux C developers largely do not use IDEs. And the autotools goals probably aren't in gyp's list of priorities. So while they both "build the project" they have pretty different goals.

The autotools goals don't always make sense anymore. For example the historical idea that the shipped tarball would only depend on POSIX sh and not on any other binary made a lot more sense when people were hand-compiling stuff on their HP-UX than it does today where most binaries come from distributions.

If you're building a package mostly for Linux and maybe OS-X-as-Unix-compatible, especially one in C/C++ and open source, autotools probably still has a lot to recommend it.

hp··on Cello High Level C: A Fat Pointer Library
all I'm saying is that "not hard" as you put it and "30% more code, transactions, and a complicated test harness" don't go together for me. If they do for you then enjoy :-)
hp··on Which language has brightest future in replacement of C between D, Go and Rust?
Usually you have to use C when a large runtime (GC, rich standard library) is going to cause a problem. One common case of that is when you're making a least common denominator library that would be called by multiple higher-level languages. Other cases are embedded systems or when you need to micro-optimize.

That's why I think Rust is promising because "no GC" is often a reason to use C. You don't want two GC's that can see the same objects (unless you like leaks) so if you're writing code to be exported up into higher level languages, you don't want a language with GC.

hp··on Cello High Level C: A Fat Pointer Library
The reason it's hard is that everything you do has to become a "transaction" with the ability to roll back. Say you send five messages in a function, now you have to pre allocate all of them in order to cancel them all if any allocation fails, before sending any. But this pre allocation tends to break abstraction barriers (every API might need separate "prepare" and "fire" calls). It doesn't sound that complicated at first but it gets that way in a hurry. Almost every function can fail, every operation needs the ability to rollback midstream... it makes a mess in a hurry.

It's also a LOT of extra code, really material bloat.

One experience I had doing this: http://blog.ometer.com/2008/02/04/out-of-memory-handling-d-b...

If you haven't written the test harness to test almost every malloc failing, you might think this is easier than it really is.

Adding 30-40% more code to your code base that will almost never get tested except maybe by your unit tests ... no thanks, not if it's possibly avoidable for a given application.

hp··on “DBus is seriously screwed up”
It's Linus being hyperbolic. Read follow-ups in the linux-kernel thread to see more specifically what these benchmarks mean.
hp··on “DBus is seriously screwed up”
I would call it "dbus performance overhead is userspace library AND context switching" See: http://article.gmane.org/gmane.linux.kernel/1939651

Or really, it isn't "context switching"; it's that there's the bus daemon in the middle which multiplies the userspace library overhead by 2, since messages are read and written twice as many times if you have the daemon in the middle.

Speeding up read/parse and marshal/write is completely separable from doing fewer read/parse marshal/write operations. Two different performance issues that aren't related as far as I can tell.

hp··on “DBus is seriously screwed up”
Linus is mixing together two different performance issues.

http://article.gmane.org/gmane.linux.kernel/1939651

kdbus is solving an "architecture" issue that would affect any binding, while his profile is essentially of the gdbus binding.

hp··on “DBus is seriously screwed up”
Here is the long version of that point: http://article.gmane.org/gmane.linux.kernel/1939651
hp··on “DBus is seriously screwed up”
kdbus really addresses a different performance issue than tuning mallocs and locks would. By tuning mallocs/locks/validation/parsing, you can reduce the overhead of each dbus send/receive, but with kdbus you remove half of the send/receives. So however fast your sends/receives are, kdbus will still make things faster by not doing as many of them.
hp··on “DBus is seriously screwed up”
The Linus profile is mostly a red herring here, because it is 1) a bad benchmark with a bunch of blocking round trips and 2) mostly profiling the gdbus bindings which are just one binding.

For a more in-depth performance discussion of dbus, check out http://lists.freedesktop.org/archives/dbus/2012-March/015024...

Above noted on linux-kernel here: http://thread.gmane.org/gmane.linux.kernel/1930358/focus=193...

hp··on “DBus is seriously screwed up”
the trace isn't dbus itself, it's a particular client program using the gdbus binding. The gdbus binding uses a lot of malloc and threads, and this particular client program is all blocking round trips.
hp··on DBus, FreeDesktop, and lots of madness
It's probably straightforward to write an HTTP server which exposes everything on the bus as an http API, if someone wants a free project idea.
hp··on DBus, FreeDesktop, and lots of madness
I should have mentioned here earlier, the original thought with dbus was that nobody would use libdbus directly; KDE would use an API more or less exactly like DCOP and GNOME would use soemthing like gdbus. For that reason, libdbus was lowlevel and flexible in a way that made it annoying to use - convenience API in libdbus would have been bloat.

What actually happened is that the high-level wrappers didn't get written for a long time because libdbus was just good enough that people didn't bother to work on alternatives. So that sucked, but it does seem to have finally been sorted out and libdbus is now on the way out AIUI.

hp··on DBus, FreeDesktop, and lots of madness
That question is like asking "can you tell me something the Twitter API solves that http does not?" - it doesn't make any sense. They are distinct layers. One builds on the other.

http+websocket is a way to set up a full-duplex stream of messages where messages are anything you like.

dbus does have that part, but then it defines additionally what the messages actually look like in enough detail to bind them to method calls; it defines semantics such as guaranteed ordering and errors; it defines a central bus daemon; it adds broadcast messages over the daemon; it adds security features to allow mixing user and system domains; it adds a way to locate the bus daemon; it adds a way to launch and track the lifecycle of named processes; etc, a number of other APIs. It is not just a socket.

Could you implement a dbus-equivalent using http? Sure. But http does not include a "free" implementation of dbus, any more than it includes an implementation of Twitter.

dbus-on-http would have to define how method signatures and types map into http, and then it would still have to actually implement the daemon with its features and semantics.

http wouldn't make any material difference here; it would have some bikeshed-level pros and cons, but not change the system design in a material way.

hp··on DBus, FreeDesktop, and lots of madness
If I had touched any of this stuff in years I might treat it that way in part (after expressing annoyance), but I'm not currently involved - my ssh key probably doesn't even work anymore, but if it did I'd still go through the current maintainers like anyone else because I haven't been keeping up with the latest.

The current people doing this kind of work deserve non-abusive informed criticism. It isn't OK to post a long diatribe of BS and then expect people to take it as if it were a helpful bug report. It isn't helpful. It's jackassery and unacceptable and this kind of abuse has done more damage to Linux than anyone knows.

It is entirely OK to ask questions or file bugs without sending patches. Just don't be an ass about it like this article was.

hp··on DBus, FreeDesktop, and lots of madness
Switching dbus to websocket/http instead of its own outer layer equivalent would get you about 1% done implementing dbus. It doesn't address or answer 99% of why dbus exists or what it does.

So it's a fine thing to consider (since websocket exists now) but I'd question the word "just" here.

It's like saying the way you'd implement an Amazon web service would be to "just use http." OK. Now what is the service? ;-) I hope that makes sense.

It's a mistake to view the problem solved here as "sending messages." The problem is all about the semantics of sending them and the lifecycle services provided by the central daemon.

hp··on DBus, FreeDesktop, and lots of madness
This probably deserves a long blog post or something (maybe I already wrote it somewhere) but here's a teaser.

dbus is not mostly about IPC.

Linux desktops, including gnome, KDE, and those before them and alternatives to them now, use a "swarm of processes" architecture. This is as opposed to an alternative like smalltalk, Eclipse, Firefox, or Emacs where lots of plugins are loaded into one huge process.

Problems common in server side IPC which aren't as big an issue here: scalability; network partitioning; protocol interoperability.

Problems which are more of an issue: service discovery (can't just use DNS); tracking lifecycle of other processes; inherent singleton, stateful nature of hardware, the kernel, and user interfaces.

The main way dbus helps with this is the star topology with a daemon that can start on demand and track all the processes. IPC is then coordinated with this in such a way that race conditions can be avoided, for example you can start a service and send it a command without a race that your command arrives too soon.

Anyhow this is just enough to get an interested person tracking down the details, I'm not spelling it out obviously.

hp··on DBus, FreeDesktop, and lots of madness
Why engage is a good question :-) I had the misfortune to see a link on Twitter and discover people were wrong on the Internet.

I do think there's useful stuff to learn and discuss here about software development and dbus itself if people dig in and understand it. Perhaps some bystanders will learn something.

I welcome improving and even disrupting and replacing dbus but I don't think the kind of criticism found in this article will lead to that.

hp··on DBus, FreeDesktop, and lots of madness
In creating dbus, I talked to a bunch of developers at KDE, specifically those who worked on Qt and DCOP, about their requirements. Then I met the requirements they said I had to meet for them to use dbus. I did the same for developers at GNOME. Because dbus met the requirements that the actual decision-making developers had, and allowed them to do useful things, it was adopted.

There was no mechanism to strongarm anybody into anything. KDE and GNOME devs told many ideas and many people to take a hike over the years. dbus was simply a matter of figuring out what those developers wanted and focusing on solving the actual problem, rather than hypothetical or philosophical problems.

When dbus was adopted, remember, people had already been down many roads; ad hoc IPC mechanisms, ad hoc communication through files and timestamps, hacks over X11 protocol, DCOP, multiple implementations of CORBA, SOAP, ICE (the old X-associated one), etc. People had wrestled with this problem space a lot and they had some pretty developed ideas about how to do things ideally. dbus was about coalescing those ideas into running code, and that was successful and stuck for a decade-plus now.

People sometimes have a "wtf" reaction coming from Internet protocols or kernel concerns, and while there are some wtf-worthy details in any piece of software, lots of the time people just don't understand the problem. Just as GNOME and KDE both took years to understand it and flailed around with all those protocols that didn't work out well.

← PreviousPage 2 of 4Next →