Pyrex is a programming language developed to aid in creating Python modules. Its syntax is very close to Python, with the aim of making it easy for Python programmers to write the non-Python code usually required for such modules in a language which at least is very close. Python itself only provides a C API to write extension modules, which allows writing of functions and datatypes in C. These can then be accessed from Python.

PropertyValue
dbpedia-owl:Work/genre
dbpedia-owl:genre
dbpprop:abstract
  • Pyrex is a programming language developed to aid in creating Python modules. Its syntax is very close to Python, with the aim of making it easy for Python programmers to write the non-Python code usually required for such modules in a language which at least is very close. Python itself only provides a C API to write extension modules, which allows writing of functions and datatypes in C. These can then be accessed from Python. It is thus also possible to wrap the functions and datatypes of existing C libraries as Python objects and therefore make them available to Python. There are tools like SWIG or Python's foreign function library ctypes which can be used for this task without requiring much additional code, but this is limited to making an external library available in Python code. If adjustments to the API are needed, glue code must again be written manually. This is where Pyrex fits in. Pyrex allows the user to write extension modules in a Python-like language which may directly access the external C code. The similarity of Pyrex's syntax to Python's makes it easy to write Python modules, as there is no need to learn another language (such as C or C++), and there may be no need to write any glue code. All that is needed is to specify the name of C-header files, enumerations, datatypes and functions needing to be accessed in the module, then simply use them as if they were Python objects. The Pyrex compiler will generate the necessary glue code automatically and compile the Pyrex code into a working Python module.
  • Pyrex は、Pythonの拡張モジュールの作成を補助する目的で開発されたプログラミング言語である。Python は拡張モジュールを記述するためのC言語のAPIを提供している。関数とデータ型をC言語で記述することができ、記述したモジュールは Python からアクセスすることができる。既存の C ライブラリ の関数とデータ型を Python オブジェクトとしてラップし、Python から利用可能にすることもできる。 こうしたプロセスの自動化を補助する SWIG のようなツールも存在するが、Python から外部のライブラリを利用可能にすることに限定されており、API の変更が必要な場合、再度グルーコードを手で記述する必要がある。このような場合に Pyrex は適している。Pyrex ではユーザーが C コードに直接アクセス可能な Python に似た言語を用いて、拡張モジュールを記述することを可能にする。 Pyrex と Python の文法が似ているため、Python のモジュールを記述するのは容易であり、C や C++ などの異なる言語を習得する必要がない。また、グルーコードを書く必要もない。C のヘッダファイルと、拡張モジュールでアクセスする必要のある列挙型、データ型、関数を指定するだけでよい。Pyrex コンパイラが必要なグルーコードを自動的に生成し、Pyrex コードを動作する Python モジュールにコンパイルしてくれる。
dbpprop:date
  • July 2009
dbpprop:developer
  • Greg Ewing
dbpprop:discuss
  • Talk:Pyrex (programming language) Merger proposal
dbpprop:genre
dbpprop:hasPhotoCollection
dbpprop:latestReleaseVersion
  • 0.9.8.5
dbpprop:name
  • Pyrex
dbpprop:operatingSystem
dbpprop:portalProperty
  • Free Software Portal Logo.svg
  • Free software
dbpprop:reference
dbpprop:website
dbpprop:wikiPageUsesTemplate
dbpprop:wordnet_type
rdf:type
rdfs:comment
  • Pyrex is a programming language developed to aid in creating Python modules. Its syntax is very close to Python, with the aim of making it easy for Python programmers to write the non-Python code usually required for such modules in a language which at least is very close. Python itself only provides a C API to write extension modules, which allows writing of functions and datatypes in C. These can then be accessed from Python.
rdfs:label
  • Pyrex (programming language)
  • Pyrex
owl:sameAs
skos:subject
foaf:homepage
foaf:name
  • Pyrex
foaf:page
is dbpprop:programmingLanguage of
is dbpprop:redirect of