comp.lang.ada
 help / color / mirror / Atom feed
* what about having ada compile ada on the fly?
@ 2003-12-20  6:38 cl1motorsports
  2003-12-20  9:41 ` Ada IDE [was: what about having ada compile ada on the fly?] Nick Roberts
  2003-12-21  5:32 ` what about having ada compile ada on the fly? Robert C. Leif
  0 siblings, 2 replies; 10+ messages in thread
From: cl1motorsports @ 2003-12-20  6:38 UTC (permalink / raw)


I've seen that there are discussions about enhancing the current ada95
spec. I was interested to know if there has been any talk of implementing
an api for compiling ada code. I've read that some languages implement
this feature(i think one was smalltalk), and i could see how that would be
very useful for making an IDE that would load modules or scripts on the
fly. I dunno much about the topic yet, my "Dragon Book" compiler book
hasn't gotten here for Christmas yet. I have ideas for an IDE for linux
and customizing the IDE with scripts that were compiled on the fly sounded
like a good idea. I dunno just a thought *shrug*.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Ada IDE [was: what about having ada compile ada on the fly?]
  2003-12-20  6:38 what about having ada compile ada on the fly? cl1motorsports
@ 2003-12-20  9:41 ` Nick Roberts
  2003-12-20 15:57   ` Ludovic Brenta
  2003-12-20 21:01   ` Pascal Obry
  2003-12-21  5:32 ` what about having ada compile ada on the fly? Robert C. Leif
  1 sibling, 2 replies; 10+ messages in thread
From: Nick Roberts @ 2003-12-20  9:41 UTC (permalink / raw)


cl1motorsports wrote:

> I've seen that there are discussions about enhancing the current ada95 
> spec. I was interested to know if there has been any talk of 
> implementing an api for compiling ada code. I've read that some 
> languages implement this feature(i think one was smalltalk), and i could
>  see how that would be very useful for making an IDE that would load 
> modules or scripts on the fly. I dunno much about the topic yet, my 
> "Dragon Book" compiler book hasn't gotten here for Christmas yet. I have
>  ideas for an IDE for linux and customizing the IDE with scripts that 
> were compiled on the fly sounded like a good idea. I dunno just a 
> thought *shrug*.

This is not relevant to the current revision process for the language
standard (which was separated in its concern from an APSE/IDE early on).
However, there is a secondary standard called ASIS, which I suggest you
look into.

There is a project called AdaCL which you ought to look at. There is also a
command interpreter called BUSH which is based on the Ada syntax, and there
was (a long time ago, in a galaxy far away ...) a STARS (should that be
STAR WARS? :-) command interpreter -- I think it was titled 'ACL' -- whose
syntax was based on Ada, which was intended to be a way of prototyping and
testing Ada code quickly before moving into a compiled environment.

Many people use an editor with its own scripting language (I guess EMACS,
with its own LISP, is the most famous). There are too many scripting
languages already in existence. I quite like the idea of an IDE written in
Ada (and compiled into native code) whose source code is available, so that
it can be customised by the (presumably Ada programmers!) who use it.

I feel a really great Ada IDE would provide great basic tools (editor,
build manager, revision control, code browser, debugger, documentation
system), in (Ada!) source code form, designed in a very modular way (and
documented well enough) so as to make them easy to adapt to specific needs.

-- 
Nick Roberts
  __________________________________________________________
|  Fight Spam! Join EuroCAUCE: http://www.euro.cauce.org/  |
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada IDE [was: what about having ada compile ada on the fly?]
  2003-12-20  9:41 ` Ada IDE [was: what about having ada compile ada on the fly?] Nick Roberts
@ 2003-12-20 15:57   ` Ludovic Brenta
  2003-12-21  0:39     ` Ekkehard Morgenstern
  2003-12-20 21:01   ` Pascal Obry
  1 sibling, 1 reply; 10+ messages in thread
From: Ludovic Brenta @ 2003-12-20 15:57 UTC (permalink / raw)


Nick Roberts <nick.roberts@acm.org> writes:

> I quite like the idea of an IDE written in Ada (and compiled into
> native code) whose source code is available, so that it can be
> customised by the (presumably Ada programmers!) who use it.
> 
> I feel a really great Ada IDE would provide great basic tools (editor,
> build manager, revision control, code browser, debugger, documentation
> system), in (Ada!) source code form, designed in a very modular way (and
> documented well enough) so as to make them easy to adapt to specific needs.

GNAT Programming System: http://libre.act-europe.fr/GPS

-- 
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada IDE [was: what about having ada compile ada on the fly?]
  2003-12-20  9:41 ` Ada IDE [was: what about having ada compile ada on the fly?] Nick Roberts
  2003-12-20 15:57   ` Ludovic Brenta
