Thoughts on a faster, smaller zeroinstall-core
Tim Cuthbertson <tim <at> gfxmonk.net>
2013-05-26 22:43:08 GMT
In the interests of:
- 0bootstrap (making available an executable to run a feed when
0install is not yet installed)
- embedding 0install (essentially, other people distributing
executables that act like a customised 0bootstrap)
- launching apps faster
- making the OSX install steps less ridiculous
- allowing a cross-platform 0install-on-a-stick style setup
I've been wondering about a port (or fork) of the core parts of
zeroinstall to some language that will allow it to be distributed as
statically linked native code. This is not (necessarily) the
fully-fledged current UI, but perhaps a command-line only variant -
with perhaps a minimal UI that just pops up a "loading..." screen and
shows the console output, or something equally simple. Whatever UI we
do would likely have to be kept separate on each OS, so as not to
bring in any cross platform UI dependency.
In terms of languages, there are not too many viable choices if we
want to avoid depending on a specific runtime.
- C/C++/ObjC (obvious, but not very enthusiasm-inspiring, for me at
least. Others may be more keen)
- a more modern language that compiles to native code. Choices include:
- D (never used it)
- Haskell (I've some experience in this, but could be a big learning
curve and discourage casual contributions)
- Haxe (seems to be an interesting language, has a lot of
compilation targets. Pretty young, likely to be issues in the C++
target, which is the only "native code" one. Has lots of compile
targets, so the same code could in theory produce both a native and a
cross-platform (interpreted) program)
- Go (I think it still has a stdlib, but it's supposedly embeddable).
- Vala (tied to gobject, so probably not a good choice for cross-platform)
For my own interest and learning, I had a crack at implementing some
core ZI stuff in haskell a while ago. To test that it was at least
plausible, I made:
- a binary that runs a (local) selections document.
- a binary that checks a feed's signature against a GPG key (both local files)
I didn't get into the solver, as that seemed like something haskell
was well suited to (and quite a bit of work). Similarly with the
networking stuff - it's not trivial, but there's little chance it
would be intractable. GPG was my main concern, but it looks like the
openpgp module is a sufficient (if under-documented) native-haskell
implementation that will allow signature verifications without
bringing any dependency on gnupg.
Unfortunately I wrote the code a while ago, and its dev-dependencies
have moved on, so it no longer even compiles. But if anyone's
interested, the code is here:
https://github.com/gfxmonk/zeroinstall-haskell-poc
Unfortunately I don't expect I'd have much time available to work on
such a project, but I'm interested in it as future direction for
getting ZI in more places, and wanted to see what other people's
thoughts on the matter are. Is anyone interested in a native zi-core?
Are there any use cases people have / will have that require it? Do
people have thoughts / preferences on what language it should be in?
Personally, I've encountered at least two specific products now where
teaching the user to use ZI upfront is not plausible / desirable, but
embedding zi-core in a minimal "launcher" program would be very
desirable technically (to manage updates, dependencies, plugins, etc)
while keeping a custom and slick launcher (that we could write
per-platform, since it shouldn't need to change often or be very
complex).
Cheers,
- Tim.
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may