And Now For Something Completely Different—Ropes

Well, I guess you can teach an old dog new tricks. I just got introduced to a new datatype—Ropes. Ropes are a “new” type of string-like data that definitely can have its uses. See the Wikipedia article here for an introduction to Ropes. The article is called Rope (Data Structure) and it says in part:

A rope is a binary tree where each leaf (end node) holds a string and a length (also known as a “weight”), and each node further up the tree holds the sum of the lengths of all the leaves in its left subtree. A node with two children thus divides the whole string into two parts: the left subtree stores the first part of the string, the right subtree stores the second part of the string, and node’s weight is the sum of the left child’s weight along with all of the nodes contained in its subtree.

For rope operations, the strings stored in nodes are assumed to be constant immutable objects in the typical nondestructive case, allowing for some copy-on-write behavior. Leaf nodes are usually implemented as basic fixed-length strings with a reference count attached for deallocation when no longer needed, although other garbage collection methods can be used as well.

It lends itself to uses in a Unicode string, because not all leaves need to be the same width.

In the article is a comparison to monolithic strings, outlining, the advantages and disadvantages of Ropes.

The Wikipedia article complains that the article mainly references  only one article, but Casey Ransberger said on the Cuis-dev mailing list:

Found the link for the paper I read about the “ropes” data type. Figured I’d share it around for interested folks.

ALSO! Grab this next one quickly, as it’s free on the ACM’s digital library for a limited time due to them opening up the library during the COVID-19 crisis. It’s a paper describing an experience implementing Ropes using Traits in Pharo. It seems that much more significant per-capita reductions in code duplication were achieved by using Traits in the Ropes implementation than were accomplished in the older experiment (referenced in the paper) which involved reimplementing the collections hierarchy using Traits. Seemed relevant to the conversation, and given the limited window for people without ACM memberships to download it, I had to bring it up:

A beginners mistake

Just to let you know, if you’re learning Clojure from the Clojure For The Brave and True website when they they tell you to download Leiningen from the website, please do that. At least on Ubuntu 18.04, the apt package is severely out-of-date, it installs Clojure 1.8, whereas the current version is 1.10. Version 1.8 is from 2016. But come to think of it, the book was copyrighted back in 2015, so it says in the book:

As of this writing, it’s at version 1.9.0, and development is going strong. If you’re reading this book in the far future and Clojure has a higher version number, don’t worry! This book covers Clojure’s fundamentals, which shouldn’t change from one version to the next. There’s no need for your robot butler to return this book to the bookstore.

By the way the Brave and True Book has a stupid title, but it’s probably the best book out if you’re looking to learn Clojure, and the book  website seems to has the whole text of the book that you can read for free. Can’t beat the price.

“Old” News

So did you read about the fault in the USB C port on the Raspberry Pi 4? There has been articles about it on Extremetech, Arstechnica, and The Verge, among others. No news from raspberry.org as to whether they’re going to fix the flaw. Of course, they’re pushing their own 15w power supply. Kind of disappointing that they’ve gone bad boy commercial.

More Arduino gear

Well, I just ordered a new new batch of Arduino gear. This time it’s a couple of Mega 2560s and 3 Arduino Dues. I’ve been working on projects that need more connectors and more space on the processor that a Arduino Uno R3 provides.

Like it says the the Arduino website,

The Arduino Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. The Mega 2560 board is compatible with most shields designed for the Uno.

And the site says this about the Due,

The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU. It is the first Arduino board based on a 32-bit ARM core microcontroller. It has 54 digital input/output pins (of which 12 can be used as PWM outputs), 12 analog inputs, 4 UARTs (hardware serial ports), a 84 MHz clock, an USB OTG capable connection, 2 DAC (digital to analog), 2 TWI, a power jack, an SPI header, a JTAG header, a reset button and an erase button.

Warning: Unlike most Arduino boards, the Arduino Due board runs at 3.3V. The maximum voltage that the I/O pins can tolerate is 3.3V. Applying voltages higher than 3.3V to any I/O pin could damage the board.

The board contains everything needed to support the microcontroller; simply connect it to a computer with a micro-USB cable or power it with a AC-to-DC adapter or battery to get started. The Due is compatible with all Arduino shields that work at 3.3V and are compliant with the 1.0 Arduino pinout.

