[Ur] Rough edges.

Michael Stone michael.r.stone at gmail.com
Tue Mar 9 16:16:24 EST 2010


Adam,

I've continued playing with Ur/Web over the last few days and I'm
fairly happy with the results I'm getting. The manual and demos have
both been exceptionally helpful.

Now, for what they're worth, here is a report of a few of the rough
edges that I've bumped up against recently, in case you're interested
in polishing a few of them off.

Regards,

Michael



script tags
:    I wanted to use the jQuery "quicksearch" library. The natural way
to do this seemed to be to add a few script tags to my document. To do
this, I added a script tag admissible in the "head" context with a
"src : url" attr. (I don't need bodies for to do what I want.)

documentation of the { eqNullable' (SQL table.Field) xyz } construction
:    An additional demo would have helped here.

ability to COUNT( table.Field ) vs. COUNT( * )
:    this is mainly a source of confusion; thus far, it's been easy to
work around with views

syntax for specifying indices on tables
:    I can post-process the generated SQL, but this will eventually get annoying

compiler/build flags for debug outputs
:   It would be easier to understand the compiler internals if I could
see the output of each phase. I'm particularly interested in the
output of the earliest phases.

an API for reading files
:    I'm basically working on a syntax highlighter and statistics
viewer for the contents of a small file system
:    At the moment, I'm using a combination of a pre-seeded database
(to inform the web-app of the contents of the filesystem) and a C FFI
module (to read the files) to work around this.

error-handling idioms in the C FFI
:    While writing my C module, I need to ensure that I close files
that I open. This makes the raw uw_error() primitive hard to use
safely. Is there, for example, a way to hook into urweb's region-based
control flow logic?

uw_malloc
:   uw_malloc is doing something that I don't understand, in that the
following approximate snippet:

    size_t len = ...
    char* c = uw_malloc(ctx, len);
    if (!c) uw_error(ctx, FATAL, "couldn't allocate %d bytes", len);
    memset(c, 0, len);

sometimes segfaults on the memset. (I was able to work around this
problem by using a fixed-size stack-allocated array.)



More information about the Ur mailing list