Closed t9md closed 8 years ago
Here is I'm doing, I could what I wanted, but if STDOUT is supported, I can do more simply.
To do this, the best I want is write bsc's output to STDOUT. Is this supported?
not yet, but it should be easy to add an option -djs
, so that bsc -djs -c hello.ml
output to STDOUT, but how is it different from bsc -c hello.ml && cat hello.js
, for performance issue?
-o
is reserved for linker, currently we rely on webpack or google closure as a js bundler, but eventually we want to have our own bundler.
can I suppress output of .cmj and .cmi file?
no, these files are meta data needed for compiling against other ml files, but you can set js output to a separate directory via -js-npm-output-path your_npm_package_name:path/to/js/output
The gif is nice!
Thanks for eraborate explanation. Understood. The reason why STDOUT is not performance, but for easier implementation. If it can write STDOUT I can just write to Atom's buffer directly through node's child_process's stdout callback.
I'm trying my Atom-editor plugin support "write js compiled output to another editor" so that I can learn OCaml itself and how buclescript compile to JavaScript.
To do this, the best I want is write bsc's output to STDOUT. Is this supported? Trying to
-o
option with-o -
not work. even normal-o hoo.js
seem to not work. Next question, can I suppress output of.cmj
and.cmi
file? I just need js output only for my editor package.I'm just start learning OCaml itself, so sorry if my question seems stupid, btw I could successfully get output of bsc.