PLT Design has announced a new version of Racket; its Scheme-like general purpose, multi-paradigm programming language Racket 6.7 introduces support for building graphical applications on Android, improvements to the REPL and to the package manager, and extended Typed Racked.
Support for Android GUI programming is provided through the racked-android project. InfoQ has spoken with Jay McCarthy, associate professor at UMass Lowell and creator of racked-android.
Could you explain how the project was born and for what kind of app development it has been used?
Black Swan Learning, LLC (BSL) is one of the current teams in the XPrize Global Learning competition. They funded the development of the port because they are building a “learning operating system” in Racket and the XPrize competition mandates that the learning tool be deployed on Android tablets. I met Byron Davies (the principle at BSL) at RacketCon and he asked for my help building the port and the rest was history.
Technically, Racket has worked on Android since the first version of Android, because the C VM was portable and Matthew Flatt even made an ARM JIT a few years ago. However, we needed to solve some issues connecting Java to Racket to actually build Android apps.
Racket-android aims to make it possible to create OpenGL-based apps. Is adding support for other Android APIs on your roadmap?
BSL is interested in full-screen canvas-based applications, so that was our first target. Using OpenGL is a further pragmatic choice, because it gives us good performance and I already have a 2D OpenGL engine for what the needs are. At this point it would be possible to build an FFI on the Racket side for Android’s Java API, but at this point it doesn’t look like there are any difficult technical challenges (just engineering effort.) We have no plans to implement this.
What advantages does using Racket bring to development for Android specifically? Are there any downsides?
Clearly it is a disadvantage that you have to ignore almost all of the system APIs (but not all of them.) The build process is a little bit exciting because you have to be careful about not using libraries that don’t exist on Android. I don’t think it gives any advantages to Android specifically, but if you have a preference for Racket programming generally (building DSLs, using functional programming predominantly, and so on) then you will have a better time building your Android application.
Other notable additions in Racket 6.7 are:
-
Racket’s REPL uses now
racket/interactive
to support line-editing, command and result history, and meta-commands. Meta-commands make it possible to extend the set of commands known to the REPL. Meta-commands available “out-of-the-box” includebacktrace
to see a backtrace of the last exception,trace
to trace a named function,profile
to profile code statistically or accurately, etc. -
Racket’s package manager (
raco pkg
) allows now to specify authentication credentials through thegit-checkout-credentials
configuration option when installing packages from a Git repository. Additionally,raco pkg
supports tunneling using HTTP CONNECT. -
Typed Racket, which is an extension of Racket enabling the gradual specification of typing information, has been extended to include
racket/os
andracket/db/sqlite
.
Racket version 6.7 is now available on Racket website.