This is an overview of the various things in my github account. I’ve experimented quite a lot with various kinds of libraries for Java. Since this is all done in my spare time, much of it is in an unfinished state. Some of it is more mature, and I hope it can be usable by others (if not now, then in the not-too-distant future).
Below is a tour of my repos.
bluegosling alpha
This is the largest repo here. It is a collection of libraries for Java with a very wide range of topics. Think of it as an extension to Google’s Guava. It has undergone a lot of tumultuous changes, all in the name of making the organization sane and easier for usage outside of my “personal playground”.
- There are few things here that, for various reasons, are not being considered for Guava. These include things like tuples, persistent collections, and operations like
Lists.filter
andSets.transform
(in the form of filtering and transforming views). - An API for describing complex computations as dependency graphs of steps, which can then be executed in a way that fully exploits possible parallelism.
- There are several concurrency packages here, too. They include new types of locks and synchronizers, a more feature-rich task scheduler than the standard
ScheduledExecutorService
, and an alternateFuture
API that tries to bridge the divide and be a best-of-breed between Guava’sListenableFuture
and the standard Java 8CompletionStage
. - Implementations of thread-safe variables, called atoms. These are heavily inspired by Clojure’s vars and include implementations that are very similar to Clojure’s dynamic vars (
ThreadLocalAtom
), refs (TransactionalAtom
, MVCC FTW!), agents (AsynchronousAtom
), and atoms (SimpleAtom
). - There are numerous packages here for writing annotation processors.
- APIs for interacting with language models and type mirrors that feel more like core reflection than the
javax.lang.model
APIs. - Tools for writing unit tests for an annotation processor.
- An implementation of the
javax.lang.model
interfaces backed by core reflection. This can be used to write reflective code once that can work both in the context of an annotation processor (backed by the compiler’s processing environment) and also in a normal runtime context (backed by core reflection).
- APIs for interacting with language models and type mirrors that feel more like core reflection than the
- A
Result
API, inspired by Rust’s result type. - Numerous other packages and random utilities…
artificer
A small library that can make annotations more powerful. It consists of an annotation processor that can generate builder classes for your annotations, for using them as value types. It can also generate “bridges”, which are a parallel API to your annotations that greatly simplify the implementation of annotation processors for your annotations.
protoreflect
This is a Go library that provides rich “descriptors”, for reflection on protocol buffer messages and language elements. It also provides a GRPC reflection client, for accessing descriptors for remote GRPC services.
tru-reflect unfinished
After making a reflection-like API for annotation processors, I decided that it would be fun to provide an API that actually uses core reflection APIs. It was also a good excuse to play with the ASM library.
This library exposes javax.lang.model
elements and type mirrors using familiar reflection types: Class
, Field
, Method
, Constructor
, etc. It does so by translating elements into synthetic classes. (It does not actually compile the source into a class. That would be too slow. The resulting class thus cannot be instantiated or used via reflection APIs like Constructor.newInstance
, Method.invoke
, or Field.get
.)
hyper-redis unfinished
At Square, we wrapped the Jedis library, which is fairly low-level has some API peculiarities (mostly just straying from idiomatic Java), with a more user-friendly a safer API. This project is similar, but it does not wrap Jedis. It instead implements a redis client from scratch, using Netty for the networking components and relying heavily on code generation to provide an idiomatic Java API that provides high performance and type safety.
arquebus unfinished
When I first tried to get my older son into programming, we talked about building a game. We started this project, but never finished it. I got to play a bit with Google’s PlayN library and with JBox2D.
I’ve most recently upgraded it to use PlayN 2.0 (a necessity since some of the dependencies for earlier versions of PlayN are no longer available in Maven Central). At the moment, it is little more than a proof-of-concept. There is no real gameplay, no enemies, no levels, no finished graphics/sprites, etc. At least not yet…
midi-compozer
This is a music composition program. I’ve been using it for quite some time to create MIDI files for music that I’ve written. Warning: it was written for DOS. So you’ll have to use DOSBox to get it to run. And it’s user interface is all keyboard driven, so has a steep learning curve.
Another warning: this is a really hideous bag of C code that I wrote in college, about 20 years ago. (But at least it works!)