Quantcast
Channel: Ambassador to the Computers
Browsing all 25 articles
Browse latest View live

Reading Camlp4, part 3: quotations in depth

(I set myself the goal of posting every week, but the latest Skydeck release has kept me busy, and it turned out I didn't understand the following as well as I thought.)After seeing the examples of...

View Article



Reading Camlp4, part 4: consuming OCaml ASTs

It's easy to think of Camlp4 as just "defmacro on steroids"; that is, just a tool for syntax extension, but it is really a box of independently-useful tools. As we've seen, Camlp4 can be used purely...

View Article

Equeue compared to Lwt

I feel like taking a break from Camlp4, so in this post I'll take a look at two libraries for asynchronous networking programming in OCaml: Equeue and Lwt. Each provides cooperative multithreading and...

View Article

Monadic functional reactive AJAX in OCaml

Yesterday I released three related projects which I've been working on for a long time: ocamljs, a Javascript backend for ocamlc, along with some libraries for web programmingorpc, a tool for...

View Article

Sudoku in ocamljs, part 1: DOM programming

Let's make a Sudoku game with ocamljs and the Dom library for programming the browser DOM. Like on the cooking shows, I have prepared the dish we're about to make beforehand; why don't you taste it...

View Article


Sudoku in ocamljs, part 2: RPC over HTTP

Last time we made a simple user interface for Sudoku with the Dom module of ocamljs. It isn't a very fun game though since there are no pre-filled numbers to constrain the board. So let's add a button...

View Article

Sudoku in ocamljs, part 3: functional reactive programming

In part 1 and part 2 of this series, we made a simple Sudoku game and connected it to a game server. In this final installment I want to revisit how we check that a board satisfies the Sudoku rules....

View Article

Lwt and Concurrent ML

Programming concurrent systems with threads and locks is famously, even fabulously, error-prone. With Lwt's cooperative threads you don't have to worry so much about protecting data structures against...

View Article


Reading Camlp4, part 5: filters

Hey, long time no see!It is high time to get back to Camlp4, so I would like to pick up the thread by covering Camlp4 filters. We have previously considered the parsing and pretty-printing facilities...

View Article


Inside OCaml objects

In the ocamljs project I wanted to implement the OCaml object system in a way that is interoperable with Javascript objects. Mainly I wanted to be able to call Javascript methods with the OCaml method...

View Article

Updated backtrace patch

I’ve updated my backtracepatch to work with OCaml 3.11.x as well as 3.10.x. The patch providesaccess to backtraces from within a program (this is already provided in stock 3.11.x)backtraces for...

View Article

orpc 0.3

I am happy to announce version 0.3 of orpc, a tool for generating RPC bindings from OCaml signatures. Orpc can generate ONC RPC stubs for use with Ocamlnet (in place of ocamlrpcgen), and it can also...

View Article

Image may be NSFW.
Clik here to view.

How froc works

.post img { border: none; } I am happy to announce the release of version 0.2 of the froc library for functional reactive programming in OCaml. There are a number of improvements:better event model:...

View Article


Reading Camlp4, part 6: parsing

In this post I want to discuss Camlp4’s stream parsers and grammars. Since the OCaml parsers in Camlp4 (which we touched on previously) use them, it’s necessary to understand them in order to write...

View Article

Reading Camlp4, part 7: revised syntax

As we have seen, Camlp4 contains an alternative syntax for OCaml, the “revised” syntax, which attempts to correct some infelicities of the original syntax, and to make it easier to parse and...

View Article


Reading Camlp4, part 8: implementing quotations

The Camlp4 system of quotations and antiquotations is an awesome tool for producing and consuming OCaml ASTs. In this post (and the following one) we will see how to provide this facility for other...

View Article

Reading Camlp4, part 9: implementing antiquotations

In this post I want to complicate the JSON quotation library from the previous post by adding antiquotations.AST with antiquotationsIn order to support antiquotations we will need to make some changes...

View Article


Reading Camlp4, part 10: custom lexers

As a final modification to our running JSON quotation example, I want to repair a problem noted in the first post—that the default lexer does not match the JSON spec—and in doing so demonstrate the use...

View Article

Mixing monadic and direct-style code with delimited continuations

The Lwt library is a really nice way to write concurrent programs. A big downside, however, is that you can’t use direct-style libraries with it. Suppose we’re writing an XMPP server, and we want to...

View Article

ocamljs 0.3

I am happy to announce version 0.3 of ocamljs. Ocamljs is a system for compiling OCaml to Javascript. It includes a Javascript back-end for the OCaml compiler, as well as several support libraries,...

View Article
Browsing all 25 articles
Browse latest View live




Latest Images