HNHacker News
TopNewBestAskShowJobs

nicolast

1,108 karma · joined December 19, 2011

Multi-language, multi-paradigm hacker, spreading noise using @eikke, formerly working at @Scality on #Kubernetes and #OSS projects.
submissionscomments
nicolast··on Zfec – Efficient, portable erasure coding tool
I ported Klaus' library to Haskell, and redid the whole SIMD implementation (see below for the extras this brings): https://github.com/NicolasT/reedsolomon/

In my library, the SSSE3 code also has AVX and AVX2 equivalents, providing higher throughput. There are also implementations with specific optimized instructions for ARM NEON, ARM64, PPC64/AltiVec and Power8. All of this in C (with intrinsics), not ASM, so making use of your C compiler's instruction scheduling, loop unrolling,... See https://github.com/NicolasT/reedsolomon/blob/master/cbits/re...

nicolast··on Is your JavaScript function actually pure?
Trivia: assuming the input to `sum` below is guaranteed to always be a non-trickery array of numbers, so it always returns the same result for the same input, is the function 'pure'?

    var x = 0;

    function sum(arr) {
        x += 1;

        return arr.reduce(function(a, b) { return a + b; }, 0);
    }
nicolast··on Accidentally nonblocking
https://blog.incubaid.com/2011/12/13/hybrid-sync-async-pytho...
nicolast··on Understanding and Hardening Linux Containers [pdf]
> and a number of other systems such as Mirage OS (a reimplementation of Solaris Zones).

I'd say that's not entirely correct. At all.

nicolast··on A visit with Apple’s chief chipmaker
(referring to move from 32bit to 64bit): "The new technology allowed for entirely new features, such as Apple Pay and the Touch ID fingerprint scanner. Developers had to rewrite applications to account for the new standard, but it gave way to smoother maps, cooler video games, and generally more responsive apps that don’t hog as much memory." Right.
nicolast··on Haskell Web Development: A Freely Available Book
I have an XDR and NFS3 implementation which is literate Haskell embedded in the RFC document texts. Not open-source though :-( Keeping implementation literally next to the spec was an interesting experience with both pros (fairly obvious) and cons (sometimes code is less fluently written or ordered somewhat unnaturally because of how the RFC is written).
nicolast··on Haskell's Type Classes: We Can Do Better
No need for TH, actually. Write a function which takes a `proxy a` and returns e.g. a Tasty `TestTree`: `testMyClassLaws :: proxy a -> TestTree`. Then in your test module, add something like `testGroup "MyClassLaws for MyType" $ testMyClassLaws (Proxy :: Proxy MyType)` somewhere in your list of tests.
nicolast··on Go enjoy Python3
Now with more operators!

    import System.Environment (getArgs)
    main = putStrLn =<< take 12 . head <$> getArgs
;-)
nicolast··on Paxos Made Moderately Complex
Raft is 'simpler' than Paxos because it's not only a consensus protocol, it include log management etc. On the other hand, Raft could be (with a stretch) considered one of the protocols in the Paxos family, whilst other family members have their specific strengths (and complexities), e.g. being more efficient in WAN networks.

If you're interested in Raft, take a look at Kontiki (https://github.com/NicolasT/kontiki). Could use some maintenance though...

nicolast··on Paxos Made Moderately Complex
At my previous employer, I worked on Arakoon, a consistent distributed key-value store based on Multi-Paxos, implemented in OCaml, using TokyoCabinet (a fork of it) as the local storage mechanism.

Implementing the protocol in an industrial setting brings up lots of ... interesting design and engineering issues for sure!

See https://github.com/Incubaid/arakoon

nicolast··on Reimplementing “git clone” in Haskell from the bottom up (2013)
Closed source (for now) I'm afraid...
nicolast··on Reimplementing “git clone” in Haskell from the bottom up (2013)
I wrote an NFS server in Haskell, using Literal Haskell to implement all related RFC's 'inside' the RFC documents, interleaving code (lots of serdes stuff...) with the specification.
nicolast··on OpenBSD has started a massive strip-down and cleanup of OpenSSL
You mean http://hackage.haskell.org/package/tls ?
nicolast··on Sta.li: Static Linux
Ever looked at Nix and NixOS?
nicolast··on Reverse Engineering a D-Link Backdoor
Doesn't this mean if '/admin/factory_reset' normally requires authentication, requesting '/admin/factory_reset?_=graphic/' would bypass this without the need for custom headers...
nicolast··on How Rsync Works
You might be interested in http://blog.incubaid.com/2012/02/14/rediscovering-the-rsync-...
nicolast··on John Carmack: Thoughts on Haskell [video]
Being an expert C++ programmer doesn't make you an expert Haskell programmer, or vice-versa ;-)
nicolast··on John Carmack: Thoughts on Haskell [video]
> The source is free, so it's a great way to see what Haskell looks like when used for large applications in the hands of experts.

