Been spending a lot of time researching campers as I want to / plan to upgrade our current Camper Trailoer (forward fold) Stoney Creek XL-FF6 to a slightly larger Hybrid Camper/Caravan with ensuite, internal kitchenette, external full hitchen, pop-top roof and twin bunks.
This is the summary and whittling down of my research so far: https://wiki.mills.io/s/1103bc9c-dd75-4a98-b64b-8dadc5b0e51f/doc/comparision-Ln03Moiibq
I did a ālectureā/āworkshopā about this at work today. 16-bit DOS, real mode. š¾ Pretty cool and the audience (devs and sysadmins) seemed quite interested. š„³
- People used the Intel docs to figure out the instruction encodings.
- Then they wrote a little DOS program that exits with a return code and they used uhex in DOSBox to do that. Yes, we wrote a COM file manually, no Assembler involved. (Many of them had never used DOS before.)
- DEBUG from FreeDOS was used to single-step through the program, showing what it does.
- This gets tedious rather quickly, so we switched to SVED from SvarDOS for writing the rest of the program in Assembly language. nasm worked great for us.
- At the end, we switched to BIOS calls instead of DOS syscalls to demonstrate that the same binary COM file works on another OS. Also a good opportunity to talk about bootloaders a little bit.
- (I think they even understood the basics of segmentation in the end.)
The 8086 / 16-bit real-mode DOS is a great platform to explain a lot of the fundamentals without having to deal with OS semantics or executable file formats.
Now that was a lot of fun. š„³ Itās very rare that we do something like this, sadly. I love doing this kind of low-level stuff.
Okay, hereās a thing I like about Rust: Returning things as Option
and error handling. (Or the more complex Result
, but itās easier to explain with Option
.)
fn mydiv(num: f64, denom: f64) -> Option<f64> {
// (Letās ignore precision issues for a second.)
if denom == 0.0 {
return None;
} else {
return Some(num / denom);
}
}
fn main() {
// Explicit, verbose version:
let num: f64 = 123.0;
let denom: f64 = 456.0;
let wrapped_res = mydiv(num, denom);
if wrapped_res.is_some() {
println!("Unwrapped result: {}", wrapped_res.unwrap());
}
// Shorter version using "if let":
if let Some(res) = mydiv(123.0, 456.0) {
println!("Hereās a result: {}", res);
}
if let Some(res) = mydiv(123.0, 0.0) {
println!("Huh, we divided by zero? This never happens. {}", res);
}
}
You canāt divide by zero, so the function returns an āerrorā in that case. (Option
isnāt really used for errors, IIUC, but the basic idea is the same for Result
.)
Option
is an enum. It can have the value Some
or None
. In the case of Some
, you can attach additional data to the enum. In this case, we are attaching a floating point value.
The caller then has to decide: Is the value None
or Some
? Did the function succeed or not? If it is Some
, the caller can do .unwrap()
on this enum to get the inner value (the floating point value). If you do .unwrap()
on a None
value, the program will panic and die.
The if let
version using destructuring is much shorter and, once you got used to it, actually quite nice.
Now the trick is that you must somehow handle these two cases. You must either call something like .unwrap()
or do destructuring or something, otherwise you canāt access the attached value at all. As I understand it, it is impossible to just completely ignore error cases. And the compiler enforces it.
(In case of Result
, the compiler would warn you if you ignore the return value entirely. So something like doing write()
and then ignoring the return value would be caught as well.)
@prologic@twtxt.net Iām trying to call some libc functions (because the Rust stdlib does not have an equivalent for getpeername()
, for example, so I donāt have a choice), so I have to do some FFI stuff and deal with raw pointers and all that, which is very gnarly in Rust ā because youāre not supposed to do this. Things like that are trivial in C or even Assembler, but I have not yet understood what Rust does under the hood. How and when does it allocate or free memory ⦠is the pointer that I get even still valid by the time I do the libc call? Stuff like that.
I hope that I eventually learn this over time ⦠but I get slapped in the face at every step. Itās very frustrating and Iām always this š¤ close to giving up (only to try again a year later).
Oh, yeah, yeah, I guess I could ājustā use some 3rd party library for this. socket2 gets mentioned a lot in this context. But I donāt want to. I literally need one getpeername()
call during the lifetime of my program, I donāt even do the socket()
, bind()
, listen()
, accept()
dance, I already have a fully functional file descriptor. Using a library for that is total overkill and Iād rather do it myself. (And look at the version number: 0.5.10
. The library is 6 years old but theyāre still saying: āNah, weāre not 1.0 yet, we reserve the right to make breaking changes with every new release.ā So many Rust libs are still unstable ā¦)
⦠and I could go on and on and on ⦠š¤£
fn sub(foo: &String) {
println!("We got this string: [{}]", foo);
}
fn main() {
// "Hello", 0x00, 0x00, "!"
let buf: [u8; 8] = [0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x00, 0x00, 0x21];
// Create a string from the byte array above, interpret as UTF-8, ignore decoding errors.
let lossy_unicode = String::from_utf8_lossy(&buf).to_string();
sub(&lossy_unicode);
}
Create a string from a byte array, but the result isnāt a string, itās a cow š®, so you need another to_string()
to convert your āstringā into a string.
- https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8_lossy
- https://doc.rust-lang.org/std/borrow/enum.Cow.html
I still have a lot to learn.
(into_owned()
instead of to_string()
also works and makes more sense to me, itās just that the compiler suggested to_string()
first, which led to this funny example.)
@lyse@lyse.isobeef.org Rust is so different and, at the same time, so complex ā itās not far fetched to assume that I simply donāt understand whatās going on here. The docs appear to be clear, but alas ⦠is it a bugs in the docs? Is it a lack of experience on my part? Who knows.
By the way, looks like there was a bit of a discussion regarding that name:
So I was using this function in Rust:
https://doc.rust-lang.org/std/path/struct.Path.html#method.display
Note the little 1.0.0
in the top right corner, which means that this function has been āstable since Rust version 1.0.0ā. Weāre at 1.87 now, so weāre good.
Then I compiled my program on OpenBSD with Rust 1.86, i.e. just one version behind, but well ahead of 1.0.0.
The compiler said that I was using an unstable library feature.
Turns out, that function internally uses this:
https://doc.rust-lang.org/std/ffi/struct.OsStr.html#method.display
And that is only available since Rust 1.87.
How was I supposed to know this? š¤Øš«©
@prologic@twtxt.net Yeah, itās difficult, you often donāt get what youād expect. They also make heavy use of 3rd party libraries. IIUC, for random numbers, they refer to this library. Iāve read many times that the Rust stdlib is intentionally minimalistic (to make it easier to maintain and port and all that).
Iām struggling with this, using 3rd party libs for so many things isnāt really my cup of tea. Iāll probably make my own tiny little āstandard libraryā. Itās silly, but I donāt see any other options. š¤·
Thanks, @movq@www.uninformativ.de! That seems to be much easier. Itās already implemented in the Python docs as examples of recvmsg(ā¦)
and sendmsg(ā¦)
:
- https://docs.python.org/3/library/socket.html#socket.socket.recvmsg
- https://docs.python.org/3/library/socket.html#socket.socket.sendmsg
I looked at them sooo many times in order to figure out why my SCM_CREDENTIALS
sending code didnāt work. :-D
@movq@www.uninformativ.de @kat@yarn.girlonthemoon.xyz @quark@ferengi.one In 2014 one person created protocol ii. Later it forked in IDEC. Why i said this? Because itās simple āfederatedā forum-like protocol where from your station fetch another every 5-10 minutes. Stations has topic-based channels like idec.talks, linux.16, haiku.os, zx.spectrum. In short itās FIDO but.. more modern? Documentation: https://github.com/idec-net/new-docs (mostly Russian, but you can use translator, also protocol already translated to english)
Confession:
Iāve never found microblogging like twtxt or the Fediverse or any other āmodernā social media to be truly fulfilling/satisfying.
The reason is that it is focused so much on people. You follow this or that person, everybody spends time making a nice profile page, the posts are all very āego-centricā. Seriously, it feels like everybody is on an ego-trip all the time (this is much worse on the Fediverse, not so much here on twtxt).
I miss the days of topic-based forums/groups. A Linux forum here, a forum about programming there, another one about a certain game. Stuff like that. That was really great ā and it didnāt even suffer from the need to federate.
Sadly, most of these forums are dead now. Especially the nerds spend a lot of time on the Fediverse now and have abandoned forums almost completely.
On Mastodon, you can follow hashtags, which somewhat emulates a topic-based experience. But itās not that great and the protocol isnāt meant to be used that way (just read the snac2 docs on this issue). And the concept of ālikesā has eliminated lots of the actual user interaction. ā¹ļø
Nobody writes emails by hand using RFC 5322 anymore, nor do we manually send them through telnet and SMTP commands. The days of crafting emails in raw format and dialing into servers are long gone. Modern email clients and services handle it all seamlessly in the background, making email easier than ever to send and receiveāwithout needing to understand the protocols or formats behind it! #Email #SMTP #RFC #Automation
@kat@yarn.girlonthemoon.xyz I skimmed through the gamja docs and they say you need an āIRC WebSocket serverā ā no idea what that is. Does gamja not speak IRC directly but essentially āIRC over HTTPā? Curious. š¤
7k words of docs on deploying a livejournal folk. you absolutely want to read 7 thousand words of me forcing dreamwidth into production shape in docker https://stash.4-walls.net/selfhostdw/
si4er3q
. See https://twtxt.dev/exts/twt-hash.html, a timezone offset of +00:00
or -00:00
must be replaced by Z
.
just a note that we are doing that on PHP: https://github.com/eapl-gemugami/twtxt-php/blob/master/docs/03-hash-extension.md#php-72
That PHP snippet could be merged into https://twtxt.dev/exts/twt-hash.html
@thecanine@twtxt.net I found it! This looks like colored easter eggs when squinting.
Hi! For anyone following the Request for Comments on an improved syntax for replies and threads, Iāve made a comparative spreadsheet with the 4 proposals so far. It shows a syntax example, and top pros and cons Iāve found:
https://docs.google.com/spreadsheets/d/1KOUqJ2rNl_jZ4KBVTsR-4QmG1zAdKNo7QXJS1uogQVo/edit?gid=0#gid=0
Feel free to propose another collaborative platform (for those without a G account), and also share your comments and analysis in the spreadsheet or in Gitea.
Itās been a long time since Iāve seen a project on Hacker News with 1300 votes (every few days something comes up with 600).
https://github.com/suitenumerique/docs
@prologic@twtxt.net I believe @andros@twtxt.andros.dev is referring to the one on the original twtxt docs . Iāve been meaning to contribute to the discussion on the git but Iām just lazy š
amma throw in a little something in a minute Poke a bee hive and run away style
š
here are a few ideas you might take into consideration when designing a secure IM https://developer.virgilsecurity.com/docs/e3kit/fundamentals/secure-instant-messaging/
Obviously if youāve worked on something similar, you already know it, he
@bender@twtxt.net oh yeah i remember that part of the docs lol! honestly yeah i think sqlite is fine for the number of users i have which is like, 5 including me, and active users is just⦠me, but if i were to have more active users i could always spin up a separate instance as jank as that is
asciinema is really cool. thought about self hosting my own upload site which they have docs for but i donāt need to host everything even if itād be a fun project. the default/main site is fine enough for me when i wonāt be uploading a whole lot.
@eapl.me@eapl.me A way to have a more blueskyāish handles in twtxt could be to take inspiration from Bridgy Fed and say: If NICK = DOMAIN then only show @DOMAIN
So instead of @eapl.me@eapl.me it will just be @eapl.me
And it event seem that it will not break webfinger lookup: https://webfinger.net/lookup/?resource=%40darch.dk (at least not for how Iāve implemented webfinger on my sever for a single user;)
@quark@ferengi.one It looks like the part about traditional topics has been removed from that page. Here is an old version that mentions it: https://web.archive.org/web/20221211165458/https://dev.twtxt.net/doc/twtsubjectextension.html . Still, I donāt see any description of what is actually allowed between the parentheses. May be worth noting that twtxt.net is displaying the twts with the subject stripped, so some piece of code is recognizing it as a subject (or, at least, something to be removed).
@falsifian@www.falsifian.org based on Twt Subject Extension, your subject is invalid. You can have custom subjects, that is, not a valid hash, but you simply canāt put anything, and expect it to be treated as a TwtSubject
, me thinks.
HTTPS is supposed to do [verification] anyway.
TLS provides verification that nobody is tampering with or snooping on your connection to a server. It doesnāt, for example, verify that a file downloaded from server A is from the same entity as the one from server B.
I was confused by this response for a while, but now I think I understand what youāre getting at. You are pointing out that with signed feeds, I can verify the authenticity of a feed without accessing the original server, whereas with HTTPS I canāt verify a feed unless I download it myself from the origin server. Is that right?
I.e. if the HTTPS origin server is online and I donāt mind taking the time and bandwidth to contact it, then perhaps signed feeds offer no advantage, but if the origin server might not be online, or I want to download a big archive of lots of feeds at once without contacting each server individually, then I need signed feeds.
feed locations [being] URLs gives some flexibility
It does give flexibility, but perhaps we should have made them URIs instead for even more flexibility. Then, you could use a tag URI,
urn:uuid:*
, or a regular old URL if you wanted to. The spec seems to indicate that theurl
tag should be a working URL that clients can use to find a copy of the feed, optionally at multiple locations. Iām not very familiar with IP{F,N}S but if it ensures you own an identifier forever and that identifier points to a current copy of your feed, it could be a great way to fix it on an individual basis without breaking any specs :)
Iām also not very familiar with IPFS or IPNS.
I havenāt been following the other twts about signatures carefully. I just hope whatever you smart people come up with will be backwards-compatible so it still works if Iām too lazy to change how I publish my feed :-)
I just manually followed the steps at https://dev.twtxt.net/doc/twthashextension.html and got 6mdqxrq. I wonder what happened. Did @cuaxolo@sunshinegardens.org edit the twt in some subtle way after twtxt.net downloaded it? I couldnāt spot a diff, other than ā appearing as ā on yarn.social, which I assume is a transformation done by twtxt.net.
@prologic@twtxt.net Yes, fetching the twt by hash from some service could be a good alternative, in case the twt I have does not @-mention the source. (Besides yarnd, maybe this should be part of the registry API? I donāt see fetch-by-hash in the registry API docs.)
Thanks @prologic@twtxt.net, I also just manage to get my own version of webmentions working. Please have a read at Webmentions vs. Custom Mentions Spec for Twtxt/Yarn - HedgeDoc and User Lookup for Twtxt/Yarn - Webfinger or Decentralized Identifiers (DIDs) - HedgeDoc for how it sorta works
Did another write up on #webfinger and DIDs for twtxt/yarn that you can read and edit/comment in: User lookup for twtxt/yarn - Webfinger or Decentralized Identifiers (DIDs) - HedgeDoc
Iāve gathers my ideas about mentions for twtxt/yarn here: Webmentions vs. custom mentions spec for twtxt/yarn - HedgeDoc
You are welcome to edit and comment in the doc, so our ideas are not fragment into a bunch of treads
@eapl.me@eapl.me I have many fond memories of Turbo pascal and Turbo C(++). They really did have a great help system. And debug tools! Its rare for language docs to be as approachable. QBasic was great. As was PHP docs when I first came into web.
@abucci@anthony.buc.ci see here in the okta docs: https://developer.okta.com/docs/reference/api/webfinger/ they are adding a prefix to the acct
ahh this is useful https://go.dev/doc/modules/managing-dependencies. the go culture doesnāt typically have large dependency graphs like Ruby or JS.
Ah git-bug! Ive chatted with the creator when he was working on the graphql parts. Its working with git objects directly sorta like how git-repo does code reviews. Its a pretty neat idea for storing data along side the branches. I believe they donāt add a disconnected branch to avoid data getting corrupted by merging branches or something like that.
Did some work on WKD handling. Can update keys with HKP posts :) Ugh need to work on docs and unit tests. Boooorrring.
initial ugens page added to !monolith wiki, with link to woven ugens scheme file. the first non-C woven file in monolith. [[/proj/monolith/wiki/ugens]]. #docs #updates