[Ur] calling javascript code in

2018-10-24 Thread Fabrice Leal
@adamChlipala

I can confirm in my end (urweb master) I get a type error when i try to use
onload on a 
-- 
---
Fabrice Leal
___
Ur mailing list
Ur@impredicative.com
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur


Re: [Ur] Tooling: type of an expression

2018-10-24 Thread Adam Chlipala
It doesn't sound too hard, and I'd be glad to see a patch for it; and 
feel free to open a GitHub issue.


On 10/24/18 4:11 AM, Simon Van Casteren wrote:

Is there a possibility for -dumpTypes to also dump values in let bindings?

Op do 11 okt. 2018 om 16:33 schreef Adam Chlipala >:


Well, you could take advantage of the type-inference daemon and
run a new compilation job with your extra expression added to the
build.

On 10/11/2018 02:56 AM, Simon Van Casteren wrote:

I think that would get me to the first level: getting types of
identifiers. Do you see any way to evaluate expressions and
getting the types of those?

This is something that would definitely be worth it for me, so
I'll be implementing it unless I can't figure it out :).

Simon

On Thu, Oct 11, 2018, 5:20 AM Adam Chlipala mailto:ad...@csail.mit.edu>> wrote:

I'm sure it's more than just remotely possible and is just a
question of
someone getting hands dirty and writing the code!  The
baseline of a
whole-program compiler could make it trickier than for many
other
toolsets, but it could work to periodically run "compiles"
through type
inference, saving the results to hidden files.

On 10/10/2018 08:22 PM, Simon Van Casteren wrote:
> Urweb tooling is pretty limited compared to other
languages. I knew
> that when I started with it and so far I'm OK with it.
Honestly, most
> of the "modern" tooling I see in other ecosystems is a
waste of time.
>
> However, the one thing that would really cut dev time in
half for me
> in Ur/web (slightly exaggerated for effect) would be being
able to
> have the compiler tell me the type of an expression. You
can go
> multiple levels deep here:
>
> - type of an identifier
> - type of an expression at top level
> - type of an expression in function definition,
let-binding, etc
>
> I'm sending this email to the mailing list to ask if
something like
> this is remotely possible, what kind of approach we can
take and how
> we could go about implementing it.
>
> Any help much appreciated


___
Ur mailing list
Ur@impredicative.com 
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur


___
Ur mailing list
Ur@impredicative.com
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur



___
Ur mailing list
Ur@impredicative.com
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur


Re: [Ur] calling javascript code in

2018-10-24 Thread Adam Chlipala
Sorry, just to be clear: to the best of my knowledge, type errors are 
already generated when trying to use 'onload' with tags other than 
!  Is that not the case?


On 10/24/18 12:05 AM, Aistis Raulinaitis wrote:

Adam,

Yes, I've noticed ignored `onload` on tags other than `body`.

It would be good to have a type error or allowing it more broadly.

Aistis

On Mon, Oct 22, 2018 at 11:41 AM Adam Chlipala > wrote:


Belated follow-up on this remark: now that I look at the types
from the standard library, I see that 'onload' is statically
disallowed for  and indeed most other tags.  Is that what you
meant?  It could be reasonable to add 'onload' more widely, but
currently including it for most tags should not have 'no effect'.
Instead, it should trigger type error messages!

On 7/5/18 2:05 PM, Adam Chlipala wrote:

On 07/05/2018 01:43 PM, Fabrice Leal wrote:

I found out too late for my own good that onload only works for
, placing it in a  as no effect


Oh, I didn't realize that some event attribute was systematically
ignored.  That might qualify as a bug!




___
Ur mailing list
Ur@impredicative.com
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur


Re: [Ur] Tooling: type of an expression

2018-10-24 Thread Simon Van Casteren
Is there a possibility for -dumpTypes to also dump values in let bindings?

Op do 11 okt. 2018 om 16:33 schreef Adam Chlipala :

> Well, you could take advantage of the type-inference daemon and run a new
> compilation job with your extra expression added to the build.
> On 10/11/2018 02:56 AM, Simon Van Casteren wrote:
>
> I think that would get me to the first level: getting types of
> identifiers. Do you see any way to evaluate expressions and getting the
> types of those?
>
> This is something that would definitely be worth it for me, so I'll be
> implementing it unless I can't figure it out :).
>
> Simon
>
> On Thu, Oct 11, 2018, 5:20 AM Adam Chlipala  wrote:
>
>> I'm sure it's more than just remotely possible and is just a question of
>> someone getting hands dirty and writing the code!  The baseline of a
>> whole-program compiler could make it trickier than for many other
>> toolsets, but it could work to periodically run "compiles" through type
>> inference, saving the results to hidden files.
>>
>> On 10/10/2018 08:22 PM, Simon Van Casteren wrote:
>> > Urweb tooling is pretty limited compared to other languages. I knew
>> > that when I started with it and so far I'm OK with it. Honestly, most
>> > of the "modern" tooling I see in other ecosystems is a waste of time.
>> >
>> > However, the one thing that would really cut dev time in half for me
>> > in Ur/web (slightly exaggerated for effect) would be being able to
>> > have the compiler tell me the type of an expression. You can go
>> > multiple levels deep here:
>> >
>> > - type of an identifier
>> > - type of an expression at top level
>> > - type of an expression in function definition, let-binding, etc
>> >
>> > I'm sending this email to the mailing list to ask if something like
>> > this is remotely possible, what kind of approach we can take and how
>> > we could go about implementing it.
>> >
>> > Any help much appreciated
>>
> ___
> Ur mailing list
> Ur@impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
>
___
Ur mailing list
Ur@impredicative.com
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur