HN user

peterhil

128 karma

https://github.com/peterhil

Posts7
Comments120
View on HN

The bold point really resonates with me.

Lately I’ve been writing a CLI application in Python to analyse and generally handle possibly megabytes of DNA data.

At first I wrote the code quickly and in haste of inspiration using some Numpy constructs, some functional maps (with list) and an occasional list comprehension. It has took WAY too long to convert to code to use iterators, because the syntax and semantics are so different.

In Lisp I could usually just switch the kind of map function to be lazy, iterative, or whatever I would like without changing and carefully thinking about the rest of the code.

I think this is the kind of glue the article points to.

I just compared and evaluated Hatch, Flit, Poetry and Pdm and found Pdm to be most robust and slimmest. Hatch was a good second option, and Poetry and Hatch are easy to use, but have too much bloat and magic.

I strongly agree with this, and I have been actively using Python since 2009.

Trying top keep a Pygame/Numpy/Scipy project working has been a real struggle. I started it with Python 2 and ported to Python 3 some years ago. The whole Python 3 transition is a huge mess with every Python 3 point release breaking some things. No other interpreted language’s packaging system is so fucked up.

On a positive note: Lately I've liked using pdm instead of pip, and things seem to work quite a lot better. I evaluated Poetry, Flit and something else also.

I just commented about this on Twitter, when someone asked “Which programming language do you consider beginner's friendly?” https://twitter.com/peterhil/status/1633793218411126789

I have this exact same idea on my audio synthesis and DSP exploration project called Akasha, that I have developed on and off for more than 13 years. I have plans to open source at least parts of it, once I get to clean up the code. I was inspired by Julius O. Smith III's writings on DSP algorithms: https://ccrma.stanford.edu/~jos/

Unfortunately my web pages are not online, I have some video samples of Björk, Gotan Project and some classical and electronic music samples.

In the analytical audio signal, the musical intervals can sometimes be easily seen, and it is mesmerizing to look at.

On this video demo by OP, when the waveform appears stationary with loops, there are intervals in (at least close to) just intonation – meaning the frequencies have integer ratio relationships.

https://en.wikipedia.org/wiki/Just_intonation

This is great! Some suggestions:

  - Add download links with download attribute:
    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download
  - Make the grid responsive with CSS minmax (and media queries):
    https://developer.mozilla.org/en-US/docs/Web/CSS/minmax
  - Display a (visual?) score for closeness of match
  - Add link to similar sounds (by the vector database closeness)
  - Add query parameter so the results can be bookmarked
  - Use HTML5 History API
  - Show tags from freesound.org (and allow to filter by tags from search results)
  - Generate visual previews for the sounds (like in Soundcloud)

Writing web applications with Lisp is a joy, so this is aptly named.

I wrote one app with Uncommon Web framework on Common Lisp around 2009, with it you could similarly render the HTML from Lisp functions, and use continuations for multi part form submissions.

I have also used Fennel recently, and if Janet is anything as good, I'll try Joy on my next suitable project!

Without Systemd 4 years ago

These are my main reasons to avoid systemd as much as possible. And a bug in systemd-udev on 32-bit Linux systems that periodically halted the performance of the system into unusable state for long times that is probably never going to get fixed.

Update: The bug was related with integrated Bluetooth card on some Dell laptops and is fixed on Ubuntu 22.04: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/17598...

My first reaction was to see if the project is made with Commnon Lisp's ASDF, and cool now it has plugins for different languages. Common Lisp ASDF is very well thought out, but not the easiest package management system.

Rosegarden gives you the promises for writing cross platform webextensions on Chrome and other browsers missing the promise based API.

## Rationale

I know Mozilla provides webextension-polyfill, but I find even that too complicated.

With my Spellbook bookmark browser extension I promisified the required callback based methods from Chrome API and checked the chrome.runtime.lastError. Eventually I promisified the whole API, while planning on writing another cross platform browser extension.

I have used only bookmarks and tabs APIs, so beware when using other APIs, in case they differ between Firefox and Chrome.

## Usage

import { browser } from 'rosegarden'

Then just use that browser object as you would use the Mozilla's promise based WebExtension API!

It just gives the global object on Firefox, but on Chrome it gives a promisified version of the chrome global object. The browser object has chrome as prototype, so everything should work as expected as long as the APIs work in a similar way.

PHP in 2022 5 years ago

Can't wait for:

  - Pattern matching in switch statements (done horribly wrong)
  - If, while, and switch expressions
  - Inferred type system
  - Consistent array method argument order
  - Actually usable higher order functions and reflection

Big reminder: Php is a fractal of bad design, and I intensely hated using it at work for many years. The only good thing in Php is Symfony2 framework.

https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

PHP in 2022 5 years ago

Wow, Php almost catches up with majority of programming languages!