From: Shark8 <onewingedshark@gmail.com>
Subject: Re: New tool "gprexec", basically "make with project file"
Date: Tue, 15 Jan 2019 09:22:07 -0800 (PST)
Date: 2019-01-15T09:22:07-08:00 [thread overview]
Message-ID: <6c5eed8b-e736-42ac-9f43-983516c6db0c@googlegroups.com> (raw)
In-Reply-To: <420cf9d0-fec9-4ab5-b5a8-ce8dced55a0d@googlegroups.com>
On Tuesday, January 15, 2019 at 9:41:04 AM UTC-7, Shark8 wrote:
>
> Package PROJECT_NAME
Sorry, I accidentally submitted the form while composing my example... which is here:
Package PROJECT_NAME is
Type Archetectures is ( x86, x86_64, ARM, SPARC, MIPS_V );
Type Node_Type is (Storage, Processing);
Type Partition_Type is (Active, Passive);
Type Compilation_Parameters is record
CPUs : Natural := 0; -- Use as many cores as available.
Symbols : Boolean := True; -- Don't strip symbols.
Target : Archetectures;
--...
end record;
Type Partition( Params : Compilation_Parameters; Style : Partition_Type ) is record
null; --... Other DSA paramters.
end record;
Type Node( Style : Node_type ) is record
Archetecture : Archetectures;
case Style is
when Storage => null; --...
when Processing => null; --...
end case;
end record;
Generic
Params : Compilation_Parameters;
Procedure Compile;
--- CONCEPTUAL GENERIC PACKAGE
Generic
Partitions : Array (Positive range <>) of not null access Partition;
Package Compiler is
Procedure Execute;
End Compiler;
--- CONCEPTUAL BODY FOR COMPILER.
Package Body Compiler is
Procedure Execute is
Begin
For P of Partitions loop
declare
Procedure Make is new Compile( P.Params );
begin
Make;
end;
End loop;
End Execute;
End Compiler;
End PROJECT_NAME;
Now, obviously there would have to be standardization -- and it would probably work better if "Archetectures" were a parameter to PROJECT_NAME -- because if all config-packages were generic we could "nest" dependencies:
Generic
Type STANDARD_PARAM is limited private; -- "Configuration standard param"
with Package P1 is new Project_1( STANDARD_PARAM );
with Package P2 is new Project_2( STANDARD_PARAM );
-- P3 depends on P1&2
with Package P3 is new Project_3( STANDARD_PARAM, P1, P2 );
Package Project_4 is
-- ... STANDARD STRUCTURE.
End Project_4;
Now, all of that is operating with the idea of using Ada as a config-language, which is doable, but perhaps a bit ugly... It might be a bit better to sit down, think about configurations (esp. in the presence of DSA) and develop an Ada-like language for that. (Perhaps in conjunction with a new Ada IR similar to DIANA, such that this configuration-description "compiles down to" the proper generic-nodes which can then be interpreted by the compiler as the configuration[s] to use; or processed by tools to inter-operate with current tools [ie IR → (GPR_File, Gnatdist_Configuration_File) for GNAT].)
prev parent reply other threads:[~2019-01-15 17:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 22:00 New tool "gprexec", basically "make with project file" VM Celier
2019-01-14 21:06 ` Shark8
2019-01-15 0:49 ` VM Celier
2019-01-15 16:41 ` Shark8
2019-01-15 17:22 ` Shark8 [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox