Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this project still active #3

Open
phillipCouto opened this issue Feb 24, 2019 · 9 comments
Open

Is this project still active #3

phillipCouto opened this issue Feb 24, 2019 · 9 comments

Comments

@phillipCouto
Copy link

Is this project still active?

@anurbol
Copy link

anurbol commented Dec 7, 2019

It seems it's not. @aqrln Alexey could you please comment on this: is this project abandoned or it just works fine despite the WIP warnings on the README.md 😃

I've seen that you do conduct some activity in this area, and I've read this PDF where you wrote that you're going to make a new release soon. In the end of that PDF though, you're writing that you're looking for a new maintainer for this crate.

So it seems that one shoudn't use this crate in commercial production, or could they?

@anurbol
Copy link

anurbol commented Dec 7, 2019

I tried to run cargo build --release with Cargo 1.41 and it didn't produce example.node, only napi_example.lib and napi_derive.dll etc.

@aqrln
Copy link
Member

aqrln commented Dec 11, 2019

@anurbol

So it seems that one shoudn't use this crate in commercial production, or could they?

I'd recommend against that, right.

I tried to run cargo build --release with Cargo 1.41 and it didn't produce example.node, only napi_example.lib and napi_derive.dll etc.

Yeah, you need to run npm run build inside the example directory to build the actual Node.js addon.

@Brooooooklyn
Copy link
Member

@aqrln I'm working on a new napi & rust project: https://github.com/Brooooooklyn/napi-rs
And it seems napi-derive crate name was taken by you..
Could you please transfer this crate name(napi-derive) to me if you don't want maintain this project anymore?

@aqrln
Copy link
Member

aqrln commented Apr 26, 2020

@Brooooooklyn yeah sure, your project looks awesome, and I don't even need that name anymore because if I were to continue working on this project, it would be called napi-codegen like in this demo.

@Brooooooklyn
Copy link
Member

My napi-derive implementation is similar with napi-codegen 😄

#[macro_use]
extern crate napi_rs_derive;

use napi_rs::{Result, Value, CallContext, Number};
use std::convert::TryInto;

#[js_function(1)]
fn fibonacci<'env>(ctx: CallContext<'env>) -> Result<Value<'env, Number>> {
  let n = ctx.get::<Number>(0)?.try_into()?;
  ctx.env.create_int64(fibonacci_native(n))
}

#[inline]
fn fibonacci_native(n: i64) -> i64 {
  match n {
    1 | 2 => 1,
    _ => fibonacci_native(n - 1) + fibonacci_native(n - 2)
  }
}

@aqrln
Copy link
Member

aqrln commented Apr 27, 2020

Cool! In my implementation the boilerplate for retrieving arguments from context is generated automatically too:

#[napi::callback(fibonacci_js)]
fn fibonacci(env: Env, n: Number) -> Result<Number> {
    Number::from_i64(env, fibonacci_native(n.to_i64()?))
}

Would you want to add something similar or there are some drawbacks I didn't account for?

@Brooooooklyn
Copy link
Member

Would you want to add something similar or there are some drawbacks I didn't account for?

How do you get this object from call object in your implementation?

My version is not simpler enough for now, I will make them easier to use in next version. Now I'm focusing developing ecosystem around my napi-rs: https://github.com/Brooooooklyn/node-rs

@aqrln
Copy link
Member

aqrln commented May 20, 2020

@Brooooooklyn

How do you get this object from call object in your implementation?

I guess it could be a parameter of special type?

Now I'm focusing developing ecosystem around my napi-rs

That looks very cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants