💾 Archived View for ftrv.se › 9 captured on 2020-09-24 at 00:40:18. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2020-10-31)

-=-=-=-=-=-=-

Ask me anything

For real. Ask. Anything.

Write a comment and I'll add the question and the answer to this post. Comments can be anonymous, and even if you put your email I don't store it anywhere, it's only used for avatars (using Gravatar).

What's your favourite book?

"Fingersmith" by Sarah Waters. There is an amazing screen adaption as well, directed by Park Chan-wook.

For someone interested in getting into Plan9/9front, where would you recommend they start?

Definitely the fqa[1] first when it comes to installation and usage. qwx's posts[2] and sl's stuff[3] might be useful too. Then there are several groups that you can join to get some grasp of what's cookin', maybe learn something and get answers, which are 9gridchan[4], 9fans discord[5] and #cat-v on freenode (I am not a member of the latter).

[1] fqa

[2] qwx's posts

[3] sl's stuff

[4] 9gridchan

[5] 9fans discord

How would I start C programming from a JavaScript/Python background?

Seems like most people do that by reading K&R, so I'd say that's the way.

K&R cover

I like 9front and plan9 and I want to use it as my daily driver. It is really distraction free and wonderful. However, my daily work involves doing something on a GNU/Linux box and use programming languages whose implementations are not in 9front. Long term, perhaps 9front would become popular enough that someone would port language runtimes into it. But what are any short term solutions to deal with this "mismatch"?

tl;dr use both GNU/Linux and 9front.

There are a few ways to go here, listed in no particular order.

All these options may involve connecting to GNU/Linux using a combination of `ssh(1)` and `vt(1)` in a script like so:

[6] VM

[7] drawterm

[8] vmx

#!/bin/rc
vt -rab 'ssh -r <LINUX_HOSTNAME> tmux new-session -A -s 9front'

I myself use 9front running in a VM on OpenBSD or another one running on a desktop (when I have access to it) to write code (eg Java or Haskell). The idea is to use 9front as a full blown development environment.

What are your recommended programming books besides K&R?

Definitely SICP[9] for programming in general. Learn you a Haskell[10] might be worth a try even if you don't plan to program in Haskell later, it might teach many functional programming aspects.

[9] SICP

[10] Learn you a Haskell

Why is C your preferred language?

It's very simple and provides a lot of freedom (including the freedom to shoot yourself in the foot ofc). It's fast to (cross)compile programs in C, on any platform. Plan 9 C specifically is much better standard library-wise than POSIX so that is also a factor.

How did you get skilled with C? Was it constant practice? Going to C for solutions for problems?

It was constant practice and my work involved a lot of low level embedded programming so that helped as well. Later on switching to backend development made me keep C as my hobby and as a refuge for my mind of some sort, where I don't have to deal with the "amazing technology" of today.

Now when I want to do anything I evaluate the possibility of doing that in 9front, and if it requires writing a new program there is a high chance I'm going to do that, and it will be in C.

What tips and tricks would you recommend to someone wanting to improve their C skills beyond what you wrote previous.

There is really not much to recommend beyond writing a lot of C, trying different solutions to the same problem to figure out the ones you like the most. One (perhaps uncommon) suggestion I have though: learn one functional programming language, it will help you reason better and might even change the way you write C a bit (to the better).

What do you do for work?

Mostly writing backend services in Go atm.

Why did you close down your Spotify account?

I don't want Spotify to become The Music just as I don't want Google to become The Internet, it's not a good place. It's impossible for small artists to get paid for their art on platform like Spotify. I want to be able to pay the artist for something I genuinely like, and so far the best way to do that was to buy their music in physical form (vinyl, tapes) or get their merch. Even downloading tracks in high quality from Bandcamp is better than nothing (Spotify).

