Giter Site home page Giter Site logo

antono / vala-object Goto Github PK

View Code? Open in Web Editor NEW
95.0 9.0 14.0 347 KB

Use Vala from Ruby, Python, Lua, JavaScript (Node.js, gjs, seed) and many other languages

Makefile 62.29% Shell 6.66% JavaScript 6.16% Lua 2.25% Perl 2.76% PHP 3.96% Python 1.31% Ruby 4.70% Vala 2.37% C++ 0.49% D 1.60% Java 2.76% HTML 2.69%

vala-object's Introduction

Use Vala for your next library, %username%

Objects for free

Write your next library in Vala and get bindings for free!

Here is example how to use functions and objects from vala in your favorite language.

Why Vala?

  • Vala is very fast
  • Vala manages memory for you
  • Write in Vala, (re)use from any %lang%

Setup Vala

Debian/Ubuntu

sudo apt-get install valac gobject-introspection libgirepository1.0-dev

Fedora

sudo yum install vala gobject-introspection-devel

OSX

brew install vala gobject-introspection

Make shared library

Source file for shared library is object.vala.

Run in shell:

make

You should get vala-object.so and ValaObject-0.1.typelib and some other files. .so and .typelib are required for next examples.

If you want more details - read about GObject Introspection and it's architecture. Otherwise just skip to next step :)

Bindings HOWTO (really easy and automagical)

Questions?

vala-object's People

Contributors

antono avatar jumplink avatar techtonik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vala-object's Issues

node.js example works now

I've tested your node.js example with the new node-gir version 0.1.0 and it works full now.
I've fixed the example in my fork.
Please update your Repository, thanks.

Cant build Node

make[1]: *** [binding.target.mk:99: Release/obj.target/binding/src/binding.o] Error 1
make[1]: Leaving directory '/home/gavr/Projects/vala-object-master/valabind/node.js/node_modules/ref/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:190:23)
gyp ERR! stack     at ChildProcess.emit (events.js:193:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:255:12)
gyp ERR! System Linux 5.2.9-zen1-1-zen
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/gavr/Projects/vala-object-master/valabind/node.js/node_modules/ref
gyp ERR! node -v v11.15.0
gyp ERR! node-gyp -v v5.0.2
gyp ERR! not ok 
npm WARN [email protected] No description
npm WARN [email protected] No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gavr/.npm/_logs/2019-08-18T15_28_53_889Z-debug.log
make: *** [Makefile:18: node_modules] Error 1

Generates broken gir bindings.

If one adds a constructor to the class, at least in python w/ gir, the constructor is never called when the object is instanced in python (yes, after regenerating the bindings) if you're using c#/java style constructors. The deconstructor is bound correctly, and so are gobject style constructors.

Probably not a bug with this project, but noting it as a warning to others who might use this as a basis for other projects.

Perl example

test.pl / make run-perl (same as python's)

!/usr/bin/perl

use Glib::Object::Introspection;

Glib::Object::Introspection->setup(
basename => 'ValaObject',
version => '0.1',
package => 'ValaObject',
search_path => 'build');

ValaObject->say_hello_to("Perl");

Cant build Java

make bind

...
ibobject_wrap.cxx:178:10: fatal error: jni.h: No such file or directory
  178 | #include <jni.h>
      |          ^~~~~~~
compilation terminated.
make: *** [Makefile:11: bind] Error 1

is this project active

I want write my python module with vala and search google then get this..................

is this project active?????

LuaJIT 5.2 Support

Hello,

I'd love to see LuaJIT 5.2 support added.

Thanks for the cool library, really fulfills the reason why Vala was created (I feel)!

Cant run Ruby

sh-5.0$ ./run.sh test.rb 
Traceback (most recent call last):
	2: from test.rb:1:in `<main>'
	1: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- object.so (LoadError)

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.