News for hackers. Stuff that matters.
Re:What is a Source Map by gumby on Wednesday November 15, 2017 @01:03AM (#15701764)
How is this different from debugging info? They should just use DWARF instead of reinventing the wheel.
Re:What is a Source Map by openasocket on Wednesday November 15, 2017 @01:12AM (#15701786)
It's very similar, but they wouldn't be able to "just use DWARF". Half the DWARF tables are devoted to byte sizes and where variables are stored in stack frame offsets or registers. It's not like you could fork libdwarf or whatever and magically get JS debugging, the effort required to change to the different scenario is enough that it's not worth the effort.
Re:What is a Source Map by the_mitsuhiko on Wednesday November 15, 2017 @03:17AM (#15702245)
I'm not so sure. I looked precisely into this (using DWARF for JavaScript) and the changes to make DWARF work in that environment are not any crazier than fixing sourcemaps.

As it stands sourcemaps are pretty much useless for a wide range of issues that we have with them and attempts to fix them went nowhere.

Re:What is a Source Map by laichzeit0 on Wednesday November 15, 2017 @02:01AM (#15701952)
Honest question, will any of this matter once we've gone full WASM? Will DWARF be a good option then?

As I understand in the not too distant future, everyone that absolutely despises Javascript and the whole ecosystem it re-invented will be able to merrily go about their way using the old familiar tools and languages from yore when they can compile to wasm.

Re:What is a Source Map by johncolanduoni on Wednesday November 15, 2017 @02:53AM (#15702156)
There's some significant complications, like the fact that most languages that compile to WebAssembly will need to use two stacks at certain times (including C/C++). In this respect WASM is in a similar situation to .NET and the JVM, which use their own debugging information formats for good reason.

Considering this wouldn't make much of a dent in the work needed to get tools like gdb/lldb to work with WebAssembly engines I don't think it's likely to be the best path forward for WASM.

Re:What is a Source Map by johncolanduoni on Wednesday November 15, 2017 @02:57AM (#15702173)
How would you map 90% of the things in DWARF (like stack variable addresses, structure memory layouts, and the honest-to-goodness VM that produces line mappings) to JavaScript? The problems they're solving don't look remotely similar even if you squint.
Re:What is a Source Map by coldtea on Wednesday November 15, 2017 @09:53AM (#15704128)
That's because it's another domain. Wheels are not very useful on ships -- or dynamic languages based on JS.
Re:What is a Source Map by colordrops on Wednesday November 15, 2017 @01:08AM (#15701778)
Do you also think that no other make-like systems should have been built?
Re:What is a Source Map by flukus on Wednesday November 15, 2017 @01:42AM (#15701894)
Not all, but most make-like systems are a waste and are basically just "make in $language" that don't do anything new or novel, the just give you a different syntax and set of functions to learn. So yes, I do think we'd be better off having a lingua franca build systems to use for every language rather than dozens of different ones.
Re:What is a Source Map by sametmax on Wednesday November 15, 2017 @01:53AM (#15701934)
"make in $language" is not a waste if sudendly you can "x install your framework" and get it without additional setup, and crossplateform.

It's not a waste if you can leverage what your teams existing knowledge instead of learning the quirks and tricks of make.

It's not a waste if you can use your existing tooling (editor plugins, debuggers, unit test frameworks...) to process your build files.

Re:What is a Source Map by matejn on Wednesday November 15, 2017 @02:45AM (#15702130)
I believe "x install your framework" is the job of a package manager, not a build tool.

I don't see how your argument holds ground. If everyone used make, tooling would support it, and you wouldn't need to learn the "quirks and tricks" of a dozen other systems.

The problem with make is that it's not portable, since it needs to call system specific binaries, like rm(1) vs del. There's also the BSD vs GNU divide.

Other than that, a newfangled tool like gulp doesn't even have a clean one liner for copying one file to a different location with a different name. It's absurd.

Re:What is a Source Map by dahauns on Wednesday November 15, 2017 @04:22AM (#15702528)
>gulp doesn't even have a clean one liner for copying one file to a different location with a different name

??

    gulp.src("srcfile")
    .pipe(rename("destfile"))
    .pipe(gulp.dest("destloc"));
What's the problem?
Re:What is a Source Map by matejn on Wednesday November 15, 2017 @04:35AM (#15702575)
How is that a one liner?

Compare to: cp srcfile destloc/destfile

Edit: In addition, the above gulp command reports success even if the file doesn't exist. If you want to check that, you need to import another library and expand the command with another pipe.

Re:What is a Source Map by flukus on Wednesday November 15, 2017 @05:03AM (#15702691)
Well it could be a one liner, but you're not wrong, the Unix tools are way more terse and we'll known than the random $language versions of make. A few of the .net ones (Nant, msbuild, psake) are ridiculously complicated to do something like sed for instance.