HNHacker News
TopNewBestAskShowJobs

how_gauche

224 karma · joined July 27, 2008

submissionscomments
how_gauche··on Git is a purely functional data structure (2013)
> A data structure cannot be functional. I understand what he's trying to say, and agree with most of it, but the word "functional" is purely wrong. What he wants to say is "good". But not all "functional programming" is good, nor is all good programming functional by necessity, despite what your local Lambda The Ultimate nerd tries to tell you.

Why is it that whenever functional programming comes up, "real programmers" come out of the woodwork to bloviate, only to expose just how little they actually know about the topic?

"Purely functional" in this case is a jargon term that relates to Okasaki's 1996 PhD thesis, available online (https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf). It's a classification for data structures much in the way "regular" or "context-free" or "turing-complete" serve as classifications for grammars.

For a data structure to be "purely functional" (and no, article author does not mean "good" here) simply means that it's implementable in a pure functional language without mutation. Examples of non-functional data structures would be ones where mutation is intrinsic to how its algorithms work: traditional linear probing hash tables, union-find for graphs, etc.

By this technical criterion, the git object graph is clearly a purely functional data structure, sorry.

how_gauche··on Designing a Tree Diff Algorithm Using Dynamic Programming and A*
Similar dynamic programming idea from Zhang + Shasha 1992: http://www.cs.nyu.edu/shasha/papers/treebook3.pdf
how_gauche··on Debian Dropping the Linux Standard Base
> I am still to find a sys admin that likes systemd.

Here's another one: I spent 18 mos in Google Site Reliability Engineering (and did a lot of pager work at startups before that) prior to transferring to software engineering, I think I can speak to both perspectives.

Systemd is incredible and is a huge advance in maintaining linux systems. It boggles my mind that anyone could compare it to what we were all doing before and walk away saying: "nah, I'll stick with the stringly-typed shell scripts and the stale pid files, thanks."

Specific technical reasons in favor /for sysadmins/:

- unit files are rigidly structured data and this is a Good Thing. Configuration is not code. Unit files are also very easy to write.

- systemd understands cgroups and manages them properly. Every single critique I've seen of systemd is from someone who either doesn't understand cgroups or doesn't realize why they are so useful and important. Cgroups manage jailing, process isolation, resource control (CPU shares, memory limits, block io shares, etc), privilege separation and dropping, etc., and this is all configurable by systemd using simple and declarative unit file directives. Like it or not, we are moving into a containerized world.

- machinectl is already useful for managing VMs and will only become more so as it matures.

- people shit on the systemd journal, but, I'm sorry -- you're wrong about this too. Structured binary logging is simply more efficient for this problem, both on the write and on the query side. The journal also can integrate with the systemd journals running in any VMs or containers running on your system, so you can get a unified and metadata-tagged logging stream of everything happening on the host

- socket activation enables zero-downtime restart/deployment for network services, any incoming connections to the port will be added to the listen queue by systemd before the target system comes back online

how_gauche··on Genuinely Functional User Interfaces (2001) [pdf]
This paper isn't from 2011, it was presented at the 2001 Haskell Workshop.
how_gauche··on Woo: Fast HTTP Server in Common Lisp
The reason people care about speed here is the reason people care about speed in all infrastructure projects: every millisecond of the timeslice spent doing work inside the transport is a millisecond you're not accomplishing application logic. Efficient http code lowers distributed system latency and saves power.
how_gauche··on 'I was bullied and beaten every day. Programming saved my life'
> if anyone has successfully overcome this please reach out!

I was bullied a lot when I was younger. I was small to begin with, but I skipped a grade and consequently hit puberty about 18 months behind all of the other kids. Growing up in a rural area, I endured a lot of abuse and violence on a daily basis, and like the typical story goes, teachers saw most of it and did nothing.

The physical abuse stopped at the end of eighth grade. We had a year-end party and all of the jocks were bullying me as usual. This other kid, who was the only one about my size, decided that he would join in the hazing this day. I guess he had his own reasons for wanting to fit in. TL;DR I snapped and beat the piss out of him. Surprisingly, I wasn't disciplined or punished for this at all, which would probably never be the case in "zero-tolerance" Canada today. The teacher was very nice to me (I was crying and shaking for what felt like an hour afterwards) and drove me home herself. I think maybe she felt bad that she hadn't intervened earlier.

I moved away after the next year, but the few friends that I had back then (the other outcasts and nerds) told me much later that things got better for them in the following years. I guess most kids get over bullying once they get a little older. These episodes left scars on me that will probably never completely heal, but I feel now that as a 34-year-old man I've long since moved past it. I'm relatively well-adjusted and socially-aware now (this took years of work in my late teens and twenties, you don't get a chance to develop critical interpersonal skills when you're a group hazing target), and I haven't let myself be permanently handicapped by the bullying that happened to me. So: things can get better.