@ 2003-12-20 21:01   ` Pascal Obry
  1 sibling, 0 replies; 10+ messages in thread
From: Pascal Obry @ 2003-12-20 21:01 UTC (permalink / raw)



Nick Roberts <nick.roberts@acm.org> writes:

> I feel a really great Ada IDE would provide great basic tools (editor,
> build manager, revision control, code browser, debugger, documentation
> system), in (Ada!) source code form, designed in a very modular way (and
> documented well enough) so as to make them easy to adapt to specific needs.

You are probably speaking about GPS ;)

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada IDE [was: what about having ada compile ada on the fly?]
  2003-12-20 15:57   ` Ludovic Brenta
@ 2003-12-21  0:39     ` Ekkehard Morgenstern
  2004-01-03 19:13       ` Pascal Obry
  0 siblings, 1 reply; 10+ messages in thread
From: Ekkehard Morgenstern @ 2003-12-21  0:39 UTC (permalink / raw)



"Ludovic Brenta" <ludovic.brenta@insalien.org> wrote:
> GNAT Programming System: http://libre.act-europe.fr/GPS

Apropos GPS: I recently downloaded it from that site and installed
it on Windows XP (SP1), and it didn't work (seems to hang during
startup). Any ideas?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: what about having ada compile ada on the fly?
  2003-12-20  6:38 what about having ada compile ada on the fly? cl1motorsports
  2003-12-20  9:41 ` Ada IDE [was: what about having ada compile ada on the fly?] Nick Roberts
@ 2003-12-21  5:32 ` Robert C. Leif
  2003-12-21 13:42   ` Robert I. Eachus
  1 sibling, 1 reply; 10+ messages in thread
From: Robert C. Leif @ 2003-12-21  5:32 UTC (permalink / raw)


From: Bob Leif
Since the time to compile with the combination of an Ada compiler and
a modern PC has greatly diminished, it may be time to start
considering compiling at run-time instead of the use of complex data
structures based on access types or discriminants.

For instance at run-time, I can set the size of an array of records;
however, I can not simply create the composition of the record from
precompiled types. If I have 26 sensors consisting of a mixture of
types integer and float, and I wish to have the user select the ones
to log; could I do this in the equivalent of SPARK with the addition
of generics?   These precompiled types are:
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z. The user selects
C, G, N, and W. One could create a program that produced a record type
(Data_Rec_Type) consisting of these fields and instantiating a generic
package to create an array with the user specified array size and type
Data_Rec_Type. The generic would already include the array storage
operations. Could this be compiled and linked as a DLL or similar
structure and used by the program? Again, the actual source to be
compiled would be Ada.

cl1motorsports <cwlambert76@yahoo.com> wrote in message news:<pan.2003.12.20.06.38.43.634696@yahoo.com>...
> I've seen that there are discussions about enhancing the current ada95
> spec. I was interested to know if there has been any talk of implementing
> an api for compiling ada code. I've read that some languages implement
> this feature(i think one was smalltalk), and i could see how that would be
> very useful for making an IDE that would load modules or scripts on the
> fly. I dunno much about the topic yet, my "Dragon Book" compiler book
> hasn't gotten here for Christmas yet. I have ideas for an IDE for linux
> and customizing the IDE with scripts that were compiled on the fly sounded
> like a good idea. I dunno just a thought *shrug*.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: what about having ada compile ada on the fly?
  2003-12-21  5:32 ` what about having ada compile ada on the fly? Robert C. Leif
