Here is the live version of my talk designed to help you advocate for adopting Kotlin:
People at work suggested Kotlin was “just syntactic sugar”, so I set out to explain how Kotlin can really make better code, and here is the result:
I gave a talk “Making 100 million requests with Python aiohttp” (slides) explaining the basics of writing async code in Python 3 and how I used that to make a very large number of HTTP requests.
(Photo by CB Bailey.)
Hopefully it was helpful – there were several good questions, so I am optimistic that people were engaged with it.
After that, there was an excellent talk by Gareth Lloyd called “GeoPandas, the geospatial extension for Pandas” in which he explained how to use the very well-developed geo-spatial data tools available in the Python ecosphere to transform, combine, plot and analyse data which includes location information. I was really impressed with how easy the libraries looked to use, and also with the cool Jupyter notebook Gareth used to explain the ideas using live demos.
London Python Meetups seem like a cool place to meet Pythonistas of all levels of experience in a nice, low-pressure environment!
Meetup link: aiohttp / GeoPandas
With up-to-date examples, and anecdotes from the last couple of years of continuing to enjoy writing web pages in Elm, here’s a new version of my Elm advert:
Slides: Elm makes me happy slides.
Series: 2D Shapes, drag and drop
Continuing to explore the Godot 3 game engine. I want to make a game where you drag blocks around and balance them on each other, but I couldn’t find much documentation on how to drag-and-drop objects (except menu UI elements), and especially I found quite a few wrinkles when doing this with objects that are normally controlled by the physics engine.
This time we actually write some code in Godot’s programming language, GDScript.
Because the Rapsberry Pi uses a slightly older Python version, there is a special version of Graft for it.
Here’s how to get it:
- Open a terminal window by clicking the black icon with a “>” symbol on it at the top near the left.
- First we need to install a couple of things Graft needs, so type this, then press Enter:
sudo apt install python3-attr at-spi2-core
- If you want to be able to make animated GIFs, install one more thing:
sudo apt install imagemagick
- To download Graft and switch to the Raspberry Pi version, type in these commands, pressing Enter after each line.
git clone https://github.com/andybalaam/graft.git cd graft git checkout raspberry-pi
- Now, you should be able to run Graft just like on another computer, for example, like this:
./graft 'd+=10 S()'
If you’re looking for a fun way to start, why not try the worksheet “Tell a story by making animations with code”?
For more info, see Graft Raspberry Pi Setup.
I’m running a workshop at the Egham Raspberry Jam on 21st October. The workshop will introduce my little animation language Graft. We will tell a story using animations that we created ourselves using code.
I reproduced it as images below.
Any feedback much appreciated.
Elm is unstable, so upgrading to the next version can be painful. Here’s what I needed to do to upgrade from 0.18 to 0.19.
- Replace elm-package.json and tests/elm-package.json with elm.json – e06f5a1728
- Switch to the new elm-test – b964b7c7a
- Stop using eeue56/elm-all-dict (since it’s not ported to 0.19 and porting it looked hard due to a lack of Debug.crash) – fe100f256
- Replace toString with String.fromX or Debug.toString – 9e78163d0a3
- Stop “shadowing” names by making new variables with the same name as another in the scope – 9688a621de
- Adapt to the changed Html.style function – b991ab4f
- Stop using Debug.crash – f98a70ad1
- Adapt to the changes in the Regex module – 856762a4
- Stop using tuples with more than 3 parts – 472c0bb7
The lack of Debug.crash is really, really painful, especially for a library like eeue56/elm-all-dict that has lots of invariants that are hard or impossible to enforce via the type system. On the other hand, if Elm can give a hard guarantee that there will be no runtime errors, this seems pretty cool. The problem is that some code may well have to return the wrong answer silently, instead of crashing, which could be much worse than crashing in some use-cases.
I was annoyed by the lack of more-than-3-part tuples, but even as I did the work to change my code, I saw it get better, so it’s hard to argue with.
The hardest part to work out was how to run the tests. Fortunately the tests themselves needed almost no changes. I just needed to do this:
rm -r tests/elm-stuff rm tests/elm-package.json sudo npm install -g email@example.com elm-test install elm-test
My next job is to check out the –optimize compiler flag, and the advice on making the code smaller and faster.
Recent Overload journal issues contain my new articles on How to Write a Programming Language.
PDF of the latest issue: Overload 146 containing part 2.
This is all creative-commons licensed and developed in public at github.com/andybalaam/articles-how-to-write-a-programming-language