This page is mainly links to online content, an overview of my open source projects and a few thoughts about the current state of programming languages.

Sami Badawi

Programmer and mathematician working in data mining, map tech, NLP.


Programming Language Aficionado

I enjoy learning language and I have worked with a lot of them: Scala, Python, Java, C++, C, C#, F#, Mathematica, Haskell, JavaScript, TypeScript, Rust, Clojure, Perl, R, Ruby, Slang, Ab Initio (ETL), VBA.

My Open Source Projects

I started doing open source work in 2007. The work has been centered around:

  • Computer vision
  • Image processing
  • Functional programming
  • Declarative programming
  • Cross platform optional GUI for CV libraries
  • Use of types

I called my first project ShapeLogic. Since it was meant to do logic programming on top of shape found using image processing. I have recycled the name ShapeLogic a few times since.

Projects in cronological order

ShapeLogic Java

ShapeLogic is a Java plugin to ImageJ image processing tool.

It has segmentation, vectorization and curve annotation. Lazy stream processing to attach algorithms to queries.

My idea was to make a declarative system running on top of ImageJ image processing. It ended up being a library for doing functional programming in Java. Sort of a primitive Scala.

ShapeLogic Cpp

Cross platform project that combined

  • Generic Image Library for writing new image processing code
  • OpenCV for existing computer vision algorithms
  • FLTK, Fast Light Toolkit lightweight cross platform GUI

Both GUI and build systems are non trivial in C++. I did not spend a lot of time this on this.

ShapeLogic Scala

ShapeLogic Scala is a generic computer vision library with cross-platform GUI in JavaFX. You write your image processing algorithm once, and it will work for images based on byte, short, float and double.

It has standard image processing algorithms like: Invert, threshold, edge detection, segmentation, skeletonize, edge tracer, vectorizer, point and line annotation all written in generic idiomatic Scala.

Scala is a very powerful programming language where you can do generic programming. I did have to use some quite sophisticated implicits to get it working.

ShapeLogic Rust

Port some image processing algorithms I had written in ShapeLogic Java and Scala to Rust.

I was surprised how easy it was to write crossplatform low-level image processing code in Rust. I ported a lot of code in a short amount of time.

ShapeLogic TypeScript

Combine TypeScript with image processing algorithms written in WebGL.

All running in browser, GUI minimal virtual dom, Mithril.js.

WebGL is not only blazingly fast is it also a good platform for writing generic image processing algorithms.


VisionQL is a project to explore the use of declarative queries on top of ML based computer vision. Think SQL for computer vision.

It is a Node.js application written in TypeScript. There is currently not a webserver, Node.js is a thin wrappers around the Google Vision api calls.

Second backend is going to be TensorFlow.js.


TensorFlow.js is an incredibly easy and powerful way to work with deep learning both in the browser and on the server.

tensorflow-typescript-starter is a starter project for running TensorFlow.js in TypeScript. The example task is the hello world example of deep learning. Recognize the handwritten digits in the MNIST dataset by training a convolutional neural network.

My 2019 Language Picks

This is my 2019 top language picks. I did not exactly pick them. They picked me.

  • Bash
  • Python
  • Rust
  • Scala
  • Terraform
  • TypeScript

The Bourne shell was cutting edge in 1977, and it still is today. I have aesthetics issues with it, but it has found a new happy home in cloud computing.

Python and Scala will take you far in backend and data engineering.
The gradual types in Python 3.6 and 3.7 are really a great help but they are very simple compared to TypeScript that probably has the most sophisticated type system these days.

Rust is beginning to make it into cloud infrastructure

Rust also seems like a natural choice for working with WebAssembly.

Terraform feels like a strange combination of Haskell and TypeSafe config. But it also fills a niche in cloud computing for: Infrastructure as code.

TypeScript is a roubust JavaScript and unsurpassed at describing and processing complex syntactic relations using its type system.

Languages Evolution with Poetic License

Looking at language everlution over many years I lost count of how many times I feel in love with a new language and thought this was the untimate language.

Here are my initial impressions for some mainstream languages that I really liked:


The one true programming language of the day.
With the awesome power of OOP.


The untimate language to end all languages.
It had everything that was cool in 1994.


The perfect language that cleaned up everything that went wrong in Java.


They lied to me!
You don't need design patterms and OOP.
You can hack it out in 10 lines of Perl.


Hey you don't need to hack it out in 10 lines of Perl.
You can program it in 15 lines of Python.


Theoretical CS and type theory is not just for academia.
A gem of a orthogonal, minimal constructs.
Safe, elegant, fast and happy.


Wow it is possible to program in mathematics.
I did it!
I scaled mount Haskell and took a snapshot and wrote a blog post.


You do not have to chose between type based language and dynamic data language.
You can have both.


At a low level the computer industry is build on a very insecure foundation.
Type theory can make lowlevel code very fast, safe and elegant.