1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
A modern runtime for JavaScript and TypeScript. https://deno.com/
Find a file
Aapo Alasuutari 73ed606bf6 feat(unstable): Improve FFI types (#20215)
Few improvements to FFI types:
1. Export `PointerObject` for convenience. It's fairly commonly used in
library code and thus should be exported.
2. Fix various comments around `PointerValue` and `UnsafePointer` and
expand upon them to better reflect reality.
3. Instead of using a `Record<"value", type>[T]` for determining the
type of an FFI symbol parameter use direct `T extends "value" ? type :
never` comparison.

The last part enables smuggling extra information into the parameter and
return value string declarations at the type level. eg. Instead of just
`"u8"` the parameter can be `"u8" & { [brand]: T }` for some `T extends
number`. That `T` can then be extracted from the parameter to form the
TypeScript function's parameter or return value type. Essentially, this
enables type-safe FFI!

The foremost use-cases for this are enums and pointer safety. These are
implemented in the second commit which should enable, in a backwards
compatible way, for pointer parameters to declare what sort of pointer
they mean, functions to declare what the API definition of the native
function is, and for numbers to declare what Enum they stand for (if
any).
2023-08-21 17:00:45 +05:30
.cargo fix: reload config files on watcher restarts (#19487) 2023-06-14 22:29:19 +00:00
.devcontainer chore: update devcontainer configuration (#15751) 2022-09-03 02:21:41 +02:00
.github ci: fix bench step (#20216) 2023-08-21 17:00:45 +05:30
bench_util 1.36.0 (#20036) 2023-08-03 18:26:25 +02:00
cli feat(unstable): Improve FFI types (#20215) 2023-08-21 17:00:45 +05:30
ext fix(ext/http): ensure request body resource lives as long as response is alive (#20206) 2023-08-21 17:00:45 +05:30
runtime fix(runtime): use host header for inspector websocket URL (#20171) 2023-08-21 17:00:45 +05:30
test_ffi feat(unstable): Improve FFI types (#20215) 2023-08-21 17:00:45 +05:30
test_napi fix(node): don't print warning on process.dlopen.flags (#20124) 2023-08-21 17:00:44 +05:30
test_util fix(unstable): disable importing from the vendor directory (#20067) 2023-08-21 17:00:45 +05:30
tools chore: remove third_party submodule (#20201) 2023-08-21 17:00:45 +05:30
.dlint.json chore: update dlint to v0.37.0 for GitHub Actions (#17295) 2023-01-16 17:17:18 +01:00
.dprint.json fix(fmt): do not insert expr stmt leading semi-colon in do while stmt body (#20093) 2023-08-08 09:15:19 -04:00
.editorconfig editorconfig: Don't insert final newline in .out files (#1686) 2019-02-07 11:31:49 -05:00
.gitattributes fix(test): support typechecking docs with CRLF line endings (#12748) 2021-11-15 09:58:04 -05:00
.gitignore chore: remove third_party submodule (#20201) 2023-08-21 17:00:45 +05:30
.gitmodules chore: remove third_party submodule (#20201) 2023-08-21 17:00:45 +05:30
.rustfmt.toml chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
Cargo.lock fix(cli): handle missing now field in cache (#20192) 2023-08-21 17:00:45 +05:30
Cargo.toml chore: deno_core -> 0.201.0 (#20135) 2023-08-21 17:00:44 +05:30
LICENSE.md chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
README.md docs: nitpick README (#19912) 2023-07-25 14:44:50 +09:00
Releases.md 1.36.0 (#20036) 2023-08-03 18:26:25 +02:00
rust-toolchain.toml chore: update to Rust 1.71 (#19822) 2023-07-13 15:16:24 -06:00

Deno

Twitter badge Discord badge YouTube badge

the deno mascot dinosaur standing in the rain

Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.

Features

Install

Shell (Mac, Linux):

curl -fsSL https://deno.land/install.sh | sh

PowerShell (Windows):

irm https://deno.land/install.ps1 | iex

Homebrew (Mac):

brew install deno

Chocolatey (Windows):

choco install deno

Scoop (Windows):

scoop install deno

Build and install from source using Cargo:

cargo install deno --locked

See deno_install and releases for other options.

Getting Started

Try running a simple program:

deno run https://deno.land/std/examples/welcome.ts

Or setup a simple HTTP server:

Deno.serve((_req) => new Response("Hello, World!"));

More Examples

Additional Resources

Contributing

We appreciate your help!

To contribute, please read our contributing instructions.