GSoC 2011 [web repl console]

Fattom Riddle fattom.riddle@gmail.com
Fri Apr 8 05:20:00 GMT 2011


Hi Per:

Thanks for your responses.
I understand them all now.

I think this:
#<a onclick=(lambda (evt) (doit)) "Click here!"/>
is very very very awesome idea!
And it will be very useful.

But let's take a look on ASP, JSP and PHP.
They have server code and client code at the same file.
It smells bad, and that's why we have MVC.

So I think we have to discuss which one is better?
#<a onclick=(lambda (evt) (doit)) "Click here!"/>
or
#<a onclick="test();" onkawa=(lambda (evt) (doit)) "Click here!"/>
or hybrid
#<a onclick="test();kawa(lambda (evt) (doit)) "Click here!"/>

Whatever, it's so interesting!
Could I make a proposal for this idea on GSoC?

Best regards,
Evans





On Fri, Apr 8, 2011 at 11:43 AM, Per Bothner <per@bothner.com> wrote:
> On 04/07/2011 07:38 PM, Fattom Riddle wrote:
>>
>> Dear Per:
>>
>> I think you mean you want the browser show the rich UI result.
>> So, we have a communication protocol to handle this?
>
> The Kawa expression "Hello" evaluates to a sting, and
> the result inserted as a text node.
>
> The Kawa expression:
> #<b>Some bold text.</b>
> evaluates to an Element node.  That would get converted to XML,
> and sent to the browser, which inserts it - as a <b> node.
>
> See http://per.bothner.com/blog/2010/XML-literals/ and
> http://www.gnu.org/software/kawa/XML-literals.html
>
>> But, how does the rich ui result work?
>> I mean it's easy to show rich ui result, but it's hard to assign an
>> event on a rich ui result.
>> For example, how to make a button which can show alert message?
>
> First, read: http://per.bothner.com/blog/2007/ReplPane/
> especially the section "Embedding Viewable objects".
>
> What I'm imagining is that "printing"
>
> #<a onclick=(lambda (evt) (doit)) "Click here!"/>
>
> would insert a <a> element, with a (JavaScript) onclick event
> handler.  When this event handler is called in the browser, it
> sends a message to the server, which applies the lambda expression
> (in the server).  No need for special handling of the lambda
> expression: It's just an expression which evaluates to a procedure
> value.  The REPL needs to manage a mapping between the JavaScript
> event handler (in the browser), and the Scheme functions (on the
> server).
>
> But this sort of thing is beyond the basic core functionality.
> However, it is very interesting, as it points to a general GUI
> for Kawa using XHTML.
> --
>        --Per Bothner
> per@bothner.com   http://per.bothner.com/
>



More information about the Kawa mailing list