Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to ZShell #31

Open
jaromil opened this issue Mar 11, 2016 · 5 comments
Open

Port to ZShell #31

jaromil opened this issue Mar 11, 2016 · 5 comments
Assignees

Comments

@jaromil
Copy link

jaromil commented Mar 11, 2016

Great tool. Would be nice to have also in zsh.

@tsudoko
Copy link

tsudoko commented Jun 20, 2016

A better idea would be making it shell-independent, if possible.

@taviso taviso self-assigned this Jul 19, 2016
@taviso
Copy link
Owner

taviso commented Jul 19, 2016

It looks like zsh does have a zmodload function, which sounds like it could work with ctypes.sh.

Let's investigate if this is possible.

Unfortunately making it shell independent is not possible (ctypes.sh is a plugin, not a script), and needs loadable module support to work.

@cemeyer
Copy link
Collaborator

cemeyer commented Jul 19, 2016

Unfortunately making it shell independent is not possible (ctypes.sh is a plugin, not a script), and needs loadable module support to work.

It may be possible to have a single .so loadable by both module systems, if there's nothing explicitly incompatible about the interfaces. :-)

Here is an example zsh module: https://sourceforge.net/p/zsh/code/ci/master/tree/Src/Modules/attr.c (in a directory full of modules).

@jaromil
Copy link
Author

jaromil commented Jul 24, 2016

I advise against a single .so loadable by both zsh and bash, since that may turn as not maintainable. One can export common functions in a separate .o to be compiled in two different modules. Such an approach may also make it simple to port to other shells.

@nonchip
Copy link

nonchip commented Dec 11, 2017

why not make it a shell independent proper executable? something like:

dlopen blah.so & handle=$!
# listens for control signals $somehow

dlcall $handle somefunction int:1337
# tells dlopen to do stuff

kill $handle
# exits dlopen (it should also exit when losing its parent, just in case)

also, @jaromil, what you're looking for is called a) "libdl.so" and b) "LuaJIT". and btw the language is called "Lua". spanish proper noun (moon), not an abbreviation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants