Eclipse/Aldor Version 3

13 views
Skip to first unread message

Peter Broadbery

unread,
Nov 9, 2014, 2:55:59 PM11/9/14
to aldor...@googlegroups.com
Hi,

I've updated the eclipse plugin for aldor to include a few new features:
- Aldor New Project Wizard (See File/New Project/Aldor)
- Aldor New File Wizard
- Initial set of Aldor Preferences (just the location of the compiler)

These help with creating workable project setup. There's a bit more
to do with creating a mechanism for building libraries and unit
tests.. Should be fairly useful after that.

I'll put up a release tat.gz later.

Martin - would it be possible to build the euclideanspace aldor bits into this?

Peter

Martin Baker

unread,
Nov 10, 2014, 4:20:00 AM11/10/14
to aldor...@googlegroups.com
Peter,

On 09/11/14 19:55, Peter Broadbery wrote:
> I've updated the eclipse plugin for aldor to include a few new features:

Thanks, I'll give it a try.

> There's a bit more to do with creating a mechanism for building
> libraries and unit tests..

Will these unit tests include syntax validation for Aldor? If so can I
include them into my tests here:
https://github.com/martinbaker/euclideanspace/blob/master/com.euclideanspace.aldor.tests/src/com/euclideanspace/aldor/tests/ParserTests.xtend

> Martin - would it be possible to build the euclideanspace aldor bits into this?

I don't see why not in principle. As far as I can see you have used the
Eclipse wizard to create a default (XML) editor here:
https://github.com/pbroadbery/aldor-eclipse/tree/master/aldor.text/src/main/aldor/text/editors
Hopefully we could replace this editor with the one created by Xtext. I
suspect its possible there might be a few overlaps/conflicts in the code
to sort out after that.

At the moment I am working out the best way to customise the Xtext
Lexer+Parser to do macros/pile-mode/semicolon-insertion/etc and to do
this I am delving into the internal workings of Xtext which is taking
all my time that I have on the project at present. (It is possible that
I may find a show-stopper which prevents me from doing these things but
I am hopeful at the moment).

After that I need to:
* Sort out some remaining aspects of the grammar.
* From this generate correct structure for EMF modelling framework.
* Write validation tests (depends on EMF structure).
* Use this to do validation (error messages).

I need to do all this to get good error messages showing a red line
under the text causing the error. I think it should be possible to get
good error messages showing exactly what caused it and I think this is
one of the key advantages of this approach but it will take a long time.

At the moment the error messages are just the defaults generated by
Xtext which are very bad (useless). If this existing code were used it
would give a bad impression to the users and so I think it would do more
harm than good. I would therefore like to wait until I get these things
sorted out before attempting to combine with your code.

Martin



Ralf Hemmecke

unread,
Nov 10, 2014, 4:35:58 AM11/10/14
to aldor...@googlegroups.com
Peter, Martin,

though I am not (yet) a big fan of eclipse, I think that creating a nice
IDE for writing Aldor code would be a big plus.
I'm quite happy that you are working on this.

Ralf

Martin Baker

unread,
Nov 10, 2014, 4:44:53 AM11/10/14
to aldor...@googlegroups.com
Ralf,

Do you prefer IntelliJ IDEA? There is work to support Xtext on this and
also web platforms (see here: http://blog.efftinge.de/ ). So its just
possible that any work on Xtext might eventually be portable to these
platforms.

Martin

Ralf Hemmecke

unread,
Nov 10, 2014, 4:54:31 AM11/10/14
to aldor...@googlegroups.com
> Do you prefer IntelliJ IDEA?

No. Emacs. ;-)

I've some experience with Eclipse, but don't use it every day.
That might change if there is proper Aldor support.

Ralf

Peter Broadbery

unread,
Nov 10, 2014, 2:29:06 PM11/10/14
to Martin Baker, aldor...@googlegroups.com
>
>> There's a bit more to do with creating a mechanism for building
>> libraries and unit tests..
>
> Will these unit tests include syntax validation for Aldor? If so can I
> include them into my tests here:
> https://github.com/martinbaker/euclideanspace/blob/master/com.euclideanspace.aldor.tests/src/com/euclideanspace/aldor/tests/ParserTests.xtend
>

