HNHacker News
TopNewBestAskShowJobs

merijnv

1,071 karma · joined January 10, 2010

merijn@inconsistent.nl
submissionscomments
merijnv··on Vim's speed is not really the point (2013)
Edit: Forgot to answer the initial question. Yes, I use vim exclusively for anything involving editing/writing. In the past years mostly C, C++, Haskell, LaTeX, Java, python...

Largest codebases I've worked with were upwards of 200k SLOC.

https://github.com/merijn/dotfiles/blob/master/install/vimpl...

I have 12, and most of them only have occasional/no use, but I haven't changed to remove them.

Coquille for working with Coq.

CtrlP for fuzzy opening of files.

Gundo for visually looking through vim's undo tree (I rarely use this, probably like once a month max, but it's very useful when I do need it)

My own haskell indenting plugin which is now disabled, because I'm too lazy to make it work like I need it too.

rainbow_parentheses highlights matching parentheses.

syntastic for highlighting compiler errors/warnings in files I'm editing.

tagbar, to be honest I actually never use this and should remove it.

vim-hdevtools lets me query the type of haskell expressions and show definitions of data types, although I mostly only use the type functionality.

vim-hoogle I never could be bothered to configure it, so it doesn't work and should be removed.

vim-pathogen for loading plugins.

vim-surround new movements for editing surrounding punctuation/html tags.

vimbufsync dependency of Coquille.

So, that's 9 plugins I actually use, one of which being a dependency.

merijnv··on Vim's speed is not really the point (2013)
It took me a day to use it as "notepad with syntax highlighting", couple of weeks before I started preferring normal mode to insert mode, and from there on I slowly evolved my configuration and the tricks I use/learn.

Nowadays when using vim I occasionally have people ask me "how did you do that?" and I won't even know what keys I typed. The keybindings are as natural as walking/grabbing things and require as much conscious thoughts. I usually have to redo it in slow motion to see what I did...

I can highly recommend Bram Moolenaar's essay on "The Seven Habits of Effective Text Editing" (http://www.moolenaar.net/habits.html), it has a vim focus, but I think his points are editor agnostic

Edit: I started using vim as a windows GUI person in university since I wanted to edit over SSH and vim was the only editor with syntax highlighting on the servers. So it's not like I was a terminal wizard back then (I am now :p)

merijnv··on Vim's speed is not really the point (2013)
Eh, I use all of those extensively...vim ships with syntax highlighting and syntax aware folding for every obscure language I've ever used (well, there was one academic project language that didn't ship those with vim, but guess what, they had those files in their repository).

Marks are powerful and play really well with all the movements like I'd expect them too...

merijnv··on Improve your touch typing
FYI, in OSX a lot of emacs/shell shortcuts work in textboxes/-fields too. e.g., ctrl-a, ctrl-e, and ctrl-k respectively for beginning of line, end of line and deleting to end of line.
merijnv··on Teaching Haskell to a 10 year old: Day 1
> in e.g. Scala, "5 + 6" is just calling the "+" method on 5

What's calling? What's a method? What's 5 that lets me "call" "methods" on it?

Yeah, absolutely nothing intimidating for a 10 year old there...

merijnv··on “Sierra… well, it was the poor victim of a hostile takeover by criminals”
Judging by your comments you weren't a backer, so here's an alternate point of view...

> Yet professional is what's badly needed. Look at the Doublefine mess with Broken Age (massively over budget, massively late, massively under-delivering in every area). reply

As one of the Broken Age backers, I think you're overly harsh on Double Fine. Personally, I feel I've gotten more than 10 times my money's worth despite Act 2 not being finished yet.

You describe it as massively late, but is that fair? The original plan was "we'll make a flash adventure for 300k", but because of the large budget they changed that to "we'll make a cross-platform, voice acted, hand-drawn custom engine game with a longer schedule" and I'm okay with that.

I got to see the entire design and development process behind the screen, which was super neat. I saw the hard discussion on decreasing scope vs delaying the game, the discussion whether to gut Act 2 or release the first part and use those funds to create an Act 2 worth of the original scope.

