Live data from Hacker News

What the Hell Is a Deno?

breadth.substack.com

71–80 of 151 posts

Re: What the Hell Is a Deno?

#71
post #30

Earlier quoted context omitted.

This doesn't make sense to me. Javascript is a breath of fresh air after writing async code in almost every other ecosystem from Go to Java to Python to Swift. Pretty much any async code snippet in those languages can be improved by porting it to Javascript. Async/await + the ubiquitous Promise make it my go-to choice for writing anything networked. Especially over the other popular dynamically typed languages.

I dislike javascript for much the reason you love it. Promises just mean having to manually build and manipulate cooperatively multitasking green-threaded call-stacks. It was a dirty necessity following the inability of the earlier callback patterns to manage the level of complexity people were attempting to express in the language.

As someone with most of my coding experience in JS/TS, what would you say is a good alternative to explore?

Re: What the Hell Is a Deno?

#72
post #47

Earlier quoted context omitted.

This is 100% true especially stupid libraries that are someone's class project. And JavaScript developers are so used to dependency hell that one of my developer imported 3rd party package for date formatting.

JS's built in date formatting/handling is terrible and often do what needs to be one. MomentJS may be a giant import, but it works an it works really well.

Formatting is fine. Take a look at `Intl.DateTimeFormat`[1]. Then there is a proposal for `Temporal`[2] which will make handling a lot easier.

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

[2]: https://github.com/tc39/proposal-temporal

Re: What the Hell Is a Deno?

#73

Earlier quoted context omitted.

It’s the closest thing we have to a useful standard library. Date handling in js without a library is a code smell.

I am confused, are you using MomentJS for fancy output like 3 days ago etc or for simple output like 5/31/2020? I can see how it is useful in former case but seems overkill in later case.

Safari is lacking in support (again) but we have `Intl.RelativeTimeFormat`[1]

    new Intl.RelativeTimeFormat("default").format(-3, "day")
1: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: What the Hell Is a Deno?

#74

Earlier quoted context omitted.

Because in those languages: . dependencies are carefully considered by users . dependencies are not added recursively . dependencies try to be dependency-free themselves to assist with the previous point . dependencies are not blindly nor automatically updated . dependencies solve important domain problems, they are not trivial one-line-functions . dependencies are typically developed and tested by a known team or co…

the parent said something about problems being solved if there was a standard library, and if perhaps there were a standard library people would be willing to write more code instead of just adding another dependency. I believe these points dependencies are carefully considered by users dependencies try to be dependency-free themselves to assist with the previous point dependencies solve important domain problems, th…

True to an extent, but consider Python which has a standard library and has also seen some of these same types of security breaches.

Re: What the Hell Is a Deno?

#75
post #13

> Javascript is great. But... in saying that it has a few quirks and can work in some unexpected ways. Typescript has just as many[1] (in fact more, as it's a superset) quirks than Javascript. I like using it (and it makes JS type-safe-ish), but it's not really some kind of paradigm shift. Not sure how I feel about import maps. They are quite literally the same thing as package.json. In fact, converting between the t…

[deleted]

Re: What the Hell Is a Deno?

#76

Deno is the Java-fication of JS. I'm sure there will be Node-like tide of "JS is better than Java now that we have X" even though Deno brings JS closer than ever to Java. Despite being cynical, I don't think its a bad thing. Java does a lot of things right. Deno -> Java Runtime security options -> Security Manager. URL based packages with simple HTTP-> Maven works same way. Bigger standard library -> Java's is huge.…

Funny, I thought it was the Go-fication of JavaScript. Look at the 'contributing' section of their stdlib: "deno_std is a loose port of Go's standard library. When in doubt, simply port Go's source code, documentation, and tests. There are many times when the nature of JavaScript, TypeScript, or Deno itself justifies diverging from Go, but if possible we want to leverage the energy that went into building Go. We generally welcome direct ports of Go's code."

Re: What the Hell Is a Deno?

#77
post #13

> Javascript is great. But... in saying that it has a few quirks and can work in some unexpected ways. Typescript has just as many[1] (in fact more, as it's a superset) quirks than Javascript. I like using it (and it makes JS type-safe-ish), but it's not really some kind of paradigm shift. Not sure how I feel about import maps. They are quite literally the same thing as package.json. In fact, converting between the t…

Frankly I find TypeScript with strict mode turned on to be a safer and saner than C# and Java because of explicitly nullable types alone. I _never_ get null pointer exceptions in my own TypeScript code. Combined with fairly strict ESLint you get something that catches a lot of problems at compile time. Of course it's still far cry from being as safe as for example Rust. And yeah the inconsistency of JavaScript/TypeSc…

C# 8 has support for non nullable references.

For lower C# versions and Java you can get your strict mode turned on via static analysis tools.

I have been using Sonar on CI/CD builds since 2008. Static analysis errors break the build, plain and simple.

Also quite convenient for writing sane C and C++ code by the way.

Re: What the Hell Is a Deno?

#78
This comment is a meta-critique on the blog itself. I've noticed a recent trend arising on the web of applying a text shadow to code to make it seem like it's glowing. I don't know where people started thinking this was a good idea but I hope it doesn't gain too much traction. When I saw it in this blog, I blinked and rubbed my eyes because I actually thought my vision was blurring...

Another nitpick which may be totally invalid and I'm open to being educated on this. It seems odd (i.e. inaccurate) that, at the end, the myProgram.bundle.js is being called an "executable binary." It's just minified JavaScript. Is it a binary because it has been minified and optimized, or is all JavaScript suddenly considered "binary?"

Re: What the Hell Is a Deno?

#79
I assume that permissions are given at application level, not at module/import level?

This means that if I write an application that requires filesystem access and has external dependencies, I'm essentially giving them access to the filesystem even if they don't need it.

These dependencies could silently check whether they have permissions and do something fishy only if that is the case.

It would be nice to be able to import dependencies in a nested sandbox but I guess it is not a simple problem.

Re: What the Hell Is a Deno?

#80
post #30

Earlier quoted context omitted.

I dislike javascript for much the reason you love it. Promises just mean having to manually build and manipulate cooperatively multitasking green-threaded call-stacks. It was a dirty necessity following the inability of the earlier callback patterns to manage the level of complexity people were attempting to express in the language.

As someone with most of my coding experience in JS/TS, what would you say is a good alternative to explore?

Go with goroutines and channels is a nice way to handle concurrency.

At least it was the one that was easiest for me to wrap my head around and actually improved the performance of my code without weird race conditions or bugs.

Post reply on HN