You Learn Something New Everyday 💭

Ryan Levick

A Sudoku Solver & Generator 🔢

For a small side project I’m working on, I’m using a Sudoku puzzle solver and puzzle generator that I’ve written in Rust. The experience was fun, so I thought I’d write up a little bit about the algorithm I’ve used and some interesting stats about how it performs. The Solver Algorithm The first thing I built was an algorithm for solving Sudoku puzzles. After reading a bunch of Stack Overflow articles and a research paper or two, I came to the conclusion that the best way (and maybe only way) to write a solver is using a recursive solver that picks a value for a cell from the possible values left, and if it gets stuck it backtracks and starts over again with a different random value....

Rust: Pass-By-Value or Pass-By-Reference? 👐

The other day, a friend of mine who is learning Rust asked if Rust is a pass-by-value or a pass-by-reference language. For the unfamiliar, pass-by-value means that when passing an argument to a function it gets copied into the new function so that the value in the calling function and the value in the called function are two separate values. Changes to one will not in turn result in the same change to the other....

Rust and JavaScript Interop ↔️

In recent projects of mine, I’ve been using WebAssembly quite a bit. WebAssembly (Wasm) is “a new binary instruction format for a stack based virtual machine” that lets you use languages besides JavaScript to run code on a web page - usually either for performance reasons or to run code you’d like to share across different platforms. In my opinion, the most promising of these languages, due to its lack of a need for a runtime and great tooling is Rust....

Babel 📜

And the Lord said, Behold, the people is one, and they have all one language Linguistic diversity is one of the true treasures of the human species. Learning a language imparts to us new insights, new ways of viewing the world. Programming languages often times mirror their natural language counterparts when it comes to what can be gained from learning new ones. Learning new languages can be extremely informative, giving the programmer not only new paradigms to think in but also a new vocabulary which she can use to describe concepts present in languages already learned....

What's All This Fuss About Monads? λ

Despite Functional Programming’s (FP) growing popularity, for many “normal programmers” the language family seems to be merely an academic exercise that they are neither capable of or willing to engage in. Despite there being many FP languages that are arguably much more accessible than some “normal” programming languages like C++ (e.g. Elixir), FP does at times have some concepts that remain fuzzy even to those who have programmed before in the functional style....

Disciplined Yak Shaving 🐂

Being productive is more popular than ever. Everyone wants to get more and more done in less and less time. And no wonder. Getting things done feels really good. Yet, “getting things done” is not always the best way to spend our time. yak shaving, done in the right way, can also be a good way to spend time. Here are some reasons why I find disciplined yak shaving to be a good thing and some things I’ve learned along the way about how to do it well....

Erlang is the Most Object Oriented Language

Here’s an idea: Erlang is the only true object oriented language in use today. You might be thinking “WATTTT, that doesn’t make any sense”. But bear with me. Let’s examine this idea a bit and see where it takes us. Functional Programming and Object Orientation Often when you ask programmers what the opposite of functional programming is, they simply reply “well, object oriented programming, of course!”. Unfortunately, this isn’t true. Object orientation and functional programming are orthogonal to one another, meaning, in more layman’s terms, that you can have your cake and eat it too....

ActiveRecord Connections

So, you feel pretty comfortable writing Ruby on Rails applications. Connecting to one (or more) databases and doing complex queries on complex relations doesn’t faze you one bit. But it bothers you that you don’t know more about how it works “behind the scenes”. Today I’ll be starting the first in a series of posts on the internals of ActiveRecord, the part of Rails that allows us to connect to relational databases....

Fear

Fear is something that we all experience. Generally when we think of fear, we conjure up stereotypical images of snakes or serial killers in our minds. And it makes sense that this would be our go-to definition of fear. We tend to remember things that are out of the ordinary, and the truth is that the fear the some homicidal manic invokes in us is much more unique than the fear that we experience on the daily basis....