词条 | Vala (programming language) |
释义 |
| name = Vala | logo = File:Vala Logo.svg | paradigm = Multi-paradigm: imperative, structured, object-oriented | developer = Jürg Billeter, Raffaele Sandrini | latest release version = 0.42.3[1] | latest release date = {{Start date and age|2018|11|7|df=yes}} | latest preview version = 0.41.92 | latest preview date = {{Start date and age|2018|8|18|df=yes}} | typing = static, strong | influenced by = C, C++, C#, D, Java, Boo | operating system = Cross-platform all supported by GLib, but distributed as source code only. | license = LGPL 2.1+ | website = {{URL|https://wiki.gnome.org/Projects/Vala}} | year = {{Start date and age|df=yes|2006}} | file ext = .vala, .vapi }} Vala is an object-oriented programming language with a self-hosting compiler that generates C code and uses the GObject system. Vala is syntactically similar to C# and includes notable features such as: anonymous functions, signals, properties, generics, assisted memory management, exception handling, type inference, and foreach statements.[2] Its developers, Jürg Billeter and Raffaele Sandrini, wanted to bring these features to the plain C runtime with little overhead and no special runtime support by targeting the GObject object system. Rather than compiling directly to machine code or assembly language, it compiles to a lower level intermediate language. It source-to-source compiles to C, which is then compiled with a C compiler for a given platform, such as GCC.[3] For memory management, the GObject system provides reference counting. In C, a programmer must manually manage adding and removing references, but in Vala, managing such reference counts is automated if a programmer uses the language's built-in reference types rather than plain pointers. Using functionality from native code libraries requires writing vapi files, defining the library interfacing. Writing these interface definitions is well-documented for C libraries, especially when based on GObject. However, C++ libraries are not supported. Vapi files are provided for a large portion of the GNOME platform, including GTK+. Vala was conceived by Jürg Billeter and was implemented by him and Raffaele Sandrini, finishing a self-hosting compiler in May 2006.[4] Code exampleA simple "Hello, World!" Vala program: A more complex version, showing some of Vala's object-oriented features: An example using GTK+ to create a GUI "Hello, World!" program (see also GTK+ hello world): The last example needs an extra parameter to compile on GNOME 3 platforms: See also{{Portal|Free and open-source software}}
References1. ^{{cite web|url=https://wiki.gnome.org/Projects/Vala|title=Vala - Compiler Using the GObject Type System|accessdate=11 November 2018|at=News section|publisher=GNOME Project}} 2. ^{{cite web|url=https://arstechnica.com/information-technology/2007/09/vala-high-level-programming-with-less-fat/|title=Vala: high-level programming with less fat|publisher=Ars Technica|accessdate=13 December 2011}} 3. ^{{cite web|url=https://lwn.net/Articles/335966/|title=A look at two new languages: Vala and Clojure}} 4. ^{{cite web|url=http://gnomejournal.org/article/80/writing-multimedia-applications-with-vala|title=Writing Multimedia Applications with Vala|archiveurl=https://web.archive.org/web/20120828170152/http://www.gnomejournal.org/article/80/writing-multimedia-applications-with-vala|archivedate=28 August 2012|deadurl=yes}} External links{{Wikibooks|Vala Programming}}{{commons category|Vala (programming language)}}
9 : Programming languages|Object-oriented programming languages|Software using the LGPL license|Source-to-source compilers|Statically typed programming languages|Vala (programming language)|Programming languages created in 2006|2006 software|Cross-platform free software |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。