HNHacker News
TopNewBestAskShowJobs

maga

892 karma · joined January 20, 2012

http://maga.name

denelxan@gmail.com

submissionscomments
maga··on Starting a TypeScript Project in 2021
prettier?
maga··on Node.js 16 Available Now
WASM has its moments, as you can see in this[1] benchmark it outperforms JS and native addons on certain tasks.

Since the bottleneck with native addons is usually data copying/marshalling, and we have direct access to WebAssembly memory from the JavaScript side, using WebAssembly on this "shared" memory might become the best approach for computationally heavy tasks. I wrote about it a bit here[2].

[1] https://github.com/zandaqo/iswasmfast

[2] https://medium.com/swlh/structurae-1-0-graphs-strings-and-we...

maga··on Node.js 16 Available Now
Node has always supported native addons, and since 2017 it also provides a stable ABI making the process a whole lot easier[1].

That said, in my own experience it was seldom worth it to rewrite something in C++ for performance sake. After rewriting some computationally heavy part as a native addon, I often ended up gaing only ~20% more perfomance at best when compared to properly optimized JS implementation, and even that was not guaranteed since V8 improved rapidly. That was not a good enough reason to keep a whole different tool chain around, so I'd end up going back to JS.

[1] https://medium.com/netscape/javascript-c-modern-ways-to-use-...

maga··on Is WebAssembly magic performance pixie dust?
A few years ago I did similar comparison but in context of Node.js and sans manual optimizations: https://github.com/zandaqo/iswasmfast

In my work, I have come to conclusion that it seldom pays off to go "native" when working with Node.js. More often than not, rewriting some computationally heavy code in C and sticking it as a native module yielded marginally better results when compared with properly optimized js code. Though, that doesn't negate other advantages of using said technologies: predictable performance from the start and re-using existing code base.

maga··on Deno 1.9
Indeed. I remember that, I have been using node since the very early days, and switched to it for precisely that reason--that I could use the same language through my web application. Nevertheless, when we did get those modern web API, Node was slow to change or adapt them, although, it's doing its best now.

In case of Deno, I hope they just stick to following the standards and changing with them. They might not, I cannot vouch for them. On the other hand, I was also skeptical about TypeScript following ECMAScript. I though at some point they'll get too much into conflict and MS will refuse to follow, but so far I've been proven wrong. And from the looks of it, TS even deprecates stuff that is likely to conflict with upcoming ES versions.

maga··on Deno 1.9
This. I started tinkering with node shortly after I heard Ryan introduce it at JSConf EU, and it was a very different world, not much for Node to draw from on the browser side, no modules, no promises, not even TypedArrays IIRC.
maga··on Deno 1.9
The often overlooked selling point of Deno that I find most compelling is the (re)use of web APIs. As a full-stack dev writing isomorphic code and libraries, dealing with ideosincracies of nodejs has been a pain.
maga··on FFmpeg 4.4
I'm a voracious audiobook consumer and get my books in all forms and shapes. At some point, I got tired of organizing them and decided to put them in my Calibre library, re-encoding each book first into a single file preferably with chapter information. To my surprise, existing tools were quite cumbersome, so I put together a small nodejs CLI[1] that uses ffmpeg for encoding. It was hacked together in few hours, but has saved me a ton of time since.

[1] https://github.com/zandaqo/ctfb

maga··on Show HN: PDFs from HTML
That's an apt observation, actually. I used to practice mind palace when I had to memorize lists, and I do feel more comfortable when information is "physically" placed somewhere like a page, I guess it's all connected.
maga··on Show HN: PDFs from HTML
Maybe it's simply a force of habit at this point, but I can only read/study/memorize technical stuff from PDF/paginated source--I memorize the overall "picture" of the page and it's location along with the bits I actually need, and it's really tough to do with non-paginated sources.
maga··on FicusJS
I have been using lit-html for years now, and lit-element for a couple years all in vanilla js for evergreen browsers with the only build step being bundling for production. Here is one of the projects: https://cisterna.app
maga··on Using ES Modules in Node.js: A Practical Guide (Part 1)
Check out esbuild.
maga··on Apple silicon M1 as-a-Service
I'm curious about how the hardware side of it all looks. Does Apple sell chips to these cloud providers or they are indeed using real/modified Mac Minis?
maga··on Ask HN: What companies are you excited about?
SpaceX.

Watching Falcons land is one of the few things that still give me warn and reassuring feeling about the future.

maga··on New measurements of the sky's blackness
I understand that, I mean the matter-energy balance in the universe at the moment accounts 5% to ordinary matter, 26% to dark matter and the rest to dark energy. Since we now assume there are less stars, hence, ordinary matter, but the galaxies are still accelerating at the same rate, doesn't that mean the dark energy accounts for more than the estimated 69%?
maga··on New measurements of the sky's blackness
Does this mean there is "more" dark energy since we still have all the effects of extra matter but less visible matter?
maga··on Mushrooms Can Eat Plastic, Petroleum and CO2 (2018)
If I understand this correctly, mushrooms can eat the carbohydrates in oil and oil products. I wonder what happens to metals mixed in the oil, do mushroom suck those in as well or somehow filter them and leave in the ground?

