← Back to team overview

leaningtech-dev team mailing list archive

[Bug 1399977] Re: Node.js support

 

Cheerp already supports some of the requirement you listed, namely:

* You can generate standalone JS files to be executed on Node.js. Indeed
we use node.js to run the files compiled from our test suite. We don't
have the required C++ header to access Node.js functionalities, but they
can be crafted easily:

https://github.com/leaningtech/cheerp-wiki/wiki/Browser-side-
programming-guide#accessing-the-dom-under-the-hood

* Cheerp can generate native code, it also has experimental support for
generating native server side code which is transparently invoked using
RPCs from code running on the client. At the moment you can use the
[[server]] custom attribute on a function to have it compiled to native
code, but it will also generate RPC boilerplate which is unnecessary for
your use case. Something like [[native]] could be added to remove such
boilerplate and only build the native code.

*  C is fully supported when generating native code. When generating
JavaScript there are limitations. Since C is less type safe than C++
there are idioms which works on native platforms but does not on Cheerp.
I can give you some examples if you want. Moreover C code has no builtin
way of accessing JS APIs as this functionality depends on C++
namespaces.

On the other hand, Cheerp can't yet be compiled in JavaScript as
LLVM/clang which are the bases for Cheerp are not type safe enough. We
have long term plans to make Cheerp self hosting but it's not something
that it's available yet.

-- 
You received this bug notification because you are a member of
Leaningtech Team, which is subscribed to Cheerp.
https://bugs.launchpad.net/bugs/1399977

Title:
  Node.js support

Status in Cheerp: C++ for the Web:
  New

Bug description:
  I would like that cheerp could be used as a C/C++ compiler running on
  top of Node.js, so it could be used on NodeOS to compile native
  modules. This has some implications:

  * cheerp itself compiled to Javascript
  * command line Node.js executable
  * C support
  * generate native code (not only Javascript)
  * detect when to generate native code. Node.js modules can be crafted for performance issues, but another usage is to access to low level libraries or system resources like syscalls. This last ones need native code to be generated with no other alternative

  Disclaimer: I'm the lead developer of NodeOS ;-)

To manage notifications about this bug go to:
https://bugs.launchpad.net/cheerp/+bug/1399977/+subscriptions


Follow ups

References