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....