Cybertruck, Apple’s M1 chip and the Godot Game Engine where all topics that was popular with my readers these past two years.

I though I’d do a little overview and discussion of the Medium stories I wrote this year and last year that turned out most popular:

  1. Why is Apple’s M1 Chip So Fast? This was the big one. By far my most popular story for me this year. I tried to unpack the microprocessor jargon for the average technology interested reader.
  2. Is Making Advanced GUI Applications with Godot the Future? In this article I explore the possibility of using an open source game engine for GUI application development. This sounds odd, but the Godot tools for GUI design are surprisingly strong.
  3. Why is the Cybertruck so Cheap? Many people where surprised by why the Tesla Cybertruck with all its features, size and power could be promised for such a low price. …

Real-world experience with the new M1 Macs has started ticking in. They are fast. Real fast. But why? What is the magic?

Image for post
Image for post
Image: Apple

On YouTube, I watched a Mac user who had bought an iMac last year. It was maxed out with 40 GB of RAM costing him about $4,000. He watched in disbelief how his hyperexpensive iMac was being demolished by his new M1 Mac Mini, which he had paid a measly $700 for.

In real-world test after test, the M1 Macs are not merely inching past top-of-the-line Intel Macs, they are destroying them. In disbelief, people have started asking how on earth this is possible?

If you are one of those people, you have come to the right place. Here I plan to break it down into digestible pieces exactly what it is that Apple has done with the M1. …

C is a widely used language used to program anything from OS kernels to cryptography libraries. Is it time for a replacement?

The C programming language is even today among the most popular languages in usage despite having been released all the way back in 1972, and having quite a number of limitations and flaws by today’s standards.

Image for post
Image for post
Programming language popularity, 2020 by TIOBE

This is the key reason why C ought to be replaced. Too much critical software is written in C/C++ which has wide ranging implications. One example is bugs in libraries such as OpenSSL. C is notoriously bad at catching problems such as buffer overruns. C is a language allowing you to shoot yourself in the foot in too may ways.

This may sound strange coming from someone who is an avid fan of dynamic languages. However the issue here is type safety. Dynamic languages such as Python and Julia typically catch wrong usage of types. Such as using an integer in an if-statement. Dynamic languages may not catch problems at compilation time but if they have a strong type system, a lot of problems will be caught at runtime. That matters especially with security. Security vulnerabilities is in large part down to causing undefined behavior, rather than a controlled shutdown. …

Do you keep forgetting the difference between lexical and dynamic scoping? Perhaps it helps to think about when you would pick one over the other.

Image for post
Image for post
A rifle scope which has absolutely nothing to do with scopes in programming languages ;-) But it looks really cool.

In programming languages we frequently talk about whether variables have lexical or dynamic scope.

However for some reason lexical and dynamic scope is one of those things I keep having to look up, because I always forget it. I am sure I am not alone, so this is an attempt at coming up with examples and associations which will help you remember.

We could look up the dictionary definition of Lexical:

of or relating to the words or vocabulary of a language, especially as distinguished from its grammatical and syntactical aspects.

It may give a clue that lexical scoping is about determining scope based on body of text itself. The code as you read it. It you do not have to consider how the code is executed or how the state of your environment changes over time. …

A tour of some of the defining characteristics and ideas of eight different programming languages

computer code on a screen
computer code on a screen
Photo by luis gomes from Pexels

I have had an affinity for playing around with different programming languages for over 20 years. This is an attempt at recollecting some of those experiences — ideas which really stood out in each language or which I have in retrospect seen the significance of.

This list is highly subjective. It is a list of features representing ideas that caught my attention. You will always find people who think some other feature or idea is more prominent or important, but that is fine.

Zig programming language logo and wordmark

Zig — Compilation Time Code

In some areas, Zig almost behaves as a dynamic language despite being statically typed. With statically typed languages, no code runs until after you have compiled that code. However, in Zig, you can mark data as known at compile time. …

The Republican party has turned into a cult, depriving otherwise sane people of their mental capabilities.

Image for post
Image for post
Senator Rand Paul, a possible cult member, struggling to comprehend the reason why we make vaccines.

I have never particular liked US Senator Rand Paul, but unlike Donald Trump I have always believed him to be a person of normal ability to reason and think. Part of the sane Republican establishement. Yet watching the Republican party under Donald Trump is like watching some Alzheimer patient in rapid mental decline.

I hope I don’t offend anyone suffering from it or having a loved one who does. It is not something anyone can control. The American republican party in contrast as brought this upon themselves. …

Practical everyday tricks to improve your functional programming skills in Julia

Image for post

Being such an expressive language, it is easy when programming Julia to start thinking:

Isn’t there an even more conscience and elegant way of solving this problem?

A lot of problems can be solved straightforward with approaches you are used to from other languages. However in Julia there is often an even shorter and clearer way to do things.

Partial Application

Partial application of a function or currying is something that was popularized by Haskell. It means by not providing all the arguments you can return a new function taking the rest of the arguments.

This may sound confusing, so let me give some examples. Normally you would do a comparison like…

Tools which help searching code, counting lines, viewing documentation and many more

There is a lot more to the command line than grep and find. Better graphics support and unicode support have given more possibilities to create beautiful command-line tools.

Tree — tree

Shows a tree view of a directory.

$ tree -L 2 foobar

This shows a tree view of the foobar directory, but only 2 levels deep.

Image for post

On macOS using Homebrew install with: $ brew install tree

Bat — bat

bat is an alternative to the classic cat command. Here is an example from executing bat on a file:

$ bat examples/
Image for post

You can see a major advantage is that it gives syntax highlighting, making it easier to look at various files, especially source code files. bat also has the ability to e.g. colorize man pages. You can read more about bat abilities here, but if you use fish shell like me you enable bat like…

4 years ago I wrote a story about how Apple would likely transition to ARM CPUs. But I underestimated Apple profoundly.

Image for post
Image for post

Back in 2016, most people were still convinced that Apple would never switch from intel chips, due to the superior performance of intel chips compared to ARM chips at the time.

Still I wrote a story detailing the reason why I believed Apple would make a switch in 2019.

The interesting thing about getting into the game of predictions is that it allows you to better appreciate how monumental the M1 released Macs actually are. My thoughts in 2016:

I think we will see a further differentiation between PC and Mac laptops. …

Work more effectively with the Vim-like Kakoune Editor

I have written about the Kakoune editor earlier, so I am not going to give much of an intro here. Kakoune is basically a significantly more user-friendly version of Vim. So if you like the concept of Vim, but find it hard to remember all the keys then Kakoune may be a better alternative.

Since last usage I have developed some slightly more effective ways of using the editor.

Moving Left and Right a Character or a Line

Instead of using left and right arrow keys for moving left and right, it may be good to get used to using h and l because these can be used in many related combinations. …


Erik Engheim

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store