HNHacker News
TopNewBestAskShowJobs

bartlomieju

277 karma · joined September 3, 2018

submissionscomments
bartlomieju··on Big changes ahead for Deno
N-API will be supported in future releases of Deno, we have a PR going that is close to completion.
bartlomieju··on Big changes ahead for Deno
That's not really what's happening behind the scenes.

We are consuming sources as they are provided in npm using "compat layer" that is part of Deno's standard library. We had to provide special module resolution, but besides polyfill for built-in Node APIs, it works very similar to how Node consumes these packages.

bartlomieju··on Big changes ahead for Deno
New server API is modelled after API available in "std/http/server.ts", so for most folks it should be a drop in replacement.
bartlomieju··on Big changes ahead for Deno
"compat" mode has been supported for some months now: https://deno.land/manual/node/compatibility_mode
bartlomieju··on Fresh – Next-gen web framework
Not really, Fresh already powers several websites https://deno.land/, so it definitely has production use.
bartlomieju··on Why LSP?
Bartek from Deno here, this is mostly true. The runtime heavily relies on the Web standards, while Go was a heavy inspiration for Deno's standard library (deno_std [0]) in the early days. Since then, we've been relying on Web standards even more and the standard library started seeing more modules added that were based on popular npm modules.

On another note: huge thanks for rust-analyzer, not only is it my main daily driver, but we also used it as a reference for implementation of "deno lsp" - the language server that ships with Deno.

[0] https://github.com/denoland/deno_std

bartlomieju··on Ask HN: Who is hiring? (January 2022)
Deno Land Inc. | Head of Growth | Remote | Full-time | https://deno.com | https://deno.land

Deno Land is a startup founded by creators of Node.js, the runtime used by millions of developers that laid the foundations for the modern web. We are continuing to innovate with our new runtime called Deno, which is already one of the most popular projects on GitHub [1].

By repurposing web browser technology for the server software, we aim to accelarate a new generation of extreme low-latency edge applications. Our nascent commercial product [2] is cloud service for hosting software built with Deno; it is one of just a couple implementations of serverless at edge in existence. Our software is being used across the industry by companies like Slack.

Head of Growth: https://deno.com/jobs/growth

Apply at jobs@deno.com

[1] https://github.com/topics/deno [2] https://deno.com/deploy

bartlomieju··on Deno 1.13 Release
If the tooling you're describing outputs JS sources there's nothing preventing you from using it. Currently there's no way to hook them up directly into Deno, so you'd have to resort to separate build step (via some kind of script, I presume this is just a matter of calling appropriate binary).

If those tools help you write better code and you prefer to code in Ocaml/F# then it definitely makes sense, but of course this is personal preference.

Drop by at our Discord server [0] to get some tips on how to set up such project.

[0] https://discord.gg/deno

bartlomieju··on Deno 1.13 Release
Oak [0] is the go-to web framework in Deno ecosystem, it has Koa-like API. There's also Opine [1], Drash [2] and some other that are also highly spoken of by folks at the Discord. AFAIK Oak used native HTTP bindings since their inception (if you were running with --unstable flag); and now that API is stabilized it will use it by default.

As for the NextJS; there are also a projects that try to mimic its API like AlephJS [3] and Fresh [4].

[0] https://github.com/oakserver/oak [1] https://github.com/asos-craigmorten/opine [2] https://github.com/drashland/deno-drash [3] https://github.com/alephjs/aleph.js [4] https://github.com/lucacasonato/fresh

bartlomieju··on Deno 1.13 Release
Bartek from deno.land here, happy to answer your questions should you have any.

Deno 1.13 is one of the biggest releases to date - we're especially happy with stabilization of native HTTP server bindings. We plan to focus on squeezing the last bits of performance out of it in the coming weeks.

Personally I'm most excited about type checking example code in Markdown files. It's critical to keep your documentation up to date and doing so for code blocks embedded in JSDoc comments or Markdown files was very challenging. With this release we got you covered - just run "deno test --doc" on your codebase.

bartlomieju··on Deno 1.13 Release
Thanks, I'll update the example
bartlomieju··on B-tree Path Hints
BuntDB [0] from @tidwall uses this package as a backing data structure. And BuntDB is in turn used by Tile38 [1]

[0] https://github.com/tidwall/buntdb [1] https://github.com/tidwall/tile38

bartlomieju··on DenoDB
https://deno.land/x/ is a service from Deno, but it's a registry for 3rd party modules. There's no need to change the URL
bartlomieju··on Deno 1.6 supports compiling TypeScript to a single executable
There's nothing preventing you from still using a central repository (or its mirrors). I highly recommend "Deno is a Browser for Code" by Kitson [1] which discusses this subject in more depth.

[1] https://kitsonkelly.com/posts/deno-is-a-browser-for-code/

bartlomieju··on Deno 1.6 supports compiling TypeScript to a single executable
> Personally I appreciate being able to choose my linter, compiler, dialect etc.

I completely agree with that! But on the other hand with plethora of tools available it can be quite overwhelming to configure all the tools, especially for new users.

> I've tried to get Deno to work before in production, but it had so many compatibility issues last I tried it would take weeks or months to refactor things so it would work.

Work on compatibility layer with Node is ongoing [1]. With every release there's some new API being compatible, but far from over.

[1] https://deno.land/x/std@0.80.0/node

bartlomieju··on Deno 1.6 supports compiling TypeScript to a single executable
> We're never going to put URLs into our imports because we want to be able to run things offline without depending on 3rd party servers to stay up over time, but if we can depend on local ./node_modules libs once compatibility is improved then that's great.

You can achieve the same thing with Deno! By default Deno downloads all dependencies into a central cache directory, but by providing DENO_DIR env variable with a path you can tell Deno to change that cache dir. And these files are cached indefinitely; Deno will not try to fetch them again on next run (unless you opt into it with --reload flag).

bartlomieju··on Deno 1.6 supports compiling TypeScript to a single executable
Deno is a JavaScript runtime much like Node. For the reasons on why creating Deno I recommend "10 Things I Regret About Node" by Deno's author [1]

Deno is different than Node in several aspects; most notably:

- Deno supports only ES modules, there's no built-in support for CommonJS modules

- Deno's APIs are all promised based

- Deno does not use NPM, instead it can pull code from any URL, much like browsers do

- Deno has built-in permission system that by default runs your code in full sandbox allowing to opt-in into breaking out of sandbox (eg. to read a file from disk)

- As you've mention Deno can run .ts files without explicit build step

- Deno comes with a full toolchain in a single binary (formatter, linter, test runner, bundler, doc generator)

[1] https://www.youtube.com/watch?v=M3BM9TB-8yA

bartlomieju··on Deno 1.6 supports compiling TypeScript to a single executable
That really depends on concrete package; a lot of npm packages works perfectly fine in Deno, especially if they're available via CDNs like Skypack.

For packages that use native Node APIs there's a Node compatibility layer being developed as part of the standard library: https://deno.land/std@0.80.0/node. It's still lacking a lot of modules and doesn't provide seamless experience, but with every release it's getting better.

bartlomieju··on Deno 1.6 supports compiling TypeScript to a single executable
Currently it's 30-45Mb depending on the OS. We're working on providing a "lite" version of the runtime, that doesn't include tools like formatter or linter. Preliminary works show that we should be able to trim executables down to about 20Mb.
bartlomieju··on Deno 1.6 supports compiling TypeScript to a single executable
Hey, Bartek from deno.land here.

I'll be more than happy to answer your questions about Deno and its development.

bartlomieju··on Small world with high risks: a study of security threats in the NPM ecosystem
You can scope it further:

  deno --allow-net=0.0.0.0:8000 https://deno.land/std/examples/echo_server.ts
Or even provide a list of addresses:

  deno --allow-net=0.0.0.0:8000,localhost https://deno.land/std/examples/echo_server.ts
bartlomieju··on ECMAScript modules in Node.js: the new plan
I don't have knowledge about early NPM stages, but from my perspective the goal right now is to get rid of need for package manager.
bartlomieju··on ECMAScript modules in Node.js: the new plan
Experience has been awesome. This tech is really challenging for me, but at the same time amount of knowledge I gain is huge. Deno community hangs around on gitter, here: https://gitter.im/denolife/Lobby

Question about contributions has been raised on gitter several times already and the answer was to look for "good first issue" labels in GitHub repo. However there are not many of them right now.

bartlomieju··on ECMAScript modules in Node.js: the new plan
Disclaimer: I contribute to Deno. IMHO it will take 1-2 months before someone deploys simple production services. We're already working on standard library, which you can see here: https://github.com/denoland/deno_std
bartlomieju··on ECMAScript modules in Node.js: the new plan
PR for this is here: https://github.com/denoland/deno/issues/975

It's expected that this should land in next month.

bartlomieju··on ECMAScript modules in Node.js: the new plan
Disclaimer: I contribute to Deno.

Contrary to Go, when using Deno you don't need to invoke any command to install a package. You just put your import statement with full URL (you can pin version there, eg. https://unpkg.com/liltest@0.0.5/dist/liltest.js) and Deno downloads it on first run and caches for later use. Changing $DENO_DIR is somehow equivalent to changing node_modules location. This eliminates need for package manager.

bartlomieju··on PostgreSQL 11 Released
Thanks, that's super useful! I found myself accidentally quitting terminal multiple times by pressing Ctrl+D one too many times.
bartlomieju··on Ask HN: What things have richly rewarded the time invested in mastering them?
Can you reveal how you did that?

EDIT: typo

← PreviousPage 2 of 2