I tend to disagree with this. Yes, GHC is a large application and most certainly developed by experts, but it's also a project with a very long history, whilst Haskell (language, extension, conventions,...) have changed over the years, and this shows in several places.

Next to that, GHC code isn't very idiomatic at times (e.g. for performance reasons, or because it can't depend on too many external high-level libraries).

nicolast··on Cap'n Proto v0.2: Compiler rewritten from Haskell to C++11
Haskell devs need to be polite and considerate, otherwise GHC slaps them during the next 'cabal build' run with some hairy type errors. You really don't want that to happen twice.

(Just kidding, I love GHC and its precise & helpful error messages. No sarcasm implied.)

nicolast··on Hard drive hack provides root access, even after reinstall
Hence http://www.breaknenter.org/projects/inception/ and similar attacks.
nicolast··on Ask HN: Any downsides of programming in Haskell?
That's not an extreme case at all, I'd even argue RWS(T) (or its 'manual' version) is a very common stack.

As an example, I use RWST in Kontiki, my implementation of the Raft consensus protocol, where the R part contains configuration (e.g. the set of nodes in the cluster), the W part is filled with 'commands' to be executed after an FSM transition as a reaction on some event (incoming message, timeout,...), where 'commands' are things like 'send this message to node N', 'broadcast this message to all nodes', 'append this entry to the replicated log' or 'log this message (for debugging)', and finally the S part provides access to the current state.

Every FSM transition returns the new state, and a list of commands to execute (& the updated state of the S part, but that's discarded).

All you need to provide is an 'interpreter' for the commands.

This approach makes testing very easy: I can start at any desired state and event (that's just pure data), run the FSM on that (which is also a pure operation, although that's slightly complicated due to the MonadLog implementation which should underlie RWST, but that's besides this discussion), and check whether the output state & commands are the ones I expect, without mocking any networking or intercepting other IO.

[update] As an example of what this looks like from inside the FSM code, see https://github.com/NicolasT/kontiki/blob/master/src/Network/... This is a rather straight-forward implementation of the algorithm and looks imperative, but is 100% pure (with all its benefits).

nicolast··on Rust will likely not support tail call optimization
Which is +- what Scala allows with an annotation.
nicolast··on Fjord – F# programming language for the JVM
Can't you lambda-lift & fully CPS-convert the code somewhere throughout compilation, then use a trampoline at runtime?
nicolast··on Docker - the Linux container runtime
I recently changed our Jenkins CI infrastructure to use something like this: all jobs run in their own LXC container, using BTRFS and its snapshots/clones instead of AUFS. Works like a charm!

The script is available at https://github.com/Incubaid/jenkins-lxc (no docs for now, and several improvements are possible). It expects CI job scripts to be contained in the job repository, e.g. https://github.com/Incubaid/arakoon/tree/1.6/jenkins

nicolast··on Google Spanner's Most Surprising Revelation: NoSQL is Out and NewSQL is In
We created Arakoon (http://arakoon.org) in-house to solve a real distributed systems problem. At small engineering scale (only a handful of contributors), using (Multi-)Paxos.
nicolast··on Moonwalking with Einstein: The Art and Science of Remembering Everything
Really enjoyed reading this book some months ago. Certainly worth some of your time.
nicolast··on HyperDex: Super-charging your NoSQL with a Strongly Consistent Datastore
Lack of consistency guarantees in most systems available in the open is the exact reason why we created Arakoon: our usage scenarios (safekeeping metadata for large-scale storage systems, among others) simply don't allow for 'eventual consistency'. It's also available as free software, check it out at http://arakoon.org.
nicolast··on Scaling node.js to 100k concurrent connections
It struck me the author runs his apps as root (in screenshots). But then I remembered he's using node.js to handle "thousands of concurrent connections".
nicolast··on Erlang port protocol for Python
For Twisted: https://launchpad.net/twotp/
nicolast··on The Game of Distributed Systems Programming
http://news.ycombinator.com/item?id=3765399
← PreviousPage 2 of 3Next →