Hacker News new | ask | show | jobs
by chrismsimpson 1162 days ago
Firstly, JS is a horrendous target. Second, breakpointing in another language is about as great (possibly worse) as debugging via printf.
5 comments

Unless you write a basic interpreter or code in plain binary, you're breakpointing in another language. It's really not a big deal as long as you preserve the mapping to the original code.

When you breakpoint in C, you breakpoint in assembly and find your C location from the debug information for example.

> Second, breakpointing in another language is about as great (possibly worse) as debugging via printf.

You don't have to. Just generate sourcemaps and you'll be able to set breakpoints in your own language even when targeting JS.

If anything that makes JS an even better target since you can leverage tooling.

Depends on your needs. In terms of functionality, JS has everything you might want, even the ability to execute itself. Viewed as a platform, not just a language, it offers WebAssembly, soon WebGPU. I don't see anything else that comes even close as a target platform!
The usual choice is C. I'm currently liking luajit as the tracing cuts through some of the DSL. The JavaScript compilers probably manage the same thing.
printf debugging is infinitely better
Agreed