並び順

ブックマーク数

期間指定

  • から
  • まで

121 - 160 件 / 248件

新着順 人気順

OCamlの検索結果121 - 160 件 / 248件

  • OCaml 5.0.0 is out!

    We have the pleasure of celebrating the birthdays of Jane Austen and Arthur C. Clarke by announcing the release of OCaml version 5.0.0. The highlight of this new major version of OCaml is the long-awaited runtime support for shared memory parallelism and effect handlers. This multicore support is the culmination of more than 8 years of effort, and required a full rewrite of the OCaml runtime envir

    • Standard ML in 2020 | notes.eatonphil.com

      Incredibly, Standard ML implementations are still actively developed. MLton, Poly/ML, MLKit, SML# and SML/NJ are the most prominent. Discussion on the future direction of Standard ML remains healthy as well. And somehow OCaml's lesser known cousin still beats out OCaml for multicore threading support (in Poly/ML). While MLton hasn't merged with MultiMLton or RTMLton to support multicore, a new for

      • Sketch.sh - Interactive ReasonML/OCaml sketchbook

        Sketching ReasonML/OCaml code with inline evaluation results

        • プログラミング in OCaml 〜関数型プログラミングの基礎からGUI構築まで

          プログラミング in OCaml 〜関数型プログラミングの基礎からGUI構築まで〜 (GIHYO Digital Publishing, amazon, 楽天Kobo, yahoo, cbook24.com) PDF/EPUB 版を販売しているGIHYO Digital Publishing のページ おしらせ EPUB版が GIHYO Digital Publishing, Amazon, 楽天Koboで販売開始です.GIHYO Digital Publishing だと pdf とのセット販売(価格は同じ)です. (2014.12.10) 長い間,出版社在庫切れとなっていましたが,この度,細かい修正を施した pdf 版の販売を GIHYO Digital Publishing にて開始しました.価格は 1,400 円と冊子体の半額です! (2012.08.29) 第16章のプログラム

          • OCamlでできるだけ型注釈を書かずに済ませる - Qiita

            これはAdvent Calendarとか関係なくなんとなく書かれた記事です。 ML系言語で型注釈が必要なケース - Qiita にある通り、OCamlには型注釈なしではコンパイルが通らないケースがいくつかある。 そのような場合でも、別の書き方をすることで型注釈なしで済ませる/より少ない型注釈で済ませる方法を紹介する。 GADTs type 'a t = | Int : int -> int t | Bool : bool -> bool t let f : type a. a t -> int -> bool = fun t y -> match t with | Int x -> y >= 2 | Bool x -> x このケースでは、型注釈を付けないと、 Int x の時点で f の型が int t -> int -> bool に確定してしまい、 Bool x : bool t ≠

              OCamlでできるだけ型注釈を書かずに済ませる - Qiita
            • Magic-trace: Diagnosing tricky performance issues easily with Intel Processor Trace

              Posts about interviewing at Jane Street and our internship program Intel Processor Trace is a hardware technology that can record all program execution flow along with timing information accurate to around 30ns. As far as I can tell almost nobody uses it, seemingly because capturing the data is tricky and, without any visualization tools, you’re forced to read enormous text dumps. Magic-trace is a

                Magic-trace: Diagnosing tricky performance issues easily with Intel Processor Trace
              • 10行LISP評価器の実装例(各言語まとめ) - Qiita

                筆者いつもの各言語お遊び記事です.【関連記事】その1,その2,その3 目的 (表)様々なプログラミング言語によるラムダ式(静的スコープ)実装のリファレンスとするため. (裏)ラムダ式プログラミングを実装レベルで布教するため.難解プログラミングじゃないやい. 【参考】ラムダ式プログラミング一時間体験講座(Python/Ruby/JavaScript同時並行版) LISP評価器の仕様 基本構文:lambda,if.Lisp-1のレキシカルスコープ.シンボルとして文字列を使用. 基本関数:=,+,-.値として整数が利用可能. 実行コードはJSONの配列構造.カレントディレクトリのsample.jsonから読み込み. 評価器本体で10行程度(1行80字以下目安,基本関数適用やユーティリティ関数定義は除く). 実行コードは基本的にS式表現と同じであり,構文・関数名と共にSchemeのサブセット仕様と

                  10行LISP評価器の実装例(各言語まとめ) - Qiita
                • Irmin

                  ExamplesBelow is a simple example of setting a key and getting the value out of a Git based, filesystem-backed store. open Lwt.Syntax (* Irmin store with string contents *) module Store = Irmin_git_unix.FS.KV(Irmin.Contents.String) (* Database configuration *) let config = Irmin_git.config ~bare:true "/tmp/irmin/test" (* Commit author *) let author = "Example " (* Commit information *) let info fm

                  • GitHub - CatalaLang/catala: Programming language for literate programming law specification

                    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                      GitHub - CatalaLang/catala: Programming language for literate programming law specification
                    • Two Years of OCaml

                      The other day I saw this post on OCaml discussed in Hacker News and Lobsters. Almost two years ago I rewrote the Austral compiler from Standard ML to OCaml, so I thought I’d share my thoughts on OCaml after using it in writing a complex software project, explaining what is good and what is bad and how it compares mainly to Haskell. If this seems overwhelmingly negative, it’s because the things OCa

                        Two Years of OCaml
                      • Compiling higher order functions with GADTs

                        Implementing first class functions in a bytecode interpreter is trivial. But how do compilers that generate machine code (or lower to C, or SSA) implement higher order functions? Back in 2021, I found an answer when contributing closures to the Pallene compiler. Today I was researching something loosely related, and found yet another neat trick called defunctionalization in this paper. Defunctiona

                        • Learn Lambda Calculus in 10 minutes with OCaml

                          I'm going to teach you the basics of Lambda Calculus really quickly. Lambda Calculus is deep. But I'm covering only the fundamentals here. What is Lambda Calculus? Lambda Calculus (LC) is a model to describe computations. LC describes the syntax and semantics. Syntax A lambda expression (also known as lambda term) can be one of the following three things: Variable Application Abstraction Variable

                            Learn Lambda Calculus in 10 minutes with OCaml
                          • Haskellを始める時に役立つ資料 - Qiita

                            Haskellを始める時に役立つ資料 関数型プログラミングが初めてで、読んでもちょっとわからないって方は OCamlをおすすめします。 OCamlで始める関数型プログラミング プログラミングの基礎は名著です。この本でわからないって方は厳しいと思います。 ※追記 haskellをやっていて、副作用云々はいいから.. ってなった方はOCamlベースのF#がおすすめです。 haskellと並行してやるのもおすすめです。 F# を知ってほしい 日本語リンク集 Haskell 超入門 網羅的に説明されており、とりあえず始める人におすすめ ウォークスルー Haskell 網羅的に説明されており、とりあえず始める人におすすめ Haskell 基本構文のまとめ すごいHaskell楽しく学ぼうの1〜5章の内容をまとめ Haskellらしさって?「型」と「関数」の基本を解説!【第二言語としてのHaskell

                              Haskellを始める時に役立つ資料 - Qiita
                            • 理学部情報科学科3S - okura diary

                              書かないと記憶の彼方に消えてしまうと思うので簡単な振り返りメモです。 対象読者 : そこのあなた 後輩に有益かどうかはわかりません。2Aについては同期のブログ kammer0820.hatenablog.comが詳しいです。 課題のネタバレなどはなるべくないように注意したつもりなのでご安心ください(?) 諸々の成果物は以下にあげてあります。 github.com ネタバレ回避のためにバイナリのみです。(使い方のdocumentはそのうち整理したい) 月2 オペレーティングシステム 月3,4 システムプログラミング実験 火2 離散数学 火3,4 関数論理型プログラミング実験 水2 情報論理 木2 言語処理系論 木3,4 ハードウェア実験 金2 計算機構成論 金3,4 情報科学演習Ⅰ 課外 まとめ 月2 オペレーティングシステム 講義名のとおりOSの仕事や仕組みを一通り学びました。 プロセス管

                                理学部情報科学科3S - okura diary
                              • ScalaのF[_]と高カインド型(Higher Kinded Type)を完全に理解していく - k.dev

                                はじめに Scalaはなんとなく書けるようになったけどライブラリコードとか読めないし、関数型はもっとわかない。 特にF[_]みたいなやついっぱい出てくるけどなに?みたいな人に捧げる記事です。 このようなものは高カインド型などと呼ばれ、なかなか理解が難しいものです。 型のさらなる抽象化の旅に出ましょう。 これはUnderstanding F[_] in Scalaの日本語訳です。 F[_]とかいうすごい抽象的なシンタックスはScalaのあちこちで目にします。 これを直感的に理解して、その意味と使い方がわかるようになりましょう。 Overview この記事の目標はこのシンタックスがなぜ必要か理解することです。 そのために抽象化のはしごをだんだんと上り、次のような疑問に答えていきます。 valueとは? proper typeとは? first-order typeとは? first-order

                                  ScalaのF[_]と高カインド型(Higher Kinded Type)を完全に理解していく - k.dev
                                • The _intf trick

                                  In this post, I explain a trick for avoiding duplication of types between .ml and .mli files that will be familiar to anyone who's worked with Jane Street codebases. The problemOCaml compilation units live a double life: one as source code (foo.ml) and one as header information (foo.mli). This works well in encouraging abstraction, so you'll often see less type information in the .mli than in the

                                  • OCamlで48 Hour Schemeをやってみる その5 (第九、十章) - Arantium Maestum

                                    Write Yourself a Scheme in 48 Hoursの最後の二章をやっていく。入出力と標準ライブラリ作成。 第九章:入出力 stdin, stdoutやファイルに対する入出力を実装する。 github.com 例によって「Haskellだとモナドが出現していろいろ型を頑張らないといけないけどOCamlだから・・・」という案件。 HaskellではIOモナド型のために新しいIOFunc式を用意したりしているが、OCamlだと普通に今まで通りPrimitiveFuncに放り込んでいける。 type expt = (* 省略 *) | PortIn of in_channel | PortOut of out_channel と入出力用のchannelをラップしたPortIn/PortOut式は用意する。あとはIoモジュールでそれを使う関数を定義し、primitives.mlで

                                      OCamlで48 Hour Schemeをやってみる その5 (第九、十章) - Arantium Maestum
                                    • [名大・講義] 計算論

                                      概要プレスルーム著作権お問い合わせクリエイター向け広告掲載開発者向け利用規約プライバシーポリシーとセキュリティYouTube の仕組み新機能を試してみる© 2024 Google LLC

                                        [名大・講義] 計算論
                                      • OCaml 入門その4 モジュール・ファンクタ - Qiita

                                        プログラムの部品だが、OCaml では ストラクチャと呼ぶ。 OCamlのライブラリは全てモジュール(ストラクチャ)として提供される。 ファイル名がモジュール名 example.ml というファイル名 → Example というモジュール。 標準モジュール OCaml組み込みのモジュール郡 (* リスト *) # List.length [1; 2; 3];; - : int = 3 # let q = Queue.create ();; val q : '_a Queue.t = <abstr> (* キュー *) # Queue.add "first" q;; - : unit = () # Queue.take q;; - : string = "first" # Queue.take q;; Exception: Queue.Empty. (* 配列 *) # Array.make

                                          OCaml 入門その4 モジュール・ファンクタ - Qiita
                                        • Lisp implementations

                                          Tiger got to hunt, Bird got to fly; Lisper got to sit and wonder, (Y (Y Y))? Tiger got to sleep, Bird got to land; Lisper got to tell himself he understand. -- Kurt Vonnegut, modified by Darius Bacon

                                          • GitHub - Ekdohibs/camlboot: Experiment on how to bootstrap the OCaml compiler

                                            camlboot is an experiment on the boostraping of the OCaml compiler. It is composed of: An interpreter of OCaml, in the directory interpreter/, which is able to interpret the OCaml compiler. This interpreter is written in a subset of OCaml called miniml, for which a compiler is available as part of the experiment. A compiler for miniml, in the directory miniml/compiler/. This compiler compiles mini

                                              GitHub - Ekdohibs/camlboot: Experiment on how to bootstrap the OCaml compiler
                                            • Data-first and data-last: a comparison

                                              BuckleScript is a quite uncommon project. It takes the compiler from one language, OCaml, and modifies it in a way that it becomes more ergonomic for users of another language: JavaScript. One of the most relevant decisions —probably one of most controversial ones as well— was to choose a data-first design for Belt API (BuckleScript's standard library), as well as introducing a "pipe first" operat

                                                Data-first and data-last: a comparison
                                              • GitHub - yawaramin/dream-html: Render HTML, SVG, MathML, htmx markup from your OCaml Dream backend server

                                                You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                                  GitHub - yawaramin/dream-html: Render HTML, SVG, MathML, htmx markup from your OCaml Dream backend server
                                                • 効率的な正規表現エンジンを Coq で検証する - fetburner.core

                                                  今年はそれらしきアドベントカレンダーが無いので,この記事は ML アドベントカレンダー 2020 の4日目の記事と言い張ってみます. ML って本を正せば定理証明支援系由来ですし.最後にちょっと OCaml を使ってますし. Coq によって検証された正規表現エンジンは既に存在していて,探せば他にもいくつもあると思うのですが, それらの実装は主として検証の簡単さに重きが置かれており,OCaml のコードを extract して使ってみると実用に堪えないものが多いように思います. 本記事では,以前 OCaml で書いた効率的な実装を Coq に移植して検証します. 加えて,extract によって OCaml のコードを再び生成し, AtCoder の問題に投げてみても TLE にならないことを確認します. 本記事で実装する正規表現エンジンと,その正当性の証明は GitHub に存在します.

                                                    効率的な正規表現エンジンを Coq で検証する - fetburner.core
                                                  • 関数型言語で学ぶプログラミングの基本 | 電子書籍とプリントオンデマンド(POD) | NextPublishing(ネクストパブリッシング)

                                                    インプレス NextPublishing 関数型言語で学ぶプログラミングの基本 著者:川井 俊輝 抽象度の高いプログラミングのスキルを身につける! 関数型プログラミングへの関心が高まる中、多くのプログラミング言語がその核心的な概念を採用しています。この流れを受け、本書ではOCamlという関数型プログラミング言語を通じて、関数型プログラミングの基礎及びその応用について詳しく解説します。 OCamlは、その直感的な文法と高度な抽象化機能を備え、複雑なアプリケーションの開発に適しています。「OCamlとは何か?」「実際に使い物になるのか?」と疑問を持つかもしれませんが、OCamlの学習は関数型プログラミングの理解を深め、さまざまな言語でのプログラミングスキルの向上につながります。 OCamlで学ぶことにより、プログラミングの基本的な概念を習得し、他言語にも適用可能なプログラミング技術を手に入れる

                                                      関数型言語で学ぶプログラミングの基本 | 電子書籍とプリントオンデマンド(POD) | NextPublishing(ネクストパブリッシング)
                                                    • How to print anything in OCaml

                                                      ONE of the big benefits of OCaml is its powerful REPL (also called the toplevel), the interactive command-line utility where you can load modules, type in and execute code, and see its results. The modern REPL, utop, has powerful auto-completion and integration with the build system dune, which enables productive workflows like loading an entire project's libraries in the REPL and interactively ex

                                                        How to print anything in OCaml
                                                      • C#でエラー処理を実装するときにEither型を作ったら良い感じになった

                                                        要約 処理に失敗したことをメソッドの呼び出し元に通知するのに例外を使いたくなかった とはいえTupleでエラーオブジェクトを返すのもなんか取り回しが悪い そこで「2つの型のどちらかが設定されている」を保証するEither型を実装したらめちゃくちゃ書きやすくなった 背景 おそらくC#において「メソッドの処理が失敗した」ことを呼び出し元に通知する一番メジャーな方法は例外オブジェクトを投げる方法だと思います(標準ライブラリの多くがそうやってエラーを通知しています)。 しかし例外を投げるように実装すると、例外は分岐が見えにくく追いかけるのが面倒だし、呼び出し側でtry~catchをいちいち書くのが面倒だし、キャッチが漏れた例外がそのまま上に突き抜けたりとか、色々な問題を孕んでいます。 また、メソッドが例外を投げることがメソッドのシグネチャで表現されないので、あるメソッドを呼び出したときに例外をキャ

                                                          C#でエラー処理を実装するときにEither型を作ったら良い感じになった
                                                        • mapの表現力 - Arantium Maestum

                                                          最近考えるきっかけがあったので書いておく。 一般的にmapやfoldは再帰を使って実装でき、そして再帰に比べて制約がかかっていて表現力が落ちるとされている。むしろその制約があるからこそそのコードの「何をしたくて何をしないか」という意図が明確になるところが好ましい、と。 しかしこの制約はOCamlのような多機能な言語においては「お作法」的な了解によって成り立っていることであり、mapによる繰り返し作用を他の機能と組み合わせて任意のループ的な処理を実装することができる。 その一例: exception Done let x = ref 0 let rec ys = 0::ys let f _ = if !x < 10 then (print_int !x; incr x) else raise Done let _ = try List.map f ys with Done -> [print

                                                            mapの表現力 - Arantium Maestum
                                                          • Announcing MirageOS 4.0.0 | MirageOS

                                                            On behalf of the MirageOS team, I am delighted to announce the release of MirageOS 4.0.0! Since its first release in 2013, MirageOS has made steady progress towards deploying self-managed internet infrastructure. The project’s initial aim was to self-host as many services as possible aimed at empowering internet users to deploy infrastructure securely to own their data and take back control of the

                                                            • Improving the dead code elimination algorithm in js_of_ocaml - Micah Cantor

                                                              I'm looking for a full-time software engineering position starting in January 2024. If you or your team is hiring, please reach out! Introduction This summer I worked as a software engineer intern at Tarides from their Paris office. My project centered on improving the dead code elimination algorithm in the OCaml to JavaScript compiler, js_of_ocaml. In this post, I'll give some background on why t

                                                                Improving the dead code elimination algorithm in js_of_ocaml - Micah Cantor
                                                              • GitHub - andrejbauer/spartan-type-theory: Spartan type theory

                                                                You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                                                  GitHub - andrejbauer/spartan-type-theory: Spartan type theory
                                                                • Getting OCaml Through the Eye of a Needle

                                                                  I think OCaml is a great language. While it’s always too simplistic to put languages on a straight line, I feel it’s alright to say that it’s somewhere in between Java/C#/Go and Rust/Haskell for a couple of reasons: Immutability is the default, but you can use types that are mutable if you need/want to You can throw exceptions if you want, or play it “safe” with a Result type Concurrency can be ha

                                                                    Getting OCaml Through the Eye of a Needle
                                                                  • Oxidizing OCaml: Locality

                                                                    OCaml with Jane Street extensions is available from our public opam repo. Only a slice of the features described in this series are currently implemented. Rust, OCaml, and Resource Management Coming from OCaml, the Rust programming language has many appealing features. Rust’s system for tracking lifetime and ownership allows users to safely express patterns that are awkward in OCaml, such as: Stac

                                                                      Oxidizing OCaml: Locality
                                                                    • Docker上にOCaml+Coqの環境を構築して動かしてみるまで - Qiita

                                                                      はじめに CoqをDocker上にインストールしたのでその手順をまとめます。 CoqのコードはOCamlに変換できるので、変換したコードをOCamlから呼び出してみます。 Dockerのインストールは済んでいる前提で進めていきます。 OPAMのインストール OCaml、CoqをインストールするためにまずOPAMをインストールします。 OPAMはOCamlのパッケージマネージャです。 OPAMをインストールするとOCamlは自動的に入りますが古いバージョンなので新しいバージョンを別にインストールします。 Alpine Linuxのコンテナを起動します。

                                                                        Docker上にOCaml+Coqの環境を構築して動かしてみるまで - Qiita
                                                                      • 関数型プログラミングのデザインパターンひとめぐり

                                                                        このスライドは、2021/11/27 に開催された「JSConf JP 2021」で発表したものです。

                                                                          関数型プログラミングのデザインパターンひとめぐり
                                                                        • Optics vs Lenses, Operationally

                                                                          Optics vs Lenses, Operationally (Update: I’ve given a talk about this blog post, which can be found here.) I’ve been thinking a lot about lenses and optics. They’re both abstract gadgets that model various sorts of bidirectional processes. They are found in machine learning, game theory, database systems, and so on. While optics are more general, it’s understood that they’re equivalent to lenses i

                                                                          • Retrofitting Effect Handlers onto OCaml

                                                                            あけましておめでとうございます、びしょ~じょです。 これは言語実装Advent Calendar2022 17日目の記事です。 諸事情ありましたが端的に申し上げると私の怠慢で大幅に投稿日が遅れました。 1. はじめに OCaml 5.0が去年末にリリースされた。 並列処理のプリミティブに加え、algebraic effectsを用いた並行処理も書けるようになり、これはとても素晴らしいことですよ。 本日はOCaml 5.0のベースとなるMulticore OCamlにおけるalgebraic effectsの実装論文『Retrofitting Effect Handlers onto OCaml』[1]について解説する。 該当論文ではeffect handlersの実装デザインにあたって以下の4つを考慮している: Backward compatibility 存のコード資産に(表層構文はもち

                                                                              Retrofitting Effect Handlers onto OCaml
                                                                            • R5RSのformal semanticsをOCamlで書いた

                                                                              R5RSのformal semanticsをOCamlで書いた 背景 bitのバックナンバーを読んでいたら見つけた 「プログラム検証入門」という記事(1980年9月〜12月号掲載)が非常に面白かった。 その記事に参考文献として載っていた 「数理情報学入門―スコット・プログラム理論」という本を買ってみたら、 これまたすごく面白かった。 この本で使っている記号が、R5RSのformal semanticsで使っている記号と 大体同じであることを思い出し、R5RSのformal semanticsを読み直してみたら、 以前よりしっかり理解できて、これまた非常に楽しかった。 楽しかったのだが、 call-with-valuesの定義 がおかしいことに気づいた。 cwv: E* -> K -> C [call-with-values] cwv = twoarg(λε1ε2κ.applicate ε1

                                                                              • Multicore OCaml - What's coming in 2021

                                                                                DeepCrysTet: A Deep Learning Approach Using Tetrahedral Mesh for Predicting Properties of Crystalline Materials

                                                                                  Multicore OCaml - What's coming in 2021
                                                                                • OCaml 5.1 と Eio で HTTPS クライアントを書く

                                                                                  Eio とは Eio は、OCaml 5.0 から導入された effect handler を用いた非同期処理ライブラリです。つい先日 1.0 がリリースされ、いまアツいです(筆者調べ)。 Eio では既存の Lwt や Async と異なり処理結果が Lwt.t などの型でラップされないため、bind(>>=)や ppx_lwt の let%lwt x = ... のような記法を用いずに(direct style で)コードを書くことができるという特徴があります。例えば単純な例として、5 秒まってから "Hello world!" と出力するようなコードは、Lwt では以下のように >>= を使って書く必要がありますが: open Lwt.Infix Lwt_main.run ( Lwt_unix.sleep 5.0 >>= fun () -> Lwt_io.printf "Hello

                                                                                    OCaml 5.1 と Eio で HTTPS クライアントを書く