iconLogo
Published:2026/1/2 21:49:11

FMC III爆誕!制御もイケちゃう関数型プログラミング💅💕

超要約: 関数型と命令型の良いとこ取り!最強プログラミングモデル誕生✨

ギャル的キラキラポイント✨ ● 副作用(状態変化)もへっちゃら!関数型プログラミングが進化💖 ● 複雑な計算効果も、ラムダ計算(超シンプル計算🤖)で統一的に扱えちゃう! ● クラウド、AI、Web3.0... 色んな分野で活躍できるポテンシャル!

詳細解説 背景 プログラミングの世界って、関数型と命令型っていう2つの派閥があるんだけど、それぞれ得意不得意があるのね🤔 関数型は、キレイで安全なコードが書けるけど、ちょっと制御が難しい💦 命令型は、ガッツリ制御できるけど、コードがゴチャゴチャしがち… そんな悩みを解決すべく、両方の良いとこ取りした新しい計算モデル「FMC」が生まれたってワケ🌟

方法 FMCは、ラムダ計算(超シンプル計算)をベースにしてて、Krivineマシンっていうモデルを拡張してるんだって! これによって、副作用とか、評価戦略とか、制御フロー操作を、ぜーんぶ統一的に扱えるようになるらしい💖 関数型の良さを残しつつ、命令型の要素もスムーズに取り込めるって、最強じゃん?

続きは「らくらく論文」アプリで

The Functional Machine Calculus III: Control

Willem Heijltjes

The Functional Machine Calculus (Heijltjes 2022) is a new approach to unifying the imperative and functional programming paradigms. It extends the lambda-calculus, preserving the key features of confluent reduction and typed termination, to embed computational effects, evaluation strategies, and control flow operations. The first instalment modelled sequential higher-order computation with global store, input/output, probabilities, and non-determinism, and embedded both the call-by-name and call-by-value lambda-calculus, as well as Moggi's computational metalanguage and Levy's call-by-push-value. The present paper extends the calculus from sequential to branching and looping control flow. This allows the faithful embedding of a minimal but complete imperative language, including conditionals, exception handling, and iteration, as well as constants and algebraic data types. The calculus is defined through a simple operational semantics, extending the (simplified) Krivine machine for the lambda-calculus with multiple operand stacks to model effects and a continuation stack to model sequential, branching, and looping computation. It features a confluent reduction relation and a system of simple types that guarantees termination of the machine and strong normalization of reduction (in the absence of iteration). These properties carry over to the embedded imperative language, providing a unified functional-imperative model of computation that supports simple types, a direct and intuitive operational semantics, and a confluent reduction semantics.

cs / cs.PL / cs.LO