I''m thinking of testing of user code, ie. something like the way junit behaves.

>> Martin - would it be possible to build the euclideanspace aldor bits into
>> this?
>
>
> I don't see why not in principle. As far as I can see you have used the
> Eclipse wizard to create a default (XML) editor here:
> https://github.com/pbroadbery/aldor-eclipse/tree/master/aldor.text/src/main/aldor/text/editors
> Hopefully we could replace this editor with the one created by Xtext. I
> suspect its possible there might be a few overlaps/conflicts in the code to
> sort out after that.
>

Seems to make sense - the current .as extension is just there as a way
to stop eclipse using openoffice for .as files (which was getting
annoying). If I get time later in the week I'll see if I can create
an integrated feature.

> At the moment I am working out the best way to customise the Xtext
> Lexer+Parser to do macros/pile-mode/semicolon-insertion/etc and to do this I
> am delving into the internal workings of Xtext which is taking all my time
> that I have on the project at present. (It is possible that I may find a
> show-stopper which prevents me from doing these things but I am hopeful at
> the moment).
>

> After that I need to:
> * Sort out some remaining aspects of the grammar.
> * From this generate correct structure for EMF modelling framework.
> * Write validation tests (depends on EMF structure).
> * Use this to do validation (error messages).
>
> I need to do all this to get good error messages showing a red line under
> the text causing the error. I think it should be possible to get good error
> messages showing exactly what caused it and I think this is one of the key
> advantages of this approach but it will take a long time.
>
> At the moment the error messages are just the defaults generated by Xtext
> which are very bad (useless). If this existing code were used it would give
> a bad impression to the users and so I think it would do more harm than
> good. I would therefore like to wait until I get these things sorted out
> before attempting to combine with your code.
>

Once I get the build mechanism out of the way I plan to create the
beginnings of a viewer for compiled .as files.. The input will be an
intermediate file generated by the compiler.. so for example when
compiled with a new flag a file

#include "aldor"

someFunction(x: Integer): Integer == x+1

Will produce (in sexpression notation)

(defs (defn "someFunction" (type "(x: Integer) -> Integer") (position
"file.as" 3)))

which can be sucked into a viewer component quite easily. The
position can also include a column and length parameter (the compiler
tracks both).

I mention this because there could be much more semantic information,
For example, syntax for the type, or if it ambiguous, then the list of
possible types.. It may be easier to match this up with an xtext tree
than it would be to recreate a type inference pass.

Peter

Martin Baker

unread,
Nov 11, 2014, 10:31:10 AM11/11/14
to aldor...@googlegroups.com
Peter,

I am having a problem installing and running the program.

I get the following error at the end of the new aldor project wizard and
when I save a source file:

'Building workspace' has encountered a problem.
Errors occurred during the build.
Errors running builder 'Aldor Project Builder' on project 'aldorTest1'.
Unknown value:

I don't know what this error means (If you get time it might help to
suggest things for users to try in the message window). I suspect this
may be because the program is not picking up the location of the aldor
binary?

In the wizard and in the properties page I deselected the 'use default
location' and entered the following:
/home/martin/aldorbinary/bin/aldor
I'm not sure if this is the correct form for the location
(path+filename) but this worked in version 2. It would be good to have a
file selector dialog to help users.
I'm not sure what is the default location for Aldor? Would it help if I
installed Aldor in the default location?

Since I used version 2, I have upgraded to opensuse 13.2 and reinstalled
Aldor so it is possible that Aldor is not installed properly.

Do I need to setup paths in some way? Here are the current paths:
martin@linux-rks1:~> echo "$ALDORROOT"
/home/martin/aldorbinary
martin@linux-rks1:~> echo "$PATH"
/home/martin/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
martin@linux-rks1:~>

My setup is as follows:
eclipse-dsl-luna-SR1-linux-gtk-x86_64
on opensuse 13.2

Martin

Ralf Hemmecke

