Giter Club home page Giter Club logo

Comments (11)

adrien-thierry avatar adrien-thierry commented on August 28, 2024 2

Hi @DuncanMacWeb !

Thank you for your interest in NectarJS, to generate c++, use the --generate flag

To generate the code in a specific path, use --tmp with a path : --tmp mypath

from nerd.

adrien-thierry avatar adrien-thierry commented on August 28, 2024

You can directly compile JS to c/c++ with NectarJS

from nerd.

jarble avatar jarble commented on August 28, 2024

Does the documentation explain how to compile JavaScript to C or C++?

from nerd.

adrien-thierry avatar adrien-thierry commented on August 28, 2024

Not yet,

you have to use njs --gen your_file.js in the core/nativejs folder

from nerd.

votecoffee avatar votecoffee commented on August 28, 2024

Where is the core/nativejs folder?
Compiling from the js file directory throws the following exception:

/usr/local/lib/node_modules/nectarjs/node_modules/eslint/lib/cli-engine/cli-engine.js:406
} catch {
^

SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/nectarjs/node_modules/eslint/lib/cli-engine/index.js:3:23)

from nerd.

adrien-thierry avatar adrien-thierry commented on August 28, 2024

There is no more core/nativejs, did you update NectarJS ?

from nerd.

votecoffee avatar votecoffee commented on August 28, 2024

I recently installed it. I was looking for a transpiler to convert javascript to c++. I'm guessing that's no longer a supported feature then?

from nerd.

adrien-thierry avatar adrien-thierry commented on August 28, 2024

Compiling to c++ is one of the main feature, so it's supported

Did you install it with npm ?

npm i -g nectarjs

from nerd.

DuncanMacWeb avatar DuncanMacWeb commented on August 28, 2024

Hi @adrien-thierry, I have installed NectarJS globally using npm i -g nectarjs:

$ nectar --version
NectarJS v0.7.99

What is the correct way to generate C/C++ output from NectarJS? Many thanks!

from nerd.

adrien-thierry avatar adrien-thierry commented on August 28, 2024

To just compile the app, use njs myapp.js

from nerd.

DuncanMacWeb avatar DuncanMacWeb commented on August 28, 2024

Got it, thanks!

from nerd.

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.