Live data from Hacker News

Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

p01.org

81–90 of 131 posts

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#81
post #78

This is similar (but much much better) to a demo I was making for JS1K a bunch of years back: http://mrspeaker.github.io/js1k16/ My "big idea" was to use the speech synthesis API (I still liked how I used it)... but I thought it was funny, because it felt like cheating to say "1K" when it relied on so many megabytes of APIs!

Does it count as megabytes when it's bog standard API ?

Nah, of course not! It's fair game (otherwise you'd first have to invent the universe). It was just the speech synth API was pretty new when I did that, so it felt sneaky ;)

Also - p01, you are a hero to us all. MONOSPACE is beautiful, congrats on the Assembly win!

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#82
post #61
post #26

I'm getting the same issues as all of the other Firefox users. Guess I'll never watch it, because I have a hard policy of never, ever installing Chrome malware on my personal computer. Maybe the title should be changed to "Chrome demo"?

You could ask one of your friends to watch the demo on their computer.

Who knows, maybe the policy extends as far as not having any friends using Chrome.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#83

OK, this is really weird, but I closed the browser tab with the demo ca. 1 minute ago and can still hear the music. I'm on FF/Big Sur.

I imagine that accidental unfair scheduling is to blame here: that the audio processor is keeping things busy in such a way that Firefox isn’t getting its “hey, this tab is closed” message through to kill the event loop. This is definitely a bug in Firefox, and it appears to be consistent across platforms (I’m on Windows, you’re on macOS, someone else is mentioning Android). The patch to fix this is likely to be quite small.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#84

OK, this is really weird, but I closed the browser tab with the demo ca. 1 minute ago and can still hear the music. I'm on FF/Big Sur.

With FF mobile on Android I still had ongoing sound after closing FF completely (at least as far as I know) and I had to reboot my phone. It's quite concerning that websites are able to do this. While it is the browsers fault to support all that javascript crap I think this is also a bug in Android.

> It's quite concerning that websites are able to do this.

They've been able to do this for a long time and for valid reasons (think of a PWA audio player, like a podcast app).

Unfortunately this used to get abused very often. I remember seeing bugs in ads that would: stop your Spotify playback (due to how audio apis work on phones), and continue playing in background (again, this is a feature, but often abused). iOS is much better in that regard, with stricter autoplay policies, etc...

What's super concerning is that audio worked even when the page was closed. Once I kill the tab, the entire process should be killed too.

So yeah, it's possible that it's just an FF bug purely because being able to play audio in BG is a valid feature BUT there should be no audio when the tab has been killed. My guess is that from the OS perspective, the tab is still running.

My another guess is that it has something to do with some clever techniques regarding reducing the app size.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#85
post #71

Earlier quoted context omitted.

Ah, I wondered why I was getting junk when I clicked that link, thank you for uploading (still falls over for me when I accidentally opened it using FF, but no harm done)

Hi, my bad. I forgot to set the Transfert Type to binary on my new laptop :p Hope you enjoy MONOSPACE anyhow. I am pretty happy with how it turned out. I believe I managed to nudge a little the state of art of what type of camera work is possible in 1kb demos.

It's absolutely beautiful, just enormously impressive. Thank you for making it!

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#87
post #76

Earlier quoted context omitted.

Thanks for the expansion and comments! On your project, I noticed the comments were about 5 times longer than the source code :) - so that makes sense how to work with it.

Hi there. I do not use any minifier. I minify the code by hand, and typically prototype ideas and performance tests in normal non-minified code. Once the main idea and approach are settled, I minify the code by hand and keep an eye on the heatmap of the DEFLATE stream to match the 1024 bytes limit. MONOSPACE took ~4months on an off to create, tallying ~60h of work. You know 2020 + trying to balance work & family, and…

Awesome work!

That makes sense. I imagine with some experience you have a decent idea about what you can make fit.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#89
post #43
post #39

People love to bash developers who put up "Chrome recommended" banners, dismissing them as lazy, but when making games and such there are real issues that are impossible to circumvent. This bug is a prime example of that.

The point is that if shadowBlur performed poorly in Chrome, people would either find a way to circumvent it, or wouldn't use it. Chrome gets a free pass for its failings, while Firefox attracts "Chrome Preferred" banners, and this is based on market share rather than software quality.

For many aspects of web development you're absolutely right, but don't forget that this is a demo. It's a showcase of talent rather than an attempt to write something accessible in every browser.

People have shown demos at parties that require a specific graphics card and a specific build of a driver in the past; something that requires a specific class of browser engine is probably OK.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#90
post #3

Earlier quoted context omitted.

Even as a Firefox-user, I would recommend running this in Chrome. It's clearly optimized for that target, and it's getting a much higher FPS in Chrome than Firefox.

Jesus I should have read this comment first. It completely locked up Firefox on Ubuntu 20.04, rendering a frame and making a single beep sound about once per second. Had to close the browser and force kill some processes to get the TTS to stop.

I had a beeping issue on Firefox 81 running on Windows 10. The weird thing was, the beeping noise continued even after I closed Firefox. There were some OS updates pending installation, so I just chose to reboot/install instead of troubleshoot further.
Post reply on HN