This post is the first of a series examining GHC’s support for DWARF debug information and the tooling that this support enables: Part 1 introduces DWARF debugging information and explains how its generation can be enabled in GHC. Part 2 looks at a DWARF-enabled program in gdb and examines some of the limitations of this style of debug information. Part 3 looks at the backtrace support of GHC’s ru
A co-worker of mine had a random thought on IRC: Is data type “unrolling” a valid performance optimization? Used anywhere? Something like: data List a = Nil | Cons a {-# Unroll 10 #-} (List a) I thought, that sounds like the vec package I wrote. One module there uses the GADT definition data Vec (n :: Nat) a where VNil :: Vec 'Z a (:::) :: a -> Vec n a -> Vec ('S n) a which in some cases optimizes
What can we do when it takes GHC a lot of time to compile a given module? Where is it spending its time? Where can we start to get a 10,000 feet view of what GHC is doing? This blog post covers one possible answer, using the eventlog mechanism. (This post has also been published on the GHC blog.) Eventlog ? GHC has a mechanism that allows us to record all sorts of “events” to an eventlog (a simple
Now suppose Bob wants to transfer $50 to Dave. He can create a new transaction that says “take the first output of transaction t1, transfer $50 to Dave and transfer $20 back to me.”1 t2 It is important that Bob transfers the $20 “change” back to himself, because a transaction output can be “spent” (that is, used as an input) only once. This style of transactions is called “UTxO” style; UTxO stands
A generational copying garbage collector, in its most basic form, is quite simple. However, as we’ll see, not all objects can be copied, and some objects require more bookkeeping by the RTS. In this post we’re going to look at these type of objects that require special treatment from the garbage collector (GC in short). For each type of object we’ll look at how they’re allocated and collected. Eac
In object oriented programming an object is a value with a well-defined interface. The internal state of the object is closed to the outside world (encapsulation), but the behaviour of an object can be modified by redefining one or more of the functions in the object’s interface, typically through subclasses (inheritance). The internal state of the object is open to, and can be extended by, such s
In this blog post we consider the problem of defining Binary instances for GADTs such as If you want to play along the full source code for the examples in this blog post can be found on github. Failed attempt The “obvious” way in which you might attempt to serialize and deserialize Val could look something like instance Binary (Val a) where put (VI i) = putWord8 0 >> put i put (VD d) = putWord8 1
TL;DR: Sharing conduit values leads to space leaks. Make sure that conduits are completely reconstructed on every call to runConduit; this implies we have to be careful not to create any (potentially large) conduit CAFs (skip to the final section “Avoiding space leaks” for some details on how to do this). Similar considerations apply to other streaming libraries and indeed any Haskell code that us
A queue is a datastructure that provides efficient—O(1)—operations to remove an element from the front of the queue and to insert an element at the rear of the queue. In this blog post we will discuss how we can take advantage of laziness to implement such queues in Haskell, both with amortised and with worst-case O(1) bounds. The results in this blog post are not new, and can be found in Chris Ok
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く