サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
セキュリティ
neilmitchell.blogspot.com
Summary: A performance investigation uncovered a memory leak in unordered-containers and performance issues with Ghcide. Over the bank holiday weekend, I decided to devote some time to a possible Shake build system performance issue in Ghcide Haskell IDE. As I started investigating (and mostly failed) I discovered a space leak which I eventually figured out, solved, and then (as a happy little acc
Summary: Sometimes <- pure makes a lot of sense, avoiding some common bugs. In Haskell, in a monadic do block, you can use either <- to bind monadic values, or let to bind pure values. You can also use pure or return to wrap a value with the monad, meaning the following are mostly equivalent: let x = myExpression x <- pure myExpression The one place they aren't fully equivalent is when myExpressio
Summary: We have been working on pieces for a Haskell IDE at Digital Asset. At Digital Asset, we wrote the DAML programming language. The compiler builds on GHC, and one of the important tools for using DAML is an IDE. You can try the DAML IDE online or download it. Since we wrote the DAML IDE in Haskell, and DAML uses GHC under the hood, it's possible to take the work we did for the DAML IDE and
After writing a VBA Macro to convert a PowerPoint with animation into a flat PowerPoint without animation (suitable for conversion to PDF), I wrote my talk. After writing my talk I realised I not only needed elements to appear on a click, but also disappear and reappear. Unfortunately my original macro script did not do that, so I've updated it with two new features: Safer The original code remove
Summary: How we went about writing a build systems comparison paper, how we learnt what we learnt, and why the end result surprised us. A glimpse inside writing a paper. The final version of the Build Systems a la Carte paper has just been sent to ICFP 2018 - see an overview from one of my co-authors. The paper is a collaboration between Andrey Mokhov at Newcastle University, Simon Peyton Jones at
Haskell is a great language, but debugging Haskell is undoubtedly a weak spot. To help with that problem, I've just released the debug library. This library is intended to be simple and easy to use for a common class of debugging tasks, without solving everything. As an example, let's take a function we are interested in debugging, e.g.: module QuickSort(quicksort) where import Data.List quicksort
Summary: memchr is faster, but the obvious implement seems to beat the builtin versions. There are two related C functions for finding the next character in a string - strchr which assumes the string has a NUL character at the end, and memchr which takes the string length as an argument. For strings where you have the size and a NUL terminator, which is fastest? Using gcc 6.2.0 64bit MSYS2 on Wind
Summary: I've released a new Haskell library, Hexml, which is an incomplete-but-fast XML parser. I've just released Hexml, a new C/Haskell library for DOM-style XML parsing that is fast, but incomplete. To unpack that a bit: Hexml is an XML parser that you give a string representing an XML document, it parses that string, and returns either a parse error or a representation of that document. Once
Haskell represents both a language and a user community - and moreover a fantastic community full of friends, fun, and deep technical debate. Unfortunately, in recent times the community has started to fracture, e.g. Cabal vs Stack, haskell.org vs haskell-lang.org. These divisions have risen above technical disagreements and at some points turned personal. The solution, shepherded by Simon Peyton
Summary: The new version of Shake supports ** patterns for directory wildcards. I've just released Shake 0.15.6. Don't be mislead by the 0.0.1 increment of the release, it's got over 50 entries in the changelog since the last release. There are quite a few bug fixes, documentation improvements and optimisations. One of the most user visible features is the new wildcard patterns. In the previous ve
Summary: Last year I made a list of four flaws with Haskell. Most have improved significantly over the last year. No language/compiler ecosystem is without its flaws. A while ago I made a list of the flaws I thought might harm people using Haskell in an industrial setting. These are not flaws that impact beginners, or flaws that stop people from switching to Haskell, but those that might harm a bi
Summary: Alex and Happy had three space leaks, now fixed. Using the techniques described in my previous blog post I checked happy and alex for space leaks. As expected, both had space leaks. Three were clear and unambiguous space leaks, two were more nuanced. In this post I'll describe all five, starting with the obvious ones. 1: Happy - non-strict accumulating fold Happy contains the code: indexI
Summary: QuickCheck had a space leak in property, now fixed (in HEAD). Using the techniques described in my previous blog post I found another space leak, this time in QuickCheck, which has now been fixed. Using QuickCheck we can chose to "label" certain inputs, for example: $ quickCheck $ \p -> label (if p > 0 then "+ve" else "-ve") True +++ OK, passed 100 tests: 54% -ve 46% +ve Here we label num
Summary: Using the technique from the previous post, here are three space leaks I found. Every large Haskell program almost inevitably contains space leaks. This post examines three space leaks I found while experimenting with a space-leak detection algorithm. The first two space leaks have obvious causes, but I remain mystified by the third. Hoogle leak 1The motivation for looking at space leak d
Summary: Below is a technique for easily detecting space leaks. It's even found a space leak in the base library. Every large Haskell program almost inevitably contains space leaks. Space leaks are often difficult to detect, but relatively easy to fix once detected (typically insert a !). Working with Tom Ellis, we found a fairly simple method to detect such leaks. These ideas have detected four s
Summary: We have a version of mapM for IO that takes O(1) stack and is faster than the standard Haskell/GHC one for long lists. The standard Haskell/GHC base library sequence function in IO takes O(n) stack space. However, working with Tom Ellis, we came up with a version that takes O(1) stack space. Our version is slower at reasonable sizes, but faster at huge sizes (100,000+ elements). The stand
Summary: I wrote a Conduit combinator which makes the upstream and downstream run in parallel. It makes Hoogle database generation faster. The Hoogle database generation parses lines one-by-one using haskell-src-exts, and then encodes each line and writes it to a file. Using Conduit, that ends up being roughly: parse =$= write Conduit ensures that parsing and writing are interleaved, so each line
Summary: I'm growing increasingly fond of the Conduit library. Here I give my intuitions and some hints I'd have found useful. Recently I've been working on converting the Hoogle database generation to use the Conduit abstraction, in an effort to reduce the memory and improve the speed. It worked - database generation has gone from 2Gb of RAM to 320Mb, and time has dropped from several minutes (or
Summary: The development version of ghcid seemed to have some problems with terminating when Control-C was hit, so I investigated and learnt some things. Given a long-running/interactive console program (e.g. ghcid), when the user hits Control-C/Ctrl-C the program should abort. In this post I'll describe how that works in Haskell, how it can fail, and what asynchronous exceptions have to do with i
Summary: Implementing a Functor instance is much easier than implementing a Monad instance, and can turn out to be quite useful. Haskell forces all programmers to understand some details of the Monad typeclass to do basic IO, but currently nothing forces people to learn the Functor typeclass. However, Functor is much simpler than Monad, and all Monads must be Functors, so thinking more about Funct
Summary: Haskell is great for refactoring, thanks to being able to reason about and transform programs with confidence. I think one of Haskell's strengths as a practical language is that it's easy to refactor, and more importantly, easy to refactor safety. Programs in the real world often accumulate technical debt - code that is shaped more by its history than its current purpose. Refactoring is o
Summary: I wrote a script to list all operators on Hackage, and which packages they are used by. In GHC 7.10 the *> operator will be moving into the Prelude, which means the Shake library will have to find an alternative operator (discussion on the mailing list). In order to pick a sensible operator, I wanted to list all operators in all Hackage packages so I could be aware of clashes. See the lis
Summary: I've just released a new version of HLint that can spot an unsafePerformIO which should have NOINLINE but doesn't. I've just released HLint v1.9.10, a tool to suggest improvements to Haskell code. I don't usually bother with release announcements of HLint, as each version just fixes a few things and adds a few hints, it's all in the changelog (plus there have now been 102 releases). The l
Summary: I've written a continuous integration system, in Haskell, designed for large projects. It works, but probably won't scale yet. I've just released bake, a continuous integration system - an alternative to Jenkins, Travis, Buildbot etc. Bake eliminates the problem of "broken builds", a patch is never merged into the repo before it has passed all the tests. Bake is designed for large, produc
Summary: I've just released ghcid, which interactively shows the errors in your project on each save. I'm please to announce ghcid, which is either "GHCi as a daemon" or "GHC + a bit of an IDE". I've been using it for my development for the last few days, and already find it quite valuable. Unlike other Haskell development tools, ghcid is intended to be incredibly simple. In particular, it doesn't
Summary: I've just released a new version of Shake, with a --demo feature and an underlying continuation monad. I want to release v1.0 in the near future. I've just released a new version of the Shake build system, version 0.13.3. While the version number is only 0.0.1 higher, the changelog lists a large number of improvements. In particular, two changes are: The Action monad is now based on conti
Summary: In moving Shake to continuations, exceptions were the biggest headache. I figured out how to somewhat integrate continuations and exception handling. The git repo for Shake now suspends inactive computations by capturing their continuation instead of blocking their thread, based on the continuations I described in a previous blog post. The most difficult part was managing exceptions. I ne
Summary: Shake is a monadic build system, and monadic build systems are more powerful than applicative ones. Several people have wondered if the dependencies in the Shake build system are monadic, and if Make dependencies are applicative. In this post I'll try and figure out what that means, and show that the claim is somewhat true. Gergo recently wrote a good primer on the concepts of Applicative
Summary: Continuations are confusing. Here we solve a simple problem (that is at the heart of the Shake build system) using continuations. Imagine we are given two IO a computations, and want to run them both to completion, returning the first a value as soon as it is produced (let's ignore exceptions). Writing that in Haskell isn't too hard: parallel :: IO a -> IO a -> IO a parallel t1 t2 = do on
次のページ
このページを最初にブックマークしてみませんか?
『Neil Mitchell's Blog (Haskell etc)』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く