Spotify desktop application degraded significantly over the years, to the point of being absolutely unusable. Using it with your local tracks is just terrible. There is no way to run Spotify on any low resource platforms like Raspberry Pi unless you're willing to use unofficial clients that might stop working at any point because the company will just feel like dropping support for yet another protocol for no apparent reason.

Do you like reading fiction? What's your favorite genre?

I do, but very selectively. Considering the skew, I'd say horror fiction would be my favorite genre.

Who would win in a fight?

A black hole would win any fight.

What forums, if any, do you frequent?

None anymore. Perhaps Mastodon is the closest to forums that I still read. Otherwise I prefer online chat with specific groups of people.

What do you like and dislike about living in Sweden?

I like the nature, the air. Not so much the cold that lasts for too long.

I love Allemansrätt[11] because I like being outdoors a lot.

[11] Allemansrätt

I'm not a huge fan of the language. I hate Swedish politics, racism (yes it's all there, despite someone telling you otherwise) and white-cis-centristic ignorance. Swedish laws regarding any mind-altering substances (such as alcohol as well) and snus do not make any sense whatsoever. I only have hope for younger generations.

Have you tried learning Colemak or Dvorak?

No. I want to get a grid layout keyboard and experiment a bit though.

Like who? ("Otherwise I prefer online chat with specific groups of people.")

9gridchan[12] mostly, and 9fans discord. Topics do not necessarily include Plan 9 at all times.

[12] 9gridchan

Can you touch type?

Yes. With Swedish and Russian layouts.

What font is in this picture[13]

It's VGA[14]. Default font in 9front.

[13] picture

[14] VGA

If you're dealing with a problem you can't solve, and you hit a wall, how do you overcome? How do you get unstuck?

