Git Product home page Git Product logo

Comments (4)

piotras avatar piotras commented on July 3, 2024

Current "plain description" is let's make it work and cover all fundamental operations with tests. Depending on expectation I would place node-gir between alfa na beta. GIR itself is not mature enough (though it's stable enough) to describe every single detail. GTK itself has been designed for C developers and docs are friendly for such. Node-gir provides runtime dynamic bindings so if you expect API docs, one should provide special routines to generate Node ones. The more feedback we have the node-gir design is more strict and clear.

from node-gir.

tiye avatar tiye commented on July 3, 2024

@piotras You mean node-gir is now alpha version.
No wonder loading "Gtk" module is slower than that in Seed.
By now only Gjs is mature enough then?

from node-gir.

piotras avatar piotras commented on July 3, 2024

@jiyinyiyong I would say it's between alpha and beta. Check tests: https://travis-ci.org/piotras/node-gir/builds/2897206.
They pass for most fundamental types and options. Still there's a lack of in&out arguments, but I find them only C level friendly. Wrt module loading speed. Do you have some real numbers? What about runtime performance? I can take a look and check module loading time, but I would like to know whether I need to fix 5% or 65% for example.

from node-gir.

tiye avatar tiye commented on July 3, 2024

Test two files here:
load.js

// Generated by CoffeeScript 1.4.0
var Gtk, gir;

if (typeof console !== "undefined" && console !== null) {
  gir = require('gir');
  gir.load('Gtk', '3.0');
} else if (typeof print !== "undefined" && print !== null) {
  Gtk = imports.gi.Gtk;
}

log.js

// Generated by CoffeeScript 1.4.0

if (typeof console !== "undefined" && console !== null) {
  console.log('node');
} else if (typeof print !== "undefined" && print !== null) {
  print('seed');
}

Run in terminal

➤➤ time node load.js 

real    0m1.482s
user    0m1.367s
sys 0m0.123s
➤➤ time seed load.js 

real    0m0.112s
user    0m0.083s
sys 0m0.027s
➤➤ time node log.js 
node

real    0m0.057s
user    0m0.050s
sys 0m0.003s
➤➤ time seed log.js 
seed

real    0m0.039s
user    0m0.023s
sys 0m0.013s
➤➤ uname -a
Linux up 3.6.8-1-ARCH #1 SMP PREEMPT Mon Nov 26 22:10:40 CET 2012 x86_64 GNU/Linux
➤➤ node -v
v0.8.15
➤➤ seed --version
Seed 3.2.0

I found a problem... and I made it work(however I dont't know why is that)

➤➤ node load.js 

module.js:340
    throw err;
          ^
Error: Cannot find module './build/Release/lib.target/girepository.node'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/home/chen/code/tmp/node_modules/gir/gir.js:8:28)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
➤➤ c node_modules/gir/build/Release/lib.target/
girepository.so
➤➤ cp girepository.so girepository.node
➤➤ c -
load.coffee  load.js  log.coffee  log.js  node_modules/
➤➤ time node load

real    0m1.614s
user    0m1.400s
sys 0m0.120s

from node-gir.

Related Issues (20)

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.