unread,
Nov 11, 2014, 10:46:15 AM11/11/14
to aldor...@googlegroups.com
On 11/11/2014 04:31 PM, Martin Baker wrote:
> Do I need to setup paths in some way? Here are the current paths:
> martin@linux-rks1:~> echo "$ALDORROOT"
> /home/martin/aldorbinary
> martin@linux-rks1:~> echo "$PATH"
> /home/martin/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
> martin@linux-rks1:~>

Martin, I think, Pippijn removed the need to set ALDORROOT. You should
probably have aldor in your PATH.

Maybe

export PATH=/home/martin/aldorbinary/bin:$PATH

helps. (Or whereever your "aldor" executable is.

Ralf


Martin Baker

unread,
Nov 11, 2014, 10:49:45 AM11/11/14
to aldor...@googlegroups.com
> I mention this because there could be much more semantic information,
> For example, syntax for the type, or if it ambiguous, then the list of
> possible types.. It may be easier to match this up with an xtext tree
> than it would be to recreate a type inference pass.

Peter,

I would certainly find this very useful to help me understand how Aldor
works.

I will also think about possible ways to use this to programmaticly add
type information to the EMF tree structure generated by Xtext.

I assume the code that generates this is written in 'C'? Would it be
hard to translate to Java?

Martin

Martin Baker

unread,
Nov 11, 2014, 10:59:27 AM11/11/14
to aldor...@googlegroups.com
On 11/11/14 15:46, Ralf Hemmecke wrote:
> Maybe
>
> export PATH=/home/martin/aldorbinary/bin:$PATH
>
> helps. (Or whereever your "aldor" executable is.

Thanks Ralf,

Its useful to know I don't need ALDORROOT.

As far as I can tell Aldor seems to be working:

martin@linux-rks1:~> export PATH=/home/martin/aldorbinary/bin:$PATH
martin@linux-rks1:~> aldor -v
Aldor version 1.2.0(20141111) for LINUX(glibc2.10+) (debug version)
#1 (Warning) No files! Type `aldor -help' for help.

Totals:
Time 0.0 s
Store 592 K pool, 289K alloc - 43K free - 149K gc = 96K final
martin@linux-rks1:~>

Am I right in thinking that PATH only applies inside bash? Anyway I
still have the problem in Peters program.

Martin

Pippijn van Steenhoven

unread,
Nov 11, 2014, 11:07:24 AM11/11/14
to aldor...@googlegroups.com
On Tue, Nov 11, 2014 at 03:49:42PM +0000, Martin Baker wrote:
> I assume the code that generates this is written in 'C'? Would it be
> hard to translate to Java?

Not hard, just a lot of work. It would be a lot of mechanical, very
boring work, and there are a number of kludges that obscure the intention
of the type system's design.
signature.asc

Pippijn van Steenhoven

unread,
Nov 11, 2014, 11:12:56 AM11/11/14
to aldor...@googlegroups.com
On Tue, Nov 11, 2014 at 03:59:25PM +0000, Martin Baker wrote:
> Am I right in thinking that PATH only applies inside bash? Anyway I
> still have the problem in Peters program.

No. PATH is an environment variable. Environments are operating system
things that are unrelated to the shell.
signature.asc

Ralf Hemmecke

unread,
Nov 11, 2014, 11:41:29 AM11/11/14
to aldor...@googlegroups.com
On 11/11/2014 04:59 PM, Martin Baker wrote:
> Anyway I still have the problem in Peters program.

I don't know what your default shell is. If it is bash then you should
probably edit $HOME/.bashrc and add the line

export PATH=/home/martin/aldorbinary/bin:$PATH

there, so that it is set on every start of bash. But most importantly,
the environment must be set before you start eclipse so that eclipse (or
whatever starts 'aldor' from there) knows about the new PATH and thus
can find aldor.

Ralf

Martin Baker

unread,
Nov 11, 2014, 12:44:44 PM11/11/14
to aldor...@googlegroups.com
On 11/11/14 16:41, Ralf Hemmecke wrote:
> export PATH=/home/martin/aldorbinary/bin:$PATH
>
> there, so that it is set on every start of bash. But most importantly,
> the environment must be set before you start eclipse so that eclipse (or
> whatever starts 'aldor' from there) knows about the new PATH and thus
> can find aldor.

I did this and then started Eclipse from the bash shell:

martin@linux-rks1:~> /usr/lib64/eclipse/eclipse
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m;
support was removed in 8.0
Adapter: P/aldorTest P/aldorTest
Adapter: P/aldorTest P/aldorTest
Number of columns: 2
Adapter: P/aldorTest P/aldorTest
Adapter: P/aldorTest P/aldorTest
Adapter: P/aldorTest P/aldorTest
Number of columns: 2
Adapter: P/aldorTest P/aldorTest
martin@linux-rks1:~>

I still got the problem and I also got the above messages on the command
line. Perhaps this may help Peter identify the problem?
('aldorTest' is the name of my Aldor project created by the new project
wizard).

Martin

Peter Broadbery

unread,
Nov 11, 2014, 6:36:37 PM11/11/14
to Martin Baker, aldor...@googlegroups.com
I've updated the release with a newer version - it should fix the exception.
> --
> You received this message because you are subscribed to the Google Groups
> "aldor-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to aldor-devel...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Martin Baker

unread,
Nov 12, 2014, 6:22:13 AM11/12/14
to aldor...@googlegroups.com
On 11/11/14 23:36, Peter Broadbery wrote:
> I've updated the release with a newer version - it should fix the exception.

Peter,

Thanks, this now gives the following more helpful error, which confirms
my suspicion that it is not setting the aldor executable location correctly:

Description Resource Path Location Type
Missing aldor executable (to set, go to project preferences)
aldorTest Unknown Aldor Problem

This is despite that I set the aldor executable location in the new
aldor project wizard, and afterwards from the project properties dialog.

Every time this error happens (when I save a source file) the aldor
executable location is set back to 'use default location' which is blank.

Eventually, by random trial and error, I found a way to set the default
location and now the program works.

The problem is I can't remember how I did it. There was some dialog box
to set the default aldor executable location.

Please could you remind me know how to do that.

So I think:

1) The project properties dialog does not override the default location,
or if it does it sets it back to default afterwards.
2) I cant remember how to set the default location.
3) If it is intended that the default is set by searching PATH, then
that is not working either.

