Recently, a new set of sorting functions has landed in Go's golang.org/x/exp/slices package [1]. These functions leverage Go generics to provide a more ergonomic API for sorting (without requiring users to implement sort.Interface), and also deliver a nice performance improvement, as the CL demonstrates. In this post, I'll dive deep into why these generic functions are faster than the existing one
というのを作りました。 モチベーション The Twelve Factor App の設定でも推奨されている通り、昨今のCommand Line Interface (CLI) で利用するアプリケーションやCLIでの開発では環境変数を多用します。これによって多くの環境変数を扱ったり、環境変数に秘匿値を扱ったり、文字数の多い環境変数を扱ったり、という機会も増えました。 環境変数を使うためにはシェルに設定したり、昔ながらの env コマンドを使ったり、dotenvを使ったり、秘匿値を扱うenvchainなどといった便利なツールが用意されています。しかし、 それぞれを個別に使えるよりは統合的に環境変数を管理したい さらに高度な環境変数の設定機能を使いたい という2つの観点から新しいツールを実装しました。 基本的な使い方 zenvの機能は大きく分けると、 CLI上で環境変数を設定 .env ファイ
Writing a document database from scratch in Go: Lucene-like filters and indexes In this post we'll write a rudimentary document database from scratch in Go. In less than 500 lines of code we'll be able to support the following interactions, inspired by Elasticsearch: $ curl -X POST -H 'Content-Type: application/json' -d '{"name": "Kevin", "age": "45"}' http://localhost:8080/docs {"body":{"id":"5ac
The Go 1.18 release adds support for generics. Generics are the biggest change we’ve made to Go since the first open source release. In this article we’ll introduce the new language features. We won’t try to cover all the details, but we will hit all the important points. For a more detailed and much longer description, including many examples, see the proposal document. For a more precise descrip
The Unix shell is pure wizardry. With the right incantation of shell spells, you can organise files, process text, compute data, and feed the output of any program to the input of any other. We might even say, paraphrasing Clarke’s Third Law: Any sufficiently clever shell one-liner is indistinguishable from magic. In this article we’ll explore a package called script that aims to sprinkle some Uni
Go: A Documentary by Changkun Ou <changkun.de> (and many inputs from contributors) This document collects many interesting (publicly observable) issues, discussions, proposals, CLs, and talks from the Go development process, which intends to offer a comprehensive reference of the Go history. Disclaimer Most of the texts are written as subjective understanding based on public sources Factual and ty
Speeding up Go's builtin JSON encoder up to 55% for large arrays of objects I was looking into some of octosql's benchmarks the other day and noticed a large chunk of time in DataStation/dsq is spent in encoding JSON objects. JSON is an intermediate format in DataStation and it's pretty inefficient. But the reason it's used is because almost every scripting language supported by DataStation has a
23 Apr 2017 Reproducing Go binaries byte-by-byte Fully reproducible builds are important because they bridge the gap between auditable open source and convenient binary artifacts. Technologies like TUF and Binary Transparency provide accountability for what binaries are shipped to users, but that's of limited utility if there is no way (short of reverse engineering) of proving that the binary is i
SMTP protocol basics from scratch in Go: receiving email from Gmail I've never run my own mail server before. Before today I had no clue how email worked under the hood other than the very few times I've set up mail clients. I've heard no few times how hard it is to send mail from a self-hosted server (because of spam filters). But how hard can it be to hook up DNS to my personal server and receiv
Go1.18は2022年3月にリリースされました。このリリースはGo言語へのジェネリクスの実装を含んでいます。 この記事ではできるだけ最新の仕様と用語法にもとづいてジェネリクスの言語仕様について解説していきます。 更新履歴 2024/01/03: Go1.21(2023-08-08)でcmpパッケージが標準ライブラリに追加されたことに対応しました。 2023/02/23: Go1.20(2023-02-01)のcomparableの仕様変更に対応しました。 次の関連資料があります: The Go Blog - All your comparable types Griesemer氏によるGo公式ブログです。 Go言語のBasic Interfaceはcomparableを満たすようになる(でも実装するようにはならない) 上記の内容に対する筆者の解説記事です。Go1.20リリース前に書いたの
Every once in a while someone notices the first commit in the Go repo is dated 1972: % git log --reverse --stat commit 7d7c6a97f815e9279d08cfaea7d5efb5e90695a8 Author: Brian Kernighan <bwk> AuthorDate: Tue Jul 18 19:05:45 1972 -0500 Commit: Brian Kernighan <bwk> CommitDate: Tue Jul 18 19:05:45 1972 -0500 hello, world R=ken DELTA=7 (7 added, 0 deleted, 0 changed) src/pkg/debug/macho/testdata/hello.
Principal Engineer @ New Relic, Founding Engineer @ Pixie Labs Go is a garbage collected language. This makes writing Go simpler, because you can spend less time worrying about managing the lifetime of allocated objects. Memory management is definitely easier in Go than it is in, say, C++. But it’s also not an area we as Go developers can totally ignore, either. Understanding how Go allocates and
February 2022 Recently I improved the performance of GoAWK – my AWK interpreter written in Go – by switching from a tree-walking interpreter to a bytecode compiler with a virtual machine interpreter. While doing that, I thought it’d be interesting to see how much the performance of Go itself has improved over the years. There are many ways programs written in Go have gotten faster: the Go team and
Hello! I wrote a comic last week called “life of a DNS query” that explains how DNS resolvers work. In this post, I want to explain how DNS resolvers work in a different way – with a short Go program that does the same thing described in the comic. The main function (resolve) is actually just 20 lines, including comments. I usually find it easier to understand things work when they come in the for
package main import ( "fmt" "os" g "github.com/ddddddO/gdag" ) func main() { var dag *g.Node = g.DAG("ゴール(目的)") var design *g.Node = g.Task("設計") reviewDesign := g.Task("レビュー対応") developFeature1 := g.Task("feature1開発") developFeature1.Note("xxが担当") reviewDevelopFeature1 := g.Task("レビュー対応") developFeature2 := g.Task("feature2開発").Note("yyが担当") reviewDevelopFeature2 := g.Task("レビュー対応") prepareInfra
Hajime Hoshi 2022-01-03 This is an English translation of my article in Japanese. tl;dr Previously, we compiled a Go program into a WebAssembly and then converted it into C++ files to make it run on Nintendo Switch. Now, I have succeeded in compiling a Go program into a native binary for Nintendo Switch, and also running a game there. I replaced system calls with C function calls using the -overla
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く