並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 69件

新着順 人気順

ocamlの検索結果1 - 40 件 / 69件

ocamlに関するエントリは69件あります。 OCamlプログラミングprogramming などが関連タグです。 人気エントリには 『OCaml でゲームボーイエミュレータを書いた話 - Qiita』などがあります。
  • OCaml でゲームボーイエミュレータを書いた話 - Qiita

    はじめに ブラウザ上で動くゲームボーイエミュレータを OCaml で書きました。以下のページで試せます。 デモページ いくつかの homebrew ROM も一緒になっているのでいろいろ遊んでみてください。おすすめは「Bouncing ball」と「Tobu Tobu Girl」です。最近のスマホならだいたい安定して 60 FPS 出るはずなので、スマホでも遊べます。 レポジトリはこちらです。 スクリーンショット なぜ OCaml でゲームボーイエミュレータ?新しいプログラミング言語を学ぶ過程で以下のように思ったことはないでしょうか? 簡単なプログラムなら書けるが、中規模以上のコード1をどうやって書けばよいのか分からない 発展的な言語機能2も勉強しなんとなく理解した気になったが、実践のなかでどのように活用すればいいのかが分からない OCaml を本格的に勉強し始めてた数ヶ月前の筆者はまさに

      OCaml でゲームボーイエミュレータを書いた話 - Qiita
    • 40歳から始める関数型言語、OCaml - すぎゃーんメモ

      動機 Why OCaml 学習方法 Real World OCaml Github Copilot と ChatGPT オンラインジャッジ (競プロ) Advent of Code その次? 所感 関数型という概念 OCamlの書き味 Rust, Python の経験 AIとの親和性 まとめ 某Nさんがここ最近Haskellとか勉強してて楽しそうで真似してみたくなって、自分も今さらながら何か関数型言語はじめてみるか〜と周りに相談したところOCamlをオススメされたので 今年に入ってからひたすらOCaml書く練習してる。AtCoder Boot camp for BeginnersのEasy 100をようやく終わらせたところ。 pic.twitter.com/POBWhvHHCn— すぎゃーん💯 (@sugyan) April 9, 2023 大西さんが動画の中で感極まっていたけど、宮川さ

        40歳から始める関数型言語、OCaml - すぎゃーんメモ
      • 直和型の代わりにユニオン型を持つ静的型付け関数型言語 Cotton

        // 割る2をする関数の引数が偶数であることを型によって強制する例(実用性はない) data O // 数字の0を表すデータ型 data S(A) forall { A } // +1を表すデータ型 // 型エイリアス type Nat = O | S[Nat] // 非効率すぎる他倍長整数 type Even = O | S[Odd] type Odd = S[Even] // 偶数を引数にとって2で割った結果を言語組込みの整数として返す関数 div2 : Even -> I64 = // 網羅性チェックつきのパターンマッチ | O => 0 | S(S(n)) => 1 + n.div2 TL;DR ユニオン型は直和型の上位互換である(追記あり)。関数型言語を作るときは直和型の代わりにユニオン型を採用するのもあり。 はじめに Cottonというプログラミング言語を2021年の夏頃から作

          直和型の代わりにユニオン型を持つ静的型付け関数型言語 Cotton
        • 関数型プログラミング言語における関数適用構文の歴史的経緯についてのメモ - Arantium Maestum

          先日こういうツイートがあった: Haskellとかの関数型言語を使用しているプログラマの皆様にお聞きしたいんですけど、「関数名 引数 引数 ...」みたいな関数呼び出し構文って見にくくは無いですか?「関数名(引数, 引数, ...)」に慣れたこちらからすると、丸括弧が無いからコード中のどこが関数呼び出しなのかパット見で把握しにくい。— sounisi5011/プログラム (@sounisi5011Prog) February 22, 2022 「見にくくは無いですか?」と聞かれると、個人的には「全然大丈夫です」と答えざるを得ないのだが、次のツイートに関しては考えさせられた: 数式でも函数には丸括弧を使ってるのに、どこのタイミングで丸括弧が消失したのかわからないし、その選択をした理由も思いつかない。— sounisi5011/プログラム (@sounisi5011Prog) February

            関数型プログラミング言語における関数適用構文の歴史的経緯についてのメモ - Arantium Maestum
          • 抽象度の高い関数型言語プログラミングのスキルを身につけるための書籍が発売/「OCaml」を通じて関数型プログラミングを学べる『関数型言語で学ぶプログラミングの基本』【Book Watch/ニュース】

              抽象度の高い関数型言語プログラミングのスキルを身につけるための書籍が発売/「OCaml」を通じて関数型プログラミングを学べる『関数型言語で学ぶプログラミングの基本』【Book Watch/ニュース】
            • GitHub - janestreet/magic-trace: magic-trace collects and displays high-resolution traces of what a process is doing

              magic-trace collects and displays high-resolution traces of what a process is doing. People have used it to: figure out why an application running in production handles some requests slowly while simultaneously handling a sea of uninteresting requests, look at what their code is actually doing instead of what they think it's doing, get a history of what their application was doing before it crashe

                GitHub - janestreet/magic-trace: magic-trace collects and displays high-resolution traces of what a process is doing
              • OCaml Programming: Correct + Efficient + Beautiful — OCaml Programming: Correct + Efficient + Beautiful

                Preface About This Book Installing OCaml Introduction 1. Better Programming Through OCaml 1.1. The Past of OCaml 1.2. The Present of OCaml 1.3. Look to Your Future 1.4. A Brief History of CS 3110 1.5. Summary 2. The Basics of OCaml 2.1. The OCaml Toplevel 2.2. Compiling OCaml Programs 2.3. Expressions 2.4. Functions 2.5. Documentation 2.6. Printing 2.7. Debugging 2.8. Summary 2.9. Exercises OCaml

                • パッケージマネージャを自作するときに考えること - gfnweb

                  プログラミング言語を自前で創っていると,パッケージマネージャが欲しくなってくるものだ.既存パッケージマネージャやそのラッパーによる配布で事足りることも多いが,自前言語の要件とうまく合わなかったりして,真に自分で実装せねばならないこともある.そうした場合,パッケージマネージャをどんな設計にすべきだろうか? 言語固有の都合には触れずになるべく一般に考慮すべき事項を洗い出し,簡単な設計例も提示してみたい. なお,本稿はパッケージマネージャの設計に焦点を当てたものであり,効率的に依存制約を解消するアルゴリズムなど実装の詳細については解説しない.実際例えばOCamlでは 0install-solver というOPAMの裏でも使われているパッケージを利用すれば制約解消アルゴリズムそのものに踏み込まずとも制約解消処理を実装でき,(それ自体に興味があるときを除けば)必ずしもアルゴリズムを理解する必要はない

                  • MoonBit

                    Language DesignExpressive multi-paradigm design, combining the best of dynamic and static, functional and practicalData-oriented language with a robust type systemMultiple backend support including WebAssembly, JavaScript and more.Check Docs AI Integrated PlatformAI-friendly language design, featuring safe-guard, easy testing, minimizing LLM hallucinations.Built-in AI assistant, automating testing

                    • OCaml 製 ActivityPub サーバ Waq の紹介 - HackMD

                      今年に入ってからずっと、OCaml で ActivityPub サーバを書いています。名前は Waq(ワク)で、例によって GitHub で大公開しています。SNS に必要な最低限の機能は揃っていて、README に従うと Docker Compose でデモが動かせるので、よければ試してみてください。

                        OCaml 製 ActivityPub サーバ Waq の紹介 - HackMD
                      • Walk around functional web frontend programming

                        https://opt.connpass.com/event/222709/

                          Walk around functional web frontend programming
                        • 12.2.1. Promises · Functional Programming in OCaml

                          Promises In Lwt, a promise is a write-once reference: a value that is permitted to mutate at most once. When created, it is like an empty box that contains nothing. We say that the promise is pending. Eventually the promise can be resolved, which is like putting something inside the box. Instead of being resolved, the promise can instead be rejected, in which case the box is filled with an excepti

                          • ML のサブセットの型推論器を Coq で検証する - fetburner.core

                            この記事は言語実装 Advent Calendar 2020 の5日目の記事です. 一度でも型推論器を書いたことがあれば,そのあまりの邪悪さ,あるいはその複雑さに恐れ慄いたことでしょう. 参照を用いて単一化を実現しようものなら構文木は参照に汚染され,純粋関数型に実装しようものなら大量の型代入をどのような順序で適用したものか悩まされる. これは Hindley-Milner 型推論器を実装する上での宿命のようなものです. 本記事では,MLのサブセット——型付きλ計算をletと参照で拡張した,let多相をサポートする言語——の型推論器を Coq で実装し,その正当性を証明します. Coq で検証を行うことで我々は型推論器のバグへの恐怖とデバッグの労力から真に解放され,枕を高くして眠ることができることでしょう. もっとも、型付きλ計算を let 多相で拡張した言語の型推論器の正当性は実はすでに証

                              ML のサブセットの型推論器を Coq で検証する - fetburner.core
                            • 限定継続いろいろ | 雑記帳

                              このブログでは限定継続について過去に何回か記事を書きました: LunarMLと継続限定継続と例外とモナド 今回、LunarML向けのVMに限定継続を実装してみて理解が深まったので、改めて記事にします。 限定継続:スタックを使ったざっくりとした説明 今回はスタックを使って限定継続をざっくりと説明してみます。 関数という概念を持つプログラミング言語では、スタックを使って関数の呼び出しを管理することが多いです。コールスタックとか、スタックのバックトレースとか言いますよね。ここではネイティブのスタックか仮想マシンのスタックかというのは問いません。 関数を呼び出すと、フレームと呼ばれる領域がスタックに確保されて、関数への引数やローカル変数はそこに確保されたりします。 例えば、以下のプログラムを考えます: void g() { // すごい計算 } void f() { double j; g();

                              • Release OCaml 5.0.0 · ocaml/ocaml

                                OCaml 5.0.0 introduces a completely new runtime environment with support for shared memory parallelism and effect handlers. As a language, OCaml 5 is fully compatible with OCaml 4 down to the performance characteristics of your programs. In other words, any code that works with OCaml 4 should work the same with OCaml 5. The currently known exceptions to this rule are: the removal of many long-depr

                                  Release OCaml 5.0.0 · ocaml/ocaml
                                • Caramel: massively scalable, type-safe applications

                                  caramel is a functional language for building type-safe, scalable, and maintainable applications Install Docs Discord Code

                                    Caramel: massively scalable, type-safe applications
                                  • GitHub - OCamlPro/owi: WebAssembly Swissknife & cross-language bugfinder

                                    Owi is a toolchain to work with WebAssembly. It is written in OCaml. It provides a binary with many subcommands: owi c: a bug finding tool for C code that performs symbolic execution by compiling to Wasm and using our symbolic Wasm interpreter; owi conc: a concolic Wasm interpreter; owi fmt: a formatter for Wasm; owi opt: an optimizer for Wasm; owi run: a concrete Wasm interpreter; owi script: an

                                      GitHub - OCamlPro/owi: WebAssembly Swissknife & cross-language bugfinder
                                    • GitHub - goblint/cil: C Intermediate Language

                                      CIL is a front-end for the C programming language that facilitates program analysis and transformation. CIL will parse and typecheck a program, and compile it into a simplified subset of C. goblint-cil is a fork of CIL that supports C99, C11 as well as most of the extensions of the GNU C. It makes many changes to the original CIL in an effort to modernize it and keep up with the latest versions of

                                        GitHub - goblint/cil: C Intermediate Language
                                      • 時間を加味したモデリング - DeNA Testing Blog

                                        こんにちは、SWETの鈴木穂高(@hoddy3190)です。 現在SWETチームにて仕様の欠陥をなるべく早くみつける取り組みにチャレンジしています。 欠陥をみつけるタイミングが早ければ早いほど、開発中の手戻りに伴うコストを抑えられます。 たとえば、仕様作成フェーズ、実装フェーズ、QAフェーズの順で開発が進んでいくときに、仕様の欠陥が実装フェーズやQAフェーズでみつかると実装やQAのやり直しを引き起こしかねません。 そうした大きな手戻りを抑えるために仕様の欠陥をなるべく仕様作成フェーズでみつけることを目指します。 対象領域に出てくる要素をモデリングすることは、仕様に潜む欠陥を開発の早い段階でみつけるための、有効な手段のひとつです。 要素には、開発者がこれから作るシステムや、そのシステムのユーザー、そのシステムと直接的または間接的に相互作用する外部のシステムが含まれます。 単に図を書くというモ

                                          時間を加味したモデリング - DeNA Testing Blog
                                        • Writing a Game Boy Emulator in OCaml

                                          IntroductionFor the past few months, I have been working on a project called CAMLBOY, a Game Boy emulator written in OCaml that runs in the browser. You can try it out on the following demo page: Demo Page I included several homebrew ROMs in the demo, so please try them out (I recommend Bouncing ball and Rocket Man Demo). You can also play with it in your mobile browser as it runs at 60 FPS on rec

                                            Writing a Game Boy Emulator in OCaml
                                          • OCamlコンパイラのバックエンドを提供するMalfunctionが面白そう - Arantium Maestum

                                            OCamlのDiscuss掲示板を眺めていたらこんなプロジェクトについての言及があった: github.com Malfunction is a high-performance, low-level untyped program representation, designed as a target for compilers of functional programming languages. OCamlコンパイラの中間表現であるLambda言語(とほぼ同等のもの)を受け取り、OCamlバイトコードかnativeコードへのコンパイルをしてくれるようだ。 (追記:バイトコードにコンパイルできるというのは間違い。実際にはOCamlコンパイラとは別なLambda言語インタプリタがある) Lambda IRはOCamlコンパイラにフラグを渡すと出力してくれる。以前少し調べていくつか記事

                                              OCamlコンパイラのバックエンドを提供するMalfunctionが面白そう - Arantium Maestum
                                            • GitHub - mazeppa-dev/mazeppa: A modern supercompiler for call-by-value functional languages

                                              Supercompilation 1 is a program transformation technique that symbolically evaluates a given program, with run-time values as unknowns. In doing so, it discovers execution patterns of the original program and synthesizes them into standalone functions; the result of supercompilation is a more efficient residual program. In terms of transformational power, supercompilation subsumes both deforestati

                                                GitHub - mazeppa-dev/mazeppa: A modern supercompiler for call-by-value functional languages
                                              • Dark's new backend will be in F#

                                                Welcome HN! Dark is a programming language, structured editor, and infrastructure—all in one—whose goal is to make it 100x easier to build backend services. Check out the website, our What is Dark post, and How Dark deploys in 50ms for more. Thanks for checking us out! Part of a set with Leaving OCaml and Why Dark didn't choose Rust. Nothing in my life so far would have prepared me for the fact th

                                                  Dark's new backend will be in F#
                                                • Dream — Tidy, feature-complete web framework

                                                  let hello who = <html> <body> <h1>Hello, <%s who %>!</h1> </body> </html> let () = Dream.run @@ Dream.logger @@ Dream.router [ Dream.get "/" (fun _ -> Dream.html (hello "world")); ] Dream is an easy-to-use, boilerplate-free Web framework, whose entire API fits on this page! It supports TLS, WebSockets, and GraphQL. HTTP/2 support is transparent. It also includes: a nice log and OCaml runtime confi

                                                  • Eio 1.0 Release: Introducing a new Effects-Based I/O Library for OCaml

                                                    Eio 1.0 Release: Introducing a new Effects-Based I/O Library for OCaml The OCaml 5 update brought much-anticipated support for programming on multiple cores. It also introduced support for concurrency via effect handlers – one of the first mainstream languages to do so. This significant update has had profound performance and UX implications, propelling OCaml into new areas of software development

                                                      Eio 1.0 Release: Introducing a new Effects-Based I/O Library for OCaml
                                                    • 既存言語のミニ版ぽいものまとめた

                                                      東大のCPU実験の記事を読んでいたらお馴染みの MinCaml の他にもいくつか既存言語のミニ版があり、探してみました。 他にもおすすめのミニ言語あれば Twitter: @kaito_tateyama 宛、もしくは discussionにコメント で教えてください。 概要 一般の言語処理系を意識した言語のミニ版っぽいものを挙げます。大学の講義で使用された/教育目的/自作目的など色々です。 ML: MinCaml C: chibicc Ruby: minruby Swift: MinSwift Go: babygo Scala: pscala 追記: mal, quickjs 詳細 ML: MinCaml リポジトリ: esumii/min-caml 東大のCPU実験の記事でお馴染みのMinCaml。これをFPGAの上で動かしてレイトレーシングを行うらしい。 型周りも実装されている教育目的

                                                        既存言語のミニ版ぽいものまとめた
                                                      • 工学部専門科目「プログラミング言語」(2022年度) - HackMD

                                                        工学部専門科目「プログラミング言語」

                                                          工学部専門科目「プログラミング言語」(2022年度) - HackMD
                                                        • soupault

                                                          Soupault (soup-oh) is a static website generator/framework that works with HTML element trees and can automatically manipulate them. It can be described as a robotic webmaster that can edit HTML pages according to your rules, but doesn’t get tired of editing them. You can use soupault for making blogs and other types of websites, pretty much like any other SSGs (Jekyll, Hugo, Eleventy, etc.). Howe

                                                          • GitHub - panglesd/slipshow: An engine for displaying slips, the next-gen version of slides

                                                            Slipshow is a tool specifically designed for technical presentations where traditional slides are not enough. In a slipshow presentation, the equivalent of a slide is called a slip. Each slip is like a slide, but with no bottom limit. That is, the content can be arbitrarily long! During the presentation, the camera will "scroll" down to reveal the hidden content, following a script given by the pr

                                                              GitHub - panglesd/slipshow: An engine for displaying slips, the next-gen version of slides
                                                            • Real World OCaml

                                                              PrologueWhy OCaml?A Brief HistoryThe Base Standard LibraryThe OCaml PlatformAbout This BookWhat to ExpectInstallation InstructionsCode ExamplesContributorsPart 1: Language Concepts1. A Guided TourBase and CoreOCaml as a CalculatorFunctions and Type InferenceType InferenceInferring Generic TypesType Errors Versus ExceptionsTuples, Lists, Options, and Pattern MatchingTuplesOperators in Base and the

                                                              • TaPL のサンプルコードを dune でビルドして読みやすくする

                                                                TaPL(型システム入門 -プログラミング言語と型の理論-) は型システムについて体系的に学べる教科書です。 友人から「型周りちゃんと勉強したいならこれ読むと良いよ〜」と勧められ読んでいるのですが、正直何もわからんという状態なのでサンプルコード(実装)から本文を読み解いています。 この本にはサポートページが存在しており、implementations というセクションからサンプルコードを DL することができます。 ただしこのサンプルコードをそのまま読んでいくのは少し辛いところがあったのでそれを読みやすくできるようにするのが本記事の趣旨です。 TaPL のサンプルコードがやっていること 本文では構文の評価規則や型付け規則を実装していく例が乗っているのですが、配布されるサンプルコードでやっていることはコンパイラの自作です。 評価可能な形に変換したり、それをテストしたりするわけなので、字句解析

                                                                  TaPL のサンプルコードを dune でビルドして読みやすくする
                                                                • First thoughts on Rust vs OCaml

                                                                  I'm about two weeks into Rust now, so this feels like a good time to write a critique, before I get Stockholm Syndrome'd. My main motivation in learning Rust is that I have to maintain some of Dark's Rust code. There was a recent outage related to that code, and I had to learn on the fly, so better to actually know what I'm looking at. I've also been dreaming of rewriting Dark in Rust for quite so

                                                                    First thoughts on Rust vs OCaml
                                                                  • GitHub - colis-anr/morbig: A static parser for POSIX Shell

                                                                    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 - colis-anr/morbig: A static parser for POSIX Shell
                                                                    • OxCaml | About

                                                                      OxCaml is a fast-moving set of extensions to the OCaml programming language. It is both Jane Street’s production compiler, as well as a laboratory for experiments focused towards making OCaml better for performance-oriented programming. Our hope is that these extensions can over time be contributed to upstream OCaml. OxCaml’s primary design goals are: to provide safe, convenient, predictable contr

                                                                      • Bunlog | 読んで良かった入門技術書

                                                                        以前インフラ分かんね~って言ってるフォロイーがいたので、何となく「この本良いよ~」っていうツイートをしたところ、そこそこ反応があって、ちょっと意外でした。 Web 開発の入門レベルの技術書なんてもう大体定番決まってるしみんなまとめてるじゃん、って思ってたんですが、「初めての一歩のその次のレベル」の入門書についてはちょっと需要あるっぽいです。 私は駆け出しに何度も成功している駆け出しエンジニアのプロなので、入門レベルの技術書についてそこそこ詳しくなっています。なのでここでは自分が読んで良かったと思った入門レベルの技術書を書いていきます。随分前に読んだものも含んでて、もしかしたら内容間違ってるかもしれないんで、指摘してくれればありがたいです。また各ジャンルの名称はマジで適当なので許してください 言語処理系とか オブジェクト指向でなぜつくるのか 第 2 版 「オブジェクト指向 入門」って検索した

                                                                          Bunlog | 読んで良かった入門技術書
                                                                        • Type Inference Was a Mistake

                                                                          Type inference is bad. It makes code harder to read, and languages that use it too much are harder to write. It’s a false economy whereby you save unobservable milliseconds of typing today and make everything else worse. Type Inference Makes Code Less Readable If you have an IDE with a working LSP, you can hover over variables to see their types. In VSCode with rust-analyzer I can see the type ann

                                                                          • I'm as shocked as you, but the Darklang backend rewrite is actually complete

                                                                            For the first few years of the life of Darklang, each time we didn't have a library available for our OCaml-based backend, or decided to build a feature in our DB instead of on a proper cloud server, we said "ugh, let's hack this and we can fix it when we rewrite it in Rust". Realizing that Dark was going to be running with a small team for a long time, it was clear that we couldn't keep piling on

                                                                              I'm as shocked as you, but the Darklang backend rewrite is actually complete
                                                                            • Coccinelle: A Program Matching and Transformation Tool for Systems Code

                                                                              What is Coccinelle? Coccinelle is a program matching and transformation engine which provides the language SmPL (Semantic Patch Language) for specifying desired matches and transformations in C code. Coccinelle was initially targeted towards performing collateral evolutions in Linux. Such evolutions comprise the changes that are needed in client code in response to evolutions in library APIs, and

                                                                              • Algebraic Effectsの型システム入門

                                                                                はじめに Algebraic Effectsは計算エフェクトを扱う言語機能である。エフェクトとハンドラから成り、エフェクトの発生をハンドラが捕捉し、なんらかの値を返してエフェクト発生部分からの計算を再開する。エフェクト自体は何もせず、ハンドラが具体的な計算をおこないという部分が重要である。例えばDependency Injectionにおいては、インターフェースで定義されたメソッドがエフェクトの定義、メソッドを呼び出すのがエフェクトの発生、インターフェースの具体的な実装がハンドラ、と対応づけることができる。 Eff言語で実際に例をみてみる。

                                                                                  Algebraic Effectsの型システム入門
                                                                                • 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

                                                                                  新着記事