Automatic programming: Difference between revisions

Content deleted Content added
Uldisn (talk | contribs)
To gii added note
 
(48 intermediate revisions by 29 users not shown)
Line 1:
{{short description|Type of computer programming}}
{{Programming paradigms}}
 
In [[computer science]], the term '''automatic programming'''<ref>Ricardo Aler Mur, "[http://www.evannai.inf.uc3m.es/et/icml06/aiptutorial.htm Automatic Inductive Programming] {{Webarchive|url=https://web.archive.org/web/20160304073124/http://www.evannai.inf.uc3m.es/et/icml06/aiptutorial.htm |date=2016-03-04 }}", ''ICML 2006 Tutorial''. June 2006.</ref> identifiesis a type of [[computer programming]] in which some mechanism generates a [[computer program]], to allow human [[programmer]]s to write the code at a higher abstraction level.
 
There has been little agreement on the precise definition of automatic programming, mostly because its meaning has changed over time. [[David Parnas]], tracing the history of "automatic programming" in published research, noted that in the 1940s it described automation of the manual process of punching [[paper tape]]. Later it referred to translation of [[high-level programming language]]s like [[Fortran]] and [[ALGOL]]. In fact, one of the earliest programs identifiable as a [[compiler]] was called [[Autocode]]. [[David Parnas|Parnas]] concluded that "automatic programming has always been a [[euphemism]] for programming in a higher-level language than was then available to the programmer."<ref>D. L. Parnas. "[httphttps://web.stanford.edu/class/cs99r/readings/parnas1.pdf Software Aspects of Strategic Defense Systems]." ''American Scientist''. November 1985.</ref>
 
[[Program synthesis]] is one type of automatic programming where a procedure is created from scratch, based on mathematical requirements.
 
==Origin==
[[Milly Koss|Mildred Koss]], an early [[UNIVAC]] programmer, explains: "Writing machine code involved several tedious steps—breaking down a process into discrete instructions, assigning specific memory locations to all the commands, and managing the I/O buffers. After following these steps to implement mathematical routines, a sub-routine library, and sorting programs, our task was to look at the larger programming process. We needed to understand how we might reuse tested code and have the machine help in programming. As we programmed, we examined the process and tried to think of ways to abstract these steps to incorporate them into higher-level language. This led to the development of interpreters, assemblers, compilers, and generators—programs designed to operate on or produce other programs, that is, ''automatic programming''."<ref>Chun, Wendy. "On Software, or the Persistence of Visual Knowledge." Grey Room 18. Boston: 2004, pg. 30.</ref>
 
