Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aidanhs/emtcl
Tcl compiled with emscripten
https://github.com/aidanhs/emtcl
Last synced: 28 days ago
JSON representation
Tcl compiled with emscripten
- Host: GitHub
- URL: https://github.com/aidanhs/emtcl
- Owner: aidanhs
- Created: 2014-08-28T23:40:03.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-12T22:11:44.000Z (over 9 years ago)
- Last Synced: 2024-08-01T15:08:48.689Z (3 months ago)
- Language: Makefile
- Homepage: http://aidanhs.github.io/emtcl
- Size: 1.89 MB
- Stars: 40
- Watchers: 7
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
emtcl
=====The imaginatively named emtcl lets you compile tcl or jimtcl with emscripten. It's pretty easy so there's not much here. The small amount there is is available under the 3-clause BSD license (see "LICENSE").
Rather than trying to compile tclsh/jimsh and get stdin working, it instead compiles the tcl library and exposes some C api calls. See js/postJs.js for how this is done.
Current supported interpreters (and their versions) are:
- tcl - core\_8\_6\_1
- jimtcl - 0.75Tcl comes with a toy DOM library as a demo. See EXTRAS.
BUILD
-----Pretty easy (assuming you've got the emscripten sdk on your path):
$ make tclprep # One off prep - hacks.patch application and configure
$ make emtcl # Build emtcl.jsor for jimtcl:
$ make jimtclprep # One off prep - tweaks appropriate #defines and configure
$ make emjimtcl # Build emjimtcl.jsIf you want to totally reset all build files in ./tcl/ and ./jimtcl/ and start again:
$ make reset
This removes all changes and untracked files in there, so be careful!
EXTRAS
------EmTcl (not EmJimTcl) comes with a toy DOM library compiled into it by default
as a demonstration of how one could do interesting things.It currently is a command of the form `dom attr|css selector key val`. It sets
the appropriate key in either the attribute or style dictionary of each element
returned by the selector. It will return the number of elements modified. Note
that style keys are in their camelcase form (backgroundColor vs background-color)
as the styles are changed in the element style dictionary.You can see the code in opt/dom.c. If you really want to compile without it, do
`make emtcl EMTCLDOM=0`.TODO
----There are a number of broken things with each of these Tcl implementations.
tcl:
- `clock` command isn't present. Caused by not calling `Tcl_Init`, would
require embedding the `library` directory. Entirely possible, just not put
the effort in.
- `after 2000 {set ::cond_var 0}; vwait ::cond_var` doesn't work. This seems to
be an emscripten problem, not sure how easy it is to solve.jimtcl:
- `package` command isn't present. Not sure of cause.
- `Jim_InitStaticExtensions` isn't called. Not sure what the implications are.