Looks even better this way
Single file, cross-platform, implementation of Dotgrid in C89. Work in progress.
@neauoire is there any particular reason why you're using C89 instead of something more recent? Also if you don't mind me asking, how long have you been using C because that looks really clean.
@yakub started learning C about a year ago, but I've been pretty intense about it. I've tried to write a bit of C everyday since.
I chose C89 because it's the most portable, a lot of the work I do I port to plan9 since one of my workstations runs on it. I find C89 crosses over more easily.
@neauoire ah, that makes sense. I haven't considered less popular platforms.
I love how nice your tools are, it makes me want to start looking for things I can write in C myself. I learned it a while back but every project I wanted to work on has been easier to implement in other languages since I don't have much incentive to aim for low power usage.
@yakub yeah it's hard to learn if you don't see a direct impact. But C is a great language, it's so simple, and the toolchain pretty much works everywhere which makes it a lot of fun.
I was really pissed off when I realized that my tools only worked on top-of-the-line modern hardware and OSes, I didn't want to encourage people to buy new hardware, so I changed my workflow to target 30 years old platforms as an experiment. And it was painful, but rewarding.
@neauoire you're right, I wish that mindset was more common.
C is definitely very elegant and makes you feel like you have almost full control over the hardware. Most of the code I write outside of work is only really meant to be used by myself and isn't useful to others so I just end up using what's fastest to write (usually Python or JS these days).
@yakub I started to kind of see this sort of .. experiment as hobby programming because while it's programmatically efficient, it's not efficient-efficient, I mean like, it's not practical in today's realities since it's a lot more work for seemingly no reward.
@reto I suppose you're right, it has a lot that C doesn't but I'd just use Python in every instance unless I wanted top multi-threaded performance.
@reto you also just have to type everything over and over because it lacks generics. Filtering or mapping an array is too common to write a loop every time considering there's no benefit to doing that. This gets much more severe in big projects like Kubernetes.
@reto right, Mypy helps with that a lot though. No language is perfect 😔
@reto even though you might think it looks "shitty" I barely ever write Python without typing hints anymore. Even if I'm not running it against Mypy continuously it just serves as documentation. Typing hints are definitely a net gain for the language.
@reto that's definitely more desirable.
I'm definitely biased because I spent a week or two trying to make sense of some horrible codegen hidden inside the Kubernetes source. If they couldn't find a better way to provide a strongly typed API than using a home-brew code generation script then there's probably no way to do it before generics arrive (if ever).
(I think the terminology is correct)
It's a sad reality we live in. Especially in terms of GUI development, where it seems like there's nothing else than Electron these days.
@james Thanks, but I don't want to redraw all the time unless something has changed. I don't mind the overpaint that much.
@james Oh! Perfect, I like that better. I will implement when I get back to the boat in 2 days ✊
@neauoire on openbsd clang, -fsanitize=address isn't a thing and -fsanitize=unknown appears to be either broken or it requires more linking. openbsd also needs -I/usr/local/include added to the compile command. maybe make the release version the default in the build script? :)
@neutral I'd expect everyone to have a look at the build script and adapt it to their needs, I can make the fast build the default, this is still a work in progress
Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.