Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
This took a different direction than I expected! I was hopping to see a bit more of the extreme weirdness of JS and not so much of "mainstream weirdness" though.
I've played with Javascript itself, brought it to extremes that were just funny and painful and it's amazingly weird. There's lots of experiments and pseudo-libraries out there exploring those as well like JS-in-CSS [1]. I've even wrote some of them, like Running PHP in Javascript [2] and a funny "jquery alternative" that allows you to do `dom.a._target = "blank";` [3] (for the equivalent of `$('a').attr('target', '_blank');`).
[1] https://github.com/walaura/js-in-css-rt
[2] https://francisco.io/blog/running-php-in-javascript/
[3] https://www.npmjs.com/package/superdom
When I last looked, it seemed like WASM blobs just take arrays of numbers and return arrays of numbers. No objects, strings, or DOM elements, so I think it'd be tough to do web dev in wasm as it stands. And you need javascript glue if you want anything in the way of side effects.
There is, however, quite a bit you can do in it. TeX has been compiled to wasm[1], it's about 600kb uncompressed 90k compressed (the memory image with latex loaded is about 6MB compressed though - latex is a beast). I think anything computationally intensive would be a good candidate for wasm (it has int64).
1: https://github.com/kisonecat/web2js
I started writing a small static site generator for myself using JavaScript and QuickJS by Fabrice Bellard[1]. QuickJS is not quite complete, and there are some cross-platform inconsistencies, but overall I found it pleasant to use and its libc wrappers to be powerful enough. I also found that JavaScript is actually pleasant to use when I'm not using classes, or dealing with metaprogramming/Babel, or implicit globals. Dependencies are just pure .js files I keep in a /lib directory and import.
I still think JS is a nice language although I tend to side with Crockford (before he started promoting the "next" language) in that JS has some good parts, and you can write clean and powerful software with it if you ignore most of its warts (even if you're using Node). My best advice is be very careful with what dependencies you choose; and also, don't feel pressured to be at the bleeding edge all the time. The Node/React world is a constant hype machine that flip-flops on best practices every 6 months. Ignore them.
[1] https://bellard.org/quickjs/
async/await did exist two years ago. Maybe they wanted to be consistent with even older examples. I dunno, every single thing Google-related uses promises, so I'm thinking they're partial to that for some reason.
Another example from 4mo ago: https://github.com/kubernetes-client/javascript/blob/master/...