Genie (programming language)
Paradigm | multi-paradigm: imperative, structured, object-oriented |
---|---|
Designed by | Jamie McCracken |
First appeared | 2008 |
Stable release | 0.52.3
/ May 1, 2021 |
Typing discipline | static, strong |
OS | Cross-platform (every platform supported by GLib) |
License | LGPLv2.1+ |
Filename extensions | .gs |
Website | {{URL|example.com|optional display text}} |
Influenced by | |
Python, Boo, D, Object Pascal |
Search Genie (programming language) on Amazon.
Genie is a modern, general-purpose high-level programming language in development since 2008.[1] It was designed as an alternative, simpler and cleaner dialect for the Vala compiler, while preserving the same functionality of the Vala language. Genie uses the same compiler and libraries as Vala; the two can indeed be used alongside each other.[2] The differences are only syntactic.
Genie's syntax is derived from numerous modern languages like Python, Boo, D and Delphi. In the vein of Python, Genie uses indentation rather than explicit block delimiters (like, for example, curly brackets) to delimit blocks.
Like Vala, Genie uses the GObject type system to create classes and interfaces declared in Genie source code, without imposing additional runtime requirements (i.e., unlike Python, Java or C#, it does not require a virtual machine).
Genie allows access to C libraries, especially those based in GObject (like GTK), without using a different application binary interface (ABI). During compilation, the code is first translated to C source and header files, which are then compiled to platform-specific machine code using any available C compiler like GCC, thus allowing cross-platform software development.
Programs developed in Vala and Genie do not depend on the GNOME Desktop Environment, usually requiring only GLib.
Code samples[edit]
"Hello World"[edit]
This sample explicitly uses four spaces for indentation.
[indent=4] init print "Hello, world!"
Objects[edit]
With no explicit indentation declaration, the default is tabs.
class Sample def run() stdout.printf("Hello, world! \n ") init var sample = new Sample() sample.run()
Criticism[edit]
As of 2013[update], Genie "for" loops are inclusive, which makes handling of empty lists cumbersome:[3]
var l = new list of string
if l.size > 0
for var i = 0 to (l.size - 1)
print l.[i]
However, one can also iterate over lists via the for-in construct. This is easy and straightforward:[4]
var l = new list of string
for s in l:
print s
References[edit]
- ↑ Jamie McCracken (2008). "Introducing Genie - the smart programming language". Archived from the original on 2011-08-18. Unknown parameter
|url-status=
ignored (help) - ↑ Using Genie and Vala together
- ↑ Tal Liron (11 January 2013). Genie. Event occurs at 32:29. Archived from the original on 2021-12-20. Unknown parameter
|url-status=
ignored (help) - ↑ "Projects/Genie - GNOME Wiki!".
External links[edit]
- Lua error in Module:Official_website at line 90: attempt to index field 'wikibase' (a nil value).
- Barry Kauler's page on Genie at the Wayback Machine (archived February 17, 2010)
- Using the Genie programming language under Puppy Linux
- Puppy Linux: Vala and Genie Programming
- API Documentation
- search github projects written in genie
This programming-language-related article is a stub. You can help EverybodyWiki by expanding it. |
This article "Genie (programming language)" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Genie (programming language). Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.