Custom Search

Thursday, November 2, 2017

Why you should be afraid of the Internet of Things

I first became excited about what eventually became the Internet of Things (aka IoT) back in the early 90s, after I wrote my first web server. I realized it was no more complex than a telnet server, so could easily replace the telnet servers in the few networked devices we had then. So we'd have point and click web configuration for those devices that was friendly and easy to use and that idea was just cool. These days, I'm mostly afraid of it.

Sunday, July 23, 2017

Some ZFS speed tests

Introduction

I just got my first new desktop in long enough that it's the first one with SSDs. Those were large enough that I had a lot of space for level 2 archive replacement cache (L2ARC) for the spinning data drives. It also had an M2 slot, so I could add a small device as a separate intent log (SLOG), neither of which I had used before. Finally, I'm moving to a new operating system (Ubuntu from FreeBSD), so it seemed like a good time to do some disk benchmarks.

Sunday, June 25, 2017

Introduction to Lifetimes in Rust


Abstract

A language that doesn't affect the way you think about programming is not worth knowing.
    -- Alan J. Perlis
Rust enhances it's variables with lifetime information, which I believe is unique among languages currently in production. This is the most exciting and best language feature I've encountered since recursion. It makes me think about aspects of a program I wasn't thinking about before and catches heisenbugs at compile time. I hope that explaining that to you will help you catch that excitement.

Wednesday, May 11, 2016

A first look at Rust

What is Rust?

Rust is one of the crop of system languages that target roughly the same space as C: running on bare metal, system utilities and libraries, and applications. Like most of them, it incorporates features from the last half century of language research - modern macros, algebraic data types, type inference, user-controlled polymorphism, variable sized arrays, and some degree of inheritance. I think it made a nice set of choices, but that's honestly more a matter of taste than anything else. I'll look at those in some detail, and explain why you'd want to learn Rust.

What sets Rust apart from other such languages is that the compiler also keeps track what code can read and write an object, which it refers to as the lifetime of the object. It uses that to prevent you from creating multiple references that can change an object. This changes how you program in a number of ways.

Wednesday, October 7, 2015

A close look at pwm input

Motivation

PWM is used for things like controlling servos, motors and LEDs. Output from a micro-controller is easy, and the hardware usually handles it. Remote control receivers also output it, as they are used to control these things as well. RC transmitters often output the closely related PPM (aka CPPM). It's not unusual to want to read those values with an Arduino microcontroller, but this is not as easy, as common - meaning ATmega328 and similar - hardware doesn't do it directly. So let's look at some options to do that.

Monday, August 10, 2015

Unicode input with X11

Unicode!

Whether you like it or not, Unicode is here. Modern programming languages allow it to be used in variable names and for operator symbols, older ones are adding it as extensions, and inputting it is getting easier all the time.
And frankly, I think most of us would rather read x ≠ 23 instead of x /= 23 or x != 23 or even x =/= 23 . Or how about x ∈ A instead of element(x, A)?
So here's how I set up my X11 keyboard to allow me to input the more popular programming symbols - at least for Haskell - directly from the keyboard, without having to use some editor-specific magic.

Friday, April 17, 2015

Functional Mazes

Long time, no blog!

Wow, it's been a long time since I posted here. Well, I've been involved with rc stuff and 3d printing things.
The latter is what led to this post. I ran into a 3d printed maze that was generated programmatically. The authors comment that trying to do this in OpenSCAD was impossible because it was a functional language.
I had to disagree. First, that OpenSCAD is a functional language. It might have functional inspiration, and the developers try to stay with those principles, but as a functional language, it sucks. So much so that I wrote a Haskell library to generate OpenSCAD from a proper functional language, with static type checking and much better error messages.
Second, I disagree that a maze generator is impossible in a functional language. There was a time in the past - long enough ago that I was working in BASIC, C and PostScript - that I wrote maze generators. So I decided to write one in Haskell. The generator is purely functional, though the State monad is used to hide some of the plumbing.