├── .gitmodules ├── LICENSE ├── README.md ├── doc ├── AdaCrateOfTheYear2022-Rejuvenation-Ada.jpg ├── README.md ├── Relations_Of_Find.jpg └── enhance-insight-reduce-complexity.jpg └── src ├── README.md ├── Renaissance_Ada.gpr ├── libraries └── README.md └── tools └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/libraries/rejuvenation"] 2 | path = src/libraries/rejuvenation 3 | url = https://github.com/TNO/Rejuvenation-Ada.git 4 | branch = main 5 | [submodule "src/libraries/rewriters"] 6 | path = src/libraries/rewriters 7 | url = https://github.com/TNO/Rewriters-Ada.git 8 | branch = main 9 | [submodule "src/tools/dependency_graph_extractor"] 10 | path = src/tools/dependency_graph_extractor 11 | url = https://github.com/TNO/Dependency_Graph_Extractor-Ada.git 12 | branch = main 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2022, TNO 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Renaissance-Ada 2 | The Renaissance-Ada project develops tooling for analysis and manipulation 3 | of [Ada](https://en.wikipedia.org/wiki/Ada_(programming_language)) software. 4 | The Renaissance-Ada project builds on top of [LibAdalang](https://adaco.re/libadalang) 5 | and includes the following functionality 6 | * [Dependency Graph Extractor](https://github.com/TNO/Dependency_Graph_Extractor-Ada) 7 | that produces a [graphml](http://graphml.graphdrawing.org) file for visualization and querying 8 | with e.g. [yEd](https://www.yworks.com/products/yed) and [Neo4J](https://neo4j.com/). 9 | * [Rejuvenation Library](https://github.com/TNO/Rejuvenation-Ada) that 10 | allow analysis and manipulation of [Ada](https://en.wikipedia.org/wiki/Ada_(programming_language)) 11 | code based on concrete syntax. 12 | * [Rewriters Library](https://github.com/TNO/Rewriters-Ada/) that 13 | enables automatic rewriting of [Ada](https://en.wikipedia.org/wiki/Ada_(programming_language)) 14 | code based on concrete syntax. 15 | 16 | ## Examples 17 | 18 | The image below shows the dependencies of Find-related subprograms of 19 | the [Rejuvenation Library](https://github.com/TNO/Rejuvenation-Ada) 20 | as extracted by the [Dependency Graph Extractor](https://github.com/TNO/Dependency_Graph_Extractor-Ada) and 21 | queried using [Neo4J](https://neo4j.com/). 22 | ![Dependencies of Find-related subprograms of the Rejuvenation Library](/doc/Relations_Of_Find.jpg) 23 | 24 | Snippets from diff made with [Code Reviewer](https://github.com/TNO/Rewriters-Ada/tree/main/code_reviewer) 25 | ```diff 26 | function Release_Only (Mode : Operation_Mode) return Boolean is 27 | - (case Mode is when Release_Size_Mode | Release_Speed_Mode => True, when others => False); 28 | + (Mode in Release_Size_Mode | Release_Speed_Mode); 29 | ``` 30 | 31 | ```diff 32 | - if Valid then 33 | - Add (Value, 0, 0, 0); 34 | - else 35 | - Add ("", 0, 0, 0); 36 | - end if; 37 | + Add ((if Valid then Value else ""), 0, 0, 0); 38 | ``` 39 | 40 | ```diff 41 | - for Acf of Acfs loop 42 | - if Acf = null then 43 | - return False; 44 | - end if; 45 | - end loop; 46 | - return True; 47 | + return (for all Acf of Acfs => Acf /= null); 48 | ``` 49 | 50 | Example based on 51 | [aws](https://github.com/AdaCore/aws/blob/7488c0f6f4c593b51e8b61b94d245e2ff4896e33/config/ssl/aws-net-ssl__openssl.adb#L215-L216) 52 | code 53 | ```diff 54 | - Max_Overhead : Stream_Element_Count range 0 .. 2**15 := 81 with Atomic; 55 | - for Max_Overhead'Size use 16; 56 | + Max_Overhead : Stream_Element_Count range 0 .. 2**15 := 81 with 57 | + Atomic, 58 | + Size => 16; 59 | ``` 60 | 61 | ## Used by Industry 62 | [Nexperia](https://nexperia.com) described during [the AdaCore Tech Days](https://events.adacore.com/eutechday2021) 63 | how [they benefit from the Renaissance-Ada tooling](https://www.youtube.com/watch?v=EHrd-9wgALM). 64 | 65 | ## Renaissance History 66 | 67 | The Renaissance approach to [legacy software](https://en.wikipedia.org/wiki/Legacy_code) was initially developed by [ESI](https://esi.nl) 68 | in public-private research projects together with [Thermo Fisher](https://thermofisher.com) and [Philips](http://philips.com). 69 | 70 | ![Enhance insight and reduce complexity](/doc/enhance-insight-reduce-complexity.jpg) 71 | 72 | The Renaissance approach is an interative process of 73 | two steps that strengthen each other 74 | * enhance insight by analysis and 75 | * reduce complexity by manipulation. 76 | 77 | For more info, see e.g. the 78 | [Bits & Chips article](https://bits-chips.nl/artikel/esi-helps-thermo-fisher-and-philips-grease-their-software-machines), 79 | [Ada User Journal article (starting on page 165)](https://www.ada-europe.org/archive/auj/auj-43-3-withcovers.pdf), and [ESI's research on model-based software transformation](https://esi.nl/research/output/methods/model-based-software-transformation) 80 | or listen 81 | to [Tom van de Ven interviewing Pierre van de Laar on Renaissance-Ada](https://open.spotify.com/episode/4jKsjhffi77gcUKiayl8mN?si=8801fec2fbcc4291) 82 | 83 | The development of Renaissance tooling to target [Ada](https://en.wikipedia.org/wiki/Ada_(programming_language)) software 84 | started in Bright, a public-private research project together with [ITEC](https://itecequipment.com), 85 | an independent subsidiary of [Nexperia](https://nexperia.com). 86 | 87 | ## Clone archive 88 | 89 | Use 90 | ``` 91 | git clone --recurse-submodules https://github.com/TNO/Renaissance-Ada.git 92 | ``` 93 | 94 | ## Related technologies 95 | * [HayStack-Ada](https://github.com/BurritoZz/Haystack-Ada) is a GNATStudio plug-in for AST-based Find and Replace. 96 | [HayStack-Ada](https://github.com/BurritoZz/Haystack-Ada) uses a re-implementation of the rejuvenation library in python. 97 | * [OpenRewrite](https://docs.openrewrite.org) is a semantic code search and transformation ecosystem for Java and other source code. 98 | * [Rascal MPL](https://www.rascal-mpl.org) is a metaprogramming language that 99 | integrates source code analysis, transformation, and generation primitives on the language level. 100 | The [Ada-Air project](https://github.com/cwi-swat/ada-air) aims to add support for [Ada](https://en.wikipedia.org/wiki/Ada_(programming_language)) 101 | to [Rascal MPL](https://www.rascal-mpl.org). 102 | * [Spoofax](https://www.spoofax.dev) is a language designer's workbench. [Spoofax](https://www.spoofax.dev) supports [concrete syntax](https://www.spoofax.dev/howtos/stratego/concrete-syntax) to specify code transformations. 103 | Unfortunately, [Spoofax](https://www.spoofax.dev) still lacks support for [Ada](https://en.wikipedia.org/wiki/Ada_(programming_language)). 104 | -------------------------------------------------------------------------------- /doc/AdaCrateOfTheYear2022-Rejuvenation-Ada.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNO/Renaissance-Ada/c0c37ec7fd6ef5994c27d2439abae9155d96182d/doc/AdaCrateOfTheYear2022-Rejuvenation-Ada.jpg -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | # Documents for Renaissance-Ada 2 | -------------------------------------------------------------------------------- /doc/Relations_Of_Find.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNO/Renaissance-Ada/c0c37ec7fd6ef5994c27d2439abae9155d96182d/doc/Relations_Of_Find.jpg -------------------------------------------------------------------------------- /doc/enhance-insight-reduce-complexity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TNO/Renaissance-Ada/c0c37ec7fd6ef5994c27d2439abae9155d96182d/doc/enhance-insight-reduce-complexity.jpg -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | # Source code for Renaissance-Ada 2 | -------------------------------------------------------------------------------- /src/Renaissance_Ada.gpr: -------------------------------------------------------------------------------- 1 | aggregate project Renaissance_Ada is 2 | 3 | for Project_Files use ("libraries/**/*.gpr", "tools/**/*.gpr"); 4 | 5 | end Renaissance_Ada; 6 | -------------------------------------------------------------------------------- /src/libraries/README.md: -------------------------------------------------------------------------------- 1 | # Libraries of Renaissance-Ada 2 | -------------------------------------------------------------------------------- /src/tools/README.md: -------------------------------------------------------------------------------- 1 | # Tools of Renaissance-Ada 2 | --------------------------------------------------------------------------------