diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2023-11-16 17:50:24 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2023-11-16 17:50:24 +0300 |
commit | ebd9c3c4ec2cfe2f08b4f700dcc5bcb2a8b4b847 (patch) | |
tree | 62897dce25fad99544ebd1ddb7257e74e133e477 /README.md | |
parent | 429991e37fc9ca4aeb49cf05db6819f735efe5b3 (diff) | |
download | applause2-ebd9c3c4ec2cfe2f08b4f700dcc5bcb2a8b4b847.tar.gz |
improved interruption (SIGINT, CTRL+C) support
* Just like the original LuaJIT interpreter, this will use a hook to automatically
raise an error from Lua code.
* Unfortunately, as long as Jit compilation is enabled, this cannot reliably work.
Therefore we still set an `interrupted` flag that must be
polled from tight loops.
* Instead of polling via applause_push_sample() which gave interruption-support only
to Stream:play(), we now have a separate checkint() function.
* checkint() should be manually added to all tight loops.
* Stream:foreach() and everthing based on it is now also supporting interruptions
(via checkint()).
* This internally works via applause_is_interrupted().
A C function was exposed only because LuaJIT does not support volatile-qualifiers and
would optimize away reads to the interrupted-flag.
As a side effect, we can also reset the hook.
* Flags set in signal handlers should be `volatile`.
* Added likely() and unlikely() macros to C code.
* Updated sample.ipynb Jupyter notebook: Everything important is now supported, albeit
requiring custom ILua patches.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -125,13 +125,21 @@ APPLAUSE_OPTS="-o 2" jupyter notebook --MultiKernelManager.default_kernel_name=l This works assuming that you symlinked `ilua-wrapper.sh` to `lua` as described above. An alternative might be to create a custom Jupyter kernel configuration (kernel.json). +If the browser is not opened automatically on the notebook's URL, you might want to try +visiting http://localhost:8888/. + Please note the following restrictions/bugs: * You cannot publicly host the Jupyter Notebook as the sound is generated on the host machine. + Similarily, it would be hard to wrap everything in a Docker container. * You cannot currently interrupt an endlessly running stream without restarting the kernel (see this [ILua bug](https://github.com/guysv/ilua/issues/1)). -* ILua does not work well with our custom `Stream:_tostring()` metamethods. +* ILua does not work well with our custom `Stream:__tostring()` metamethods. As a workaround, invoke `tostring()` manually on Streams. * The output of other functions like Stream:toplot() is garbled. * You cannot currently output rich text or graphics. There is a working [workaround](https://github.com/guysv/ilua/issues/5), though. + At least `Stream:gnuplot()` can now plot graphs with this workaround. + +There are workarounds for most of these problems and they might eventually be upstreamed +or ILua will be forked.
\ No newline at end of file |