This whole adventure began because I wanted to write a C compiler in Go. I wanted to use Chibicc, a tiny C compiler, as a basis since I could start with the first commit and add each feature since each one is a separate commit. However, Chibicc uses GCC to assemble the final binary and since a direct port had already been done before, I wanted to do this only using the Go compiler. Sure, I could t
Go1.24 がついに公開されましたね。その中でとても興味深い改善内容がありました。 1/14 Go's new map implementation in 1.24 is powered by Swiss Tables, a cutting-edge hash table design that significantly boosts performance. Let's break down why this matters and how @CockroachDB's implementation played a key role. 🧐🚀— Peter Mattis (@petermattis) 2025年2月10日 9/14 Performance gains? Benchmarks show Go's new maps are 30%+ faster in many wo
A few weeks ago, we launched Dagger Cloud v3, a completely new user interface for Dagger Cloud. One of the main differences between v3 and its v2 predecessor is that the new UI is written in WebAssembly (WASM) using Go. At first glance, this might seem an odd choice - Go typically isn't the first language you think of when deciding to program a Web UI - but we had good reasons. In this blog post,
Go 1.24 is scheduled for release in February, so it's a good time to explore what's new. The official release notes are pretty dry, so I prepared an interactive version with lots of examples showing what has changed and what the new behavior is. Read on and see! Generic aliases • Weak pointers • Improved finalizers • Swiss tables • Concurrent map • Directory scope • Benchmark loop • Synthetic time
Thanks to the sponsor for today's video - Graphite! Check out stacked PRs, code review tools and more: http://gt.dev/topshelf 0:00 - Intro 0:52 - CTO to Open Source 7:00 - Graphite Ad 8:10 - Future Of Ghostty 21:30 - How It Started 25:29 - Zig vs Rust 29:53 - Go’s Place In The Stack 34:28 - Managing Open Source 42:42 - Motivation 45:49 - AI 52:21 - Live Q&A Twitch https://twitch.tv/ThePrimeag
1. ジェネリクスなしでの開発 ジェネリクスが導入される前に、異なるデータ型をサポートするジェネリック関数を実装するためにいくつかのアプローチがありました。 アプローチ1: 各データ型に対して関数を実装する このアプローチは、極めて冗長なコードと高い保守コストをもたらします。いかなる変更も、すべての関数に対して同じ操作を行う必要があります。さらに、Go言語は同じ名前の関数のオーバーロードをサポートしていないため、外部モジュールからの呼び出しにこれらの関数を公開するのも不便です。 アプローチ2: 最も広い範囲のデータ型を使用する コードの冗長性を避けるために、別の方法は最も広い範囲のデータ型を使用することで、つまりアプローチ2です。典型的な例はmath.Maxで、これは2つの数のうち大きい方を返します。様々なデータ型のデータを比較できるように、math.MaxはGoの数値型の中で最も広い範囲
古いGoのコードが腐ったという話を聞いて、状況はよく分かりませんが、そんなことは基本ないので安心して欲しいという話を書きます。 2行まとめ 一般的なアプリケーション(cgoやHTTPやgoroutineの細かい挙動に依存していない限り)であればGoは古いコードでも動くはず ただし依存先のコードが消えていたり、非互換な変更が入っていたら動かなくなるので、動かしたいならvendorディレクトリ以下にソースコードを入れて完全固定するべき Goは非常に互換性が高い言語 Goはversion 1のリリース以降、互換性を維持しており、コードが動かなくなることは基本的にありません。 実はGo 1.22で初めて非互換な変更(forループの変数を毎回生成する変更)が入りましたが、これにより問題が出るのは、もともとバグがあったコードである可能性が極めて高いです(少なくともGoogle社内で見つかった非互換なコ
はじめに Go Advent Calendar 2024 に参加の皆さま、お疲れさまでした。今年も良い Go ライフを送れたでしょうか。来年も良い Go 縁があると良いですね。 さて今日は strings.Replacer の話をしようと思います。 キーワード置換やってますか GitHub を見ているとよくこんなコードを目にする事があります。 s = strings.ReplaceAll(s, "hoge", "moge") s = strings.ReplaceAll(s, "foo", "bar") s = strings.ReplaceAll(s, "fizz", "buzz") 複数ある特定のキーワードを置換するコードですが、実はとても効率が悪いのです。strings.ReplaceAll は第一引数の文字列を走査し、第二引数にマッチした場合に第三引数へ置換し続ける実装です。つまり
はじめに この記事はenechain Advent Calendar 2024の19日目の記事になります。 enechainでSWEをしている神楽坂です。 業務では、電力の取引仲介をするブローカーが正確・高速にお客様の注文(ナンバー)を管理するための社内ツールを開発しています。 電力という商品は株式などと比較して、どのエリア・時間帯のものか、どのように電力を受渡するか、燃調はあるか、ある場合の具体的な式は何かといった、多種多様な属性が付随します。 そのようなナンバーを素早く正確に管理するためには、特定の属性を持つものをフレキシブルにフィルタリングできる機能が求められます。 そこで price>10 のような記述式のクエリを使ってナンバーをフィルタリングできる機能を実装したので、本記事ではその実現方法について述べます。 なお、実際に業務で扱っている電力ドメインを例にしてしまうと、本題とは異な
The Go Blog Go Protobuf: The new Opaque API Michael Stapelberg 16 December 2024 [Protocol Buffers (Protobuf) is Google’s language-neutral data interchange format. See protobuf.dev.] Back in March 2020, we released the google.golang.org/protobuf module, a major overhaul of the Go Protobuf API. This package introduced first-class support for reflection, a dynamicpb implementation and the protocmp pa
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く