@ 2003-12-21 13:42   ` Robert I. Eachus
  0 siblings, 0 replies; 10+ messages in thread
From: Robert I. Eachus @ 2003-12-21 13:42 UTC (permalink / raw)


Robert C. Leif wrote:
> From: Bob Leif
> Since the time to compile with the combination of an Ada compiler and
> a modern PC has greatly diminished, it may be time to start
> considering compiling at run-time instead of the use of complex data
> structures based on access types or discriminants.
> 
> For instance at run-time, I can set the size of an array of records;
> however, I can not simply create the composition of the record from
> precompiled types. If I have 26 sensors consisting of a mixture of
> types integer and float, and I wish to have the user select the ones
> to log; could I do this in the equivalent of SPARK with the addition
> of generics?   These precompiled types are:
> A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z. The user selects
> C, G, N, and W. One could create a program that produced a record type
> (Data_Rec_Type) consisting of these fields and instantiating a generic
> package to create an array with the user specified array size and type
> Data_Rec_Type. The generic would already include the array storage
> operations. Could this be compiled and linked as a DLL or similar
> structure and used by the program? Again, the actual source to be
> compiled would be Ada.

What is wrong with doing this in current Ada (or SPARK).  You declare a 
type with 26 boolean discriminants (and no defaults):

type Data_Rec_Type (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z: 
  Boolean) is record
   case A is when True => ...;
       when False => null;
   end case;
   ...
end record;

Now you can declare a generic procedure (or more likely package if you 
need several different subprograms) that takes a generic parameter of 
Data_Rec_Type, and you instantiate it with a constrained subtype 
(instantiation occurs at run-time of course).

It is possible that your compiler will generate relatively junk code for 
the type, and not pack it as fiercely as you like, but that is between 
you and the compiler vendor.  Since there are no defaults the compiler 
should be willing to create objects without stored discriminants and 
only the data that is actually present.  A compiler that notices the 
special structure and generates efficient code for the generic should 
not be too hard to find.  (What you want is a compiler that not just 
stores the discriminants as a descriptor for the subtype, but creates an 
offset table as well.)

Generating code (for the procedures) that doesn't test all the 
discriminants may be too much to ask.  But code that tests each 
discriminant once should not be.  As I said, the compiler can pass not 
only the discriminants of the type as a "hidden" parameter, but a table 
of offsets for the components as well.   This is a generally useful 
optimization, and some compilers do it.  Skipping past or around the 
code for the discriminant cases where the value is false, though, may be 
too much to ask.

But you can ask, and compiler vendors can do a lot with code generated 
"on the fly."  I know the GNAT compiler does generate some code on the 
fly using trampolines, ask ACT for more details.

-- 
                                           Robert I. Eachus

"The war on terror is a different kind of war, waged capture by capture, 
cell by cell, and victory by victory. Our security is assured by our 
perseverance and by our sure belief in the success of liberty." -- 
George W. Bush




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada IDE [was: what about having ada compile ada on the fly?]
  2003-12-21  0:39     ` Ekkehard Morgenstern
@ 2004-01-03 19:13       ` Pascal Obry
  2004-01-04  0:17         ` Ekkehard Morgenstern
  0 siblings, 1 reply; 10+ messages in thread
From: Pascal Obry @ 2004-01-03 19:13 UTC (permalink / raw)



"Ekkehard Morgenstern" <ekkehard.morgenstern@onlinehome.de> writes:

> Apropos GPS: I recently downloaded it from that site and installed
> it on Windows XP (SP1), and it didn't work (seems to hang during
> startup). Any ideas?

No, it works just fine on XP (and Win2K) for me.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada IDE [was: what about having ada compile ada on the fly?]
  2004-01-03 19:13       ` Pascal Obry
@ 2004-01-04  0:17         ` Ekkehard Morgenstern
  2004-01-04 12:16           ` Pascal Obry
  0 siblings, 1 reply; 10+ messages in thread
From: Ekkehard Morgenstern @ 2004-01-04  0:17 UTC (permalink / raw)



"Pascal Obry" <p.obry@wanadoo.fr> schrieb im Newsbeitrag news:u7k087smn.fsf@wanadoo.fr...
> > Apropos GPS: I recently downloaded it from that site and installed
> > it on Windows XP (SP1), and it didn't work (seems to hang during
> > startup). Any ideas?
> 
> No, it works just fine on XP (and Win2K) for me.

Perhaps it's because I already have GTK+ installed (for The GIMP).

How to install GTK+ that it can be used by both applications?




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada IDE [was: what about having ada compile ada on the fly?]
  2004-01-04  0:17         ` Ekkehard Morgenstern
@ 2004-01-04 12:16           ` Pascal Obry
  0 siblings, 0 replies; 10+ messages in thread
From: Pascal Obry @ 2004-01-04 12:16 UTC (permalink / raw)



"Ekkehard Morgenstern" <ekkehard.morgenstern@onlinehome.de> writes:

> Perhaps it's because I already have GTK+ installed (for The GIMP).
> 
> How to install GTK+ that it can be used by both applications?

Try setting the PATH to GPS bin directory first and remove all path to the
GTK+ directories. A gps.cmd should do the trick.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-01-04 12:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-20  6:38 what about having ada compile ada on the fly? cl1motorsports
2003-12-20  9:41 ` Ada IDE [was: what about having ada compile ada on the fly?] Nick Roberts
2003-12-20 15:57   ` Ludovic Brenta
2003-12-21  0:39     ` Ekkehard Morgenstern
2004-01-03 19:13       ` Pascal Obry
2004-01-04  0:17         ` Ekkehard Morgenstern
2004-01-04 12:16           ` Pascal Obry
2003-12-20 21:01   ` Pascal Obry
2003-12-21  5:32 ` what about having ada compile ada on the fly? Robert C. Leif
2003-12-21 13:42   ` Robert I. Eachus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox