Live data from Hacker News

Deno 1.9

deno.com

141–150 of 245 posts

Re: Deno 1.9

#141
post #88

I'd love to use deno, but I really don't understand the point deno's module/package system. The standard practice of deps.ts/dev_deps.ts as described in the docs[1] just seems absolutely asinine to me. Importing everything into one scope and then re-exporting from one file just seems like an awful hack. What do you do if two libraries have functions with the same name? Do you namespace them yourself, or export an obj…

The issue is that JavaScript (by extension TypeScript) doesn't have the concept of folders.

You can only import a single file per import statement.

Developers create "barrel" files that allow them to re-export all of the important stuff in a folder externally. This allows for namespacing

  // foo/index.ts
  export * from './foobar'


  // main.ts
  import * as foo from './foo/index'

  new foo.Foobar()
Or use destructured imports to help with static analysis tool that trace imports removing unused references from the final build

  // main.ts
  import { Foobar } from './foo/index'
Node has non standard behaviour where it appends `/index` to the import path if it's a folder allowing you to shorten imports to

  import {} from './foo'

Re: Deno 1.9

#142
post #107

I have a question, how come people do not use Dart in place of this? It runs on the server, it is a typed language, it's faster than v8 javascript (since that is part of the reason for it's existence to eek out more performance) From what I've seen it can be distributed very as well, and your app is self contained ala Go. --- So my question is, why don't more people use Dart where they would use a "Node + 'Typescript…

Because Typescript eventually won that race? (The race to be a fine, typed and sane counterpart to Javascript).

Somehow Typescript convinced people from the Javascript side of the fence that they could mix both and eventually upgrade from it. While Dart also tried the same feat, it failed doing so.

Nowadays Dart is only being considered to anything because the team behind it are top-notch and implemented themselves a platform where Dart could be the king.

Giving their talent they were able to create a great platform, where they would made even more success if they used Javascript or Typescript as a development language. But giving they wanted to save all their years of work on Dart, and giving its not a bad technology per-se, it just had a adoption problem, Dart lives on Flutter.

If you want to use Flutter go for Dart, but picking Dart to anything outside Flutter will just alienate the developer crowd as giving even Typescript is some sort of a niche language in terms of adoption, nevermind forcing people to learn Dart.

Re: Deno 1.9

#143

Having read multiple comments Deno looks to me like somethung I want to get into. Is there somewhere a getting started with Deno guide, tackling setup of a d velopment environment and some typical use cases as examples? How would e.g. a company like CloudFlare run Deno instead of v8 for it's serverless infrastructure?

Are you a computer program? Your third sentence is much more sophisticated than your first two; they don't seem to have been written by the same human. And the two typos look somewhat inauthentic.

Re: Deno 1.9

#146
post #88

I'd love to use deno, but I really don't understand the point deno's module/package system. The standard practice of deps.ts/dev_deps.ts as described in the docs[1] just seems absolutely asinine to me. Importing everything into one scope and then re-exporting from one file just seems like an awful hack. What do you do if two libraries have functions with the same name? Do you namespace them yourself, or export an obj…

You realize Deno is founded by Ryan Dahl, who founded Node 12 years ago, don't you?

Perhaps you should be less quick to label anything about it "asinine" or even "awful hack".

Re: Deno 1.9

#147
post #88

I'd love to use deno, but I really don't understand the point deno's module/package system. The standard practice of deps.ts/dev_deps.ts as described in the docs[1] just seems absolutely asinine to me. Importing everything into one scope and then re-exporting from one file just seems like an awful hack. What do you do if two libraries have functions with the same name? Do you namespace them yourself, or export an obj…

You realize Deno is founded by Ryan Dahl, who founded Node 12 years ago, don't you? Perhaps you should be less quick to label anything about it "asinine" or even "awful hack".

With all respect to Ryan Dahl, I'm sure he'd disagree with the "asinine" characterization but would also disagree he's infallible - as evidenced by the creation of Deno after Node

Re: Deno 1.9

#148
post #65

Earlier quoted context omitted.

Indeed. I remember that, I have been using node since the very early days, and switched to it for precisely that reason--that I could use the same language through my web application. Nevertheless, when we did get those modern web API, Node was slow to change or adapt them, although, it's doing its best now. In case of Deno, I hope they just stick to following the standards and changing with them. They might not, I c…

Overall this is true. And beyond that the TypeScript team is heavily involved in TC39, and quite a lot of TC39 proposals are specifically designed to be enhanced by TS. That said... There are a few longstanding incompatibilities/footguns. And they’re likely to remain due to widespread use, even though most are controversial. Off the top of my head: - access control annotations (`private` which is compile time only vs…

> enums [...] everybody but me hates them

Hmm, what did I miss, why do people hate them exactly?

> And sure it’s marked “experimental” but it’s used a lot and almost guaranteed to be a future conflict. Putting that toothpaste back in the tube is gonna make a lot of people feel a lot of pain.

Maybe I'm a bit masochist, but I can't say I feel a lot of compassion for people using experimental features in missing-critical production code.

Re: Deno 1.9

#149
post #147

Earlier quoted context omitted.

You realize Deno is founded by Ryan Dahl, who founded Node 12 years ago, don't you? Perhaps you should be less quick to label anything about it "asinine" or even "awful hack".

With all respect to Ryan Dahl, I'm sure he'd disagree with the "asinine" characterization but would also disagree he's infallible - as evidenced by the creation of Deno after Node

I'm just saying Don't be so quick to judge. Be humble!

No one is infallible. That said, creating Deno after Node doesn't imply that Node was a fail or that Deno will be perfect. Obviously not.

Consider that someone really smart has reasons for doing (or trying to do) things a certain way. Be humble!

Re: Deno 1.9

#150
I wish deno files had a different file extension. Editor gets confused often switching between front end typescript and deno typescript.
Post reply on HN