Bug 579333 - Make Xtend extensible: Open xtend packages for reuse
Summary: Make Xtend extensible: Open xtend packages for reuse
Status: UNCONFIRMED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-19 14:01 EDT by Constantine Plotnikov CLA
Modified: 2022-04-01 00:24 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Constantine Plotnikov CLA 2022-03-19 14:01:16 EDT
Xtend language implementation itself is closed and does not provide access to the implementation packages. It is reasonable if we consider Xtend a language implementation, so internal packages are closed. But it makes a poor sense if we consider Xtend as an extensible language.

To support heavy-weight extensions (like adding new types of types or new operators) to the Xtend language the following should be done:

1. OSGi packages should be opened for all xtend related modules. This is a minimal first step. This includes Xtend/java code, models and grammar. This need for both: the core language components, compiler, and ide support components.

2. In future, when Xtend grammar is updated, it should be considered how people will extend the grammar. For example, now, if one wants to add a new classifier type, definition of other classifiers needs to be copied.

3. The components like compilers should be open to extension and customization. Final or sealed classes should be avoided for components as first step, and possibly some extension points should be considered to these components to support customizations. The private and package visibility also should be considered more carefully.

4. A sample should be created how to create a heavy-weight extension. A good sample might be entity sample, but refactored as heavy-weight extension (new classifier type) to Xtend. This example might directly reuse "def" from Xtend instead of the custom "op" construct.

These changes will greatly increase value of Xtend in the following areas:

1. A better language research platform for the scientific community 

2. A better teaching material in education context (tasks like adding operator or classifier to the language will become possible as short-term student tasks)

3. A better platform for code generators in commercial and open source projects. Sometimes there is a need for all of Xtend + little extension. Like new classifier type or C#-like Linq queries for JPA using criteria API.
Comment 1 Christian Dietrich CLA 2022-04-01 00:24:51 EDT
please note: we prefer github over bugzilla
https://github.com/eclipse/xtext-xtend
please also note:
we do not want to offer xtend as stable
api so exporting would be done
as x-internal anyway.
please also note:
we do not really have the capacity to maintain
what you expect to be worked on xtend side

would you like to jump in?