I "don't" use AI, I mean like most devs nowadays, I have a Copilot suggesting "smart" autocomplete, that's all. I wouldn't let an AI pilot my codebase. If you have a bit of probability knowledge, you may be aware of what happens when you're trying to get specific outputs from generic inputs.
And if you don't have a bit of probability knowledge: generic input just means high variance in the output, so "it looks right" isn't the same as "it is right." In other words, you'll just get a noisy sample out of many possible ones... and not what you really want.
I made one based on this tutorial (about 50 lines), which is about 8x faster and cheaper for small tasks in my experience. I highly recommend the learning experience.
> In hindsight maybe a binary level translator from 8080 to 8086 would have worked better (and be simple enough)
Many programs written in assembly language used self modifying code back then. It saved RAM and improved performance. All programs that used such trickery would have broken by a binary translator.
If by "thousands of virus" you mean software shipped by default in Windows, then I agree with you. Everything feels so sluggish on Windows 11 compared to any Linux distribution even if you run it on an HDD... it's ridiculous.
The fun thing was the Roland Sync. You could sync up all the TB-303, TB-909 and all the others with a 5-pole DIN cable. The sync was badly implemented. It lagged, it had latency.
However!
As soon as you cabled all together their imperfections added up and they started to groove like nothing that has been heard before.
This I don't understand. DINsync is raw trigger outputs/inputs like you'd have in a modular synth, in contrast to MIDI that has to send serial messages over a 1k data bus.
Perhaps this take has something to do with calling a five-pin DIN plug '5-pole'? Something's wrong and backwards here.
Again, I guess this is where we are now? I remember reality, but here we are.
No, this is different from pure CV. Each device has its own (digital) sequencer that can synchronize with others using pulse trains over DIN cable. Lots of places where latency and instability can occur!
DIN sync is not trigger based, it's a full clock protocol invented by Roland that has various different states. The fact is that not all DIN sync capable machines implement it the correct way, leading to slight differences in synchronisation, even between devices made by Roland.
Interesting, I'd be curious to read a technical analysis of the differences. DIN provides by far the tightest sync we've ever seen in hardware, so I question the idea that lag and latency are a defining feature of the protocol.
Owner of all (ALL!!) the classic Roland x0x boxes here, which are connected together using DIN Sync - the sync was not badly implemented at all - they sync together perfectly.
The sequencers in each of the machines have a bit of nuance, which is where that famous groove comes from!
You might be confusing this with the sometimes hilarious midi timing of the 909 and 707.
The problem is rather, that most data structure tutorials and books don't even get the idea, to introduce a purely functional version, but merely state the imperative versions. Coming up with the functional versions of data structures can be difficult. Papers about it can be hard to understand and often require one to already know some niche language, that a researcher used for the paper. Even if you can find a functional implementation of a data structure, there is often not a good explanation and you need to, sort of, reverse engineer it and translate it to the language you are using.
In short, it seems relatively few people have the skills to implement them and even fewer have the skills to come up with functional versions of ordinary data structures. They are almost completely absent from university lectures as well, as far as I am aware. For example for AVL trees I could only find a document from ETH from a lecture, that no longer exists or is taught. The language is Isabel and I need to understand its syntax first, before being able to translate it to Scheme.
If anyone has an obscure source for implementations one can learn from and implement oneself in another language, please share.
[1] are the exercises with solutions (!) of a lecture [2] at ETH Zurich, which include AVL trees in Isabel. The whole list of exercise PDFs is at [3]. I started porting the AVL trees to Scheme [4], but lately have not worked more on this. I also try to make it easy to understand the implementation by providing explanatory comments.
Okasaki's is basically the Bible for this stuff. Anyone writing data structure libraries in a functional language will have read this or have it on their to-read list.
I have the book, but it also doesn't contain that many data structures. Some of the maybe most used (AVL tree?) are not in there.
Not all exercises have solutions. I get stuck on some exercise and have a hard time finding solutions to them, that I can compare with my implementations in Scheme. Not being a Haskell user (yet), I also have some issues translating Haskell to Scheme. In languages like Haskell one often controls flow by pattern matching on type. In Scheme one needs to make structures or records explicitly and use their predicates to explicitly check the type. It's all possible, but not exactly great for learning. Sort of the road has many sticks and stones to stumble.
You can even build them with basically one line of code by sorting points using Morton / Z-curve order. It's linear time if you use a counting/radix sort.
Edit: lol, downvoted for this post. Never change, HN.
Here's an example from AWS, where lat/long pairs are put into a Z-index, which is used as a DynamoDB sort key, letting you efficiently query for items near a point.
I would like to know about this more, too. Is there a code anywhere, ideally with comments? But I am fine without comments, too, I would just like to see the code and possibly with an example usage.
Okay, I was intrigued and I did some digging. Morton / Z-order is all about interleaving the individual bits of the x and y coordinates. You end up grouping by quadrants. Python one liner:
points.sort(key=lambda p: sum(((p[0]>>i&1)<<(2*i))|((p[1]>>i&1)<<(2*i+1)) for i in range(16)))
Yeah good point, they are downsides for sure but it's a simple enough approach and most of all it can be shoved in a database (or b-tree or any 1d-sorted data structure).
And for a z-curve, the order is basically a depth-first traversal of a quadtree.
It’s super easy to click the downvote button by accident on mobile when you meant to upvote. And this UI will never be fixed because this is HN after all.
This is precisely the reason that I do not log in to HN on my phone. My phone is read-only and if I want to upvote or comment then I have to switch to my laptop. Pretty easy with firefox because I can send tabs to other devices.
Might want to share your harness /s