Re: An Eiffel to javascript compiler?

Paul Cohen <[email protected]> Thu, 14 Jan 2010 11:36:36 +0100
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
Hi,

2010/1/14 Cheng-Chang Wu <chengchangwu-/[email protected]>
> as an exercise to understand GEC I'd like to write an Eiffel to javascript compiler.

This an excellent idea!

> What is the best way to start such a project?

Eric has already given you some pointers.

At my work we have discussed the idea of an Eiffel-2-JavaScript
compiler a few times. I assume you are talking about
Client-Side/Browser JavaScript? I also assume you have looked at or
used Google's GWT (http://code.google.com/webtoolkit/) and/or Pyjamas
(http://pyjs.org)? Here are a few general issues to consider and some
suggestions, even though I am aware that your primary goal is to
understand GEC!

1. Should you generate JavaScript code that relies on an existing
JavaScript library such as jQuery (http://jquery.com) or Dojo
(http://www.dojotoolkit.org)? If so you will need to develop Eiffel
classes that match the abstractions that exist in those libraries.

2. Should you generate JavaScript that does not rely on any existing
JavaScript library, you could look at EiffelVision and possibly see
how that could be used as a basis for generating UI widgets etc.

3. It's a good idea to allow users to mix handwritten JavaScript with
the Eiffel source code, including support for using other JavaScript
frameworks and libraries. Among other things this would allow you
concentrate on pure compiler issues, while at the same time enabling
users to use fx. jQuery or Dojo UI widgets to write Ajax applications,
until you can provide a pure Eiffel based UI widget set! ;-)

4. You should consider the developer environment. How will a developer
test and run his/her Eiffel-2-JavaScript code in a IDE-style
environment? For example Pyjamas enables you to run your Python
programs in an emulated browser environment. I realize that this will
come much further along the road in your project but it is worth
giving a thought now!

5. You could take a look at EDOM (http://eiffel-edom.sourceforge.net)
and see if you can use any of the design or code there.

Good luck and keep us posted on your progress!

/Paul

--
Paul Cohen
www.seibostudios.se
mobile: +46 730 787 035
e-mail: paul.cohen-qf2BM/[email protected]


------------------------------------

To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected]! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gobo-eiffel/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/gobo-eiffel/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/