この記事は Haskell Advent Calendar 2021 の21日目の記事です。 2020年に発表されたApple Silicon (Arm) Macは、2021年に新チップ “M1 Pro/Max” が、2022年には新チップ “M1 Ultra” が登場し、ますます勢いを増しています。Mac使いの皆さんはもう手にされましたか? 新しいアーキテクチャーにはハードウェアだけではなくソフトウェアの対応も重要です。この記事では、2022年3月時点のApple Silicon MacへのHaskellエコシステムの対応状況をまとめます。 この記事では、なるべくRosetta 2を使わず、Armネイティブに動作する環境を構築することを目指します。 インストールにどれを使うか UnixでHaskell環境を構築する場合、 パッケージマネージャーを使う GHCupを使う Stackを使う
bgamari - 2021-03-09 A few months ago, Apple released the latest round of Apple hardware built upon their M1 ARM implementation. Today, existing x86-64 GHC releases can be used on M1 hardware using Rosetta emulation. In this post I will describe recent work in GHC to enable native use of the compiler on M1 hardware, as well as some welcome improvements to GHC’s general ARM support coming in GHC 9.
はじめに わたしがHaskellを使い始めてもうそろそろ10年目になります。(タイトルは多少サバを読んでいますね) これまで使ってきた感想をまとめます。 Haskellのつらいところ まずは愚痴らせてください。 コンパイルが遅い 依存モジュールはすべてソースコードからビルドする必要があります。(バイナリ形式のモジュールはありません) 最初のビルドに20分くらい待つのはザラです。 複雑な型システムをつかうと型推論や型レベル計算に時間がかかります。 高速なHaskellプログラムを書くためには多くの関数をインライン化する必要があります。最適化ビルドではインライン展開によってコードサイズが大きくなるので時間がかかります。 デバッグが難しい 公式のGHCiデバッガはありますが、今のところIDEから簡単に利用できるわけではないですし、コンパイル済みのライブラリはデバッグできないです。 近年スタックト
Posted on July 24, 2020 by Luke Lau If you’ve ever had to install haskell-ide-engine or haskell-language-server, you might be aware that it is quite a lengthy process. There are several reasons for this, two of the most significant being: Both haskell-ide-engine and haskell-language-server act as a kitchen sink for plugins. These plugins all depend on the corresponding tool from Hackage, and as a
bgamari - 2020-05-15 The ARM architecture represents an overwhelming majority of CPUs on this planet. Furthermore, there are now GHC users (myself included) who stake their livelihood on being able to deploy their Haskell applications on ARM-based platforms. As such, the task of making GHC run well on ARM has never been more important. This task has a long history, being the project that brought m
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
信頼性はない 都市伝説かもしれん 大体枕詞に特別な理由がなければがつく 思いついたら徐々に更新する それは違うよってことがあったら @Lugendre まで ghc 8.6.5の話(8.8.1は仕事で使ってなくてな......) コンパイル通るかの確認だけなら最適化オプションO0でコンパイルする stackでいうとstack build --fast 動かすときはO2ビルドしたほうがいいが,インライン展開に5億年消費する なんならこのくらいは静的解析に任せてもいいが,でかいプロジェクトだと一定時間動いてハングアップするのしか世の中にないのでオワリ VSCode のせい説もある ghcideに期待 haskell-language-serverがすべてを解決した CIするときは必ずキャッシュする 毎回一から依存関係やGHCのビルドが走って余裕で1時間超えるようになるので データ構造のフィール
C言語やC++にはインラインアセンブリやintrinsics(組み込み関数)があり、最近のCPUで追加された命令を活用したコードを簡単に書くことができます。 一方、Haskell (GHC) にはそのような仕組みはありません1。しかしそれで諦めるのは早い。なんとかしてHaskellからインラインアセンブリっぽいことをしてみましょう。 筆者の環境はx86_64なMacで動かしているGHC 8.6.5です。他の環境では状況が異なる可能性があります。C言語の処理系はClangを使いますが、GCCでも多分同じです。 題材:64ビット整数の積の上位と下位 2つの64ビット整数の積を計算し、上位64ビットと下位64ビット(合わせて128ビット)をそれぞれ計算することを考えます。 C言語やHaskellにあるような通常の乗算 (*) :: Word64 -> Word64 -> Word64 では下位6
次のバージョンである GHC 8.0 では、正格評価用のプラグマして Strict と StrictData が提供されます。環境を作ってみたので、少し試しました。 以下のファイルを用意します。 {-# LANGUAGE DeriveFunctor #-} module A where data List a = Nil | Cons a (List a) deriving (Eq,Functor) xs :: List Int xs = Cons 1 (Cons 2 Nil) 注意: トップレベルの束縛とローカルの束縛では挙動が違います。Strict が効くのは、ローカルの束縛です。なので、GHCi で let を使って試します。 評価が遅延しているかは、GHCi の :sprint コマンドで確かめられます。GHC 7.8 以降の GHCi では MonomorphismRestric
Haskell compilation benchmark But does it run Crysis? View on GitHub NB: The benchmark conlusions are out of date since no results have been collected for Intel and AMDs latest desktop CPU offerings. TL;DR The Intel Core i7-8700K is 20%-30% faster than the AMD Ryzen 7 2700X at Haskell compile workloads, and performs 7%-19% better in terms of performance per Euro when you buy a completely new syste
Browse by time: December 2018 (1) November 2018 (1) October 2018 (1) September 2018 (1) May 2018 (1) April 2018 (1) March 2018 (1) November 2017 (1) August 2017 (2) July 2017 (1) January 2017 (1) September 2016 (1) July 2016 (1) June 2016 (1) May 2016 (1) October 2015 (1) September 2015 (1) August 2015 (1) July 2015 (3) June 2015 (2) May 2015 (1) April 2015 (1) March 2015 (3) February 2015 (4) Jan
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く