Martin

Peter Broadbery

unread,
Nov 12, 2014, 7:23:59 AM11/12/14
to Martin, aldor...@googlegroups.com

The project - clean thing does clear the missing compiler errors

--
You received this message because you are subscribed to the Google Groups "aldor-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aldor-devel+unsubscribe@googlegroups.com.

Peter Broadbery

unread,
Nov 12, 2014, 4:14:24 PM11/12/14
to Martin Baker, aldor...@googlegroups.com
sorry for the short message earlier - I can't do full emails from work.

I will experiment a bit with default paths (naturally, it kind of
works for me). I've made 'aldor' the default executable - so this
ought to clean things up in future versions. It was blank in version
4 at least.

I'll also update the UI so it uses a file location editor thing
instead of the raw text field where applicable.

There's obviously a bunch more issues with the IDE at the moment; If
you run into anything do raise an issue, or send a mail.. I've got a
few locally, but there is obviously a long list, even ignoring the
whole issue of no semantic information. No need to raise that, I
think.
- need gui indicator of file type (include, library, program or test)
- not producing .exe files at the moment
- Run menu missing in Aldor perspective
- Overview of file dependencies
- Compile console should be per-project

These class of issues are good to have catalogued as you run into them
- it's a bit too easy to get used to them.


Peter

Martin Baker

unread,
Nov 13, 2014, 3:25:30 AM11/13/14
to aldor...@googlegroups.com
On 12/11/14 21:14, Peter Broadbery wrote:
> - need gui indicator of file type (include, library, program or test)
> - not producing .exe files at the moment
> - Run menu missing in Aldor perspective
> - Overview of file dependencies
> - Compile console should be per-project

Peter,

That looks like a good list to me, I'll let you know if I think of
anything else. The only other thing I can think of at the moment is the
need for a user guide.

Martin
Reply all
Reply to author
Forward
0 new messages