3 ms·
> Janet has os/ and file/ packages, as well as a PEG system which mostly stand in for the best features of Perl. Some low-level POSIX-specific operations (like
by Karrot_Kream 5y ago
> Janet has os/ and file/ packages, as well as a PEG system which mostly stand in for the best features of Perl. Some low-level POSIX-specific operations (like daemonizing and forking) aren't practical but I can just use C for those.
The README briefly mention the C API. How easy is it to use it, and how easy is it to "lift" results from the C API into Janet? (e.g. wrapping an fd from the POSIX API into a file object)
- matvore 5y agoGood question :) I actually haven't had a good excuse to use the C API yet. When I need C I just code the entire tool in C, or use IPC.
- cjohnson318 5y agoDumb question: Is IPC Inter-Process Communication? Or is it an unrelated tool?
- matvore 5y ago> Is IPC Inter-Process Communication? Or is it an unrelated tool? The former. Piping with the shell, or C subprocess hosted by the Janet script, or vice-versa.
- saikyun 5y agoIt's easy to treat any C struct as an abstract object in Janet, then have functions that do specific things (e.g. write to the file, read from it, etc). You have to write some manual code, but it's generally not too bad.