Posts tagged Author: Asumu Takikawa

Tutorial: Racket FFI, part 3

:: Racket, FFI, tutorial

By: Asumu Takikawa

This is part 3 of my tutorial for using the Racket FFI. You can find part 1 here and part 2 here.

In this post, we will experiment with some low-level operations with pointers, union types, and custom C types. The main takeaway will be the custom C types, which let you define abstractions that hide the details of the C representation when manipulating data in Racket.

Tutorial: Racket FFI, Part 2

:: Racket, FFI, tutorial

By: Asumu Takikawa

This is part 2 of my tutorial on using the Racket FFI. If you haven’t read part 1 yet, you can find it here. Update: part 3 is also now available here.

Part 2 will continue with more Cairo examples. In this installment, I plan to go over some more advanced FFI hacking such as handling computed argument values, custom return arguments, and using C structs.

Tutorial: Using Racket’s FFI

:: Racket, FFI, tutorial

By: Asumu Takikawa

Update: this post is now part of a series. Part 2 is here and part 3 is here.

I’ve seen several people ask for a tutorial on Racket’s foreign function interface (FFI), which allows you to dynamically load C libraries for use in Racket code. While I think the documentation for the FFI is quite good, it is a lot of information to process and the overview examples may be tricky to run for a beginner.

With that in mind, this blog post will provide a step-by-step tutorial for Racket’s FFI that requires minimal setup. All that you will need to follow along is a copy of Racket and ideally a DrRacket window.

Gradual Typing Across the Spectrum

:: gradual typing, PI meeting

By: Asumu Takikawa

Instead of being Pythonistas, Rubyists, or Racketeers we have to be scientists. — Matthias Felleisen

Yesterday we hosted a PI meeting for the Gradual Typing Across the Spectrum NSF grant, gathering researchers from a number of institutions who work on gradual typing (the meeting program can be found here). In case you aren’t familiar with gradual typing, the idea is to augment dynamically typed languages (think Python or Ruby) with static type annotations (as documentation, for debugging, or for tool support) that are guaranteed to be sound.

Gradual typing is these days a fairly popular area, but the research can seem fragmentary because of the need to support idiosyncratic language features. One of the points of the meeting was to encourage the cross-pollination of the key scientific ideas of gradual typing—the ideas that cross language and platform barriers.