Category Archives: coding

Beautiful Scotland

2023 Reading list (updated as we go)

State of the developer ecosystem : https://www.jetbrains.com/lp/devecosystem-2023/

Margareth Hamilton, the first software engineer story : https://levelup.gitconnected.com/the-untold-story-of-the-errorless-code-written-by-a-woman-that-took-man-to-the-moon

Avoid Try/Catch https://betterprogramming.pub/try-catch-considered-harmful and remember what google recommends about exceptions (and c++ in general)

Thanks Mafe : Maniac by Benajmin Labatut, see the Alpha-Go documentary

Agile roadmaps : Now, Next, Later approach https://developingskills.substack.com/p/now-next-later

Reasons why you burnout swe : https://engineercodex.substack.com/p/how-to-burnout-a-software-engineer My list in order of priority : 1. don’t ship code (there is nothing worse than working months on something that is not going to prod or is lingering in the deploy queue) 2. Not trusting your engineers by telling them in fine detail how to do things. 3. Lack of Recognition (not reward, about the difference).

So google uses design documents to describe design of new components : https://www.industrialempathy.com/posts/design-docs-at-google/

From a friend of mine substack, Chris Hedges talking about war :
“But these words give me a balm to my grief, a momentary solace, a little understanding, as I stumble forward into the void.”

Readability (and thus Maintainability) is the most important attribute of a code base and Google knows it : https://engineercodex.substack.com/p/how-google-writes-clean-maintainable

An open source 3D universe simulator with support for more than a billion objects : https://zah.uni-heidelberg.de/gaia/outreach/gaiasky/ based on data from Gaia mission

Resources on Microservices https://blog.quastor.org/p/scaling-microservices-doordash-6c35

How Diffusion Models work i.e. how does an AI generate images : https://developer.nvidia.com/blog/improving-diffusion-models-as-an-alternative-to-gans-part-1/

Watch out for Thundering herds

Engineering Metrics : https://hybridhacker.email/p/diving-into-engineering-metrics

My next read : http://lawsofsimplicity.com/ John Maeda

System design and the cost of architectural complexity : https://dspace.mit.edu/handle/1721.1/79551

Simplicity was the key for Instagram backend (in 2011) : https://engineercodex.substack.com/p/how-instagram-scaled-to-14-million

Simplicity mindset : https://betterprogramming.pub/3-tips-to-adopt-a-simplicity-mindset-when-designing-software-711b95328062

Fastly supports go on Edge : https://www.fastly.com/blog/announcing-standard-go-support-for-fastly-compute

Go WASI support : https://go.dev/blog/wasi

Any company providing support for a product would want to have something like this https://www.fixie.ai/

Meta Launches AI Code Writing tool https://www.theverge.com/2023/8/24/23843487/meta-llama-code-generation-generative-ai-llm : you can test it here : https://labs.perplexity.ai/

Whats App : https://newsletter.systemdesign.one/p/whatsapp-engineering

Photographs that are like films https://www.rencontres-arles.com/en/expositions/view/1447/gregory-crewdson

I find it so true : https://intenseminimalism.com/2013/conways-law/

Jerome Lanier on music and what Reality is in the end : https://www.newyorker.com/culture/the-weekend-essay/what-my-musical-instruments-have-taught-me