As for how I did it, honestly the biggest thing is "fake it till you make it". Pretend to be the confident person that you would like to be, even if it feels forced or fake, or like a role that you're playing instead of your loathsome putrid self. People do respond to charm and confidence -- if you play the role well then things become less difficult over time, and you realize that the only thing that was holding you back was fear before. Over time you can really change the way that you feel about yourself, and you won't need to pretend anymore. It's possible! Amy Cuddy gave a well-regarded TED talk on this topic (http://www.ted.com/talks/amy_cuddy_your_body_language_shapes...), it's worth viewing.

The other thing I did that I feel really helped me was to increase my level of physical exercise. When you're bullied all you want to do is withdraw into yourself behind a protective shell. Lots of bullied people end up living in the mind for this reason, I know I did (and boy am I glad for it in retrospect --- those Commodore 64 programmers' manuals didn't read themselves!). Not a great strategy going into adulthood however. You inhabit a physical body moving through space and getting better at doing that has knock-on effects that improve lots of other parts of your life, besides just looking better: stamina, mood, posture, body language, etc.

Sorry for the mega-post.

how_gauche··on What's new in purely functional data structures since Okasaki? (2010)
It's the best book about data structures in functional programming, as relevant today as when it was published almost fifteen (gasp) years ago.

You can get a flavor of the book by reading Okasaki's PhD thesis: http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf

The book is essentially a fleshed-out version of this thesis.

how_gauche··on Web Framework Benchmarks Round 4
It's still several months away from being released.
how_gauche··on Why is Linux more popular than BSD?
PLEASE tell me you didn't just compare monochrome output from "ls" with female genital mutilation. Please.
how_gauche··on High-Performance Web Applications in Haskell
A system upgrade borked the server, sorry (i.e. libev got upgraded from libev.so.3 -> .4 and I had to relink the server).
how_gauche··on "Google asserts copyright, even on work I do in my own time." (Snap framework)
Yes, when Oracle buys Google the absolutely bog-standard BSD license text accompanying this open source project will spontaneously transmute into a mystical poem written in ancient Aramaic. This poem, when read backwards, will summon the demon Yog-Sothoth from the depths of Larry Ellison's underpants to remove my right to use the code however I wish provided I retain the copyright message and license text somewhere in the accompanying documentary materials.

Oh wait: no it won't.

how_gauche··on "Google asserts copyright, even on work I do in my own time." (Snap framework)
In the case of a single author, the copyright holder has all the same rights he/she used to have (including to re-license under a proprietary or different open source license), except the right to revoke the open-source license already granted to people who have obtained the source.

In the case of multiple authors, the legal rights of any one contributor are significantly curtailed. Unless they vote with unanimity, the license cannot easily be changed: contributor X has licensed her code to contributors Y and Z (and everyone else) under BSD licensing terms, and it cannot be relicensed without her consent unless her contribution is completely excised from the project.

Even then, the waters can become murky because most code cannot just be deleted from a project, other code grows organically into and around it, so the line between what constitutes a "derivative work" and what doesn't can become really blurry.

how_gauche··on "Google asserts copyright, even on work I do in my own time." (Snap framework)
Yes, stuck forever, because there is absolutely no way I could pick up a telephone and have a pleasant conversation with the person responsible for making that decision. He lives in a cold granite tower guarded by dragons and evil wizards. And snakes. Thousands of poisonous snakes.
how_gauche··on "Google asserts copyright, even on work I do in my own time." (Snap framework)
Re: your ridiculous "some animals are more equal than others" claptrap: the reason I gave Google its own line in the license file rather than adding it to CONTRIBUTORS like all of the other copyright holders (myself included) is because Google is not actually a code author, it is a legal entity which happens to own copyright to some of the contributions made by one of the contributors.

The English-language text reads:

Copyright (c) 2009, Snap Framework authors (see CONTRIBUTORS)

Copyright (c) 2010, Google, Inc.

Putting Google in the contributors file would be inaccurate because that list is for people who have put code into the project. It is a difference in categorization and essentially I am saying "the copyright to this code is owned by these people and this corporation".

how_gauche··on "Google asserts copyright, even on work I do in my own time." (Snap framework)
Given that fully three quarters of the comments I've read can be paraphrased as "isn't it mean for the big bad multinational to steal the poor hacker's code just so he can get a paycheck", over a one-line commit message, it most certainly IS about me.

Maybe not personally -- clearly almost nobody gives a rat's ass about me, or about Haskell code in general for that matter -- but I'm just a little exasperated by being used as a proxy cudgel to wield against my totally reasonable employer, when the people who are sniping from the peanut gallery really have no idea what the legal situation is, what I have or haven't agreed to, whether I have done this voluntarily or under coercion, etc etc.

