Issue #38

Issue #38

I think I haven't used Elm enough to fully embrace the concept of elm-css, and still prefer to have it separate from the application code. And just recently thanks to Hans Hoffman I found out about global css variables. In his blog post titled "Dynamic css themes with Elm" Hans explains how to create css themes and switch between them from within the app (hint: by manipulating the dom via ports).

About a year ago I first learned about Elm. Around the same time Jeroen decided to release elm-review. What a coincidence! 😀 If it's the first time you've heard about the project, elm-review allows to enforce your code conventions, somewhat similar to what ESLint and various public configs. If you type elm-review in the package index, you'll find lots of public rules that you can grab and use in your own project. To celebrate the anniversary, Jeroen laid out the roadmap for elm-review where he explains his thoughts on future development.

If you remember the game jam, one of the submissions was a game where you had to find your cow based on its pattern. Game's author, Wiktor, released a new post in his series explaining how the game was built where he explains the animation. As I was reading the story, I stumbled upon this:

How to animate cow legs? I've watched several movies on YouTube how cows  walk, and dang... This seems that is not an easy task to represent this  accurately 😅 Just check it out for yourself if you don't believe me

Turns out IT IS a heck of a challenge to try and animate the leg movement of an animal. Having forgotten about the game development, I spent the next 20 minutes watching in awe how different animals walk and thinking what it would take to animate, for example, a centipede. Or a tarantula. A gorilla. Or even a dog. And I love the final result:

A walking cow

The post explains different approaches to animating things in Elm: using css animations (not exactly Elm though, but a valid option still), subscribing to onAnimationFrame event, using the elm-animator package, or using SMIL.

Music is a fascinating subject. Similar to how you can get lost watching YouTube videos of cows walking in slowmo, you can spend even more time learning the music theory. If you dig deeper into music and what makes a good melody, an exciting world of math would open. There are even programming languages for creating music. I am telling you this because I got dragged into another rabbit hole (after watching cows walk) when I read Duncan Malashok's announcement of elm-music-theory, a library which...

allows you to work with musical concepts like pitches, intervals,  chords, keys, and scales. This includes (but is not limited to) the  tasks involved in arranging sectional harmony.

This also week saw the release of parser-recoverable by Rupert Smith, a library which helps create parsers that would allow parsing to continue after encountering syntax error.  Think of a markdown text where a syntax error would just mean that you render the text as is without applying the styling rule.

Christoph has released elm-esm that allows you to turn the result of elm make src/Main.elm --optimize --output=elm.js into an ES module that you can import in the browser:

<script type="module">
import { Elm } from './myElmModule.js';

Elm.Main.init({ node: document.body })
</script>

And I'll finish this week with a quote by Ian Stewart:

It was music, more than anything else, that led the Pythagoreans to  believe that the universe is a harmonious place governed by numbers.
Show Comments