<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>rakyll.org</title>
    <link>https://rakyll.org/</link>
    <description>Recent content on rakyll.org</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 21 Sep 2026 19:25:00 -0700</lastBuildDate>
    <atom:link href="https://rakyll.org/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Stateful jobs</title>
      <link>https://rakyll.org/stateful-jobs/</link>
      <pubDate>Mon, 21 Sep 2026 19:25:00 -0700</pubDate>
      <guid>https://rakyll.org/stateful-jobs/</guid>
      <description>&lt;p&gt;Almost every job scheduler we rely on today was built on the assumption that work is stateless. In fact, in the last 15 years we mostly designed stateless schedulers, or stateful executors for niche topics. In the stateless world, you have a pool of tasks, a pool of workers, some CPU and memory constraints, maybe a priority queue and dependencies, and your goal is to find an efficient placement. If a node dies, you reschedule the task elsewhere. If a task fails, you retry it. Scheduling is fundamentally an allocation and packing problem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Compute</title>
      <link>https://rakyll.org/compute/</link>
      <pubDate>Wed, 29 Jul 2026 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/compute/</guid>
      <description>&lt;p&gt;I said that it&amp;rsquo;s likely that AI layers commoditize like everything else has.&#xA;The harness, the planning loop, tools use patterns, the memory files, the protocols,&#xA;context management, etc. I have watched ideas in this layer go from&#xA;novel to table stakes in a few months. Everyone follows the same patterns.&#xA;And the ones that actually work get absorbed into the model in the next training&#xA;run, at which point they stop being anyone&amp;rsquo;s differentiator at all. I cannot&#xA;think of a layer with a shorter shelf life. The scaffolding is not where this&#xA;gets decided.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Zero sum games</title>
      <link>https://rakyll.org/zero-sum-games/</link>
      <pubDate>Sun, 19 Jul 2026 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/zero-sum-games/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m relatively new to ML/AL. I spent most of my career in&#xA;commodity layers claiming to do boring things, and I&amp;rsquo;m still learning this field&amp;rsquo;s history, its&#xA;culture, and its assumptions. So take this as an outsider&amp;rsquo;s&#xA;observation. There is one assumption&#xA;I keep running into that contradicts what I have seen in the&#xA;past: the belief that AI is a zero-sum game. It impacts projects,&#xA;people, organizational dynamics, and everything you can imagine&#xA;in this domain.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Thoughts on coding agents</title>
      <link>https://rakyll.org/coding-agents/</link>
      <pubDate>Fri, 03 Jul 2026 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/coding-agents/</guid>
      <description>&lt;p&gt;My thoughts on coding agents are evolving but they significantly&#xA;shifted in December 2025.&#xA;The models are being trained to produce trajectories that are effective&#xA;for people who already know where they want to go.&#xA;The value is the model reducing the distance between a&#xA;clear goal and its execution. Once you see it this way, the interesting&#xA;question is &amp;ldquo;how cheap is it now to get from a decision to a working artifact?&amp;rdquo;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Generics facilitators in Go</title>
      <link>https://rakyll.org/generics-facilititators/</link>
      <pubDate>Mon, 20 Dec 2021 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/generics-facilititators/</guid>
      <description>&lt;p&gt;Go 1.18 is going to be released with &lt;a href=&#34;https://go.dev/blog/generics-proposal&#34;&gt;generics support&lt;/a&gt;. Adding generics to Go was a multi-year effort and was a difficult one. Go &lt;a href=&#34;https://rakyll.org/typesystem/&#34;&gt;type system&lt;/a&gt; is not a traditional type system and it was not possible just to bring an existing generics implementation from other language and be done. The current proposal was accepted after years of user research, experiments and discussions. The proposal got iterated a few times during the implementation phase. I found the final result delightful.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Shardz</title>
      <link>https://rakyll.org/shardz/</link>
      <pubDate>Fri, 03 Dec 2021 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/shardz/</guid>
      <description>&lt;p&gt;Shard coordination has been one of the bigger challenges to design&#xA;sharded systems especially for engineers with little experience in the subject.&#xA;Companies like Facebook have been using general purpose shard coordinators,&#xA;e.g. &lt;a href=&#34;https://engineering.fb.com/2020/08/24/production-engineering/scaling-services-with-shard-manager/&#34;&gt;Shard Manager&lt;/a&gt;, and suggesting that general&#xA;purpose sharding policies have been widely successful. A general&#xA;purpose sharding coordinator is not a solution to all advanced sharding needs,&#xA;but a starting point for average use cases.&#xA;It&amp;rsquo;s a framework to think about core abstractions&#xA;in sharded systems and providing a protocol that orchestrate sharding&#xA;decisions. In the last few weeks, I&amp;rsquo;ve been working on an extendible general purpose&#xA;shard coordinator, Shardz. In this article, I will explain&#xA;the main concepts and the future work.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Spanner&#39;s SQL support</title>
      <link>https://rakyll.org/spanner-sql/</link>
      <pubDate>Wed, 22 Jul 2020 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/spanner-sql/</guid>
      <description>&lt;p&gt;Spanner is a distributed database Google initiated a while ago to build a highly available and highly consistent database for its own workloads. Spanner was initially built to be a key/value and was in a completely different shape than it is today and it had different goals. Since the beginning, it had transactional capabilities, external consistency and was able to failover transparently. Over time, Spanner adopted a strongly typed schema and some other relational database features. In the last years, it added SQL support*. Today we are improving both the SQL dialect and the relational database features simultaneously. Sometimes there is confusion whether Spanner supports SQL or not. The short answer is yes. The long answer is this article.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Notes on the Go generics proposal</title>
      <link>https://rakyll.org/generics-proposal/</link>
      <pubDate>Wed, 17 Jun 2020 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/generics-proposal/</guid>
      <description>&lt;p&gt;&lt;em&gt;Update: The proposal draft has been&#xA;&lt;a href=&#34;https://groups.google.com/g/golang-nuts/c/7t-Q2vt60J8&#34;&gt;revisited to use brackets&lt;/a&gt;&#xA;instead of parenthesis. This article will be updated with&#xA;the new syntax soon.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Ian Lance Taylor and Robert Griesemer have been working on a&#xA;&lt;a href=&#34;https://blog.golang.org/generics-next-step&#34;&gt;generics proposal&lt;/a&gt;&#xA;for Go for a while.&#xA;Unlike other proposals, a highly significant language&#xA;change as such generics will require experimentation and comprehensive&#xA;feedback before it can be finalized and submitted as&#xA;a formal language change proposal.&lt;/p&gt;&#xA;&lt;p&gt;As an initial step, they have been working on an transitioning tool&#xA;so the Go users can put their ideas into test and have working&#xA;understanding of the proposal. &lt;code&gt;go2go&lt;/code&gt; is a tool available if you&#xA;install &lt;a href=&#34;https://golang.org/doc/install/source&#34;&gt;Go from the source&lt;/a&gt;.&#xA;Then you can build, run and test .go2 files with generics.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Spanner&#39;s high availability writes</title>
      <link>https://rakyll.org/spanner-ha-writes/</link>
      <pubDate>Tue, 19 May 2020 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/spanner-ha-writes/</guid>
      <description>&lt;p&gt;Spanner is a relational database with 99.999% availability which is roughly 5 mins a year. Spanner is a distributed system and can span multiple machines, multiple datacenters (and even geographical regions when configured). It splits the records automatically among its replicas and provides automatic failover. Unlike traditional failover models, Spanner doesn’t failover to a secondary cluster but can elect an available read-write replica as the new leader.&lt;/p&gt;&#xA;&lt;p&gt;In relational databases, providing both high availability and high consistency in writes is a very hard problem. Spanner’s synchronous replication, the use of dedicated networking and &lt;a href=&#34;https://en.wikipedia.org/wiki/Paxos_(computer_science)&#34;&gt;Paxos&lt;/a&gt; voting provides high availability without compromising consistency.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Inlined defers in Go</title>
      <link>https://rakyll.org/inlined-defers/</link>
      <pubDate>Mon, 20 Jan 2020 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/inlined-defers/</guid>
      <description>&lt;p&gt;Go&amp;rsquo;s &lt;code&gt;defer&lt;/code&gt; keyword allows us to schedule a function to run&#xA;before a function returns. Multiple functions&#xA;can be deferred from a function. &lt;code&gt;defer&lt;/code&gt; is often used&#xA;to cleanup resources, finish function-scoped tasks, and&#xA;similar.&#xA;Deferring functions are great for maintability.&#xA;By deferring, for example, we reduce the risk&#xA;of forgetting to close the file&#xA;in the rest of the program:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;func main() {&#xA;    f, err := os.Open(&amp;#34;hello.txt&amp;#34;)&#xA;    if err != nil {&#xA;        log.Fatal(err)&#xA;    }&#xA;    defer f.Close()&#xA;&#xA;    // The rest of the program...&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Deferring helps us by delaying the execution of the Close method&#xA;while allowing us to type it when we have the right context.&#xA;This is how deferred functions also help the readability&#xA;of the source code.&lt;/p&gt;</description>
    </item>
    <item>
      <title>NUMA</title>
      <link>https://rakyll.org/numa/</link>
      <pubDate>Mon, 18 Nov 2019 11:28:27 -0400</pubDate>
      <guid>https://rakyll.org/numa/</guid>
      <description>&lt;p&gt;Non-uniform memory access (NUMA) is an approach to optimize memory access time&#xA;in multi-processor architectures. In NUMA architectures, processors can access&#xA;to the memory chips near them instead of going to the physically distant ones.&lt;/p&gt;&#xA;&lt;p&gt;In the distant past CPUs generally ran slower than the memory.&#xA;Today, CPUs are quite faster than the memory they use. This became a problem&#xA;because processors constantly started to wait for data to be retrieved from the&#xA;memory. As a result of such data starvation problems, for example,&#xA;CPU caches became a popular addition to modern computer architecture.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Go type system for newcomers</title>
      <link>https://rakyll.org/typesystem/</link>
      <pubDate>Wed, 27 Dec 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/typesystem/</guid>
      <description>&lt;p&gt;It is real struggle to work with a new language,&#xA;especially if the type doesn&amp;rsquo;t resemble what you have previously&#xA;seen. I have been there with Go and lost my&#xA;interest in the language when it first came out due to the&#xA;reason I was pretending it is something I already knew.&lt;/p&gt;&#xA;&lt;p&gt;Go is considered as an object-oriented language even though it lacks type hierarchy.&#xA;It has an unconventional type system. It is expected&#xA;to do the things differently in this language given the traditional paradigms are not always going to help the Go users.&#xA;This article contains a few gotchas.&lt;/p&gt;</description>
    </item>
    <item>
      <title>pprof user interface</title>
      <link>https://rakyll.org/pprof-ui/</link>
      <pubDate>Tue, 10 Oct 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/pprof-ui/</guid>
      <description>&lt;p&gt;pprof now is coming with a Web UI. In order to try it out,&#xA;go get the pprof tool:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ go get github.com/google/pprof&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The tool launches a web UI if &lt;code&gt;-http&lt;/code&gt; flag is provided. For example,&#xA;in order to launch the UI with an existing profile data, run the&#xA;following command:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ pprof -http=:8080 profile.out&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can focus, ignore, hide, and show with regexp. As well as clicking&#xA;on the boxes and using the refining menu also works:&lt;/p&gt;</description>
    </item>
    <item>
      <title>The future of latency profiling in Go</title>
      <link>https://rakyll.org/latency-profiling/</link>
      <pubDate>Tue, 18 Jul 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/latency-profiling/</guid>
      <description>&lt;p&gt;&lt;em&gt;Note: This article contains non-finalized ideas; we may end up not implementing any of this but ideally we should do work towards the direction explained here.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Go is the language to write servers, Go is the language to write microservices. Yet, we haven&amp;rsquo;t done much in the past for latency analysis and observability/diagnostics of request/RPC performance.&lt;/p&gt;&#xA;&lt;p&gt;GopherCon 2017 was an opportunity for me to discuss our roadmap for latency analysis. I have talked to many whose main job is to provide instrumentation solutions to the ecosystem.&#xA;A few common problems have been pointed out by pretty much everyone I talked to:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go&#39;s work-stealing scheduler</title>
      <link>https://rakyll.org/scheduler/</link>
      <pubDate>Sun, 16 Jul 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/scheduler/</guid>
      <description>&lt;p&gt;Go scheduler&amp;rsquo;s job is to distribute runnable goroutines over&#xA;multiple worker OS threads that runs on one or more processors.&#xA;In multi-threaded computation, two paradigms have emerged in scheduling: work sharing and work stealing.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Work-sharing&lt;/strong&gt;: When a processor generates new threads, it attempts to migrate some of them to the other processors with the hopes of them being utilized by the idle/underutilized processors.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Work-stealing&lt;/strong&gt;: An underutilized processor actively looks for other processor&amp;rsquo;s threads and &amp;ldquo;steal&amp;rdquo; some.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The migration of threads occurs less frequently with work stealing&#xA;than with work sharing. When all processors have work to run, no threads are being migrated. And as soon as there is an idle processor, migration is considered.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Profiler labels in Go</title>
      <link>https://rakyll.org/profiler-labels/</link>
      <pubDate>Mon, 03 Jul 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/profiler-labels/</guid>
      <description>&lt;p&gt;Go 1.9 is introducing &lt;a href=&#34;https://github.com/golang/proposal/blob/master/design/17280-profile-labels.md&#34;&gt;profiler labels&lt;/a&gt;, a way to add arbitrary key-values to the samples collected by the CPU profiler. CPU profilers collect and output hot spots where the CPU spent most time in when executing. A typical CPU profiler output is primarily reports the location of these spots as function name, source file/line, etc. By looking at the data, you can also examine which parts of the code invoked these spots. You can also filter by invokers to have more granular understanding of certain execution paths.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Custom pprof profiles</title>
      <link>https://rakyll.org/custom-profiles/</link>
      <pubDate>Fri, 30 Jun 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/custom-profiles/</guid>
      <description>&lt;p&gt;Go provides several pprof profiles out of thet box to gather&#xA;profiling data from Go programs.&lt;/p&gt;&#xA;&lt;p&gt;The builtin profiles provided by the &lt;a href=&#34;https://golang.org/pkg/runtime/pprof/&#34;&gt;runtime/pprof&lt;/a&gt; package:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;profile&lt;/strong&gt;: CPU profile determines where a program spends its time while actively consuming CPU cycles (as opposed while sleeping or waiting for I/O).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;heap&lt;/strong&gt;: Heap profile reports the currently live allocations; used to monitor current memory usage or check for memory leaks.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;threadcreate&lt;/strong&gt;: Thread creation profile reports the sections of the program that lead the creation of new OS threads.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;goroutine&lt;/strong&gt;: Goroutine profile report the stack traces of all current goroutines.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;block&lt;/strong&gt;: Block profile show where goroutines block waiting on synchronization primitives (including timer channels). Block profile is not enabled by default; use runtime.SetBlockProfileRate to enable it.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;mutex&lt;/strong&gt;: Mutex profile reports the lock contentions. When you think your CPU is not fully utilized due to a mutex contention, use this profile. Mutex profile is not enabled by default, see runtime.SetMutexProfileFraction to enable.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Additional to the builtin profiles, &lt;a href=&#34;https://golang.org/pkg/runtime/pprof/&#34;&gt;runtime/pprof&lt;/a&gt; package allows you to export your custom profiles, and instrument your code to record&#xA;execution stacks that contributes to this profile.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Debugging Go core dumps</title>
      <link>https://rakyll.org/coredumps/</link>
      <pubDate>Mon, 22 May 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/coredumps/</guid>
      <description>&lt;p&gt;Debugging is highly useful to examine the execution flow&#xA;and to understand the current state of a program.&lt;/p&gt;&#xA;&lt;p&gt;A core file is a file that contains the memory dump of a running&#xA;process and its process status. It is primarily used for post-mortem&#xA;debugging of a program, as well as to understand a program&amp;rsquo;s state&#xA;while it is still running. These two cases make debugging of core dumps&#xA;a good diagnostics aid to postmortem and analyze production&#xA;services.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Automatic Stackdriver Tracing for gRPC</title>
      <link>https://rakyll.org/grpc-trace/</link>
      <pubDate>Wed, 22 Mar 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/grpc-trace/</guid>
      <description>&lt;p&gt;In monolithic systems, it is relatively easy to collect diagnostic&#xA;data from the building blocks of a program. All modules live within&#xA;one process and share common resources to report logs and errors.&lt;/p&gt;&#xA;&lt;p&gt;Once you are distributing your system into microservices, it becomes&#xA;harder to follow a call starting from the user&amp;rsquo;s entry point until a&#xA;response is served. To address this problem, Google invented&#xA;&lt;a href=&#34;https://research.google.com/pubs/pub36356.html&#34;&gt;Dapper&lt;/a&gt; to instrument and analyze its production services. Dapper-like&#xA;distributed tracing systems allow you to trace a user request from&#xA;the entry point to the response.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Naming tests to self-document</title>
      <link>https://rakyll.org/naming-tests-to-doc/</link>
      <pubDate>Fri, 03 Feb 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/naming-tests-to-doc/</guid>
      <description>&lt;p&gt;Go doesn&amp;rsquo;t specifically enforce you how you choose your test names.&#xA;Tests are a significant contributors for the maintainability&#xA;of your code. Tests not just providing correctness checking&#xA;but also are useful in self documenting your code and its usage.&#xA;On top of that, tests are the single best source to read about&#xA;responsibilities of a type, function, etc.&#xA;This is where naming tests better can help the internal documentation&#xA;and therefore the maintainability of your code.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Style guideline for Go packages</title>
      <link>https://rakyll.org/style-packages/</link>
      <pubDate>Sat, 14 Jan 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/style-packages/</guid>
      <description>&lt;p&gt;Go is about naming and organization as much as everything else in the language.&#xA;Well-organized Go code is easy to discover,&#xA;use and read. Well-organized code is as critical as well designed APIs. The location, name,&#xA;and the structure of your packages are the first elements your users see and interact with.&lt;/p&gt;&#xA;&lt;p&gt;This document&amp;rsquo;s goal is to guide you with common good practices not to set rules.&#xA;You will always need to use your own judgement to pick the most elegant solution&#xA;for your specific case.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go 1.8 development stats</title>
      <link>https://rakyll.org/go18cls/</link>
      <pubDate>Wed, 11 Jan 2017 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/go18cls/</guid>
      <description>&lt;p&gt;Go 1.8 is going to to launched in February 2017. There is a sizable list of&#xA;&lt;a href=&#34;https://beta.golang.org/doc/go1.8&#34;&gt;new features and improvements&lt;/a&gt; on the release notes.&#xA;While these notes is the best summary to see what has happened in the last 6 months,&#xA;I will try to give you some stats to give you a sense of the size of the work.&#xA;I have examined all the changes merged into the tree during the Go 1.8 window and&#xA;will highlight some of the interesting and significant ones.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mutex profile</title>
      <link>https://rakyll.org/mutexprofile/</link>
      <pubDate>Mon, 19 Dec 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/mutexprofile/</guid>
      <description>&lt;p&gt;Go 1.8 introduces a new profile, the contended mutex profile, that allows you to&#xA;capture a fraction of the stack traces of goroutines with contended mutexes.&lt;/p&gt;&#xA;&lt;p&gt;You need to set the sampling fraction by calling&#xA;&lt;a href=&#34;http://beta.golang.org/pkg/runtime/#SetMutexProfileFraction&#34;&gt;runtime.SetMutexProfileFraction&lt;/a&gt;&#xA;to a value above zero to enable collection.&lt;/p&gt;&#xA;&lt;p&gt;Consider the following program:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import _ &amp;#34;net/http/pprof&amp;#34;&#xA;&#xA;var mu sync.Mutex&#xA;var items = make(map[int]struct{})&#xA;&#xA;runtime.SetMutexProfileFraction(5)&#xA;for i := 0; i &amp;lt; 1000*1000; i++ {&#xA;    go func(i int) {&#xA;        mu.Lock()&#xA;        defer mu.Unlock()&#xA;&#xA;        items[i] = struct{}{}&#xA;    }(i)&#xA;}&#xA;&#xA;http.ListenAndServe(&amp;#34;:8888&amp;#34;, nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run the program, &lt;a href=&#34;http://localhost:8888/debug/pprof/mutex?debug=1&#34;&gt;http://localhost:8888/debug/pprof/mutex&lt;/a&gt; will&#xA;serve the mutex profile. Then, you can use &lt;code&gt;go tool pprof&lt;/code&gt; to examine the profile.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The default GOPATH</title>
      <link>https://rakyll.org/default-gopath/</link>
      <pubDate>Wed, 14 Dec 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/default-gopath/</guid>
      <description>&lt;p&gt;Go 1.8 will set a default GOPATH if the GOPATH env variable is not set.&lt;/p&gt;&#xA;&lt;p&gt;The requirement of setting a GOPATH has been a major issue for Go users&#xA;who installed the Go tools for the first time and got the&#xA;&amp;ldquo;you have to set a GOPATH&amp;rdquo; error in their initial experience with the tools.&#xA;Explaining the GOPATH is and instructing how to set this env variable were both&#xA;distracting new users away from using Go. This was especially true for users who&#xA;are not necessarily developing in Go but using &lt;code&gt;go get&lt;/code&gt; to download commands.&lt;/p&gt;</description>
    </item>
    <item>
      <title>HTTP/2 Server Push</title>
      <link>https://rakyll.org/http2push/</link>
      <pubDate>Sat, 10 Dec 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/http2push/</guid>
      <description>&lt;p&gt;Go 1.8 is going to feature support for HTTP/2 server push.&lt;/p&gt;&#xA;&lt;p&gt;HTTP/2 has many features designed to make the Web faster. One of those features&#xA;is the server push, the ability to send resources before the client asks for it.&#xA;This feature enables websites to push assets like JavaScript and CSS files&#xA;before waiting for the web page to be loaded and asking for those resources.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;net/http&lt;/code&gt; package will support server push by exposing a &lt;a href=&#34;https://tip.golang.org/pkg/net/http/#Pusher&#34;&gt;Pusher API&lt;/a&gt;&#xA;that will be supported by HTTP/2 ResponseWriters. This interface is only implemented when HTTP/2 is available.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Deprecation notices in Go</title>
      <link>https://rakyll.org/deprecated/</link>
      <pubDate>Thu, 08 Dec 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/deprecated/</guid>
      <description>&lt;p&gt;In Go, for a long time, we didn&amp;rsquo;t have a convention to label the deprecated APIs.&#xA;In the past years, there is new convention emerged to add deprecation notices to the docs.&lt;/p&gt;&#xA;&lt;p&gt;Today, standard library uses this specific format.&lt;/p&gt;&#xA;&lt;p&gt;As an example, Go 1.8 deprecates &lt;a href=&#34;https://tip.golang.org/pkg/database/sql/driver/#Execer&#34;&gt;&lt;code&gt;sql/driver.Execer&lt;/code&gt;&lt;/a&gt;&#xA;and adds a deprecation notice to its godoc.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// Execer is an optional interface that may be implemented by a Conn.&#xA;//&#xA;// If a Conn does not implement Execer, the sql package&amp;#39;s DB.Exec will&#xA;// first prepare a query, execute the statement, and then close the&#xA;// statement.&#xA;//&#xA;// Exec may return ErrSkip.&#xA;//&#xA;// Deprecated: Drivers should implement ExecerContext instead (or additionally).&#xA;type Execer interface {&#xA;&#x9;Exec(query string, args []Value) (Result, error)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The deprecation notice should be in the godoc, begin with string &amp;ldquo;Deprecated: &amp;quot; and follow with&#xA;a tip for replacement.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using contexts to avoid leaking goroutines</title>
      <link>https://rakyll.org/leakingctx/</link>
      <pubDate>Tue, 25 Oct 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/leakingctx/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://godoc.org/pkg/context&#34;&gt;context&lt;/a&gt; package makes it possible&#xA;to manage a chain of calls within the same call path by signaling context&amp;rsquo;s&#xA;Done channel.&lt;/p&gt;&#xA;&lt;p&gt;In this article, we will examine how to use the context package to&#xA;avoid leaking goroutines.&lt;/p&gt;&#xA;&lt;p&gt;Assume, you have a function that starts a goroutine internally. Once this&#xA;function is called, the caller may not be able to terminate the goroutine&#xA;started by the function.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// gen is a broken generator that will leak a goroutine.&#xA;func gen() &amp;lt;-chan int {&#xA;&#x9;ch := make(chan int)&#xA;&#x9;go func() {&#xA;&#x9;&#x9;var n int&#xA;&#x9;&#x9;for {&#xA;&#x9;&#x9;&#x9;ch &amp;lt;- n&#xA;&#x9;&#x9;&#x9;n++&#xA;&#x9;&#x9;}&#xA;&#x9;}()&#xA;&#x9;return ch&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The generator above starts a goroutine with an infinite loop,&#xA;but the caller consumes the values until n is equal to 5.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Debugging code generation in Go</title>
      <link>https://rakyll.org/codegen/</link>
      <pubDate>Sat, 15 Oct 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/codegen/</guid>
      <description>&lt;p&gt;&lt;em&gt;Last week, I was at &lt;a href=&#34;http://www.dotgo.eu/&#34;&gt;dotGo&lt;/a&gt;.&#xA;I gave a very short lightning talk about inspection of code generation&#xA;with the tools already available in the toolchain. This post goes through the talk for&#xA;those who didn&amp;rsquo;t have the privilege to be at the conference. Slides are also&#xA;available at &lt;a href=&#34;https://go-talks.appspot.com/github.com/rakyll/talks/gcinspect/talk.slide&#34;&gt;go-talks&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Throughout this article, we will use the following program:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;package main&#xA;&#xA;import &amp;quot;fmt&amp;quot;&#xA;&#xA;func main() {&#xA;    sum := 1 + 1&#xA;    fmt.Printf(&amp;quot;sum: %v\n&amp;quot;, sum)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;toolchain&#34;&gt;Toolchain&lt;/h3&gt;&#xA;&lt;p&gt;Go build command encapsulates a bunch of underlying tools such as&#xA;the compiler and the linker.&#xA;But, it also provides more details about the build process optionally.&#xA;&lt;code&gt;-x&lt;/code&gt; is a flag that makes go build output what is being invoked.&#xA;If you want to see what the components of the toolchain are,&#xA;which sequence they are invoked and which flags being used, use &lt;code&gt;-x&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Keeping Go a human-first language</title>
      <link>https://rakyll.org/human-first/</link>
      <pubDate>Tue, 11 Oct 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/human-first/</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclaimer: I forked my opinions on this one from a barely readable Twitter thread&#xA;and wanted to write it down how I feel about keeping the language internals away&#xA;from the users, especially from the newcomers. This is not a skill-level concern,&#xA;it is a core goal of Go to provide a high-level programming language that saves users from&#xA;excessive mental overhead. Note that these&#xA;are personal opinions and are not written on the behalf of a group.&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go tooling essentials</title>
      <link>https://rakyll.org/go-tool-flags/</link>
      <pubDate>Sun, 25 Sep 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/go-tool-flags/</guid>
      <description>&lt;p&gt;New to the Go tools? Or do you want to expand your knowledge? This article is&#xA;about the flags for the Go tools everyone should know.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Disclaimer: This article might be slightly biased. This is a collection of&#xA;flags I personally use and flags people around me having trouble finding references for.&#xA;If you have more ideas, ping me on &lt;a href=&#34;https://twitter.com/rakyll&#34;&gt;Twitter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;-go-build--x&#34;&gt;$ go build -x&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;-x&lt;/code&gt; lists all the commands go build invokes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Examples coverage</title>
      <link>https://rakyll.org/examples-coverage/</link>
      <pubDate>Thu, 08 Sep 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/examples-coverage/</guid>
      <description>&lt;p&gt;Go programming language provides many unique good features to &lt;!-- raw HTML omitted --&gt;&#xA;write and maintain examples&lt;!-- raw HTML omitted --&gt; for your packages backed by the testing tools.&lt;/p&gt;&#xA;&lt;p&gt;As an addition to the test coverage and test coverage report, &lt;code&gt;go test&lt;/code&gt;&#xA;also can provide coverage for testable examples.&lt;/p&gt;&#xA;&lt;p&gt;Use the following commands in your package to use the&#xA;&lt;code&gt;-run&lt;/code&gt; flag to only the match the example tests and view the results&#xA;in your browser.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Parallelize your table-driven tests</title>
      <link>https://rakyll.org/parallelize-test-tables/</link>
      <pubDate>Tue, 06 Sep 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/parallelize-test-tables/</guid>
      <description>&lt;p&gt;With Go 1.7, testing package supports sub-tests that allows you to run&#xA;multiple smaller tests from a test case. Each sub test is reported&#xA;independently in the &lt;code&gt;go test&lt;/code&gt; output. More information about these&#xA;recent additions can be found at &lt;a href=&#34;https://speakerdeck.com/mpvl/advanced-testing-concepts-for-go-1-dot-7&#34;&gt;Marcel van Lohuizen&amp;rsquo;s recent talk&lt;/a&gt;&#xA;from GolangUK 2016.&lt;/p&gt;&#xA;&lt;p&gt;These additions to Go 1.7 enabled reporting and other testing.T&#xA;functionality for subtests. One of the biggest contributions of the&#xA;recent changes is to be able to use these features for table-driven tests.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Instruments to profile Go programs</title>
      <link>https://rakyll.org/instruments/</link>
      <pubDate>Fri, 02 Sep 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/instruments/</guid>
      <description>&lt;p&gt;Apple has a suite of instrumentation and tracing tools for performance&#xA;analysis available as a part of their Xcode tooling set. In this article,&#xA;we will use &lt;a href=&#34;https://developer.apple.com/library/prerelease/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/&#34;&gt;Instruments&lt;/a&gt;&#xA;to record and analyze the CPU profile of a Go program.&lt;/p&gt;&#xA;&lt;p&gt;Instruments also provide a large set of macOS-specific tracing and profiling&#xA;if you have performance issues specifically on darwin.&lt;/p&gt;&#xA;&lt;p&gt;Some of these specific profiles are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;System trace: Collects comprehensive information about system calls,&#xA;scheduling, user-kernel space transitions. (Available only on OSX.)&lt;/li&gt;&#xA;&lt;li&gt;System usage: Gives very detailed output about I/O system activity.&#xA;(Available only on iOS.)&lt;/li&gt;&#xA;&lt;li&gt;File Activity: Monitors file and directory activity such as open/close,&#xA;permission modifications, creation, copying and moving.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Instruments provide a rich and very easy to use UI to display profiles.&#xA;I highly recommend it as an addition to existing profiler UIs and visualizers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bidirectional gRPC streaming for Go</title>
      <link>https://rakyll.org/grpc-streaming/</link>
      <pubDate>Tue, 30 Aug 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/grpc-streaming/</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclaimer: This article is not about a core Go package or tool but &lt;a href=&#34;http://www.grpc.io/&#34;&gt;gRPC&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;gRPC provides support for implementing streaming endpoints as well as&#xA;streaming support in their clients. Bidirectional streaming is useful&#xA;if you want both server and client to be able to communicate&#xA;to the other side independently in a full duplex fashion.&lt;/p&gt;&#xA;&lt;p&gt;In this article, I will dig into how to use the streaming gRPC&#xA;Go client to talk to a streaming API endpoint.&lt;/p&gt;</description>
    </item>
    <item>
      <title>About</title>
      <link>https://rakyll.org/about/</link>
      <pubDate>Sat, 27 Aug 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/about/</guid>
      <description>&lt;h3 id=&#34;about-the-author&#34;&gt;About the author&lt;/h3&gt;&#xA;&lt;p&gt;I work at Google working on our AI infrastructure.&#xA;I&amp;rsquo;ve spent many years at Google where&#xA;I worked on Google Drive, the API infrastructure,&#xA;Go Programming Language, and our monitoring stack.&lt;/p&gt;&#xA;&lt;p&gt;I live in San Francisco, CA and I&amp;rsquo;m a polyglot.&lt;/p&gt;&#xA;&lt;h3 id=&#34;contact&#34;&gt;Contact&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Email: &lt;a href=&#34;mailto:jbd@google.com&#34;&gt;jbd@google.com&lt;/a&gt;, &lt;a href=&#34;mailto:rakyll@rakyll.org&#34;&gt;rakyll@rakyll.org&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Github:  &lt;a href=&#34;https://github.com/rakyll&#34;&gt;rakyll&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Twitter: &lt;a href=&#34;https://twitter.com/rakyll&#34;&gt;rakyll&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Apply transformations to Go code with eg</title>
      <link>https://rakyll.org/eg/</link>
      <pubDate>Sat, 27 Aug 2016 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/eg/</guid>
      <description>&lt;p&gt;If you are willing to make large scale refactoring in your&#xA;Go programs, automating the refactoring tasks is more desirable than&#xA;manual editing. &lt;code&gt;eg&lt;/code&gt; is a program that allows you to perform transformations&#xA;based on template Go files.&lt;/p&gt;&#xA;&lt;p&gt;To install the tool, run the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ go get golang.org/x/tools/cmd/eg&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;eg&lt;/code&gt; requires a template file to look for which transformation it should&#xA;apply to your source code. What&amp;rsquo;s nice is that the template file is a Go file&#xA;with little annotations.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calling Go from Swift</title>
      <link>https://rakyll.org/swift/</link>
      <pubDate>Sat, 03 Oct 2015 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/swift/</guid>
      <description>&lt;p&gt;&lt;em&gt;Note: Swift bindings are highly experimental and subject to change.&#xA;This work must currently be classified as preliminary work and we will&#xA;be improving APIs in the long term.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;As a part of the Go Mobile, we have announced tools and packages that&#xA;make language bindings from Java to Go and Objective-C to Go available.&#xA;A relatively new and less documented aspect of the bindings is the&#xA;availability of the Swift to Go calls. This tutorial will explain you&#xA;how to make your initial Swift to Go function invocation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go cross compilation</title>
      <link>https://rakyll.org/cross-compilation/</link>
      <pubDate>Tue, 08 Sep 2015 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/cross-compilation/</guid>
      <description>&lt;p&gt;Note: This article extends &lt;a href=&#34;http://dave.cheney.net/2015/03/03/cross-compilation-just-got-a-whole-lot-better-in-go-1-5&#34;&gt;Dave Cheney’s Go 1.5 cross compilers&lt;/a&gt; post.&lt;/p&gt;&#xA;&lt;p&gt;Cross compilers got easier with Go 1.5.&#xA;You don’t have to bootstrap the standard library and toolchain as you&#xA;used to do prior to 1.5.&lt;/p&gt;&#xA;&lt;h3 id=&#34;if-cgo-is-not-required&#34;&gt;If cgo is not required&lt;/h3&gt;&#xA;&lt;p&gt;The go tool won’t require any bootstrapping if cgo is not required.&#xA;That allows you to target the following program to any GOOS/GOARCH without&#xA;requiring you to do any additional work. Invoke &lt;code&gt;go build&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Concrete first, abstract later</title>
      <link>https://rakyll.org/concrete-first-abstract-later/</link>
      <pubDate>Sat, 18 Oct 2014 11:27:27 -0400</pubDate>
      <guid>https://rakyll.org/concrete-first-abstract-later/</guid>
      <description>&lt;p&gt;If there is one standout language feature in Go, it is interfaces. Go&amp;rsquo;s internals combine useful ideas from various type systems, inevitably piquing curiosity. I recently surveyed globally available open source Go code bases for interface declarations, and the results indicate that Go developers often pollute their codebases with interfaces no one needs or will ever use.&lt;/p&gt;&#xA;&lt;p&gt;Don’t export any interfaces until you have to.&lt;/p&gt;&#xA;&lt;p&gt;Interfaces are great, but interface pollution is not. You are likely coming to Go from a language (often a static one) that generates a dispatch table during compilation, where the compiler requires you to explicitly declare the interfaces a type implements. That’s how the compiler generates a vtable with pointers to all available virtual functions. If your background is in C++ or Java, you might have a habit of starting your codebase with abstract types and writing the concrete implementation as a follow-up exercise.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Archive</title>
      <link>https://rakyll.org/archive/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://rakyll.org/archive/</guid>
      <description></description>
    </item>
  </channel>
</rss>
