summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-08-05 12:33:23 +0200
committerAraq <rumpf_a@web.de>2012-08-05 12:33:23 +0200
commitc7158af75273f0f88010b6313748437149f6ac8b (patch)
tree2fcb344716c1e8b1a695d11184bd71cd0ccc8f5a /doc
parenta7a2f464a2cdc66b6c7e77545a13913cbe21bf5c (diff)
downloadNim-c7158af75273f0f88010b6313748437149f6ac8b.tar.gz
idetools: 'usages' and 'def' should work now; documented js backend
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/nimrodc.txt37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt
index 13bf5295a..98e1b96d8 100755
--- a/doc/nimrodc.txt
+++ b/doc/nimrodc.txt
@@ -514,3 +514,40 @@ efficient:
   of "license": c.license = UnixToNativePath(k.value)

   else: quit(errorStr(p, "unknown variable: " & k.key))

 
+
+The ECMAScript target
+=====================
+
+Nimrod can also generate `ECMAScript`:idx: (also known as `JavaScript`:idx:)
+code. However, the ECMAScript code generator is experimental!
+
+Nimrod targets ECMAScript 1.5 which is supported by any widely used browser.
+Since ECMAScript does not have a portable means to include another module,
+Nimrod just generates a long ``.js`` file.
+
+Features or modules that the ECMAScript platform does not support are not
+available. This includes:
+
+* manual memory management (``alloc``, etc.)
+* casting and other unsafe operations (``cast`` operator, ``zeroMem``, etc.)
+* file management
+* most modules of the Standard library
+* proper 64 bit integer arithmetic
+* unsigned integer arithmetic
+
+However, the modules `strutils`:idx:, `math`:idx:, and `times`:idx: are
+available! To access the DOM, use the `dom`:idx: module that is only
+available for the ECMAScript platform.
+
+To compile a Nimrod module into a ``.js`` file use the ``js`` command; the
+default is a  ``.js`` file that is supposed to be referenced in an ``.html``
+file. However, you can also run the code with `nodejs`:idx:\:  
+
+  nimrod js -d:nodejs -r examples/hallo.nim
+
+
+Known bugs
+----------
+
+* exception handling does not work
+