Coder Social home page Coder Social logo

meme / vala Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frida/vala

0.0 2.0 0.0 27.59 MB

Frida depends on Vala

License: GNU Lesser General Public License v2.1

Emacs Lisp 0.01% Shell 0.14% Perl 0.04% Vala 88.85% Makefile 0.78% C 2.09% GAP 7.03% M4 0.12% Yacc 0.22% CSS 0.25% JavaScript 0.04% Python 0.01% Meson 0.44% GLSL 0.01% Genie 0.01%

vala's Introduction

What is Vala?

Vala is a programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.

valac, the Vala compiler, is a self-hosting compiler that translates Vala source code into C source and header files. It uses the GObject type system to create classes and interfaces declared in the Vala source code.

The syntax of Vala is similar to C#, modified to better fit the GObject type system. Vala supports modern language features as the following:

  • Interfaces
  • Properties
  • Signals
  • Foreach
  • Lambda expressions
  • Type inference for local variables
  • Generics
  • Non-null types
  • Assisted memory management
  • Exception handling

Vala is designed to allow access to existing C libraries, especially GObject-based libraries, without the need for runtime bindings. All that is needed to use a library with Vala is an API file, containing the class and method declarations in Vala syntax. Vala currently comes with bindings for GLib and GTK+.

Using classes and methods written in Vala from an application written in C is not difficult. The Vala library only has to install the generated header files and C applications may then access the GObject-based API of the Vala library as usual. It should also be easily possible to write a bindings generator for access to Vala libraries from applications written in e.g. C# as the Vala parser is written as a library, so that all compile-time information is available when generating a binding.

More information about Vala is available at https://wiki.gnome.org/Projects/Vala/

Building Vala

Instructions on how to build the latest version of Vala. These can be modified to build a specific release.

Step One:

Install the following packages:

  • a C compiler, e.g. GCC
  • a C library, e.g. glibc
  • glib (>= 2.48)
  • flex
  • bison
  • Graphviz (libgvc) (>= 2.16) to build valadoc
  • make
  • autoconf
  • autoconf-archive
  • automake
  • libtool

Step Two:

Decide where the Vala compiler is to be found.

Vala is self-hosting so it needs another Vala compiler to compile itself. valac is the name of the executable and can be:

If you have an existing valac installed then move on to step three.

If you don't have an existing version of Vala installed (i.e. because you're bootstrapping or cross-compiling) then a source tarball or the vala-bootstrap module contain pre-compiled C files from the Vala sources. These can be used to bootstrap valac.

Source tarballs can be downloaded via:

https://wiki.gnome.org/Projects/Vala/Release

or the vala-bootstrap module is available at:

https://gitlab.gnome.org/Archive/vala-bootstrap

Here is an example on how to download and compile from a Vala release tarball. In this example it is release version 0.42.3:

curl --silent --show-error --location https://download.gnome.org/sources/vala/0.42/vala-0.42.3.tar.xz --output vala-bootstrap.tar.xz
tar --extract --file vala-bootstrap.tar.xz
cd vala-bootstrap
./configure --prefix=/opt/vala-bootstrap
make && sudo make install

The configure script will check if valac can be found in PATH. If not then valac is bootstrapped from the C source files in the tarball. If you do not wish to install the bootstrapped version of valac it can be found in vala-bootstrap/compiler/valac This is a libtool wrapper script that makes the libraries in the build directory work together.

An example of downloading and compiling from the bootstrap module:

git clone https://gitlab.gnome.org/Archive/vala-bootstrap
cd vala-bootstrap
touch */*.stamp
VALAC=/no-valac ./configure --prefix=/opt/vala-bootstrap
make && sudo make install

Step Three:

Compiling the newest Vala from the repository using a pre-installed valac:

git clone https://gitlab.gnome.org/GNOME/vala
cd vala
./autogen.sh
make && sudo make install

To use valac from a bootstrapped build detailed in step two use:

git clone https://gitlab.gnome.org/GNOME/vala
cd vala
VALAC=/opt/vala-bootstrap/bin/vala ./autogen.sh
make && sudo make install

Compiling Different Vala Versions

Maybe you now want to compile Vala with the new version you have just installed. Then you simply clean the version files and start the build. Be warned that git clean -dfx will remove all untracked files from the source tree:

git clean -dfx
./autogen.sh
make && sudo make install

If you wish to build a specific release, for example 0.40.11:

git checkout 0.40.11
git clean -dfx
./autogen.sh
make && sudo make install

vala's People

Contributors

abderrahim avatar abustany avatar allisonkarlitskaya avatar asabil avatar astavale avatar autumngray avatar ceyusa avatar elmarco avatar flobrosch avatar garnacho avatar jaaphaitsma avatar juergbi avatar lovebug356 avatar lucabrunox avatar mhr3 avatar mickeyl avatar nemequ avatar oleavr avatar phako avatar philippejer avatar prince781 avatar ptitjes avatar pwithnall avatar ricotz avatar robert-ancell avatar sandrinr avatar sebp avatar tak avatar uzytkownik avatar zeenix avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.