前回から引き続き、Haskell Implementors’ Workshop 2019への参加レポートとして、私の印象に残った発表を紹介します。 今回は、Copilotという、C言語のコードを生成するHaskell製内部DSLについての発表です。 Link to hereCopilot 3.0: a Haskell runtime verification framework for UAVs 発表者: Frank Dedden Royal Netherlands Aerospace Center, Alwyn Goodloe NASA Langley Research Center, Ivan Perez NIA / NASA Formal Methods Haskell製の内部DSLからC言語のソースコードを生成する、Copilotの紹介です。 似た謳い文句の内部DSLとしてivor
{-# LANGUAGE QuasiQuotes #-} import qualified Language.C.Inline as C sigma :: C.CInt -> IO C.CInt sigma x = [C.block| int { int i, ret = 0; for (i = 1; i <= $(int x); i++) ret += i; return ret; }|] main :: IO () main = print =<< sigma 10 inline-cでは、QuasiQuoteでCのコードをHaskellに埋め込むので、LANGUAGEプラグマでこれを使えるようにしないといけません。sigmaという関数は、ご覧のとおり、引数xに対して、1からxまでの和を計算する関数です。基本的にCで普通に書けばいいのですが、$(<型名> <変数名>)などのunquote
Because Haskell is a language of choice for many problem domains, and for scales ranging from one-off scripts to full scale web services, we are fortunate to by now have over 8,000 open source packages (and a few commercial ones besides) available to build from. But in practice, Haskell programming in the real world involves interacting with myriad legacy systems and libraries. Partially because t
Ivory Language The Ivory Language is an eDSL for safe systems programming. You can think of Ivory as a safer C, embedded in Haskell. The Ivory Language compiler is open source software. It is available on github and on hackage: We have two technical papers about Ivory, one covering the language itself and one describing our experiences in building a high-assurance autopilot using Ivory:
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く