NaTcl

Announcing Tcl for the Web

NaTcl is Tcl running in the Native Client ("NaCl") sandbox of Google Chrome (and Google Chromium).

This allows Tcl to run on client browsers, and mutate and access Chrome's DOM. Thus, people can write web apps in Tcl, as nature intended :)

NaTcl will soon be followed by NaTk, a port of WubTk technology to NaTcl, which will allow people to write Web Apps in Tk!!!

We believe, as it was with Tcl v. C, that Tcl will be a faster, easier, more convivial language in which to write things than JavaScript. The evidence is that javascript requires substantial ecosystem to support it, and we think that may just be because JavaScript is based on a system language, whereas Tcl gives all that scripting language goodness.

Try it out

  • Get chrome (we use 10.0.648.204)
  • Kill all running chrome instances.
  • chrome, google-chrome --no-sandbox
    • on OSX use /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --no-sandbox
  • navigate to about:flags and enable native client, save it.
    • on OSX (at least) you will need to restart Chrome after enabling native client
  • https://wiki.tcl-lang.org/_natcl/balls.html

Problems?

If you get missing so file error on the console, it's a known issue with chrome rpms and debs not including the NaTcl plugin. http://code.google.com/p/nativeclient/issues/detail?id=1416

Can you run these non-tcl demos? http://code.google.com/chrome/nativeclient/docs/examples.html (URL is 404 on Oct 4, 2011) ... if not, there's something wrong with your chrome installation.

If you've installed the chrome .deb in lucid puppy (linux), make sure you: ln -s /opt/google/chrome/chrome /usr/bin/chrome

jima (2011-06-14) Apparently our NaTcl won't work with Chrome version 12. The highest version of Chrome that works for me is: 11.0.696.65. I cannot say for sure the problem is with the building of NaTcl. Perhaps the NaCl mechanism don't go very well in latest "experimental" version of Chrome.

Serve with Wub

  • Make NaTcl per README
  • mkdir [docroot]/NaTcl and [docroot]/NaTcl/exe
  • cp tcl.nexe [docroot]/NaTcl/exe
  • cp index.html tcl.nmf [docroot]/NaTcl/

Edit tcl.nmf to

{
  "nexes": {
    "x86-32": "exe/tcl.nexe",
  }
}

Add to site.config:

/natcl/ {
    domain File
    root $Wub::docroot/NaTcl
}

/natcl/exe {
    domain File
    root $Wub::docroot/NaTcl/exe
    expires tomorrow
}

See the article at [L1 ] for a description of the native client implementation. Is anyone working on getting NaTcl to work with the newer versions of Chrome Native Client?


jvoung - 2012-08-28 23:02:17

Note, there is a port to Chrome 14/15+: http://core.tcl.tk/tcl/timeline?r=ferrieux-nacl

May require additional source changes to that compile with the newest NaCl SDK though (some headers changed slightly).