logoalt Hacker News

biffgifftoday at 1:40 PM3 repliesview on HN

Why would I want to use this over, say, Node.js and TypeScript?


Replies

throwatdem12311today at 1:55 PM

I suggest you try using Ghostty (written in Zig) for a bit and compare it to another terminal like Hyper (written in JavaScript).

araoztoday at 2:09 PM

I believe if the work you do fits well with Node & TS, you have no reason to use zig (other than for learning or curiosity). Like, if you don't need every drop of performance, memory layout & control, there's more downsides to using zig. Idk, cruds or "enterprise" stuff or websites don't benefit from zig.

AlienRobottoday at 3:22 PM

What?

You can't run Node on embedded systems, because there isn't enough memory.

A compiled zig program can be only several kilobytes with no depedenencies.

Array access programmed in low-level languages can be optimized with SIMD and parallelization, which will be orders of magnitude faster than the same thing on Javascript. Text processing, image manipulation, video processing, hashing, etc.

There is like infinite reasons to not use Javascript.