Live data from Hacker News

Plink-plonk.js – hear webpages render with DOM observer and audio API

gist.github.com

31–40 of 61 posts

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#31
post #17
post #12

Earlier quoted context omitted.

Semicolons in JS is how you differentiate between someone who understands that code ambiguity leads to pain, vs someone who shouldn't be allowed near multi-line statements.

Please give a concrete example of this pain that you have actually experienced. I understand that ASI (automatic semi-colon insertion) is in theory ambiguous because you are relying on the compiler, or in some cases many different compilers, to execute the statement correctly. In practice, for over a decade, I have never run into such an issue. I suspect it's due to engineers trying to get too cute with their impleme…

Without opening your console, consider whether the below code throws or not and why:

  var a = []
  var b = ''
  var c = {}
  [].concat.apply(a, [b, c])

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#32
post #8

This appears quite useful for debugging renders in web apps, and also just sounds quite cool.

Supposedly Alan Turing used a tool like this for debugging his programs.

Do you have a link to a source? Sounds interesting

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#33
post #10
post #7

Earlier quoted context omitted.

Just minify it...?

Imagine still using semi-colons in JS source in 2020 and "bookmarklet compatibility" being your reasoning.

Bookmarklets are situationally pretty useful; they’re the easy entry to custom cross-site userscripting, a test drive before going full extension. They’re as legit a use of JS as anything else is.

(That said: if you use someone else’s code, putting up with their style is part of the bargain, even if I think leaving out semicolons is pointless aesthetic bikeshedding.)

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#34
post #11

I cannot help but refer to this old, old joke: https://en.wikipedia.org/wiki/Blinkenlights#Etymology (I used to discern between program stages on 286/386 because sound of power supply was different for different loops)

Just as electric vehicles can have skeuomorphic “engine” sounds for safety [1] or aesthetics [2], I’d love to see a service that emits “fan” noise to track CPU usage. [1]: https://en.wikipedia.org/wiki/Electric_vehicle_warning_sound... [2]: https://electrek.co/2018/03/07/jaguar-i-pace-artificial-moto...

I used to have something like that with an old machine with poor, spluttering cooling. You could really tell every time something processor intensive was running.

It was actually quite useful at times. For example, if some webpage was constantly running some heavy javascript, the fans would soon alert me that something was up.

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#37
post #11

I cannot help but refer to this old, old joke: https://en.wikipedia.org/wiki/Blinkenlights#Etymology (I used to discern between program stages on 286/386 because sound of power supply was different for different loops)

Just as electric vehicles can have skeuomorphic “engine” sounds for safety [1] or aesthetics [2], I’d love to see a service that emits “fan” noise to track CPU usage. [1]: https://en.wikipedia.org/wiki/Electric_vehicle_warning_sound... [2]: https://electrek.co/2018/03/07/jaguar-i-pace-artificial-moto...

I have my motherboard set to run the CPU radiator fans a low-moderate speed at ~50 degrees C and below, but ramp up rapidly approaching 55+, with no hysteresis or gradual ease-in. I can absolutely gauge CPU usage on a second-by-second basis by fan noise. Any transient spikes cause an easily perceptible (but not overwhelming) wooshing.

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#38
post #11

I cannot help but refer to this old, old joke: https://en.wikipedia.org/wiki/Blinkenlights#Etymology (I used to discern between program stages on 286/386 because sound of power supply was different for different loops)

Well it's true today as well. I know immediately that something's gone wrong if I'm training an ML model and the GPU fan spools down.

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#39
post #17

Earlier quoted context omitted.

Please give a concrete example of this pain that you have actually experienced. I understand that ASI (automatic semi-colon insertion) is in theory ambiguous because you are relying on the compiler, or in some cases many different compilers, to execute the statement correctly. In practice, for over a decade, I have never run into such an issue. I suspect it's due to engineers trying to get too cute with their impleme…

Without opening your console, consider whether the below code throws or not and why: var a = [] var b = '' var c = {} [].concat.apply(a, [b, c])

;[]... is one of two rules you memorize when you omit semis. It's not even that common of a case, though your own example doesn't even make sense.

I don't really understand the drama, just like people who use semis in place you don't need them. In real code, you should be using a linter anyways. At which point semis or no semis becomes purely an aesthetic concern. Like whether you use single or double quotes.

I haven't used semicolons in over 8 years and never had an issue. And with tools like eslint and prettier, you have no excuse to be making such trivial mistakes, like adding superfluous semicolons like function(){};

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#40
A blind programmer named Karl Dahlke does something similar: he pipes linux console output directly to a speaker to get a quick overview. (then he uses text-to-speech to delve into the details.) I think this hack is less discordant than Dahlke's hack.
Post reply on HN