We lost Kevin (The Condor) Mitnick ( https://www.dignitymemorial.com/obituaries/las-vegas-nv/kevin-mitnick-11371668 ) : TCP is a much more secure protocol also thanks to him.

Yoshua Bengio (CA) and John Bunzl (UK), moderated by Nico A. Heller on strengths and limitations of current artificial intelligence, why it may become a dangerous instrument of disinformation, why superintelligent AI may be closer (years) than most previously expected (decades) and how this could yield to catastrophic outcomes – from AI-driven wars to the extreme risk of extinction. https://www.youtube.com/watch?v=07c1ZRUQOeY. Notes, general concepts from Bengio talk :


AI currently perceive the world and make sense of it with images, sound and text, generating content in all 3 areas.
Current systems are not at the level of human intelligence, they master what psychologist call system 1 intelligence (intuition) : react to any question/context, no reasoning (or little reasoning) – arithmetic : simple operations with numbers ok, more complex (of the type we will need paper and pencil) they make mistakes.
System 2 intelligence : explicit reasoning, you can plan, imagine. Ex:
driving left hand roads after having driven right hand all life. We take 1 hour to adapt because we don’t use intuition but reasoning. AI will get there : how much time will take to bridge the gap between s1 and s2 ? nobody knows, could be close or take 10 years.
Training data currently needs to be filtered to remove data that appears to be insulting, homophobic or racists, dangerous, inadequate. AI will get there too to avoid the need of preparing training material.
Machines that are as intelligent as we are will be inevitably more intelligent than us because they are machines : immortal, don’t sleep, can exchange info at high speeds like if they were a huge brain. Humans have culture to try to simulate this.

  • pure intelectual power, completely detached from the goal. The goal will make the difference between a “good” AI and an “evil” one.
  • humans cannot turn off compassion (or just most people can’t) as it has been hardwired into us by evolution; machines can

Stating a goal in a precise way is probably impossible so even AI with good goals might behave evil.

Goals are not expressable, we can only give partial specifications

We’ll get to the point where the game will be : who’s AI is bigger/better/faster ?

Most important thing to reduce the probability of bad behavior connected to AI is to reduce the actors, materials, information, proliferation (like we did for atomic bombs)
Regulatory frameworks are necessary.

Go : inside map implementation https://www.youtube.com/watch?v=Tl7mi9QmLns and https://phati-sawant.medium.com/internals-of-map-in-golang-33db6e25b3f8

Go 10 years after : https://blog.carlmjohnson.net/post/2023/ten-years-of-go-good-bad-meh/ and why we can live without subclassing https://hynek.me/articles/python-subclassing-redux/

Extreme readability https://www.moderndescartes.com/essays/readability/

AI can’t create software, only code : https://stackoverflow.blog/2023/06/26/the-hardest-part-of-building-software-is-not-coding-its-requirements

Some WASM Stuff :
– cloudflare wasm runtime https://github.com/cloudflare/workerd
– wasmtime runtime : https://github.com/bytecodealliance/wasmtime
– wasi-libc : still no thread support (june 2023) https://github.com/WebAssembly/wasi-libc

Ping Pong Programming : TDD + Pair Programming : https://www.agileconnection.com/article/ping-pong-programming-enhance-your-tdd-and-pair-programming-practices

Using AI in Ping Pong programming : https://www.mechanical-orchard.com/post/can-ai-play-the-tdd-pairing-game

AI Technology map : https://a16z.com/2023/06/20/emerging-architectures-for-llm-applications/

You build it, you own it : https://blog.alexewerlof.com/p/you-build-it-you-own-it

AI generated sort algorithms make it into LLVM/C++ https://www.nature.com/articles/s41586-023-06004-9

Superfast hash https://github.com/wangyi-fudan/wyhash

Google leaked internal document on AI : https://www.semianalysis.com/p/google-we-have-no-moat-and-neitherkkjhnmmmm

Compression algorithms benchmarks : https://github.com/inikep/lzbench

What’s inside training data for LLM https://arxiv.org/pdf/2101.00027.pdf

Cache Optimization Models and Algorithms : https://arxiv.org/pdf/1912.12339.pdf

ChatGPT Is a Blurry JPEG of the Web https://twitter.com/paulborile/status/1647640363555758083

Ordinals https://docs.ordinals.com/overview.html

NO Pause on AI development : https://medium.com/enrique-dans/a-pause-on-the-development-of-ai-its-not-going-to-happen-d4f894816e82

Cheatsheet for golang test, benchmarks, profiling https://github.com/samonzeweb/profilinggo

Yet another browser https://mullvad.net/it/browser promising to minimize tracking and fingerprinting.

everything cli https://www.commandlinefu.com/commands/browse

Amazon Is Making a New Web Browser ? https://gizmodo.com/amazon-prime-new-web-browser-survey-1850224922?utm_source=tldrnewsletter

Interview with OpenAI’s Greg Brockman: GPT-4 isn’t perfect, but neither are you https://techcrunch.com/2023/03/15/interview-with-openais-greg-brockman-gpt-4-isnt-perfect-but-neither-are-you/?utm_source=tldrnewsletter&guccounter=1

On jpeg-XL https://cloudfour.com/thinks/on-container-queries-responsive-images-and-jpeg-xl/#jpeg-xl-the-holy-grail-image-format
https://cloudinary.com/blog/the-case-for-jpeg-xl

On crypto and thieves :
“In February 2022, a hacker stole 120,000 wrapped Ethereum from Wormhole, a cross-blockchain bridge” https://newsletter.mollywhite.net/p/oasis-defi-centralization – subscribe to Molly White newsletter for unbiased crypto news.

B Corporation Certification : https://en.wikipedia.org/wiki/B_Corporation_(certification) “As of September 2022, there are 5,697 certified B Corporations across 158 industries in 85 countries.” https://www.bcorporation.net/en-us/
https://www.positive.news/economics/five-trends-sustainable-business/

https://lumalabs.ai/ : acquire 3d assets anywhere with a phone

https://roaringbitmap.org/ compressed bitmaps

Code RED in google : https://medium.com/@ignacio.de.gregorio.noblejas/can-chatgpt-kill-google-6d59742ee635

Node.js is aging like milk https://javascript.plainenglish.io/node-js-is-aging-like-milk-now-whats-next-a4e726ae668f :

Ryan Dahl, creator of Node.js moved to Go.

TJ Holowaychuk, creator of Express.js framework moved to Go.

Boston dynamics showing off https://youtu.be/-e1_QhJ1EhQ

Chat GPT4 talk https://www.theverge.com/23560328/openai-gpt-4-rumor-release-date-sam-altman-interview

Fyne IDE, currently work in progress https://github.com/fyne-io/defyne

1995 paper by the Niklaus Wirth “A Plea for Lean Software” https://cr.yp.to/bib/1995/wirth.pdf

2022 Reading list

Pingora : Cloudfront new rust based proxy for edge servers https://blog.cloudflare.com/how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet/

How much memory your video card has : https://www.cyberciti.biz/faq/howto-find-linux-vga-video-card-ram/

Rewriting a monolith into microservices (or just into a more maintainable monolith) : the Strangler pattern https://www.redhat.com/architect/pros-and-cons-strangler-architecture-pattern

Context switching costs in sw development : https://www.infoq.com/articles/multitasking-problems/

Wasmedge runtime https://wasmedge.org/book/en/index.html

Python compiler that produces native machine code (10/100x speed gain) https://github.com/exaloop/codon

How AVIF compares to other image formats https://storage.googleapis.com/avif-comparison/index.html

Some tools for enumerating : https://github.com/OJ/gobuster, https://github.com/OWASP/Amass

Updates on the twitter affair : https://newsletter.pragmaticengineer.com/p/the-scoop-twitters-ongoing-cruel

Reverse engineering Swift physics

Pelikan cache, a C/Rust memcached type cache server made in twitter http://www.pelikan.io/

Giza 3D http://giza.fas.harvard.edu/giza3d/

Memory allocator used in Go language : https://google.github.io/tcmalloc/design.html
Slab Allocation : https://hammertux.github.io/slab-allocator
Linux virtual FS filename lookup : https://www.kernel.org/doc/html/latest/filesystems/path-lookup.html
Linux dentry cache and slabtop command

Your wordpress site can feed mastodon https://fedi.tips/the-fediverse-beyond-mastodon/#WordPress

Image Format wars :
– Google removing JXL support from chrome : https://chromium-review.googlesource.com/c/chromium/src/+/3988999
– reasons https://www.phoronix.com/news/Chrome-Dropping-JPEG-XL-Reasons
– comments : https://cloudinary.com/blog/the-case-for-jpeg-xl
– support for JXL in android : https://issuetracker.google.com/issues/259900694?pli=1

Bare metal or cloud services : https://levelup.gitconnected.com/how-we-reduced-our-annual-server-costs-by-80-from-1m-to-200k-by-moving-away-from-aws-2b98cbd21b46

New Directions in Cloud Programming : https://www.cidrdb.org/cidr2021/papers/cidr2021_paper16.pdf

I know you all know but, just a reminder :

package main

import "fmt"

func main() {
  var m = 0.1
  var n = 0.2
  fmt.Println(m + n)

  var a = 0.1
  var b = 6.0
  fmt.Println(a * b)

  var o = 0.6
  var p = 0.3
  fmt.Println(o + p)

  var f = 1.39
  fmt.Println(f * f)

  const c = 1.39
  fmt.Println(c * c)
}

0.30000000000000004
0.6000000000000001
0.8999999999999999
1.9320999999999997
1.9321

Reducing Cognitive load (Golab2022 notes) in code :

  • Line of Sight : 1st level, second level for error conditions
    • eliminate else, return early, avoid extra nesting, wrap in function
    • align the happy path
    • remove misterious booleans
  • Package Names : concise and clear, move on the calling side. No util/common/ packages, split
  • Pure functions as much as possible
  • pass with & to indicate we change the object
  • Don’t lie to the reader

Interesting WASM talk from https://xeiaso.net/

Organize you software assets https://stackoverflow.blog/2022/09/19/i-spent-two-years-trying-to-do-what-backstage-does-for-free/ spotify open sourced their internal tool

VCF East 2019 Bryan Kernigham interviews Ken Thompson : how unix, pipes, and other things like grep came out just to run nroff/troff for Bell Labs patents office https://youtu.be/EY6q5dv_B-o

Engineering ladders https://github.com/jorgef/engineeringladders

Stackoverflow engineering https://hanselminutes.com/847/engineering-stack-overflow-with-roberta-arcoverde

Stackexchange 1.3 bil pageview/month : https://stackexchange.com/performance

Airbnb path from monolith to microservices https://medium.com/qe-unit/airbnbs-microservices-architecture-journey-to-quality-engineering-d5a490e6ba4f

Perche’ l’innovazione e’ cosi’ difficile in italia : qui

Questo non vale solo per la digitalizzazione, vale per l’industrializzazione e per il capitalismo. Prendo in prestito la domanda (e la risposta) di Roberto Maragliano “Perché i temi della maturità sono ancora così? Ce lo dice Camillo Olivetti (padre di Adriano) in un appunto del 1927: “L’istruzione della nostra borghesia ha un fondamento prettamente anti-industriale. Noi siamo ancora i figli dei Latini che lasciarono ai servi e ai liberti i lavori industriali e che in ben poco conto li ritennero, tanto che ci tramandarono i nomi dei più mediocri proconsoli e dei poetucoli ed istrioni che dilettarono la decadenza romana, ma non ci ricordarono neppure i nomi di quei sommi ingegneri che costruirono le strade gli acquedotti e i grandi monumenti dell’Impero Romano” (da Paolo Bricco, Adriano Olivetti, un italiano del Novecento, Rizzoli, appena uscito)”.

End to end tracing : Jaeger (opentelemetry)

Consistent Hashing used for load balancing resources :

Porting python2 code to python3

Interesting point of view on “complete rewrite” vs “enhance/evolve the existing” from dropbox tech blog

T Shape Engineers

Perkeep .. “Throughout our life, we all continue to generate content …”

Peer to peer hypermedia protocol : https://ipfs.io/

Building and Testing in-kernel (Rust code to be discussed at next Linux Plumbers : https://lpc.events/event/16/page/193-proposed-microconferences and discussed here : https://arstechnica.com/gadgets/2021/03/linus-torvalds-weighs-in-on-rust-language-in-the-linux-kernel/

Linux Foundation Real Time OS : https://www.zephyrproject.org/learn-about/

Microservice patterns : https://microservices.io/patterns/index.html

Broken Window Theory applied to software ( initial statement in “The Pragmatic Programmer” by Andrew Hunt and David Thomas, 1999 if I’m not wrong) interesting review and interesting to meet another fan of simplicity and minimalism in code.

Again on avoiding accidental complexity (I wrote something on this in the past) https://searchsoftwarequality.techtarget.com/tip/How-to-prevent-accidental-complexity-in-software-development
Interesting :

Super, 10X, rockstar — these are names for developers who produce a lot of code or work in many development areas. Such developers sometimes build a reputation — and an ego. “These super developers usually make their code unnecessarily complex just because they can,” Rials said. Other team members struggle to comprehend and edit the complex code. These colleagues might even compliment the super developer about the code’s complexity, which encourages more of it. Businesses should empower junior developers to take a fresh look at code.

Bill Rials, associate director and professor at Tulane University’s School of Professional Advancement

How common the pattern above is ..

Composer, music theorist, architect, performance director and engineer https://en.wikipedia.org/wiki/Iannis_Xenakis (I love multi potential people). Known for his studies on Music generation software : author of UPIC, which inspired many other tools like Iannix, HighC, UPISketch. I was able to run HighC …

Tz0, a video game made to listen music

The first ecologist ? https://www.rachelcarson.org/

Clearness when she explains, clearness of vision, clearness of thinking : Mariana Mazzucato

Back to untargeted adv ?

https://projecteuler.net/ take some time to solve math things

The importance of Rubber Ducking : a funny tool to do it alone ..

Ethical resources : sustainable, mindful, transparent, open and much more. Here’s a list of tools (browsers, search engines, email services, web hosting, tools for team collaboration, messaging, and a lot more) for a more ethical internet.


Web design patterns

Heidelberg

You’ve probably seen these acronyms around : SSG, SSR, MPA, SPA, PWA. Web design is getting complex and this tries to explain (with the help of other good content) what these acronyms mean :

  • PWA : Progressive Web App, web apps developed using a number of specific technologies and standard patterns to allow them to take advantage of both web and native app features. Not sure if this is a web design pattern
  • MPA : Multi Page Application, every operation requests data from server, receives a new page (html+css+js) and renders the data in the browser.
  • SPA : Single Page Application, performs inside a browser and does not require page reloading during its use. Initial html+cs+js is obtained from the server and then all login is done in js browser side.More info here and here
  • CSR : Client Side Rendering, all rendering happens in the browser. Use when UI is complex, lots of dynamic data, you need auth and SEO contents are not that many.
  • SSR : Server Side Rendering, as the acronyms imply, renders content in the server and sends ready .html+js files to the browser. Browser still executes js to reload pages. Use when UI has little interactivity, when you need best SEO and faster loading.
  • SSG : Static Site Generating, all pages are already generated and rendered server side.

There are several popular frameworks that can be used for static site generation (SSG) and server-side rendering (SSR).

For SSG, some popular options include Gatsby, Next.js, and Jekyll. These frameworks use a variety of technologies, such as React, Vue, and Ruby, to generate static HTML pages from dynamic content.

For SSR, some popular options include Express, Flask, and Hapi. These frameworks use Node.js and other technologies to generate the HTML for a page on the server and send it to the client.

Overall, there are many different frameworks available for both SSG and SSR, and the best choice will depend on the specific needs and goals of the project. It is important to carefully evaluate the features and capabilities of each framework to determine which one is the best fit for the project.

Interview with Ken Thompson

(this comes from a DrDobbs’s post May 18, 2011 – the article disappeared from the site so I’m just saving it here)

The creator of UNIX discusses writing UNIX, the Go language, and collaborating with Dennis Ritchie

The Japan Prize, one of the highest honors awarded for outstanding contribution to science and technology, was awarded jointly this year to Ken Thompson and Dennis Ritchie for the creation of UNIX. The prize is normally given to the recipients at a lavish banquet in Tokyo attended by the emperor. However, due to the April earthquake and tsunami, the prizes this year were distributed at the honorees’ place of work. I was able to attend the ceremony for Ken Thompson, held at Google headquarters, where he currently works. After the ceremony, he consented to this exclusive interview.


DDJ: Congratulations on winning this prize.

KT: Thanks.

Developing UNIX

DDJ: You’ve received a lot of awards over the years for UNIX. At what point in UNIX’s development did it become clear it was going to be something much bigger than you’d anticipated?

KT: The actual magnitute, that no one could have guessed. I gather it’s still growing now. I thought it would be useful to essentially anybody like me because it was not built for someone else or some third party. That was a perjorative term then. It was written for Dennis and me and our group to do its work. And I think it would have been useful to anybody who did the kind of work that we did. And therefore, I always thought it was something really good that was going to take off.

Especially the language [C]. The language grew up with one of the rewritings of the system and, as such, it became perfect for writing systems. We would change it daily as we ran into trouble building UNIX out of the language and we’d modify it for our needs.

DDJ: A symbiosis of sorts…

KT: Yeah. It became the perfect language for what it was designed to do. I always thought the language and the system were widely applicable.

DDJ: In the presentation today, it mentioned that UNIX was open source. Was UNIX open source from the beginning?

KT: Well there was no such term as “open source” then.

DDJ: I was under the impression that UNIX really became open source with the Berkeley distribution.

KT: No, we charged $100, which was essentially the reproduction cost of the tape, and then send it out. And we distributed, oh, probably close to 100 copies to universities and others.

Go Language

DDJ: Skipping several decades of work, let’s speak about Go. I was just at the Google I/O Conference, where it was announced that Go will be supported on the Google App Engine. Does that presage a wider adoption of Go within Google, or is it still experimental?

KT: It’s expanding every day and not being forced down anybody’s throat. It’s hard to adopt it to a project inside of Google because of the learning curve. It’s brand new and there aren’t good manuals for it, except what’s on the Web. And then, of course, its label of being experimental, so people are a little afraid. In spite of that, it’s growing very fast inside of Google.

DDJ: In the presentation before the awarding of the Japan Prize today, you were quoted on the distinction between reasearch and development. [The former, Thompson stated, was directionless, whereas development had a specific goal in mind.] So in that context, is Go experimental?

KT: Yes. When the three of us [Thompson, Rob Pike, and Robert Griesemer] got started, it was pure research. The three of us got together and decided that we hated C++. [laughter]

DDJ: I think there’d be a lot of people who are with you on that.

KT: It’s too complex. And going back, if we’d thought of it, we’d have done an object-oriented version of C back in the old days.

DDJ: You’re saying you would have?

KT: Yes, but we were not evangelists of object orientation. [Returning to Go,] we started off with the idea that all three of us had to be talked into every feature in the language, so there was no extraneous garbage put into the language for any reason.

DDJ: It’s a lean language, indeed.

Collaboration with Dennis Ritchie

DDJ: Returning to UNIX, for a moment, when you and Dennis worked together, how did that collaboration operate? Were you working side by side?

KT: I did the first of two or three versions of UNIX all alone. And Dennis became an evangelist. Then there was a rewrite in a higher-level language that would come to be called C. He worked mostly on the language and on the I/O system, and I worked on all the rest of the operating system. That was for the PDP-11, which was serendipitous, because that was the computer that took over the academic community.

DDJ: Right.

KT: We collaborated every day. There was a lunch that we went to. And we’d talk over lunch. Then, at night, we each worked from our separate homes but we were in constant communication. In those days, we had mail and writ (pronounced ‘write’), and writ would pop up on your screen and say there was a message from so-and-so.

DDJ: So, IM essentially.

KT: Yes, IM. There was no doubt about that! And we discussed things from home with writ. We worked very well together and didn’t collaborate a lot except to decide who was going to do what. Then we’d run and very independently do separate things. Rarely did we ever work on the same thing.

DDJ: Was there any concept of looking at each other’s code or doing code reviews?

KT: [Shaking head] We were all pretty good coders.

DDJ: I suspect you probably were! [Laughter]

SCM

DDJ: Did you use any kind of source code management product when working together?

KT: No, those products really came later; after UNIX. We had something like it, which we called “the code motel” because you could check your code in but you couldn’t check it out! So, really, no we didn’t.

DDJ: I bet you use SCM today in your work on Go.

KT: Oh, yes, Google makes us do that!