I think the art, music and voice acting is gorgeous. The puzzles were a bit underwhelming, but everything I've heard is that the difficulty curve is better in Act 2. All in all, for the 15 (or was it 25?) dollar backing I feel the project was a great success, massively exceeding my expectations about what I'd get for the money.

merijnv··on Learn You a Haskell for Great Good (2008)
Extensive list of resources including many that have exercises: https://github.com/bitemyapp/learnhaskell
merijnv··on Learn You a Haskell for Great Good (2008)
I would not say that Haskell is currently ideal for writing native smartphone apps. It's possible and people are working on making it easier, but it's rough territory still.

Javascript is easier, ghcjs (while still a bit tricky to install) is 1.0 and lets you compile arbitrary GHC Haskell (including all extensions, lightweight threads and STM) to JS for both Node.js and the browser. Template Haskell support is on the way too.

Calling the C FFI from Haskell is fairly trivial in my experience. If you have structs you want to manipulate from inside haskell it's a bit cumbersome and confusing initially, but if you're just using primitive types and pointers it's easy.

Haskell does very well for high-performance when it comes to IO, as-of GHC 7.8's new IO manager the fastest Software-Defined Networking (SDN) application is written in Haskell [1]. In terms of pure computation bound performance Haskell, does well enough, optimising truly high-performance Haskell is as much arcane art as optimising C (we're talking "I want microsecond inner-loops" level of optimising). In general I would say that you should expect Haskell to be around JIT Java levels of speed for most cases where the code is not blatantly inefficient. So certainly an order of magnitude faster than python/ruby.

Lots of people complain about performance reasoning in Haskell being hard, which is partially true. But mostly, IMO it is simply different from doing so in C, so you need to unlearn/relearn all your performance tweaking skills.

As for Haskell vs Clojure and becoming a better developer. I think Clojure looks like an interesting language, but I would recommend learning Haskell anyway. Why? Because Haskell is one of the "most different" languages in which people are still writing lots of real world code. Which means that it will expose you to the largest number of new concepts while still having decent practical library support. Key features, IMO are: Purity, type system, laziness, and type classes.

Incidentally, I would urge everyone to please stop using this silly "transpile" word. Compile is already source-to-source and introducing a new silly sounding word for it isn't helping anyone.

[1] - http://haskell.cs.yale.edu/wp-content/uploads/2013/08/hask03...

merijnv··on The Worst Way to Fire Someone: I Was There
FWIW, in the Netherlands many collective bargaining agreements DO stipulate a minimum notice for firings (barring special circumstances like gross neglect, committing felonies, etc.). For example, my first system admin job had a contract mandating 1 month's notice in both directions. Usually the notice given by the employer is longer than the notice given by the employee and the notice duration for the employer increases with seniority (so after several years I'd be owed 2 or 3 months notice).

I think the main reason there's no notice by employers in the US is the lack of unions/organised labour to fight for rights like these.

merijnv··on Apple's libc shells out to Perl to implement wordexp
It's Apple's libc. They ship always ship Perl on OSX (and presumably iOS too?), so what do they care whether other platforms have to deal with an extra dependency? Their platform has Perl anyway, so the dependency is essentially free.
merijnv··on I think I've solved the Haskell records problem
The main reason it's not a massive headache is simple: Records aren't used THAT widely. Sure, in C++ or Java everything has named fields, because that's the only thing you have. Most Haskell datatypes use ADTs without record syntax, which means fields aren't named.

Personally I only use records for large-ish "configuration" datatypes which and I just don't use that many of those for it to be a real problem.