== Generative programming ==
'''Generative programming''' and the related term [[Metaprogramming|meta-programming]]<ref>{{cite web
''Generative programming'' is a style of [[computer programming]] that uses automated [[source code]] creation through [[generic programming|generic]] [[Frame Technology (software engineering)|frames]], [[class (computer science)|classes]], [[Prototype-based programming|prototypes]], [[template processor|template]]s, [[aspect (computer science)|aspect]]s, and [[Code generation (compiler)|code generator]]s to improve [[programmer]] productivity.{{failed verification|date=December 2017}}<ref>James Wilcox, "[http://edgewatertech.wordpress.com/2011/03/11/paying-too-much-for-custom-application-implementation-code-generation/ Paying Too Much for Custom Application Development]", March 2011.</ref> It is often related to code-reuse topics such as [[component-based software engineering]] and [[Product Family Engineering|product family engineering]].
|quote=Generative programming, as a subdomain of meta-programming, describes the practice of writing programs that generate other programs as part of their execution.
|url=https://scala-lms.github.io/tutorials/01_overview.html
|title=About Generative Programming}}</ref> are concepts whereby programs can be written "to manufacture software components in an automated way"<ref>{{cite book
|quote=Generative Programming (GP) is an attempt to manufacture software components in an automated way by developing programs that synthesize other programs.
|author=P. Cointe |title=Unconventional Programming Paradigms
|volume=3566 |pages=315–325 |date=2005|doi=10.1007/11527800_24
|series=Lecture Notes in Computer Science |isbn=978-3-540-27884-9 |chapter=Towards Generative Programming }}</ref> just as automation has improved "production of traditional commodities such as garments, automobiles, chemicals, and electronics."<ref>{{cite web
|title=Generative Programming: Concepts and Experiences (GPCE)
|url=http://www.sigplan.org/Conferences/GPCE}}</ref><ref>A conference of [[SIGPLAN]] on
this topic is planned for November 2018. Earlier/1970s attempts in this area included [[Yacc]]
and the related Lex programs.</ref>
 
''GenerativeThe programming''goal is a style of [[computer programming]] that uses automated [[source code]] creation through [[generic programming|generic]] [[Frame Technology (software engineering)|frames]], [[class (computer science)|classes]], [[Prototype-based programming|prototypes]], [[template processor|template]]s, [[aspect (computer science)|aspect]]s, and [[Code generation (compiler)|code generator]]s to improve [[programmer]] productivity.{{failed verification|date=December 2017}}<ref>James Wilcox, "[http://edgewatertech.wordpress.com/2011/03/11/paying-too-much-for-custom-application-implementation-code-generation/ Paying Too Much for Custom Application Development]", March 2011.</ref> It is often related to code-reuse topics such as [[component-based software engineering]] and [[Product Family Engineering|product family engineering]].
==Source code generation==
 
''Source code generation'' is the process of generating source code based on a description of the problem<ref>{{cite web
==Source -code generation==
''Source -code generation'' is the process of generating source code based on a description of the problem<ref>{{cite web
|quote=Software that generates application programs from descriptions of the problem rather than by traditional programming. It is at a higher level and easier to use than a high-level programming language such as ...
|url=https://www.pcmag.com/encyclopedia/term/37909/application-generator
|title=Application generator |publisher=PCmag.com}}</ref> or an [[Ontologyontology (computerinformation science)|ontological]] model such as a template and is accomplished with a [[programming tool]] such as a [[template processor]] or an [[integrated development environment]] (IDE). These tools allow the generation of [[source code]] through any of various means.
 
Modern programming languages are well supported by tools like [https://www.json4swift.com/ Json4Swift] ([[Swift (programming language)|Swift]]) and [https://www.json2kotlin.com/ Json2Kotlin] ([[Kotlin (programming language)|Kotlin]]).
 
Programs that could generate [[COBOL]] code include:
* the DYL250/DYL260/DYL270/DYL280 series<ref>{{cite web
|url=http://www.sysed.com/DnLoads/RefCards/DYL280.pdf
|title=DYL-280 Command Syntax}}</ref>
|access-date=2018-09-03
|archive-url=https://web.archive.org/web/20180730111004/http://www.sysed.com/DnLoads/RefCards/DYL280.pdf
|archive-date=2018-07-30
|url-status=dead
}}</ref>
* [[Business Controls Corporation]]'s SB-5
* [[KPMG|Peat Marwick Mitchell]]'s PMM2170 application-program-generator package.
These application generators supported COBOL inserts and overrides.
 
A [[Macro (computer science)|macro]] processor, such as the [[C preprocessor]], which replaces patterns in source code according to relatively simple rules, is a simple form of source -code generator.{{citation needed|date=August 2017}} [[Source-to-source compiler|Source-to-source]] code generation tools also exist.<ref>Noaje, Gabriel, Christophe Jaillet, and Michaël Krajecki. "[https://www.researchgate.net/profile/Ponnuswamy_Sadayappan/publication/221302775_Automatic_C-to-CUDA_Code_Generation_for_Affine_Programs/links/09e4150e7f97085734000000/Automatic-C-to-CUDA-Code-Generation-for-Affine-Programs.pdf Source-to-source code translator: OpenMP C to CUDA].". High Performance Computing and Communications (HPCC), 2011 IEEE 13th International Conference on. IEEE, 2011.</ref><ref>Quinlan, Dan, and Chunhua Liao. "[https://www.researchgate.net/profile/Chunhua_Liao/publication/267861836_The_ROSE_Source-to-Source_Compiler_Infrastructure/links/5465a8120cf2f5eb17ff4238.pdf The ROSE source-to-source compiler infrastructure].". Cetus users and compiler infrastructure workshop, in conjunction with PACT. Vol. 2011. 2011.</ref>
 
[[Large language model]]s such as [[ChatGPT]] are capable of generating a program's source code from a description of the program given in a natural language.<ref name="ChatGPT can write code">{{Cite web |url=https://www.zdnet.com/article/chatgpt-can-write-code-now-researchers-say-its-good-at-fixing-bugs-too/ |title=ChatGPT can write code. Now researchers say it's good at fixing bugs, too |website=ZDNET |date=January 26, 2023 |first=Liam |last=Tung |access-date=June 22, 2023 |archive-date=February 3, 2023 |archive-url=https://web.archive.org/web/20230203051252/https://www.zdnet.com/article/chatgpt-can-write-code-now-researchers-say-its-good-at-fixing-bugs-too/ |url-status=live}}</ref>
==Low code applications==
{{Weasel|section|date=February 2018}}
Over the past decade,<ref>[[Low-code development platforms]]</ref>{{Better source|reason=per WP:CIRCULAR|date=December 2017}} a new class of automatic programming has emerged targeting sophisticated end users and IT departments looking for rapid development. These tools allow development of applications in very short periods of time (weeks rather than months). In many cases, the applications are pre-developed but customizable.<ref>{{cite web|url=https://lb.appian.com/low-code-2016/ar-forrester-wave-low-code-q42017?Campaign_Source=Appian|title=[Forrester Wave] Low-Code Development Platforms For AD&D Pros, Q4 2017|website=LookBookHQ|access-date=8 November 2017}}</ref> Products are sometimes targeted at end users, dissatisfied with turnaround times or with IT departments looking for major productivity enhancements. These tools typically operate at a higher level of representation than code generation tools for programming languages.<ref>{{cite web|url=https://www.pcmag.com/roundup/353252/the-best-low-code-development-platforms|title=The Best Low-Code Development Platforms of 2017|website=PCMag.com|access-date=8 November 2017}}</ref>
 
Many [[Relational database system|relational database systems]] provide a function that will export the content of the database as [[SQL]] [[Data definition language|data definition]] queries, which may then be executed to re-import the tables and their data, or migrate them to another RDBMS.
===Implementations===
{{Advert|section|date=October 2010}}
Some [[Integrated development environment|IDE]]s for Java and other languages have more advanced forms of source code generation, with which the programmer can interactively select and customize "[[snippet management|snippet]]s" of source code. Program "[[wizard (software)|wizard]]s", which allow the programmer to design [[graphical user interface]]s interactively while the compiler invisibly generates the corresponding source code, are another common form of source code generation. This may be contrasted with, for example, [[user interface markup language]]s, which define user interfaces [[declarative programming|declaratively]].
 
==Low -code applications==
Besides the generation of code from a wizard or template, IDEs can generate and manipulate code to automate code [[refactor]]ings that would require multiple (error prone) manual steps, thereby improving developer productivity.<ref name="refactoring">{{cite web|url=http://martinfowler.com/articles/refactoringRubicon.html|title=Crossing Refactoring's Rubicon|website=MartinFowler.com|access-date=8 November 2017}}</ref> Examples of such features in IDEs are the refactoring class browsers for [[Smalltalk]] and those found in Java IDEs like [[Eclipse (software)|Eclipse]].
{{Main article|Low-code development platforms}}
 
A [[Low-code development platforms|low-code development platform]] (LCDP) is software that provides an environment [[programmer]]s use to create [[application software]] through [[graphical user interface]]s and configuration instead of traditional [[computer programming]].
A specialized alternative involves the generation of ''[[compiler optimization|optimized]]'' code for quantities defined mathematically within a [[Computer algebra system]] (CAS). Compiler optimization consisting of finding common intermediates of a vector of size <math> n </math> requires a complexity of <math>O(n^2)</math> or <math>O(n^3)</math> operations whereas the very design of a computer algebra system requires only <math>O(n)</math> operations.<ref>C. Gomez and T.C. Scott, ''Maple Programs for Generating Efficient FORTRAN Code for Serial and Vectorized Machines'', [[Computer Physics Communications|Comput. Phys. Commun.]] '''115''', pp. 548-562, 1998 [http://www.sciencedirect.com/science/article/pii/S0010465598001143].</ref><ref>T.C. Scott and Wenxing Zhang, ''Efficient hybrid-symbolic methods for quantum mechanical calculations'', [[Computer Physics Communications|Comput. Phys. Commun.]] '''191''', pp. 221-234, 2015 [http://www.sciencedirect.com/science/article/pii/S0010465515000545].</ref><ref>T.C. Scott, [[Ian Grant|I.P. Grant]], M.B. Monagan and V.R. Saunders, ''Numerical Computation of Molecular Integrals via optimized (vectorized) FORTRAN code'', Proceedings of the Fifth International Workshop on New computing Techniques in Physics Research (Software Engineering, Neural Nets, Genetic Algorithms, Expert Systems, Symbolic Algebra, Automatic Calculations), held in Lausanne (Switzerland), [[Nuclear Instruments and Methods in Physics Research|Nucl. Instrum. Methods Phys. Res.]] '''389''', A, pp. 117-120, 1997 [http://www.sciencedirect.com/science/article/pii/S0168900297000594].</ref> These facilities can be used as pre-optimizer before processing by the compiler. This option has been used for handling mathematically large expressions in e.g. [[Computational chemistry|computational (quantum) chemistry]].
 
Examples:
* [[Acceleo]] is an open source code generator for [[Eclipse (software)|Eclipse]] used to generate any textual language (Java, PHP, Python, etc.) from [[Eclipse Modeling Framework|EMF]] models defined from any metamodel ([[Unified Modeling Language|UML]], [[SysML]], etc.).
* [[Actifsource]] is a plugin for [[Eclipse (software)|Eclipse]] that allows graphical modelling and model-based code generation using custom templates.
* [[Altova]] [[MapForce]] is a graphical data mapping, conversion, and integration tool capable of generating [[application code]] in Java, C#, or C++ for executing recurrent transformations.
* [[CodeFluent Entities]] from [[SoftFluent]] is a graphical tool integrated into Microsoft Visual Studio that generates .NET source code, in C# or Visual Basic.
* [[DMS Software Reengineering Toolkit]] is a system for defining arbitrary [[___domain specific language]]s and translating them to other languages.
* [[Gii]]<ref>{{Gii|url=https://www.yiiframework.com/doc/guide/2.0/en/start-gii|website=www.yiiframework.com|quote= Generating Code with Gii}}</ref> is a [[Yii]] module for module, model, CRUD and form generation.
* [[HPRCARCHITECT]] (from MNB Technologies, Inc) is an artificial intelligence-based software development tool with a Virtual Whiteboard human interface. Language and technology agnostic, the tool's development was funded by the US Air Force to solve the problem of code generation for systems targeting mixed processor technologies.
* [[Spring Roo]] is an [[open source]] active code generator for [[Spring Framework]] based [[Java (programming language)|Java]] applications. It uses [[AspectJ]] [[mixins]] to provide [[separation of concerns]] during round-trip maintenance.
* [[SensioGeneratorBundle]] is an [[open source]] code generator for [[Symfony]] based [[PHP]] applications.
* [[RISE Editor|RISE]] is a free information modeling suite for system development using [[Entity-relationship model|ERD]] or [[Unified Modeling Language|UML]]. Database code generation for [[MySQL]], [[PostgreSQL]] and [[Microsoft SQL Server]]. Persistence code generation for [[C Sharp (programming language)|C#]] (.NET) and [[PHP]] including both [[SOAP]] and [[JSON]] style [[web service]]s and [[Ajax (programming)|AJAX]] proxy code.
* The [[Maple (software)|Maple]] computer algebra system offers code generators for Fortran, MATLAB, C and Java. [[Wolfram Language]] ([[Mathematica]]), and [[MuPAD]] have comparable interfaces.
* Screen Sculptor,<ref>{{cite web|url=https://books.google.com/books?id=a91QXlvTPHAC&pg=PA281&lpg=PA281&dq=%22screen+sculptor%22&source=bl&ots=EeT_58qiJI&sig=JCV7rTVDtAI_QpekYNVNX8KYMYw&hl=en&sa=X&ei=XWmbT6vYDYn30gHx3ZX0Dg&ved=0CEkQ6AEwBQ#v=onepage&q=%22screen+sculptor%22&f=false|title=PC Mag|first=Ziff Davis|last=Inc|date=1 August 1986|publisher=Ziff Davis, Inc.|access-date=8 November 2017|via=Google Books}}</ref> SoftCode,<ref>{{cite web|url=http://www.drdobbs.com/184402499|title=New Products|website=DrDobbs.com|access-date=8 November 2017}}</ref> UI Programmer,<ref>{{cite web|url=http://www.ousob.com/ng/isvd/ng6d817.php|title=ClipX - Nantucket . ISV Directory - Norton Guide|website=www.ousob.com|access-date=8 November 2017}}</ref> and Genifer<ref>{{cite book|last1=Arora|first1=Ashok|last2=Bansal|first2=Shefali|title=Comprehensive Computer and Languages|publisher=Firewall Media|isbn=978-81-7008-355-9|pages=41|url=https://books.google.it/books?id=s9Cn9nqq6dYC&lpg=PA41&pg=PA41#v=onepage&q=genifer&f=false|access-date=19 September 2014|quote=Jenifer is a full-scale code generator that provides a pattern called template, from which the code is generated. After definig screens, menus and reports, Genifer creates the data files, index files and programs.}}</ref> are examples of pioneering program generators that arose during the mid-1980s through the early 1990s. They developed and advanced the technology of extendable, template-based source code generators on a mass market scale.
* [[GeneXus]] is a cross-platform, knowledge representation-based development tool, mainly oriented to enterprise-class applications for Web applications, smart devices and the Microsoft Windows platform. A developer describes an application in a high-level, mostly declarative language, from which native code is generated for multiple environments.
* [[Bidji]] is an [[Apache Ant]] project for code generation and [[data transformation]].
* [http://www.json4swift.com Json4Swift] is an online tool that generates native code mainly [[Swift (programming language)|Swift]] models out of a sample [[Representational state transfer|REST]] response in [[JSON]] format (Similar to [[Plain old Java object|POJO]]). It generates code in [[Associative array|Dictionary]] mapping format, [[Serialization|Swift Codable Protocol]] and [https://github.com/Hearst-DD/ObjectMapper ObjectMapper] syntax.
 
==See also==
* [[Automatic bug fixing]]
* [[Automated machine learning]]
* [[Comparison of code generation tools]]
* [[Feature-oriented programming]]
* [[GitHub Copilot]]
* [[AI-assisted software development]]
* [[Language-oriented programming]]
* [[Modeling language]]
Line 67 ⟶ 70:
* [[Semantic translation]]
* [[Vocabulary-based transformation]]
 
 
==See also==
* [[Fourth-generation programming language]]
* [[Low-code development platform]]s
* [[Emergent Coding]]
 
==Notes==
Line 79 ⟶ 81:
 
==External links==
{{External links|date=November 2017}}
* [http://www.methodsandtools.com/archive/archive.php?id=86 Code Generation for Dummies]
* [http://claude-gomez.fr/macrofort/macrofort.html Code Generation with Macrofort]
 
{{Programming paradigms navbox}}
{{Authority control}}