News for hackers. Stuff that matters.
Re:Today’s Javascript, from an outsider’s perspective by alanbernstein on Monday May 25, 2020 @09:20PM (#23306541)
Or maybe John found it less aggravating to find or create another implementation in a different language?
Re:Today’s Javascript, from an outsider’s perspective by fastball on Monday May 25, 2020 @09:32PM (#23306617)
Well if he followed internet trends he'd try Rust next, which doesn't exactly have the most straightforward package system either.
Re:Today’s Javascript, from an outsider’s perspective by DangitBobby on Monday May 25, 2020 @09:49PM (#23306705)
As someone with little experience in Rust, I can say that I have had no trouble downloading, compiling, and running binaries from a crate. The only hard part for me is organizing my own crate correctly.
Re:Today’s Javascript, from an outsider’s perspective by saghm on Monday May 25, 2020 @09:50PM (#23306712)
Rust is definitely known for having a sharp learning curve, but I'm not sure what you mean about the package system. I've onboarded several people onto Rust at my job over the past year, and the package system has never been an issue for any of them.
Re:Today’s Javascript, from an outsider’s perspective by jtdev on Monday May 25, 2020 @09:55PM (#23306731)
Or, you know, Python, Ruby, Java, Go, C#, Swift, Kotlin, etc., etc., or any number of other languages that are less of a foot-gun full of bizarre issues, poorly maintained packages, and droves of Jr. devs eager to do clever things that make the language and ecosystem psychotic.
Re:Today’s Javascript, from an outsider’s perspective by TechBro8615 on Monday May 25, 2020 @10:06PM (#23306791)
Python is good at many things, but packaging is not one of them. The best python package manager at the moment is Poetry, and it drew most of its inspiration from npm and yarn...

Python packaging has historically been so bad that dotcloud invented docker in an attempt to make it usable.

Re:Today’s Javascript, from an outsider’s perspective by Carpetsmoker on Monday May 25, 2020 @10:16PM (#23306846)
But at least I can just download a .py file (or a bunch of files) and just import them. Perhaps the biggest frustration/pain point in this article isn't npm as such, but that you can't "just" use some JS module.
Re:Today’s Javascript, from an outsider’s perspective by yawaramin on Tuesday May 26, 2020 @01:15AM (#23307646)
> But at least I can just download a .py file (or a bunch of files) and just import them

Unless you have a Python version locally that doesn't support some features used in said .py file...

Re:Today’s Javascript, from an outsider’s perspective by dceddia on Monday May 25, 2020 @10:41PM (#23306954)
Nothing would stop you from doing that (import thing from ‘./downloaded.js’) but it’s Just Not Done That Way and packages aren’t really built with that in mind, so it probably wouldn’t work very well in practice.
Re:Today’s Javascript, from an outsider’s perspective by TechBro8615 on Monday May 25, 2020 @10:39PM (#23306946)
You definitely can. On the server side, you can literally do that. On the client side, you can "import" one with a script tag, and increasingly you can use modules in browsers too.
Re:Today’s Javascript, from an outsider’s perspective by runawaybottle on Monday May 25, 2020 @10:02PM (#23306777)
Woah woah woah, show me a Java project repo that we’re all going to be able to install here without running into an issue.

I ran into one with Go imports just the other day, and since I’m new to it, it wasn’t a 10 minute google fix.

Re:Today’s Javascript, from an outsider’s perspective by FridgeSeal on Tuesday May 26, 2020 @04:16AM (#23308595)
I've played around with a bunch of languages, and Rusts' is unequivocally the best experience I've had so far. Cargo works as intended, literally straight out of the box, crates.io and the Cargo.toml was straightforward to figure out. Certainly way less frustrating than figuring out how to use Python virtualenv when I was first starting.
Re:Today’s Javascript, from an outsider’s perspective by fastball on Tuesday May 26, 2020 @04:42AM (#23308715)
I meant how imports work within a package, since that is what was being discussed in the article.

Nested `mod`s with sometimes `pub` and then `use` for other stuff certainly seems more complex to me than `import X from P`.

Package/crate management is fairly trivial in both cases, yes. `npm i [package]` isn't exactly a difficult process either.

Re:Today’s Javascript, from an outsider’s perspective by guitarbill on Tuesday May 26, 2020 @06:27AM (#23309294)
that's fair, but newer languages like Rust have the benefit of hindsight, and can mandate one way to do things. to be clear, i'm all for that.

i don't think it's possible to do that any more with Python, the genie is out of the bottle. but you can get close with things like Black (auto-formatting) and Poetry (nicer deps mgmt and so much more). of course, how would a beginner know this? hopefully some day tools like that will become the default answers

Re:Today’s Javascript, from an outsider’s perspective by jack1243star on Tuesday May 26, 2020 @01:22AM (#23307690)
Cargo (Rust's equivalent to npm) is quite good.
Re:Today’s Javascript, from an outsider’s perspective by NightlyDev on Tuesday May 26, 2020 @05:32AM (#23308972)
To be fair, Rust is a dream compared to JS.
Re:Today’s Javascript, from an outsider’s perspective by trashfindhunter on Monday May 25, 2020 @09:50PM (#23306710)
He wouldn't be the first. Speaking of which, whatever happened to Dart?