merijnv··on A Localization Horror Story: It Could Happen to You
To be honest, I thought the Dutch translation was relatively awkward (I have to admit I've only heard the Dutch "Let It Go" version, not the rest of the movie). I thought the Flemish version was much nicer, despite some Flemish phrasing sounding off as Dutch...
merijnv··on Go is moving to GitHub
You're not the only one. If you prefer the Mercurial interface, I highly recommend trying out hg-git. It's an extension that does transparent bi-directional conversion between git and mercurial. I've been using it for the past 3 years to interact with GitHub and colleagues in different companies and I have yet to run into significant problems.

There are some minor nits: occasionally I manually need to forward the "master" tag to the latest revision to push it to git and since git doesn't log file moves you can run into "broken" history for a file, where Mercurial doesn't know a file was moved. But in day-to-day use I don't really have any issues.

merijnv··on Fingerprints Are Usernames, Not Passwords (2013)
I remember reading the original article on cracking Apple's fingerprint ID and the crackers mentioned that, while definitely crackable, it requires a certain level of sophistication and thus they considered the addition very worthwhile as a way to protect against robbing, etc.
merijnv··on Refactoring Ruby with Monads
The reason GHC allocates at such an aggressive rate is the fact that memory allocation is really cheap in GHC. Allocating memory on the GHC heap is literally just bumping the "top of heap ptr", so writing one word.

The idea is that 90% of allocations are very short-lived, so allocating a ton doesn't matter as long as you can throw it away cheaply. Suppose we have an inner loop over an array, summing values. We may allocate at 1.6 GB/s doing the computation, but everything except the last value is garbage.

When we GC we simply copy this last value from the current heap and reset the "top of heap pointer". Yet another cheap operation.

There's a lot more going on (generational GC, nursery's and what not), but GHC's GC heavily abuse some facts that, for example, CRuby cannot, such as the fact that older generations can never reference data in newer generations, so GCing the current generation never has to perform "major GC" (i.e. checking the older data whether it still needs the current generation).

merijnv··on The New Haskell Homepage
Haskell functions never take zero arguments. Things that take zero arguments are not functions. For a more in-depth explanation of why, see: http://conal.net/blog/posts/everything-is-a-function-in-hask...
merijnv··on Why Events Are A Bad Idea For High-Concurrency Servers (2003)
Or when using the highly inconvenient model of mutable state ;)

Purely functional language can share state between threads just fine, since any state will be immutable (barring any explicit communication primitives).

merijnv··on What's New in Mercurial 3.0
This is of course a straw man as Mercurial already has several tools for this (MQ, rebase, histedit), which will keep working as-is even with changeset evolution. So changeset evolution allows things in addition to the local rebasing.
merijnv··on What I Would Do If I Ran Tarsnap
The difference is, I trust Colin. Aside from djb he's one of the few people on this planet I would trust to write crypto/security software and get it right.

SpiderOak? Only heard about them because they're "hip" on here, given the state of technology in the average startup, I wouldn't trust them with my data ever.

merijnv··on JZed.js – The functional JQuery alternative
By the same logic:

People see reactions like yours and they develop impressions that software programmers are boring stick-in-the-muds. The result is that programmers are not treated as people you'd want to interact with.

In the grand scheme of things do you think that people who write like Zed are going to feel compelled to change their behaviour because you would like them too?

merijnv··on JZed.js – The functional JQuery alternative
And what kind of language does belong in a software project? He's literally giving away work he did in his own time for free and you complain about the language he used when he did so?

If you don't like the language, don't use the library? Seems a simple solution.

merijnv··on FreeBSD 10.0 is here
Shipping non-open graphics drivers together with the linux kernel is a violation of the GPL. Providing non-open binaries separately from the linux kernel is not. The GPL only applies to distribution, if you're not distributing GPL code (for instance, only your non-open drivers) there's no problem.

The GPL puts no restrictions on use, i.e. once you've got both linux and your non-open drivers the GPL doesn't care whether you combine the two.

Additionally, as people point out the license can only be enforced by copyright holders, so if no linux copyright owners bother to sue people distributing non-open drivers, nothing will happen.

This is however rather shaky legal ground, as at any point you could get sued for violating the license. This also why linux doesn't ship ZFS, since the CDDL is incompatible with GPL any company distributing linux with ZFS would open itself to a potential lawsuit by any linux copyright holder. You can imagine most companies are not very happy taking this risk.