I usually switch to something else (for a few days perhaps), then try again. That clears up the mind from the past assumptions and forces me to kind of "restart" so I might notice something new (or old, if that's a bug lol).

What are some items you'd consider BIFL (Buy It For Life)?

A stand mixer, coffee grinder, coffee maker, analog camera, amplifier.

What are some of your favorite programming books?

Do you play any video games? If so, what are your favorites?

I'd say most favourite would be BioShock series. In general I play(ed) shooters mostly, so the list is long. Quake 1 and 2 are great, Half-Life 1 and 2, Unreal Tournament 99, Left For Dead 2, RTCW.

Beyond shooters I really liked Warcraft 2 and Starcraft, Don't Starve Together, Need For Speed Underground.

What are your favorite board games?

Backgammon, Barjis (Syrian version of Pachisi), Clue, Luxor, Game of Thrones, of the ones I have.

What does your work station and bedroom look like?

Work station

You mentioned you do back-end development. Are you working mostly in Go? How do you like it? It's no C, but is it worth learning?

Yeah, I write a lot of code in Go. I'm not a huge fan tbh (after going through functional programming) but then again I'd pick Go over any JVM-based one. It is worth learning. It's very simple and prototyping anything in it is very fast.

Thoughts on Rust? Is it a meme, or do you think it's worth learning?

No.

On a more serious note:

If your work requires very fast and low resource applications running natively and there is absolutely no way you want to do it in C or Go, sure, try Rust. Otherwise: just say no.

Reason to use Rust: if you want to become popular and get lots of stars on GitHub, followers on Twitter etc etc, start doing useless rewrites and periodically post "C is insecure!"-style "infosec"-kind of quotes on social media. That seems to work for many people. And please don't forget to use an anime girl avatar, that is very important.

Rust in a nutshell

From your "C code" post: "The shorter the code, the better. Code is read more often than is written."; how do you define code?

Instructions given to the computer, either through a compiler or interpreter or anything else, to be executed.

Can you explain what's good about functional programming, without the usual pitfalls? (link[15] contains an example of "usual pitfalls".)

I'm not sure I'm good at explaining that, but here we go. With functional programming you (usually) don't care about the "global state", as there is none. Every function's result depends only on the arguments passed to it. Types in functional programming language like Haskell and OCaml won't let you add strings with numbers, or integers with fractions, they won't let you have a basic list with values of different types. These languages have strong type systems that do not allow common mistakes that many other PLs do. There are no pointers like in C, no `NULL` or `nil`, no memory (de)allocation, ie less things to care about. No sudden "goto" or "return" or "continue" in random places inside a function, the code flow is top-to-bottom.

[15] link

In functional programming you can combine functions together into new ones. You can pass some of the arguments to get another function: `f(x,y,z)` → `g(z) = f(2,3,z)`, so you call `g(4)` instead of `f(2,3,4)`.

Why are name and email is optional, but comment is not?

If there is no comment, it's not really a comment.

What do you think about Urbit?

I haven't dived into that, but looks a bit too isolationist for my liking. Looking at who was involved from the start doesn't make it any better.

Playing with 9front in VM, it seems awesome and fun, but as a developer, how do manage with just `sam` and `acme`? Not trying to be the Vim snob/tiling WM guy meme, but, besides window management with `rio` (which seems intuitive and flexible enough), it seems exceedingly laborious to have to constantly reach for the mouse for editing and navigation? Do you have tips? Has some mad genius come up with a Vim-like/movement-based plugin for the standard kit?

Sam has a few things that most people might be missing as it was added later to 9front but never existed in any other variants. Namely `C-b` (I added it in 2014) to go to command window, `C-g` to focus on text window (and switch between zeroxed windows), `_` and `^` to provide some kind of IDE-like fast shortcuts (added this in 2014 as well). This does save quite a lot on mouse movement and typing. Sometimes I do `C-a` and `left` or `C-e` and `right` to quickly go to next line but apart from that I didn't feel the need to add more shortcuts to avoid mouse use. I use a trackpoint on my laptop so I might be a bit biased here, but I use a mouse on my desktop as well, and although it's not as fast as with a trackpoint, I got used to it.

There is also vim port[16] that is available through "ports" (which I never used myself).

[16] vim port

When it comes to rio, I always felt fine with that one, but have been missing on some stuff so made riow[17] to keep as many windows as I want without having to resort to nested rios nor `winwatch`.

[17] riow

How do you decide which programming language is right for a job? If you could write something in C that could be done in Python, do you often opt to go with C? What's the thinking behind that?

If something is one-time write and use, or a internet-facing server, I pick Go. If it's something very simple and can be done with a small shell scripts, I use `sh` or `rc`. Otherwise (beyond rare exceptions) it's always C for me. Considering it's specifically 9front's C, things are very easy.

I see you dropped off mastodon, and I read your blog post. I will miss our occasional conversations about FAUST, 9front, C, and music in general. IRC has never stuck with me. do you have an email I can use to ping/bother you occasionally?

Hi! My email is ftrvxmtrx at gmail, feel free to bother :)

Why did you leave mastodon? Where you are hanging out now?

Somewhat explained here[18].

[18] Somewhat explained here

tl;dr I got sick of the way Mastodon and other social networks feel empty and emotionless, and full of self-promotion and "I'm gonna start talking about it because it's popular to talk about!".

I'm hanging out on #merveilles at freenode and 9gridchat[19].

[19] 9gridchat

"Otherwise (beyond rare exceptions) it’s always C for me.". What's an example? It seems like most tasks can be accomplished with Go.

Anything for Plan 9. Go feels very much alien on Plan 9, especially when it comes to anything UI-based, which is what I'm doing these days mostly.

How did you learn about plan9? What was your experience when you started with it?

Years ago (probably somewhere in 2007-2008) one of my friends showed me Plan 9. I didn't get into it at the time, can't remember the reason really. After that I successfully forgot its existence until the message of uriel's passing in go-nuts mailing list. That was 2012. Then I discovered cat-v and 9front and on it went.

First I ran it in QEMU, but at some point switched to native after figuring out I could actually fix things that didn't work natively. After a bit of acme I switched to sam, which I'm still using.