I think most emscripten developers focus on the web case, not node, at least so far. But it would be possible to extend emscripten to do what you want, if it's just calling into node shell() or something similar. See library.js, shell(), the code would go in there. Improvements for node are certainly interesting to have in emscripten.
- ALon On Thu, Feb 26, 2015 at 10:36 AM, <[email protected]> wrote: > On Wed, 25. Feb 2015 20:46:19 UTC+1 Alon Zakai wrote: > > system() requires a full shell environment, which emscripten does > > not provide. When the code runs on the web, we don't have a POSIX > > style OS underneath us. We would have to emulate one, in theory. > > Ok, when the code runs on the web there is no shell that can execute > system(). But I execute the program on my local computer with > node.js. So there is definitely an OS underneath, that CAN execute > system() commands. I have no intention to execute a program with > system() calls on the web (there it would be totally okay when > system() fails with -1). But this is not the case here. I use > system() in my build system. > > Other projects use ./configure scripts to determine the properties > of the C compiler and its run-time library. But ./configure scripts > require a shell like bash. Therefore I decided to do the > configuration with a C program instead. This works fine with gcc, > clang, msvc, bcc32, icc and probably also with other compilers. > With this compilers system() works under Linux and Windows. > When I use emcc the resulting program is executed with node.js. > > Isn't there an emcc or node option that allows accessing the > shell of the operating system. This shell would then start emcc > and node to compiler and execute many small test programs. > > The same holds for the filesystem access. When the program runs > on the web it is necessary to have an emulated filesystem. > But when I execute a program locally I expect something that > allows me to access the filesystem. Of cause this would be > outside of the program (E.g. an option of emcc or node.js). > > My goal is: The Seed7 compiler translates to C and emcc carries > on to javaScript. This would be linked to a part of the Seed7 > run-time library that is written in C and has also been compiled > with emcc. This way Seed7 programs could execute on the web. > > The problems with system() and the filesystem are not related to > this use case. They are related to the build system that is used > to compile the Seed7 run-time library and the Seed7 compiler. > > Is there a way to reach the goal stated above? > > > Regards, > Thomas Mertes > > -- > Seed7 Homepage: http://seed7.sourceforge.net > Seed7 - The extensible programming language: User defined statements > and operators, abstract data types, templates without special > syntax, OO with interfaces and multiple dispatch, statically typed, > interpreted or compiled, portable, runs under linux/unix/windows. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
