Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Code samples  



1.1  "Hello World"  





1.2  Objects  







2 Criticism  





3 References  





4 External links  














Genie (programming language)






Español
فارسی

Bahasa Melayu


 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Genie
Paradigmmulti-paradigm: imperative, structured, object-oriented
Designed byJamie McCracken
First appeared2008; 16 years ago (2008)
Stable release

0.52.3 / May 1, 2021; 3 years ago (2021-05-01)

Typing disciplinestatic, strong
OSCross-platform (every platform supported by GLib)
LicenseLGPLv2.1+
Filename extensions.gs
Websitewiki.gnome.org/Projects/Genie Edit this at Wikidata
Influenced by
Python, Boo, D, Object Pascal

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, 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]

  1. ^ Jamie McCracken (2008). "Introducing Genie - the smart programming language". Archived from the original on 2011-08-18.
  • ^ Using Genie and Vala together
  • ^ Tal Liron (11 January 2013). Genie. Event occurs at 32:29. Archived from the original on 2021-12-20.
  • ^ "Projects/Genie - GNOME Wiki!".
  • External links[edit]


  • t
  • e

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Genie_(programming_language)&oldid=1232009947"

    Categories: 
    2008 software
    Cross-platform free software
    GTK language bindings
    High-level programming languages
    Object-oriented programming languages
    Programming languages created in 2008
    Software using the LGPL license
    Statically typed programming languages
    Programming language topic stubs
    Hidden categories: 
    Wikipedia neutral point of view disputes from March 2023
    All Wikipedia neutral point of view disputes
    Wikipedia articles in need of updating from June 2019
    All Wikipedia articles in need of updating
    Articles with multiple maintenance issues
    Articles containing potentially dated statements from 2013
    All articles containing potentially dated statements
    Webarchive template wayback links
    All stub articles
     



    This page was last edited on 1 July 2024, at 13:01 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki