Fosdem 2022 notes

:fosdem: :konferencija:

This is the second time I’m participating online conference and both times are Fosdem. Below are my personal notes of Fosdem 2022. Some notes might not be completed which I was planning to do later. But it is possible the later never came. My personal scores are mostly based how much fun I’ve received from the talk. These do not reflect quality of presentations. Simply I might be to stupid to understand the content so I’d rate the talk as “not so much fun”.

Getting 1K Chess for the ZX81

Personal score: 2/5

Interesting approach to run old 1K Chess code in background and use Web interface for it. Value of talk is the idea itself.

  • 1K Chess goal: Make computer to play against human chess. And still fit into 1K of memory.
  • Emulator written in JavaScript. Because JS comes with nice debugging options: two debuggers from JS emulators.
  • Replaced player actions to NOP so those could be injected from web interface.

Let’s Get Serial!

Kudos for LaTeX Beamer slides :-) History & present of Serial port connection.

Personal score: 3/5

  • point-to-point, binary, async, half duplex or full-duplex.
  • GND is used in data transfer as edge low signal.
  • The “fat” serial port (25 pins) has enough room for two serial connections. One for low speed and one for higher speed.
  • RJ45 (can be found on dedicated network equipment). Any pin can be used for anything.
  • Data Rates (bps): from 75 to 115,200.
  • On-Wire format: Start Bit, Vector, Parity Bit, Stop Bit(s).
  • Low adoption cost, simple & easy to understand. High availability, a lot of software for it, easy to debug.
  • chat comment: Does not require much from hardware: couple of wires (2-3) and easy software stack.

Five mysteries in Embedded Linux

Personal score: 4/5

Though topic is for embedded Linux these tips also work for packaging pretty well. Main focus is on reproducible builds system and not reinventing the wheel (e.g. updates system).

  • “Do not tinker with powers you don not fully understand.”
  • Do not manually complie. There are many dependencies such as libraries, variables etc. Fragile, unreproducible build.
  • Always use a build system what integrates all application stack.
  • Golden image does not work well. Don’t create images manually, use build system.
  • Don’t rely on package repositories (e.g. apt). Don’t use packages from different distributions.
  • Some HW devices requires manual steps to setup or solve some problems (e.g. entering commands manually). Automate if possible. Document, write down & maintain a list of MAC addresses to identify which devices are updated.
  • Updates are difficult, can brick devices. Don’t build your own update process
    • better pick existing solution: OStree, SWupdate, RAUC. E.g. time in embedded Linux might be out of sync.

Lightning talks: Tracking your time with Timewarrior

Personal score: 4/5

I’ve tried to use Timewarrior a while ago but did not liked it too much. Probably because I’ve tried to integrate it with Taskwarrior and results of integration were not those which I wanted. It was nice to see demo by the maintainer and I was convinced to try Timewarrior again.

Go: Dissecting Slices, Maps and Channels in Go

Personal score: 3/5

Clear & slow pace presentation on fundamentals of slices, maps & channels internals. Good if you are not aware of those & like data structures. Intro too long.

Go: Mastering Your Error Domain

Personal score: 4/5

I liked the Q&A part even more than content. Raising the personal score for this.

  • Slides from documentation.
  • See how exitcode error is implemented.
  • resperr for handling HTTP status code errors and user messages (two error interfaces).
  • Use bitmaps to define “this error & that error” things.
  • Tip for decorating errors - say something positive to avoid duplicated statements in error message. Just mention what app is doing: “opening url: (err)", “running subcommand: (err)".

Go: Go further without wires

Personal score: 3/5

Great presenter & video, not much content. Basically connecting different boards and using different protocols.

  • TL;DR Tiny-Go supports wireless: TCP, HTTP, MQTT, UDP. On multiple types on devices.
  • On embedded systems there might not be OS. Hence using default net/http packages might not be possible. Tiny-Go has drivers to solve that.
  • I want drone.

Fun with Finite Automata

Personal score: 5/5

The guy created few performance related patched to Golang standard library and was telling the story of his workflow. Really liked!

  • Golang compiles regex into internal data structure. Prog is a list of Insts. Inst is regex token.
  • go test -run xxx -bench Regexp -cpuprofile cprof
  • Three Regexp matchers in Go: One-Pass, Backtracking, NFA.
    • One-Pass - simple match. E.g. ^foo.
    • Stack of Backtracking can grow. Used to check different matches of the same pattern.
    • NFA uses multiple threads.
  • Fun fact - Go devs use Gerrit to review the code. Github PRs are mirrored to Gerrit.
  • Grafana has another regexp library focused on speed.
  • Generics did not add any performance benefit on current compiler. Might add in future compilers.
  • Non-greedy matches are simpler & faster. Use those when you can. Not only related with Golang.

Go: Fuzzy generics

Personal score: 4/5

Presentation of two topics: Generics & Fuzzing. Mostly focused what does not work well (which is great).

  • Generics: Methods can’t have type parameters (yet?). Go team haven’t decided if interface should be implemented if method contains type parameter or not. Functions can have those and can be used instead of methods. More details.
  • For getters the code should know the type it is receiving. E.g. Get[int]("key") which is not very convenient.
  • Fuzzing is mutation testing. Arrives with go1.8. Some gotchas:
    • input might be larger than needed. Then b2 != b. Unread portion should be removed.
    • No support of subtests. PR
    • Unnamed seed values - can’t reproduce easily. PR
  • But in general fuzzing helps detect multiple bugs. Especially useful for parsing input, binary log, protocols, etc. Nice to test public libraries :-)

JSON Serialization - The Finite Print

Personal score: 2/5

Marshaling & unmarshaling tutorial with basic tips & tricks.

  • JSON wastes memory & is slow.
  • Marshaling int value and unmarshaling it back to interface{} returns a float64.
  • Adding json:"-" flag skips encoding for this struct field.
  • To check if value was set when decoding - unmarshall to map[string]interface{} and check if key exists. Or just use default values. See mapstructure.
  • Use anonymous structures to avoid type pollution and decode only what is needed.

Implementing the NTFS filesystem in Rust

Personal score: 5/5

My favorite talk of the Saturday. Internals of NTFS file system & caveats when implementing driver in Rust.

  • Guy ported NTFS to Rust in several weekends! Insane.
  • NTFS is “New Technology File System”. Most popular desktop file system.
  • It is still proprietary and needed to be reverse engineered.
  • NTFS supports Unicode. Windows NT was first major OS to support it.
  • Timestamps in Windows epoch starts from 1601 year.
  • Everything is file in this fs.
  • The file record on file system is 1KiB at max. Then files gets fragmented.
  • Data field of file record can’t be read directly from disk because there might be required to fixup the data due bad sectors.
  • ntfs-shell for inspecting the file system.

The manifold joys of metaprogramming

Personal score: 3/5

  • Introspection is to metaprogramming as variables to a whole program. E.g. reflect package on Golang.
  • Overloading changes.
  • Macros is further step. Introspect & modify. Works with AST. Macros rewrite syntax tree.
  • EVAL: poor person’s macro. Insecure.
  • Raku allows access metamodel in runtume.

A year o RISC-V adventures: embracing chaos in your software journey

Haven’t listened full session, jumped to another.

WASM for dummies

Personal score: 2/5

Maybe talk was for Too-Dummies. Covered some history, reason why WebAssembly was created and what is it. That is it, no technical things.

  • On JS a lot of time is spent on compiling, optimizing, reoptimizing (over 50% according slide). There was requirement to eliminate this.
  • asm.js - low level, compiler targeted. Still targeted to things which JS is capable of.
  • WebAssembly: binary, designed for stack based virtual machines, statically typed, standartized.

Adda Looks Good, Now Program a Game Without Knowing Anything

The gui is working on console based Civ clone and then switched to Ada related gotchas which I am not familiar with.

Why safe programming matters and why Rust

Personal score: 3/5

General story “why rust”.

  • 60-90% are memory safety issues (resouces: Google, Apple studies).
  • It is possible to create memory safety issues via type safety issues.

TODO

  • Made by Woz: how Apple-1 operating system works?
  • A Brief History of Spreadsheets
  • Plan 9 CPU command, in Go, for Linux
  • The State of Go
  • The road towards using regular Linux on ebook readers.
  • Open Source Network Automation in 2022
  • Somebody set up us the bomb
  • Sudo
  • What made your container fat?