Hacker GitHub

← All repos

taviso/ctypes.sh

View on GitHub ↗ ★ 2,181 C

A foreign function interface for bash.

30 mentions on Hacker News by 23 people: 12 stories, 18 comments · first 2015-07-28 · latest 2026-06-20

Mentions per year 30 mentions · busiest year 2024 (8)
20082026
  1. …Introduction to Streams : https://www.lucasfcosta.com/blog/streams-introduction [1] : ctypes.sh : https://github.com/taviso/ctypes.sh [2] : socat : https://github.com/3ndG4me/socat/releases [3] : gnu netcat: https://netcat.sourceforge.net/…
  2. Behold, FFI for bash: https://github.com/taviso/ctypes.sh
  3. …of native code. Usually it starts processes, but here it interacts with a native-code library. See: https://github.com/taviso/ctypes.sh/ https://github.com/raysan5/raylib
    comment by nine_k · 2024-09-15 · in A bullet hell game written in bash
  4. Well, you can use https://github.com/taviso/ctypes.sh .
    comment by layer8 · 2024-07-29 · in ps aux written in bash without forking
  5. maybe access to libc functions can be achieved through something like < https://github.com/taviso/ctypes.sh >. Although that very specific implementation seems to require explicitly bash and is not broadly POSIX Shell compatible as Pnut…
  6. Here are some examples! https://github.com/taviso/ctypes.sh/blob/master/test/select.... https://github.com/taviso/ctypes.sh/blob/master/test/poll.sh Yes, it is crazy :)
  7. They should have used my (dumb?) library, ctypes.sh: https://github.com/taviso/ctypes.sh Then they can access libm, poll(), select() and so on from bash :)
  8. It's a funny trick, but you could probably also use setjmp and longjmp with ctypes.sh :-) https://github.com/taviso/ctypes.sh
    comment by taviso · 2023-08-03 · in Goto in Bash (2012)
  9. …the Witchcraft Compiler Collection [1], which includes among other things an interactive shell. [0] https://github.com/taviso/ctypes.sh [1] https://github.com/endrazine/wcc
    comment by rkeene2 · 2022-08-20 · in Shared Libraries as Executables
  10. …ability from bash, it's available [0]. However, it interacts with C FFI, so it's lower level. [0] https://github.com/taviso/ctypes.sh
  11. …lets you call native functions from bash [0]. My mind is spinning from the possibilities... [0]: https://github.com/taviso/ctypes.sh
    comment by gkfasdfasdf · 2020-10-10 · in Bash Error Handling
  12. This seems like a good time to mention my (ridiculous) project, a ctypes module for bash. https://github.com/taviso/ctypes.sh/wiki There are some little demos here: https://github.com/taviso/ctypes.sh/tree/master/test I even ported the…
    comment by taviso · 2019-09-19 · in Pure Bash Bible
  13. …re: bash is a simple scripting/glue language, not a general-purpose programming tool. [1] https://github.com/taviso/ctypes.sh [2] https://news.ycombinator.com/item?id=19951990
  14. Another way to skin the cat: https://github.com/cemeyer/httpd.sh Based on ctypes: https://github.com/taviso/ctypes.sh/
    comment by foobarian · 2019-04-13 · in I got tired of PHP and Perl, so I tried bash
  15. Well... There's always https://github.com/taviso/ctypes.sh ...
  16. Here are the reactions from the parent project's readme: https://github.com/taviso/ctypes.sh#here-is-what-people-have...
  17. I've never heard of ctypes.sh, but it sounds pretty interesting: https://github.com/taviso/ctypes.sh/wiki
    comment by shmerl · 2016-03-09 · in A port of the GTK+3 Hello World to Bash
  18. …the ctypes.sh Bash plug-in, which is what is doing the magic calling into a native library. See https://github.com/taviso/ctypes.sh/wiki , that was very interesting.
    comment by unwind · 2016-03-09 · in A port of the GTK+3 Hello World to Bash