Genie (programming language)

Not to be confused with Genie ALGOL 68G or Geany.
Genie
Paradigm multi-paradigm: imperative, structured, object-oriented
Designed by Jamie McCracken
Developer GNOME Project
First appeared 2008 (2008)
Stable release
0.34.2 / October 23, 2016 (2016-10-23)
Typing discipline static, strong
OS Cross-platform (every platform supported by GLib)
License LGPL 2.1+
Filename extensions .gs
Website wiki.gnome.org/Projects/Genie
Influenced by
Python, Boo, D, Object Pascal

Genie is a modern, general-purpose high-level programming language in active 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 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.

Although both Vala and Genie are being developed and promoted by GNOME, programs developed in Genie don't depend on the GNOME Desktop Environment, usually requiring only GLib.

Code samples

"Hello World"

This sample explicitly uses four spaces for indentation.

[indent=4]

init
    print "Hello, world!"

Objects

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()

References

This article is issued from Wikipedia - version of the 11/26/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.