

Writing a Vi-like Graphics Editor in Racket - p4bl0
http://jeapostrophe.github.io/2013-05-13-vi-post.html

======
BMarkmann
I'm not sure why, but I love that Racketeers write their docs in Scribble. The
application docs look like the platform docs... it makes everything have a
very cohesive feel. So much more powerful than something like JavaDocs, too,
since you get the full power of the language.

<http://docs.racket-lang.org/scribble/>

~~~
gcr
Scribble is excellent.

My favorite part about Scribbled documentation is that everything from code
samples to function names in text is clickable. Even the function names in the
five-line code samples on the front page of <http://racket-lang.org/> are
clickable; you can just jump straight to any function's documentation from the
home page of the language.

------
unwind
I missed screenshots, it seems this editor has a fairly unique (or at least
unusual) concept but it's much harder to quickly get it from the textual
description.

It's intriguing that it talks about very simplistic sprite definitions (8
colors), but yet seems to expect the sprites to be rendered using 3D hardware
(talk of normal maps and lighting).

~~~
goldfeld
Same here. And it's even more intriguing for me that it _seems_ to match a lot
of my own current game design aesthetics (namely the idea of simple, very low
pixel graphics but with high-end light and particle effects). What's more,
when browsing for the simplest (yet powerful) sprite editor for my own use, I
found Pixen to be the best available option but still I dreamed of a vi-like
pixel pusher (I was thinking in terms of having buffers with, say, small
reusable sprites which then I could compound to make variations and
animations, all accessible through a CtrlP inspired browser.)

~~~
jeapostrophe
This is the author.

I agree very much with both of you. I assemble all the tiles into texture
atlases (and earlier post discusses the technique) and then use a fairly
simple shader to render. If you look in the gb/graphics directory [1], then
you can see the GLSL code. It was originally coded for OpenGL 3.3 with
geometry shaders but I switched to OpenGL 3.00 as a stepping stone to ES 2.

The whole model is based on the concept of "SNES Unbound": I want to have
effectively infinite numbers of sprites with many layers and any Mode 7
effects with arbitrary scaling and rotations. This is a very small level of
expectation of a modern GPU, so I can get about 1,000 FPS on my laptop with
millions of sprites, because I only use a single OpenGL draw call per layer.

Anyways, I'd be happy to comment or chat more with you. Maybe I should post
some screenshots of the editor.

Jay

1\. [https://github.com/get-bonus/get-
bonus/tree/master/gb/graphi...](https://github.com/get-bonus/get-
bonus/tree/master/gb/graphics)

------
_pmf_
Dr. Racket is one hell of a development environment. The things we could do if
we were using Scheme+Racket instead of Java+Eclipse ...

~~~
nnq
Racket is a Scheme dialects that adds quite a lot to vanilla scheme as far as
I know. The racket IDE is not praised that much and the lispers/schemers I
know prefer Emacs/SLIME (though I believe you that it's better than Eclipse).

...so saying "Scheme+Racket vs Java+Eclipse" is really comparing apples to
pineapples :) (maybe Clojure+Lighttable is closer to what you'd mean...)

~~~
p4bl0
Just to be nitpicky, Racket is not a Scheme dialect (hence the name changing
from PLT Scheme to Racket a few years ago (already!)). It's not because it not
only adds a lot to Scheme but also has somewhat important differences. For
instance, `cons` pairs are immutable in Racket: there's no `set-car!` or `set-
cdr!` as in Scheme (you can have mutable cons pair using `mcons`, `set-mcar!`,
and `set-mcdr!` though). Also the macro systems that Racket uses (`syntax-
parse` and co) is quite more advanced than the current Scheme rNrs one.

~~~
moron4hire
Well, #lang racket is not scheme, but one can run rnrs in the racket runtime.
There are many languages that run on the racket runtime.

~~~
jlgreco
IIRC, Arc/HN runs on mzscheme because they rely on mutable cons cells that
newer versions (racket) don't provide. Could they run under new rackets by
just telling racket to use a proper scheme?

~~~
jeapostrophe
As a Racket author, I can tell you that we provided them with a hack to enable
mutation on arbitrary conses, so they can upgrade whenever they wish, and I
don't know whether they have or not.

