From: anon@att.net
Subject: Re: Ada platforms and pricing, was: Re: a new language, designed for safety !
Date: Fri, 20 Jun 2014 09:54:58 +0000 (UTC)
Date: 2014-06-20T09:54:58+00:00 [thread overview]
Message-ID: <lo10de$8qm$1@speranza.aioe.org> (raw)
In-Reply-To: erb49jp6qy6n$.5cesca6do7x3$.dlg@40tude.net
First, for the client the priority of "Safety" falls below
"Data Integrity" and "Performance". And for a gamer type of
client its "Performance" and "Functionally" then "Data Integrity"
and before "Safety". Just to give an example of how some
non-programmers feel.
Now for a compiler. its easier than most here thanks, and it is
even easier if you use Ada itself.
Step 1: remove OPP packages which will reduce the libraries
that are needed to the bare minimum.
Create and add the Opps packages back later once the compiler
is working for everything else. And since OPPs does not require
any system connections you could simply use GNAT's OPP packages
during the testing phases, before writing your own set.
Note 0: All coding outside Lexical Analysis should use the BNF in
"Annex P" starting with 10.1.1.
Step 2: Create the "Lexical" and "Syntactic" routines with
Error report.
Note 1: If you write your compiler right then the "Aggregate"
routines will become the most important routine in the Semantic
Analysis. This is because a lot Ada code within parenthesis can
be process as an aggregate or modified aggregate routine. An
example list:
argument_association -- within pragma statement
aggregate
qualified_expression -- can uses aggregate
enumeration_type_definition
index_constraint -- no "choice"
discriminant_constraint -- Choice is simple name
indexed_component -- after prefix
slice -- after prefix
parameter_association
actual_parameter_part
entry_declaration -- after prefix, no "choice"
entry_call_statement -- after prefix, no "choice"
generic_actual_part
enumeration_representation_clause -- uses an aggregate
code_statement -- uses a record aggregate
-- modified replacing the arrow with assignment
component_list
discriminant_part
discriminant_specification
formal_part
-- modified for "when" could handle
-- and the expression can be sequence_of_statements
variant
case_statement_alternative
formal_part
entry_declaration
entry_call_statement
select_alternative
exception_handler
Step 3: Semantic Analysis should be dome in two or three phases.
Phase 1: Type checking, such as
type identifier is range
simple_expression .. simple_expression
In this case both simple_expressions must be
integer. And in some case you can determine if
expression is static (required or integer type).
Phase 2: Range checking. Add code to do range checking.
In the compile I created that was a problem since
the lower and upper ranges are not defined by the hardware, but
by the programmer. In other words you could define a number as
-- a foolishly large integer
type Sample_Integer is range
- 2 ** ( 2 ** 32 ) .. 2 ** ( 2 ** 32 ) - 1 ;
-- or a real, in this case the compiler generates
-- lower and upper bounds
type Sample_Float is digits 32767 ;
Even though the line length (RM 2.2 (15)) shall exceed 199
characters, the compiler may have limits such as setting the
token size to 80 characters. And forcing a limit on token size
will force an internal compiler storage limit. Which in turn does
force source code limits but not programming limits.
The reason I did this was to see if a compiler could truly allow
universal_integer and universal_reals and still be functional with
only limited performance loss.
Phase 3: Maintain a Data Dictionary instead of recalculating
types in "Code Generation". Saves compile time
Step 4: First Optimization, to reduce dead code.
While GNAT will report generate a warning message for
unreference variables it does not report unreference routines. Here
there are three options:
A) do nothing,
B) perform only if "pragma Optimize (Space)" is used
C) just automatically remove all dead code.
In the two later cases, this process can be simple.
Step 5: Expansion. Where "Generic" evaluated and new packages are
created. And complex structures are rewritten to simpler
structures, then in some cases "Semantic" may need to be repeated
for these routines or structures.
Step 6: Second Optimization, for speed of code. For GNAT this is
done by the GCC back_end, which exceeds the Optimization defined
in the RM. Here there are four options:
A) do nothing,
B) perform only if "pragma Optimize (Time)" is used,
C) use a implementation created pragma to define Optimization
such as "pragma Optimization ( <numeric-level> )". Then perform
optimization at the level requested. Could also be a command-line
option.
D) automatically optimize code.
Initial it is easier and faster to "do nothing" except for may be
adding a dummy routine that can be modified later once the
compiler works.
Step 7: Code Generation:
If the compiler generate code based on the system configuration
identifiers. "System_Name", "Storage_Unit" and "Memory_Size"
Which are located in System package and can be modified by
using one or more configuration pragmas which can alter these
identifiers.
These configurational identifiers allow the compiler to perform
cross-compiling for different CPU and systems such as bare, Linux
or Windows and can include Apple OS, or other OS. By loading
using libraries to set opcodes and calls for specific CPU/OS or
bare board.
Note 2: Use the ACVC files for your Testsuite. Helps to make
compiler ACVC compliant from the start.
Just a Suggestion:
Since you will have to write your version of the Ada libraries such
as "Ada.Text_IO" write it and the rename the new library to
"Compiler.Text_IO" and etc. Then use "Compiler.Text_IO" instead of
"Ada.Text_IO". Later if you want use can spend a few minutes
changing "Compiler." to "Ada.".
As for using GNAT, the GPL only effects your code if you link to the
GNU or GNAT libraries, such "Ada.Text_IO" code generation does not
force the code to be under GPL, unless you use GNAT version of
"Ada.Text_IO". Otherwise, GNU would own all intellectual property of
all codes use by its compilers and that's not legal.
Note 3. Using GNAT's obsolete pragma "pragma No_Run_time" removes
access to most GNAT's libraries. So, it will force you to use your
own packages instead of GNAT's.
In <erb49jp6qy6n$.5cesca6do7x3$.dlg@40tude.net>, "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>On Wed, 18 Jun 2014 17:34:35 +0000 (UTC), Natasha Kerensikova wrote:
>
>> For some reason I'm much more frightened by parsing Ada text than by
>> code generation. I know the latter is probably not easier than the
>> former (I'm aware of LLVM vs nested functions), but who said fright is
>> rational?
>
>Oh, but parsing is really simple thing. You do recursive descent all the
>time. Except for expressions. For expressions you could take this:
>
>http://www.dmitry-kazakov.de/ada/components.htm#12.9
>
>Semantic analysis is a hell. Code generation, optimization is a hell within
>hell, IMO.
>
>--
>Regards,
>Dmitry A. Kazakov
>http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2014-06-20 9:54 UTC|newest]
Thread overview: 285+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-03 1:37 a new language, designed for safety ! Nasser M. Abbasi
2014-06-04 0:21 ` Luke A. Guest
2014-06-04 1:19 ` Dan'l Miller
2014-06-04 4:05 ` Dan'l Miller
2014-06-04 6:59 ` Georg Bauhaus
2014-06-04 4:12 ` Dan'l Miller
2014-06-04 5:44 ` Jeffrey Carter
2014-06-04 15:25 ` Dan'l Miller
2014-06-04 19:43 ` Robert A Duff
2014-06-04 21:32 ` Simon Clubley
2014-06-05 9:13 ` Nasser M. Abbasi
2014-06-05 15:33 ` Adam Beneschan
2014-06-05 19:19 ` Jeffrey Carter
2014-06-05 15:55 ` Adam Beneschan
2014-06-05 19:15 ` sbelmont700
2014-06-05 22:40 ` Robert A Duff
2014-06-06 15:13 ` Dan'l Miller
2014-06-06 17:51 ` G.B.
2014-06-06 18:39 ` Niklas Holsti
2014-06-06 19:43 ` Robert A Duff
2014-06-06 20:42 ` Dmitry A. Kazakov
2014-06-08 9:40 ` Georg Bauhaus
2014-06-08 13:56 ` Robert A Duff
2014-06-08 16:13 ` Dan'l Miller
2014-06-08 17:22 ` J-P. Rosen
2014-06-08 19:36 ` Dmitry A. Kazakov
2014-06-09 5:30 ` Niklas Holsti
2014-06-09 7:06 ` Dmitry A. Kazakov
2014-06-09 16:07 ` Dan'l Miller
2014-06-10 7:44 ` Dmitry A. Kazakov
2014-06-10 16:31 ` Dan'l Miller
2014-06-10 16:52 ` Dmitry A. Kazakov
2014-06-06 18:52 ` Robert A Duff
2014-06-06 22:50 ` Simon Clubley
2014-06-23 0:40 ` Yannick Duchêne (Hibou57)
2014-06-23 0:43 ` Yannick Duchêne (Hibou57)
2014-06-23 0:51 ` Shark8
2014-06-23 1:47 ` Nasser M. Abbasi
2014-06-23 6:46 ` Shark8
2014-06-23 14:17 ` Peter Chapin
2014-06-23 15:39 ` Dan'l Miller
2014-06-23 17:04 ` Dmitry A. Kazakov
2014-06-05 8:26 ` Georg Bauhaus
2014-06-09 10:03 ` Pascal Obry
2014-06-10 9:36 ` Stephen Leake
2014-06-10 10:48 ` Luke A. Guest
2014-06-10 18:31 ` Pascal Obry
2014-06-23 1:01 ` Yannick Duchêne (Hibou57)
2014-06-10 12:28 ` Simon Clubley
2014-06-10 12:42 ` Lucretia
2014-06-10 12:50 ` J-P. Rosen
2014-06-10 13:00 ` Lucretia
2014-06-10 14:43 ` Brad Moore
2014-06-10 15:15 ` J-P. Rosen
2014-06-10 20:28 ` Simon Clubley
2014-06-10 20:39 ` Pascal Obry
2014-06-10 21:04 ` Simon Clubley
2014-06-11 7:17 ` Pascal Obry
2014-06-25 22:37 ` Yannick Duchêne (Hibou57)
2014-06-10 22:09 ` Luke A. Guest
2014-06-12 23:58 ` Shark8
2014-06-13 1:28 ` Luke A. Guest
2014-06-25 22:41 ` Yannick Duchêne (Hibou57)
2014-06-26 1:36 ` Shark8
2014-06-26 10:19 ` J-P. Rosen
2014-06-25 22:40 ` Yannick Duchêne (Hibou57)
2014-06-26 7:39 ` Luke A. Guest
2014-06-26 7:42 ` Yannick Duchêne (Hibou57)
2014-06-26 10:07 ` Luke A. Guest
2014-06-26 10:18 ` J-P. Rosen
2014-07-02 22:06 ` Randy Brukardt
2014-06-11 0:16 ` Jeffrey Carter
2014-06-11 7:29 ` Simon Clubley
2014-06-11 19:22 ` Jeffrey Carter
2014-06-12 11:48 ` Simon Clubley
2014-06-12 16:59 ` Jeffrey Carter
2014-06-10 15:33 ` Lucretia
2014-06-10 16:31 ` Dmitry A. Kazakov
2014-06-10 19:34 ` Tero Koskinen
2014-06-11 6:46 ` Natasha Kerensikova
2014-06-11 8:45 ` Dmitry A. Kazakov
2014-06-11 9:05 ` Simon Wright
2014-06-11 12:09 ` Simon Clubley
2014-06-11 12:34 ` Dmitry A. Kazakov
2014-06-11 12:42 ` björn lundin
2014-06-11 13:04 ` Lucretia
2014-06-11 12:11 ` björn lundin
2014-06-10 19:49 ` J-P. Rosen
2014-06-10 22:09 ` Luke A. Guest
2014-06-11 9:01 ` Simon Wright
2014-06-16 16:22 ` Randy Brukardt
2014-06-16 17:11 ` Ada platforms and pricing, was: " Simon Clubley
2014-06-17 19:34 ` Randy Brukardt
2014-06-17 20:16 ` Jeffrey Carter
2014-06-18 5:56 ` Georg Bauhaus
2014-06-18 6:34 ` Nasser M. Abbasi
2014-06-18 19:57 ` Simon Clubley
2014-06-19 3:46 ` Randy Brukardt
2014-06-22 19:50 ` Simon Clubley
2014-06-22 23:38 ` Randy Brukardt
2014-06-23 6:18 ` Niklas Holsti
2014-06-23 7:42 ` Dmitry A. Kazakov
2014-06-23 11:17 ` Simon Wright
2014-06-23 17:14 ` Dmitry A. Kazakov
2014-06-23 19:21 ` Dan'l Miller
2014-06-23 20:14 ` Dmitry A. Kazakov
2014-06-23 21:48 ` Simon Wright
2014-06-24 1:18 ` Nasser M. Abbasi
2014-06-24 2:15 ` Jeffrey Carter
2014-06-24 7:51 ` Dmitry A. Kazakov
2014-06-23 21:52 ` Simon Wright
2014-06-24 1:04 ` Dan'l Miller
2014-06-26 3:24 ` Yannick Duchêne (Hibou57)
2014-06-26 3:27 ` Yannick Duchêne (Hibou57)
2014-06-24 1:01 ` Shark8
2014-06-24 10:24 ` Simon Wright
2014-06-24 11:25 ` Dan'l Miller
2014-06-24 15:55 ` Shark8
2014-06-24 18:06 ` Dan'l Miller
2014-06-24 18:44 ` Dan'l Miller
2014-06-24 18:49 ` Shark8
2014-06-24 21:25 ` Dan'l Miller
2014-06-24 16:48 ` Simon Wright
2014-06-26 3:41 ` Yannick Duchêne (Hibou57)
2014-06-23 20:40 ` Simon Wright
2014-06-24 7:48 ` Dmitry A. Kazakov
2014-06-23 11:48 ` G.B.
2014-06-24 7:52 ` Maciej Sobczak
2014-06-24 8:33 ` Dmitry A. Kazakov
2014-07-01 10:28 ` Simon Wright
2014-07-01 12:41 ` Dmitry A. Kazakov
2014-06-26 2:50 ` Yannick Duchêne (Hibou57)
2014-06-26 10:04 ` G.B.
2014-06-26 18:20 ` Yannick Duchêne (Hibou57)
2014-06-25 17:24 ` Niklas Holsti
2014-06-26 2:43 ` Yannick Duchêne (Hibou57)
2014-06-23 7:31 ` Dmitry A. Kazakov
2014-06-23 20:08 ` Randy Brukardt
2014-06-23 20:20 ` Dmitry A. Kazakov
2014-06-24 11:56 ` Simon Clubley
2014-06-24 12:13 ` Simon Clubley
2014-06-17 20:27 ` Luke A. Guest
2014-06-18 7:09 ` Natasha Kerensikova
2014-06-18 10:32 ` J-P. Rosen
2014-06-18 11:50 ` Brian Drummond
2014-06-18 17:34 ` Natasha Kerensikova
2014-06-18 17:56 ` Peter Chapin
2014-06-19 7:22 ` Natasha Kerensikova
2014-06-19 12:02 ` Peter Chapin
2014-06-20 7:03 ` Natasha Kerensikova
2014-06-19 13:33 ` Lucretia
2014-06-20 7:07 ` Natasha Kerensikova
2014-06-20 11:44 ` Lucretia
2014-06-20 12:47 ` Dennis Lee Bieber
2014-06-18 18:24 ` Lucretia
2014-06-19 7:26 ` Natasha Kerensikova
2014-06-18 18:47 ` Dmitry A. Kazakov
2014-06-18 20:17 ` Simon Clubley
2014-06-18 22:51 ` Simon Clubley
2014-06-19 8:51 ` Dmitry A. Kazakov
2014-06-19 3:35 ` Randy Brukardt
2014-06-19 7:34 ` Natasha Kerensikova
2014-06-19 8:19 ` J-P. Rosen
2014-06-19 9:11 ` Dmitry A. Kazakov
2014-06-19 12:08 ` Peter Chapin
2014-06-19 13:48 ` Dmitry A. Kazakov
2014-06-19 20:59 ` Randy Brukardt
2014-06-26 2:04 ` Yannick Duchêne (Hibou57)
2014-06-26 22:24 ` Shark8
2014-06-26 22:44 ` Yannick Duchêne (Hibou57)
2014-06-26 22:51 ` Shark8
2014-06-27 12:43 ` Ada platforms and pricing, was: Re: a new language, anon
2014-06-19 21:13 ` Ada platforms and pricing, was: Re: a new language, designed for safety ! Robert A Duff
2014-06-19 23:47 ` Adam Beneschan
2014-06-19 21:03 ` Randy Brukardt
2014-06-20 7:26 ` Natasha Kerensikova
2014-06-20 19:50 ` Randy Brukardt
2014-06-21 8:35 ` Natasha Kerensikova
2014-06-22 23:26 ` Randy Brukardt
2014-06-26 2:16 ` Yannick Duchêne (Hibou57)
2014-06-20 9:54 ` anon [this message]
2014-06-20 12:25 ` Lucretia
2014-06-20 19:32 ` Ada platforms and pricing, was: Re: a new language, designed for anon
2014-06-18 17:01 ` Ada platforms and pricing, was: Re: a new language, designed for safety ! Jeffrey Carter
2014-06-19 7:53 ` Natasha Kerensikova
2014-06-19 21:10 ` Randy Brukardt
2014-06-19 22:27 ` Luke A. Guest
2014-06-16 21:31 ` Luke A. Guest
2014-06-16 23:02 ` Jeffrey Carter
2014-06-17 11:14 ` gvdschoot
2014-06-17 17:42 ` Jeffrey Carter
2014-06-17 12:56 ` Simon Clubley
2014-06-17 17:43 ` Jeffrey Carter
2014-06-17 19:46 ` Jacob Sparre Andersen
2014-06-26 1:20 ` Yannick Duchêne (Hibou57)
2014-06-17 19:41 ` Randy Brukardt
2014-06-17 20:08 ` Jeffrey Carter
2014-06-18 5:46 ` Georg Bauhaus
2014-06-18 8:02 ` Dmitry A. Kazakov
2014-06-18 9:34 ` G.B.
2014-06-18 12:30 ` Dmitry A. Kazakov
2014-06-18 14:43 ` G.B.
2014-06-18 16:39 ` Dmitry A. Kazakov
2014-06-20 8:27 ` Georg Bauhaus
2014-06-25 22:43 ` Yannick Duchêne (Hibou57)
2014-06-12 23:56 ` Shark8
2014-06-10 20:22 ` Simon Clubley
2014-06-10 21:14 ` Simon Clubley
2014-06-10 22:09 ` Luke A. Guest
2014-06-10 22:09 ` Luke A. Guest
2014-06-11 0:05 ` Jeffrey Carter
2014-06-11 7:32 ` Simon Clubley
2014-06-11 16:50 ` G.B.
2014-06-11 19:20 ` Jeffrey Carter
2014-06-12 7:01 ` Simon Clubley
2014-06-12 17:46 ` Jeffrey Carter
2014-06-12 21:40 ` Simon Clubley
2014-06-13 6:37 ` J-P. Rosen
2014-06-13 12:03 ` Simon Clubley
2014-06-13 15:34 ` Lucretia
2014-06-13 17:00 ` Simon Clubley
2014-06-13 22:21 ` Brian Drummond
2014-06-14 20:41 ` Simon Clubley
2014-06-15 6:26 ` Tero Koskinen
2014-06-16 0:11 ` Simon Clubley
2014-06-15 18:10 ` Luke A. Guest
2014-06-16 0:00 ` Simon Clubley
2014-06-25 6:42 ` Yannick Duchêne (Hibou57)
2014-06-25 7:29 ` Georg Bauhaus
2014-06-25 12:17 ` Simon Clubley
2014-06-12 23:53 ` Shark8
2014-06-13 4:28 ` Simon Clubley
2014-06-13 8:17 ` gvdschoot
2014-06-13 13:16 ` Simon Wright
2014-06-13 14:13 ` gvdschoot
2014-06-13 15:52 ` Shark8
2014-06-13 17:04 ` Simon Clubley
2014-06-13 20:10 ` Simon Wright
2014-06-15 6:33 ` Tero Koskinen
2014-06-15 7:47 ` gvdschoot
2014-06-15 8:13 ` gvdschoot
2014-06-15 8:18 ` Nasser M. Abbasi
2014-06-16 0:16 ` Simon Clubley
2014-06-16 0:35 ` Simon Clubley
2014-06-16 6:08 ` Georg Bauhaus
2014-06-16 6:19 ` Georg Bauhaus
2014-06-16 12:08 ` Peter Chapin
2014-06-25 22:28 ` Yannick Duchêne (Hibou57)
2014-06-16 12:30 ` Simon Clubley
2014-06-16 6:22 ` gvdschoot
2014-06-25 6:28 ` Yannick Duchêne (Hibou57)
2014-06-11 8:27 ` Maciej Sobczak
2014-06-11 19:39 ` Peter Chapin
2014-06-11 19:52 ` Luke A. Guest
2014-06-12 1:39 ` Peter Chapin
2014-06-12 2:46 ` Dan'l Miller
2014-06-12 11:24 ` Peter Chapin
2014-06-12 11:36 ` Lucretia
2014-06-12 14:48 ` björn lundin
2014-06-12 22:12 ` Simon Clubley
2014-06-13 8:36 ` Dmitry A. Kazakov
2014-06-13 15:55 ` Shark8
2014-06-13 16:13 ` Dmitry A. Kazakov
2014-06-13 20:57 ` Robert A Duff
2014-06-14 7:27 ` Georg Bauhaus
2014-06-14 21:02 ` Simon Clubley
2014-06-16 16:39 ` Randy Brukardt
2014-06-16 17:13 ` Dmitry A. Kazakov
2014-06-16 17:24 ` Simon Clubley
2014-06-16 19:13 ` Simon Wright
2014-06-16 20:25 ` Simon Clubley
2014-06-17 16:10 ` Simon Wright
2014-06-16 21:53 ` Robert A Duff
2014-06-16 23:02 ` Jeffrey Carter
2014-06-16 23:42 ` Robert A Duff
2014-06-17 19:18 ` Randy Brukardt
2014-06-14 21:05 ` Maciej Sobczak
2014-06-15 6:52 ` Dmitry A. Kazakov
2014-06-15 10:04 ` Georg Bauhaus
2014-06-15 12:25 ` Dmitry A. Kazakov
2014-06-17 8:18 ` Maciej Sobczak
2014-06-17 9:13 ` Dmitry A. Kazakov
2014-06-18 7:55 ` Maciej Sobczak
2014-06-18 8:31 ` Dmitry A. Kazakov
2014-06-12 8:16 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox