News for hackers. Stuff that matters.
Re:jc – JSONifies the output of many CLI tools by synergy20 on Thursday November 03, 2022 @08:12AM (#33449830)
to make this great tool truly universal, it has to be written in c instead of python these days, then provide python|javascript|etc bindings if possible.

I'd like to use it on embedded systems, where python is too large to fit. this tool can be widely deployed just like awk|sed|etc but it has to be in C for that.

Re:jc – JSONifies the output of many CLI tools by montroser on Thursday November 03, 2022 @08:29AM (#33449988)
I would welcome POSIX shell or at least bash as an alternative to a compiled C/Rust/Go binary.

But yeah, for these types of utilities, relying on an external language runtime like Python/Node is pretty rough.

Re:jc – JSONifies the output of many CLI tools by makapuf on Thursday November 03, 2022 @08:15AM (#33449859)
Agreed but I would change it with "any compiled language that has no external runtime" and common shared libs dependencies. I don't care that a utility is written in Go, Zig, C++ or Pascal ;)
Re:jc – JSONifies the output of many CLI tools by kbrazil on Thursday November 03, 2022 @05:29PM (#33457953)
`jc` is available today as a compiled binary with all dependencies self-contained. The binaries and OS package installers are available under the GitHub Releases:

https://github.com/kellyjonbrazil/jc/releases

This is still python under the hood and not as small of a binary as I would like, but it does work.

Re:jc – JSONifies the output of many CLI tools by ElectricalUnion on Thursday November 03, 2022 @09:36AM (#33450729)
But python is also universal? You can just bundle jc inside https://github.com/jart/cosmopolitan/tree/master/third_party... and it's as universal as it gets.
Re:jc – JSONifies the output of many CLI tools by bitwize on Thursday November 03, 2022 @12:57PM (#33453918)
Replace C with Rust.
Re:jc – JSONifies the output of many CLI tools by synergy20 on Thursday November 03, 2022 @03:41PM (#33456351)
on embedded rust is still much larger than c because rust links its stdlib statically.
Re:jc – JSONifies the output of many CLI tools by bitwize on Thursday November 03, 2022 @04:22PM (#33456947)
There is such a thing as no-stdlib Rust deployments.
Re:jc – JSONifies the output of many CLI tools by synergy20 on Thursday November 03, 2022 @06:12PM (#33458574)
which is for MCUs only and is like a bare metal language without any libraries, its use is very limited.

all I need is that rust's stdlib can be linked dynamically just like c/c++/java/whatever, if that happens I'm ready to switch to it.

Re:jc – JSONifies the output of many CLI tools by maxbond on Friday November 04, 2022 @11:16AM (#33468126)
It seems like you have multiple binaries (otherwise, I don't see how you would save space) in a context without an operating system, but do have abstractions like a linker; throwing this out there, you may be able to sort of fake having dynamically linked binaries with transparent disk compression. The shared code gets compressed, and you trade the overhead of your linker for the overhead of your compression, and probably roughly break even.
Re:jc – JSONifies the output of many CLI tools by synergy20 on Friday November 04, 2022 @12:08PM (#33469021)
nope,not even close,the final size of a few binaries is at least 10x larger
Re:jc – JSONifies the output of many CLI tools by maxbond on Thursday November 03, 2022 @01:34PM (#33454510)
Seems to me like anywhere Python is too bulky to work, a layer serializing and deserializing JSON at every pipeline step is likely to exhaust your memory too.