Show more
~b boosted
~b boosted
:9front: fossil/venti really are very nice and it is great to have a system that is very easy to hack.

I looked over to check the time and it was the Plan 9 clock, which always takes a second to read. The dots indicating the hours are all the same shape/color, and the hour hand is the same thickness as the minute hand. I figured it'd be trivial to tweak, so I popped up the source. Finding the source is a pain in most Linux distros, but on Plan 9, the location of the source code is at the bottom of the man page. But you don't even need to do that: there's a program called src(1)¹ that can print the location of the source code, or just open it up in your editor². So instead of untarring anything or `apt-get source` or whatever, I just typed `src clock`.

The source was easy to read, about a hundred lines, and I did the tweak and thought "Oh, I should post a patch to fedi, there are people on fedi that use this." But I'd made the changes already, so what do I do to get a diff?

This is the magic part: yesterday(1)³. You type `yesterday $filename` and it mounts the archive (for which you do not need root, because you control your namespace so every mount works like FUSE, and the fileserver enforces permissions itself, so unlike zfs or whatever, any user can securely inspect snapshots and filesystem history) and then prints out the path to that file from yesterday's dump (or whenever, just yesterday is the default). So you can do "diff `{yesterday /sys/src/cmd/clock.c} /sys/src/cmd/clock.c"⁴ and this gives you the diff.

Whole process took about five minutes from wanting to tweak something to installing the new version and retrieving the diff. It was quicker to do than to explain. Nearly everything on Plan 9 is like that, you see something you wanna tweak and you can tweak it with no friction, because the source is simple and available and because of fossil and venti⁵, you can get the full history of arbitrary files.

Here's the diff and a screenshot. (The clock is still nothing impressive but it is somewhat faster to read it; anyway, this is how you do that.)

--


¹ http://man.9front.org/1/src

² The plumber handles this: http://man.9front.org/4/plumber . The overview is that it's sort of like things like OSX's "open" or XDG's (:vomit:) "xdg-open", but arbitrary data instead of filenames/URLs only, and the plumber is much more hacker-friendly. So the plumbing file says things like "if it looks like the path to a C file, send it to the 'edit' port" and whatever editor you have open listens for things sent to "edit", sort of like pub-sub. There are also rules in $home/lib/plumbing for starting whatever it is that you want to start, so if there's nothing listening for "plumb to edit" you can tell it how to start up your editor.

³ http://man.9front.org/1/yesterday

⁴ While grabbing the link to the 9front manual, I noticed that the man page also covers `diffy`, which basically does this. I did not know about diffy. Sometimes I post this stuff and someone says "Who cares?" and "Why would you post this?" and that's why. I hope it is useful or interesting to whoever reads it, but trying to explain it is often very useful to me, I find stuff out or it makes me think things through more carefully than just using it.

⁵ I will keep posting this until I am blue in the face: http://doc.cat-v.org/plan_9/4th_edition/papers/venti/ . Here's the fossil paper, too, for good measure: http://doc.cat-v.org/plan_9/4th_edition/papers/fossil/ .
clock.diff
clock.png

@derickr
Yep. Hare is a system's programming language, so it wouldn't be appropriate to ship our own compiled tzdb package like most languages. We have to parse the tzif files like C.

And yes, the POSIX DST ruleset strings are very annoying! We will likely have to move or copy some code from datetime:: to time::chrono::.

@derickr
Wow, what a better fedi-encounter than that of the author of a "Guide to Date and Time Programming" book. Nice to meet you!

I will certainly be reading up on PHP's datetime facilities, and thankful for your outreach. I'm guilty of leaving PHP out of my reading list. A quick glance tells me there's quite a similarity to Hare's design.

If you are interested, (the Hare project and) I would love some feedback regarding Hare's (nacent, in-progress and unpolished) datetime library. Perhaps you have some wisdom, some design theory we can learn from.

=> @hare
=> harelang.org/community/
=> docs.harelang.org/datetime
=> git.sr.ht/~torresjrjr/hare/tre

Thanks again. Will use that email.

Does anyone know of any good literature on datetime arithmetic? Or perhaps a really good software library (standard or third-party)? Especially anything that tackles non-communitivity, overflows or nonexistant dates/times (due to timezone effects).

I'm looking to rehaul the stdlib datetime module soon, and we want it to be very robust and of high quality. Will also be helpful in some Hare projects, like a scheduler.

=> docs.harelang.org/datetime
=> git.sr.ht/~sircmpwn/scheduled

The closest thing to a useful standard I've found is this:

=> w3.org/TR/xmlschema-2/#adding-

In the mean time, I'm trying to create a formalisation of datetime arithmetic so we can have something theoretically sound to implement. Something which takes advantage of Hare's language features. If you're interested, let me know. The more gray matter, the better. Boosts welcome.

@G117CH

You certainly make some good points there. I agree. I suppose I always talk with the implication of libre software in mind.

What business, if I may ask?

@G117CH
I'd argue philosophically that npm as a concept is flawed, and the lack of this insight is what causes all these issues in the first place.

Also, I don't buy a lot of this "forced upon by the world ecosystem complexity". I see a large lack of due diligence out there. But yes, the outside world exists, and we have to deal with it :D.

> I wonder how adoption will work out.

World domination is not a priority for the Hare project. Upstream Hare deliberately does not support non-libre OSs. It's a principled language, and if others happen to find value in it, that's great. It's not meant to replace anything. Languages serve different purposes and niches, including Rust.

@G117CH
> intoxicatingly easy
Precisely where the poison lies. Copying the npm/.node_modules monster is a terrible idea. Your point about C/C++ external libraries is also true. Which is why I like Hare's sensible and user-friendly inbetween.

=> harelang.org/tutorials/librari

@G117CH
I myself kinda hate Rust haha. Or more so the Rust ecosystem. But I do respect it's primary points of memory safety, etc.

@G117CH
> complex and bug-prone memory management
> doesn't support Unicode

The author of the manifesto holds these same opinions, and in fact made his own programming language in the spirit of C which addresses these issues. It might interest you.

harelang.org/
@hare

I've contributed to Hare myself and enjoy the language.

@captainepoch @DjBRINE1
Everyone should have an alt, or multiple. It really solves a lot of problems!

For so many people (including me once), it never even occurs to them. It's really a mindset change that needs to happen. People are used to mindlessly filling out their (Facebook/Twitter/etc) profiles, and they become attached to this singular electronic entity, this single digital representation of them. It's a whole personality onto its own.

Multiple accounts should be commonplace. They allow you to produce different feeds with different personalities and registers of tone and content for different people, just like you would in the real world. It also exposes you to different subcultures around the network, just like how you'd explore the real world. You are complex person. I think the natural accident of federation results in this naturally better .

There are many more good reasons, like network resiliency, proliferation of ActivityPub implementations, etc.

Show more
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.