[Ur] Several patches and questions

Adam Chlipala adamc at csail.mit.edu
Wed Nov 28 11:58:30 EST 2012


Sorry for the delayed response; I won't try to give more of an excuse 
than "I've been busy." :-)  I'm very glad to have your contributions, 
and I'd also be interested in hearing more about any Ur/Web projects 
you're working on.

Also, the patches you sent are missing username information.  Is that 
intentional?  I like to give credit to the right people in version 
control history, and usernames in patches make that easiest.

On 11/18/2012 06:08 PM, Austin Seipp wrote:
> Attached are some patches. In order:
>
> 1.) Add a 'username' tag, mostly to match 'password'. I wanted to have
> a nice bootstrap-style login, but it wants the type attribute to be
> 'text' for the login and 'password' for the pass, and there's no way
> to specify the type for the attribute (you could theme this with CSS
> or something, but this is just the out of the box config for bootstrap
> it seems.) So this just specifies type="text" - This patch also adds
> 'placeholder' attributes to 'username' and 'password' to match
> 'textbox.'
>    

What would you think about instead making the compiler include 
'type="text"' with every <textbox> tag?  For this one especially, I'm 
interested in others' opinions, too.

> 2.) A bugfix for 'urweb daemon stop'
>    

I agree it was a bug.  Patch applied.

> 3.) Standard library additions - add 'Basis.exp' for nums and
> 'Option.unsafeGet' for mild convenience. I'm using these both in an
> scrypt binding. I didn't bother to add any changes to the grammar to
> support exponents, but that could be nice. :)
>    

Patch applied, and then followed up with a cosmetic change of my own: I 
like [pow] better than [exp] for exponentiation, since the latter makes 
me think "expression" first, so I changed it.

I think I'll skip changing the grammar for now.

> 4.) Enable MLton options in the 'Makefile', including DEBUG, PROFILE,
> and I added VERBOSE. I like to see what the compiler is doing
> sometimes while sipping my drink, and I don't see any reason why they
> should be turned off. :)
>    

Unfortunately, I had those parts of Makefile.am commented out because I 
couldn't figure out how to get them to work with Automake.  Presumably 
they work for you, but from the version in Debian stable, I get error 
messages like:
     Makefile.am:52: endif without if
I'd be happy to accept a patch for this functionality if it doesn't 
require super-new Autotools.

> As for the questions, here are some things I might hack on if they are
> deemed OK:
>
> 1.) I would like to be able to have the Ur/Web compiler build basic .c
> files.

Sounds completely reasonable, as it's an easy feature to ignore if unwanted.

> I have an in flight patch that almost does this. It will add 2
> directives to .urp files:
>
> 'CSource file.c'
>
> [...]
>
> 'COptions ...'
>    

Sounds reasonable, except that I'd prefer lowercase directive names, to 
match the convention already in use for .urp files.

> 2.) Is it reasonable to support ad-hoc tags in the compiler, defined
> by the user? Previously I proposed some tags as compiler patches, but
> I realize this is inflexible. Instead, I would like to be able to
> write a syntactic form similar to the basis library. Say:
>
>     tag audio : ...
>    

I can support this easily with a small patch to allow tags to be defined 
in FFI modules beside [Basis].  The core tags don't have actual 
implementations anywhere, and it's easy to enable the same possibilities 
for tags in further FFI modules.  I.e., no need to define a C function 
returning a string.  (The identifier is used to figure out the tag name.)

Sound good?

> 3.) Is there a reason the 'num' type-class is closed, other than 'it
> just is'?

No one asked for it be open yet, so I didn't implement that. :)  I'd be 
glad to have a patch opening it.



More information about the Ur mailing list