It is nice that there is some reasonable discussion coming out of this thread about the law and industry practices re: intellectual property vis-a-vis programmers, but for the most part I am pretty disappoint.

how_gauche··on "Google asserts copyright, even on work I do in my own time." (Snap framework)
Hello,

I see the righteous indignation engine is fully spinning up on my behalf. No need: I can take care of myself, thanks. I posted this on the github thread, but:

* Google has a slightly paperwork-heavy process I could have gone through to retain copyright on further contributions to this project

* I chose not to use it in lieu of using a paperwork-free process which involves me assigning copyright to MY contributions under a Google copyright

* I am quite happy with this situation, from a de facto standpoint my day-to-day life is completely unaffected

* because the code is BSD-licensed and it REALLY doesn't matter.

...but if railing against the "man" is making you guys happy, then by all means, continue?

how_gauche··on "Google asserts copyright, even on work I do in my own time." (Snap framework)
I don't work in California.
how_gauche··on Time Travel with Git for TDD
So if the ritual components aren't spelled out in the version history in exactly the right order, the voodoo spell doesn't work? Or is your OCD just wasting a bunch of your time?
how_gauche··on Snap: A Haskell Web Framework
I personally like http://hackage.haskell.org/package/HStringTemplate for that.
how_gauche··on Snap: A Haskell Web Framework
> Check out attoparsec-iteratee http://hackage.haskell.org/package/attoparsec-iteratee for an example of iteratee usage: it turns a fast bytestring parser into one that's based on iteratees, which will probably end up being even faster.

Iteratees don't really make things "faster" (you end up with a sequence of imperative read()/write() calls just like everything else), but they allow you to stream in O(1) space while still being easily composable.

For example, we do gzip, buffering, & chunked transfer encoding using simple function calls, and we don't really have to worry about explicit buffer management or control flow while we're doing it.

how_gauche··on Snap: A Haskell Web Framework
Sorry you feel that way, at least it's optional. The idea is that we are interesting in doing DOM-level transformations bound to html tags and there just isn't a robust HTML5 DOM parser available for Haskell.
how_gauche··on Point-Free style: What is it good for?
I often use this algorithm:

1. write a function in pointed style 2. run it through pointfree 3. is it shorter/easier to read? then use pointfree's definition

This is really a personal shortcoming though because after 20+ years of writing code in "standard" languages my brain is sufficiently warped that I'm not always able to think of the short and clear solution without "grinding the gears".

how_gauche··on "Purely Functional Data Structures" by Chris Okasaki [pdf]
A true classic!
how_gauche··on Ask HN: Github or your own git server?
I'd never use Github if money was on the line, it's down all the time and source code is core competency stuff, you do it in-house. Gitosis + gitweb aren't that difficult to set up.

There's also "Gitorious" but I tried to use it once and spent two days unsuccessfully trying to get it to work.

how_gauche··on Ask HN: Back problems
Try stretching out your hamstrings. A lot of lower back pain is actually caused by shortened hamstrings pulling the pelvis and lower back out of alignment.
how_gauche··on Ask HN: Is GRE useful outside graduate school?
GRE is completely inapplicable to grad school, I'm pretty sure it's used with a cutoff to thin out the applicant pool.

I didn't study for mine one iota and did pretty well (got into Yale) -- I think if I'd spent some time preparing I could've had close to straight 800s, but I don't see that alone getting me into the schools I was rejected from.

Honestly I think "GRE scores" are about 19th on the list of things most university departments look for when they're seriously considering applicants. You'd be much better off putting that effort into preparing material for publishing.

how_gauche··on Ask HN: What state [or region] is hiring the most of us?
Move to Dubai? I'm a Canadian living in Toronto and I know headhunters who are trying to find people HERE to relocate there. Salary seems very competitive also.
how_gauche··on Ask HN: Emacs users on OS X, what's your setup?
I'm an old hand in Emacs and new to the Macintosh, so I use Cocoa Emacs.app because it's closest to the "standard" distribution, and override the Mac keybindings. I avoid using the mouse (those things are very bad for the wrists), so my .emacs turns the toolbar, menubar, and scrollbars off -- just a plain white screen.

I use a 25" widescreen LCD, and I like to jack up the font size until I get about 200 characters across; this lets me hold two 100x47 buffers side by side, which is how I prefer to work. Most of my interaction with the computer (besides web) goes through Emacs -- eshell, gnus, bbdb, calendar/diary, planner, etc.

how_gauche··on Ididwork (YC Summer 08) Launches
How are you planning on making money, exactly?
how_gauche··on Alexa - since June, most sites have been on a downward spiral
Dear idiots: it's summer in the northern hemisphere. People are outside, or on vacation.
← PreviousPage 2 of 2