Bluish Coder

Programming Languages, Martials Arts and Computers. The Weblog of Chris Double.

Closures in ATS

My last post on ATS was about C style functions. This post covers what I've learnt about closures in ATS. As I mentioned in my last post, closures are functions combined with an environment mapping names to values. These are like closures in dynamic languages that enable you to capture variables in the enclosing scope. To create a closure you... more →

Functions in ATS

Using higher order functions in ATS was a bit of a struggle for me at first due to having to deal with getting types correct. I'm coming from a background of dynamically typed languages where it is easy to create and pass around anonymous functions. Even other typed languages like Haskell proved easy to pick up, primarily because of the... more →

Safer C Code Using ATS

When developing the original Ogg backend for Firefox we had to integrate and use a number of C libraries. Over the months after landing a number of bugs were raised for various issues in the backend. A fair number of these were the result of common coding errors. Things like not checking return values of the C API calls and... more →

ATS Preforking Echo Server

As an exercise in learning more about ATS I worked on porting the preforking echo server I wrote in Pure. I wanted to get a feel for how higher order functions worked so I followed the same structure as the Pure program. The code I ended up with is in preforking1.dats. There is also a pretty-printed version produced by 'atsopt'.... more →

VP8, WebM and Firefox

For all the details on the recent announcing of VP8 video code support in Firefox, the WebM container and playing YouTube videos with Firefox, read Firefox, YouTube and WebM on hacks.mozilla.org. More links: more →