Concurrent Programming in Erlang - Scaling Up (week three)

The concurrent programming in Erlang course ended this week. It's been informative. There's been a ton of resources shared (both in the course itself and in the comments), but wow I was spending much more than the 5 hours a week they said to expect. That's a good thing though - lots of stuff learned and lots more to read up on. Check out my notes from week 1 and week 2. Scaling Apps A major topic this week was the ability to quickly scale apps. That could mean adding more CPUs, memory and other resources into the mix for »

Concurrent Programming in Erlang - Winning by Failing (week two)

No one wants to fail. We'd like to succeed in life, to pass our exams, advance in our jobs, achieve our goals. And when we become bored with the usual challenges, we see who can eat the most hotdogs, throw a horse's shoe the farthest and get the most sacks of corn in a hole. Winning, and avoiding failure at all costs, is deeply ingrained in us. That's what makes Erlang so unusual as a language. Failure is expected and even embraced. It's easy to get defensive when you're writing a program. You don't want your application to crash - »

Concurrent Programming in Erlang - You've Got Mail (week one)

This past weekend was great weather-wise. Sunny and 70. Summer's around the corner but in Ohio there are never any guarantees... the weekend before it snowed 4 inches. We had places to go and errands to run (as always), but I got some work done outside, took the kids on a bike ride, and met some new neighbors down the street who were cutting up trees they'd taken down (free firewood!). Sunday ended with a nice cookout, a good vanilla stout, and watching "Fantastic Beasts and Where to Find Them" with the kids. All-in-all, it was pretty awesome. This is »

How to evaluate a string of code in Erlang at runtime

Erlang has the ability to read in a string, representing a line of code to execute, at runtime. It can parse it out, evaluate it and return the value. Evaluating Simple Expressions At its most basic, we can just read any expression passed in and execute it. -module(parser). -export([ evaluate_expression/1 ]). -spec evaluate_expression(string) -> any(). evaluate_expression(Expression) -> {ok, Tokens, _} = erl_scan:string(Expression), % scan the code into tokens {ok, Parsed} = erl_parse:parse_exprs(Tokens), % parse the tokens into an abstract form {value, Result, _} = erl_eval:exprs(Parsed, []), % evaluate the expression, return »

Reviewing the Basics Helps Us See the Light

I enjoy finding the occasional online mooc to participate in, as time permits, even if it’s something I’m already familiar with. Hearing or reading about an old concept in a slightly different way can bring new insights, make us rethink something we’ve been taking for granted, or just help us make a new connection. “Don’t assume that just because you can get something to work once, there’s nothing more to understand.” - Bob Frankston— Programming Wisdom (@CodeWisdom) September 1, 2016 For the last few weeks, it’s been an intro to computer science on »

A Tail of Recursion in Erlang (a C# developer's observations)

A group of us at VHT has been meeting weekly, reviewing some Erlang basics and running through examples. Even though it means giving up a lunch hour, over a dozen people have still been showing up to learn and help each other. Two of us were recently challenged to figure out a couple problems in Erlang without using obvious built-in functions: Determine the length of a list. (without using length([1,2,3]).) Reverse the list. (without using lists:reverse([1,2,3]).) We looked into it, and even shared what we found with the group a week later. This »