With regards to Richard Yao's comments, of course he's not worried. Copyright violation (which is what breaking the GPL is) only lets you sue for monetary damages or to stop the distribution. There's zero reason for people to sue most linux distros as they're non-profits that aren't charging for distribution. Since it's nearly impossible to show monetary loss by a linux copyright holder (it's being distributed for free!) The only thing to possibly do would be to sue the distros into ceasing distribution, which seems an undesirable outcome for most linux copyright holders, so that's unlikely to be enforced.

Since GPL doesn't restrict actual usage the users of these distros have nothing to worry about anyway.

In summary, you only have to worry about being sued if you are both violating the GPL and making some sort of money while doing it. But the fact that you probably won't get sued doesn't mean that what you are doing is not illegal.

- Well, in any country that's signed the Berne Convention, anyway.

merijnv··on FreeBSD 10.0 is here
Dude, that's literally what "licenses are incompatible" means.

The GPL gives you a license to distribute IF AND ONLY IF all the linked binaries have AT LEAST the same permissive rights as the GPL mandates. The CDDL gives rights SIMILAR to GPL, but in a way that is incompatible, i.e. which does not let you distribute CDDL code with all the permissions the GPL mandates. As such, you void the license to distribute the GPL code, as you're unable to comply with the GPL license (i.e. the bit that all linked binaries have at least the GPL enforced liberties).

The GPL's license to distribute is dependent on you distributing binaries with the appropriate permissions and the CDDL won't let you.

merijnv··on Haskell vs. Erlang for bittorent clients
Memory leaks due to laziness are not as frequent as the interwebs would tell you. It's not like that this type of code appears in every single program you write.

Memory leaks are notorious mostly due to leaks in lazy code looking very innocent when coming from strict languages. After you get comfortable with laziness the same code (usually) stands out very clearly. And even when it doesn't, these leaks aren't very subtle. GHC has a good profiler for memory usage, so tracking them down is mostly trivial and fixing them once you know what's wrong is not very hard.

merijnv··on The Best To-Do List: A Private Gist
For me it's just empty lined paper. I much prefer that to all these fancy solutions.
merijnv··on Single assignment C
The compiler implementation isn't really open source at the moment. On the other hand, they're very interested in new collaborations. Getting access to the source is not much harder than just dropping them an email.

If you (or anyone else) is interested, drop me an email (see HN profile) and I can get you in contact with them as most of the people involved are either current or old colleagues of mine.

merijnv··on Single assignment C
It's still being actively worked on, due to a recent move to a different university a lot of the infrastructure (such as building new releases) is still offline, so the website hasn't updated in a while. Blame university IT departments.
merijnv··on List of Open Source Licences in Mercedes Cars [pdf]
I don't think they provide downloads, but the document includes an offer to obtain the source:

Components of the software used in the vehicle may be free and open source software licensed under the terms of license of the GNU General Public License, Version 2 (GPLv2), GNU Lesser General Public License, Version 2.1 (LGPLv2.1) or GNU Library General Public License, Version 2 (LGPLv2). Upon request, we will supply the source code of the components licensed under the GPLv2, LGPL v2.1 and LGPLv2 on a data-medium (please specify the designation of your vehicle). Please direct your request to the following address within three years after vehicle delivery:

Daimler AG, HPC: CAC, Customer Service, D-70546 Stuttgart

The copyright holders usually do not provide any warranty and assume no liability whatsoever for the free and open source software components. Note that any modificati- on to the vehicle of any kind can void any warranty claim.

merijnv··on Learn Haskell Fast and Hard
After that chapter it goes on the same way as before. I think the chapter is just a reference for "good places for beginners to get acquainted with".
merijnv··on Learn Haskell Fast and Hard
How is that weird, it's just uses the increment from the first to second value as step and repeat as long as it's smaller than the end value. Python does the exact same thing:

    Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) 
    [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> range(1, 10, 2)
    [1, 3, 5, 7, 9]
← PreviousPage 5 of 11Next →