Giter VIP home page Giter VIP logo

Comments (9)

jfilby avatar jfilby commented on August 22, 2024 1

When you make the fix to kapsis can you please make a release, and set denim's dependency to that new version of kapsis? Also please then release a new version of denim. It's just easier to develop against specific versions than head.

from denim.

georgelemon avatar georgelemon commented on August 22, 2024

If you want to use the new High-level API {.export_napi} there is no need to check for types. Consider the following:

init proc(module: Module) =
  proc callNimFn(name: string): string {.export_napi} =
    # `callNimFn` is not a real proc, here we'll use nnkProcDef to retrieve
    # nnkFormalParams for creating the auto type checker. 

    # types supported (Nim > NAPI):
    # string > napi_string
    # int > napi_number
    # object > napi_object
    # array > napi_object (cuz it's an object that) here we use `napi_is_array`
    # undefined > napi_undefined
    # nil > napi_null
    # symbol > napi_symbol
    # func > napi_function
    # external > napi_external
    # varargs[string] > variable arguments (unstable)

    # optional args should be called like (not implemented, yet):
    # age: int = 21
    # or
    # age = 21 

    # the return type is not required. but is going to be used
    # when generating the docblock comment for `@return {object}`

    # args.get("name") is not implemented, yet
    # so you will have to keep using `args` sequence.
    return args[0].getStr

And yes, I will make expect proc work with the old module.registerFn()

from denim.

georgelemon avatar georgelemon commented on August 22, 2024

Reinstalling denim should fix a little bug around getNimNapiType

from denim.

georgelemon avatar georgelemon commented on August 22, 2024

Note that you can npm install cmake-js -g. Is faster than node-gyp

denim build src/myapp.nim --cmake --yes

Node-gyp gives an unhelpful error: Error: unhandled exception: field 'vStr' is not accessible for type 'Parameter' using 'ptype = LongFlag' [FieldDefect]

There is a little bug in kapsis cli. I will try fix this soon

from denim.

georgelemon avatar georgelemon commented on August 22, 2024

Will keep my README simple, with a minimal example.

Anything else will be in tests.

from denim.

jfilby avatar jfilby commented on August 22, 2024

Thanks. I'm trying cmake-js, it does seem faster on repeated calls. I'll wait for the fix to kapsis.

from denim.

georgelemon avatar georgelemon commented on August 22, 2024

Not quite ready for a release, but you can reinstall from head. Should work for now.

Also, check /tests for fully working examples.

from denim.

georgelemon avatar georgelemon commented on August 22, 2024

Just released 0.1.5. Updated docs

from denim.

jfilby avatar jfilby commented on August 22, 2024

Works great, thanks!

from denim.

Related Issues (13)

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.