Old oil well and refinery sites in the developing world are full of ponds with a mix of water and oil/oil products that often come as a result of cleaning processes. Over time, due to evaporation and dust, these turn into asphalt like hard substances. Mushrooms could be a low cost solution to removing those over time, the slow speed of growth won't that much of issue as with fresh oil spills.

maga··on What You Can Learn from Living in Antarctica
I wonder why no one tries to colonize Antarctica as a stepping stone for future space colonization. We can test and develop our greenhouse and energy tech there. E.g. create a colony that gets all its energy from solar and uses it to grow greenhouse plants supplying most if not all of its food.
maga··on 'Bath sponge' breakthrough could boost cleaner cars
I'd like to know how it compares to existing solutions, the only thing I see in abstract is meeting/exceeding some US gov target. Can someone knowledgeable weigh in on this? How big of progress is this?
maga··on Firefox 73
And still no support for RegExp features from ES2018(!), i.e. named groups [1]. I love FF as much as the next web dev, but sometimes features fall by the wayside, and it takes forever for FF to implement them. For example, it took literally years for FF to implement focusin/focusout events after they were standardized and all other browsers implemented them.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1362154

maga··on Safari 13 Is Out
This. I was really hoping for EventTarget constructor to land: https://bugs.webkit.org/show_bug.cgi?id=174313

Safari now is the only evergreen browser that does not support it.

maga··on The cost of parsing JSON
It usually took me ~20 min to download an mp3 around that size through dial up back in the day. Indeed what a time.
maga··on Why does all life use the same 20 amino acids?
So, tl;dr answer is that it's because those amino acids are more eager to react/polymerize.

I wonder what it means for exobiology, is this true only in Earth conditions or in general, i.e. can we expect life elsewhere to use the same 20 amino acids? Also, if not, how toxic/dangerous would that life be for humans?

maga··on Ask HN: Do you keep a personal knowledge repository?
Evernote. For KM, I keep notebooks labeled:

- Excerpts (for summaries and excerpts from books and articles)

- Snippets (for code snippets, formulas, etc)

- Reports (for results of research on a subject, e.g. learning new API)

- Papers (copies of research papers)

Dividing notes in such a way also helps to review them with varying frequency. For example, snippets get outdated often (e.g. workarounds for bugs or polyfills) so I have to go over them more often. Reports get updated as I learn new things about a particular subject that has its report. Excerpts are updated only if I decide to re-read the material they cover and extend them. Papers last as long as I'm interested in subject.

maga··on On Oliver Sacks and His Obsession with Weightlifting
I've been doing various sports on/off since I was a student (10+ years ago), mostly martial arts. There were some periods when I was out of shape, but in general I kept myself fit. I was never into lifting though, I could barely bench my own weight, and never even tried deadlifts. Two years ago I tore a tendon in my shoulder rendering me incapable of doing most MA things. While in recovery I started playing with free weights. A local powerlifter noticed me and told me that my numbers can win me local meets if I work on my form. So around January 2018 I started looking up powerlifting and went through two cycles of Candito's 6 Week Program.

Last June I attended my first meet and tanked it: failed all three deadlift attempts due to errors (not following commands, double movement, etc). I started working on technique and won the two local meets that followed. I cannot say I enjoy it as much as I enjoy martial arts, but at the moment I'm just curious to see how much my body can progress within my normal sleep/rest/nutrition regimen.

maga··on On Oliver Sacks and His Obsession with Weightlifting
By finding a coach to set up a proper form for the lifts. That is, if we are talking about powerlifting, learning how to properly do bench press, squat, and deadlift. Internet is awash with materials about it, but each person is different and you really want someone experienced checking your lifts.

I have been somewhat seriously lifting for more than a year (~350 Wilks, raw), never had a coach and it's my only regret that I had not worked out the forms with someone early on. I didn't think much of the sport at first and was doing it just for fun. But as I hit heavier weights I had to re-learn all the lifts multiple times because the "canonical" forms I learned from youtube were often ill suited for my body structure.

maga··on Construct-JS – A library for creating byte level data structures
I believe I have the same thing in structurae [1]. I have a RecordArray[2] class for exactly this: you can define a struct (or record) and use ArrayBuffer to hold a specified number of structs. Although I went with extending DataView to do it all instead of creating a "wrapping" class. I wrote about it in the article introducing structurae[3].

[1] https://github.com/zandaqo/structurae

[2] https://github.com/zandaqo/structurae#RecordArray

[3] https://blog.usejournal.com/structurae-data-structures-for-h...

maga··on WebAssembly’s post-MVP future
I have done some benchmarking comparing JS, WASM, and native C++ addon performance in Node.js: https://github.com/zandaqo/iswasmfast

From the look of it, in Node.js, WASM suffers less data exchange overhead while been decently close to performance of the native addons.

maga··on Hydrogen derived from ammonia could open up new export market for Australia
And then there is BRICS--countries that have the means to use the modern tech, but the governments are too weak or too corrupt to enforce regulations.

This tech has its merits, if done right it can increase the overall efficiency of hydrogen tech, however carrying kgs of ammonia in consumers' cars or tons of it in local gas stations when mere grams can kill you is pushing it too far.

maga··on Hydrogen derived from ammonia could open up new export market for Australia
And it's regulated way more than the fuel industry. In many of those developing nations, opening a gas station is as simple as burying a few containers and paying off fire-safety inspectors. I'm not at all eager to see them handling ammonia that way.
← PreviousPage 3 of 8Next →