The big with this one is the power requirements.

Lightweight Devices

Well, I haven’t had anything to gripe about since I finally got my Snickerdoodle Black, but I haven’t had a chance to delve into it, since I have other projects that I’ve been working on. I’m in between contracts, but the holiday season has put a crimp on “work” time. Besides the Snickerdoodle Black, I’ve got a number of Raspberry Pis, a few Pine A64s, 2 TinyFPGA BXs and about a half dozen Arduino Unos. Nothing like a little variety to keep the creative juices flowing. Bought a new laptop to put all the IDEs on because it was a pain to keep on cluttering up my office with all the detritus from the little boards and all the peripherals. Bought some cases for the Unos and they got delivered today. Hope to be posting some of my investigations on GitHub or GitLab. I don’t know if I’ll post notices here or on Objectnets.org, so keep an eye on both places.

More 10: snickerdoodle

Finally some good, maybe great news! I got an email saying my snickerdoodle black and piSmasher have shipped. Now all i need is the rest of my order, the power supply and SD card with OS to ship. Of course the main reason for ordering this was to develop a product, but the cost increase has made it infeasible.

It’ll still be interesting to develop some software for this product, I haven’t done FPGA programing for 15 years, and I’m sure things have changed.

More 9: snickerdoodle

Well, more “news” from krtkl: the rest of the preorders of snickerdoodle black have finally arrived, less some parts. So I guess that means shipments will take place in the next couple of months unless there are more delays. I placed my order March 2016, 2 1/2 years ago. And the piSmasher still hasn’t shipped, even though it’s 3 times the price I ordered it at. I’d say these products are the ultimate fail. Makes me hesitant to back any more non-shipping products lest I get involved in another vaporware product.

More 8: snickerdoodle

Well, finally got another update from krtkl:

Also, in snickerdoodle news…another shipment of ~200 boards just landed at Crowd Supply and we’ve started the next batch of snickerdoodle blacks. Combined, this will represent the LAST of the preordered snickerdoodles – we made it!!! These are likely still several weeks from shipping, but the light at the end of the tunnel is starting to get a lot brighter.

Well, it is progress, but it’s been over 2 years in the making, and I haven’t gotten it yet.

More 7: snickerdoodle

Well, finally got an update from krtkl about snickerdoodle. No mention of the snickerdoodle black, bu there was this:

snickerdoodle black – qty 1
This is a pre-order.
Originally expected to ship on Jun 29, 2016
Currently expected to ship on Apr 20, 2018
piSmasher SBC – qty 1
This is a pre-order.
Originally expected to ship on Jun 29, 2016
Currently expected to ship on Jul 26, 2018

This could be a LOOOOOOONNNNNNNGGGGG wait. Two more months (at least).

Edit:

Oops, I didn’t read the whole update, they state:

  • 100 more snickerdoodle blacks (including the last of the ‘connectors up’ preorders) are scheduled to be delivered to Crowd Supply by the end of June.
  • piSmasher is going to fab the last week of May; if all goes according to plan, we should (finally) be shipping production units by mid July.

That’s still 2 months out, unless the dates slip again.

More 6: snickerdoodle

No updates from krtkl since April 10, 2018. I don’t know if I even care when it arrives. There’s no way I’d give them anymore money if I was to develop a product using the snickerdoodle black. Time to look more for alternate platforms.

More 5: snickerdoodle

Well, there’s been an update from krtkl, but snickerdoodle black wasn’t mentioned. I guess no news is bad news. They mentioned the supply chain has completely broken down, they just can’t get parts. Not that that helps the backers. They still haven’t gotten to the point that they are making piSmashers. So the snickerdoodle black wouldn’t do me too much good. Maybe if I could get the software I could start developing something for the vapor hardware.

More 4: snickerdoodle

Well, there haven’t been any updates from krtkl about progress on shipments, so I’ve started to look around for another vendor that supplies an SBC integrated with an FPGA for a project I want to do. Results for my search so far has yielded the SYZYGY Brain-1 at $350 which comes from a company with a little more street cred, Opal Kelly, and the Z-turn board at $119 from MYIR Tech Limited. The $99 part is a Zynq-7010 part whereas I’m interested in the more powerful Zynq-7020 at $119. I sent off an inquiry to the company, but so far I haven’t heard back from them.