\n \n
\n\nA collection of Rust libraries oriented around implementing [Yjs](https://yjs.dev/) algorithm and protocol with cross-language and cross-platform support in mind. It aims to maintain behavior and binary protocol compatibility with Yjs, therefore projects using Yjs/Yrs should be able to interoperate with each other.\n\nProject organization:\n\n- **lib0** is a serialization library used for efficient (and fairly fast) data exchange.\n- **yrs** (read: *wires*) is a core Rust library, a foundation stone for other projects.\n- **yffi** (read: *wifi*) is a wrapper around *yrs* use to provide a native C foreign function interface. See also: [C header file](https://github.com/y-crdt/y-crdt/blob/main/tests-ffi/include/libyrs.h).\n- **ywasm** is a wrapper around *yrs* that targets Web Assembly and JavaScript API.\n\nOther projects using *yrs*:\n\n- [ypy](https://github.com/y-crdt/ypy) - Python bindings.\n- [yrb](https://github.com/y-crdt/yrb) - Ruby bindings.\n\n## Feature parity with Yjs project\n\n- Supported collaborative types:\n - [x] Text\n - [x] text insertion (with variable offsets including configurable UTF-8, UTF-16 and UTF-32 mappings)\n - [x] embedded elements insertion\n - [x] insertion of formatting attributes\n - [x] observe events and deltas\n - [x] Map\n - [x] insertion, update and removal of primitive JSON-like elements\n - [x] recursive insertion, update and removal of other collaborative elements of any type\n - [x] observe events and deltas\n - [x] deep observe events bubbling up from nested collections\n - [x] Array\n - [x] insertion and removal of primitive JSON-like elements\n - [x] recursive insertion of other collaborative elements of any type\n - [x] observe events and deltas\n - [x] deep observe events bubbling up from nested collections\n - [x] move index positions\n - [x] XmlElement\n - [x] insertion, update and removal of XML attributes\n - [x] insertion, update and removal of XML children nodes\n - [x] observe events and deltas\n - [x] deep observe events bubbling up from nested collections\n - [x] XmlText\n - [x] insertion, update and removal of XML attributes\n - [x] text insertion (with variable offsets including configurable UTF-8, UTF-16 and UTF-32 mappings)\n - [x] observe events and deltas\n - [x] XmlFragment\n - [x] XmlHook (*deprecated*)\n - [x] Sub documents\n - [x] Transaction origin\n - [x] Undo/redo manager\n- Encoding formats:\n - [x] lib0 v1 encoding\n - [x] lib0 v2 encoding\n- Transaction events:\n - [x] on event update\n - [x] on after transaction\n\n## Maintainers\n\n- [Bartosz Sypytkowski](https://github.com/Horusiath)\n- [Kevin Jahns](https://github.com/dmonad)\n- [John Waidhofer](https://github.com/Waidhoferj)\n\n## Sponsors\n\n[![NLNET](https://nlnet.nl/image/logo_nlnet.svg)](https://nlnet.nl/)\n\n[![Ably](https://ably.com/assets/ably_ui/core/images/ably-logo-ad51bb21f40afd34a70df857594d6b7b84f6ceca0518f1d4d94e2b9579486351.png)](https://ably.com/)", "readme_type": "markdown", "hn_comments": "", "gh_updated_time": "", "gh_accessed_time": "", "hn_accessed_time": ""}, {"name": "rust-num/num", "link": "https://github.com/rust-num/num", "tags": ["rust", "number", "trait", "numeric-types", "num"], "stars": 833, "description": "A collection of numeric types and traits for Rust.", "lang": "Rust", "repo_lang": "", "readme": "# num\n\n[![crate](https://img.shields.io/crates/v/num.svg)](https://crates.io/crates/num)\n[![documentation](https://docs.rs/num/badge.svg)](https://docs.rs/num)\n[![minimum rustc 1.31](https://img.shields.io/badge/rustc-1.31+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)\n[![build status](https://github.com/rust-num/num/workflows/master/badge.svg)](https://github.com/rust-num/num/actions)\n\nA collection of numeric types and traits for Rust.\n\nThis includes new types for big integers, rationals (aka fractions), and complex numbers,\nnew traits for generic programming on numeric properties like `Integer`,\nand generic range iterators.\n\n`num` is a meta-crate, re-exporting items from these sub-crates:\n\n| Repository | Crate | Documentation |\n| ---------- | ----- | ------------- |\n| [`num-bigint`] | [![crate][bigint-cb]][bigint-c] | [![documentation][bigint-db]][bigint-d]\n| [`num-complex`] | [![crate][complex-cb]][complex-c] | [![documentation][complex-db]][complex-d]\n| [`num-integer`] | [![crate][integer-cb]][integer-c] | [![documentation][integer-db]][integer-d]\n| [`num-iter`] | [![crate][iter-cb]][iter-c] | [![documentation][iter-db]][iter-d]\n| [`num-rational`] | [![crate][rational-cb]][rational-c] | [![documentation][rational-db]][rational-d]\n| [`num-traits`] | [![crate][traits-cb]][traits-c] | [![documentation][traits-db]][traits-d]\n| ([`num-derive`]) | [![crate][derive-cb]][derive-c] | [![documentation][derive-db]][derive-d]\n\nNote: `num-derive` is listed here for reference, but it's not directly included\nin `num`. This is a `proc-macro` crate for deriving some of `num`'s traits.\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nnum = \"0.4\"\n```\n\n## Features\n\nThis crate can be used without the standard library (`#![no_std]`) by disabling\nthe default `std` feature. Use this in `Cargo.toml`:\n\n```toml\n[dependencies.num]\nversion = \"0.4\"\ndefault-features = false\n```\n\nThe `num-bigint` crate requires the `std` feature, or the `alloc` feature may\nbe used instead with Rust 1.36 and later. Other sub-crates may also have\nlimited functionality when used without `std`.\n\nThe `libm` feature uses pure-Rust floating point implementations in `no_std`\nbuilds, enabling the `Float` trait and related `Complex` methods.\n\nThe `rand` feature enables randomization traits in `num-bigint` and\n`num-complex`.\n\nThe `serde` feature enables serialization for types in `num-bigint`,\n`num-complex`, and `num-rational`.\n\nThe `num` meta-crate no longer supports features to toggle the inclusion of\nthe individual sub-crates. If you need such control, you are recommended to\ndirectly depend on your required crates instead.\n\n## Releases\n\nRelease notes are available in [RELEASES.md](RELEASES.md).\n\n## Compatibility\n\nThe `num` crate as a whole is tested for rustc 1.31 and greater.\n\nThe `num-traits`, `num-integer`, and `num-iter` crates are individually tested\nfor rustc 1.8 and greater, if you require such older compatibility.\n\n## License\n\nLicensed under either of\n\n * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n * [MIT license](http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n\n[`num-bigint`]: https://github.com/rust-num/num-bigint\n[bigint-c]: https://crates.io/crates/num-bigint\n[bigint-cb]: https://img.shields.io/crates/v/num-bigint.svg\n[bigint-d]: https://docs.rs/num-bigint/\n[bigint-db]: https://docs.rs/num-bigint/badge.svg\n\n[`num-complex`]: https://github.com/rust-num/num-complex\n[complex-c]: https://crates.io/crates/num-complex\n[complex-cb]: https://img.shields.io/crates/v/num-complex.svg\n[complex-d]: https://docs.rs/num-complex/\n[complex-db]: https://docs.rs/num-complex/badge.svg\n\n[`num-derive`]: https://github.com/rust-num/num-derive\n[derive-c]: https://crates.io/crates/num-derive\n[derive-cb]: https://img.shields.io/crates/v/num-derive.svg\n[derive-d]: https://docs.rs/num-derive/\n[derive-db]: https://docs.rs/num-derive/badge.svg\n\n[`num-integer`]: https://github.com/rust-num/num-integer\n[integer-c]: https://crates.io/crates/num-integer\n[integer-cb]: https://img.shields.io/crates/v/num-integer.svg\n[integer-d]: https://docs.rs/num-integer/\n[integer-db]: https://docs.rs/num-integer/badge.svg\n\n[`num-iter`]: https://github.com/rust-num/num-iter\n[iter-c]: https://crates.io/crates/num-iter\n[iter-cb]: https://img.shields.io/crates/v/num-iter.svg\n[iter-d]: https://docs.rs/num-iter/\n[iter-db]: https://docs.rs/num-iter/badge.svg\n\n[`num-rational`]: https://github.com/rust-num/num-rational\n[rational-c]: https://crates.io/crates/num-rational\n[rational-cb]: https://img.shields.io/crates/v/num-rational.svg\n[rational-d]: https://docs.rs/num-rational/\n[rational-db]: https://docs.rs/num-rational/badge.svg\n\n[`num-traits`]: https://github.com/rust-num/num-traits\n[traits-c]: https://crates.io/crates/num-traits\n[traits-cb]: https://img.shields.io/crates/v/num-traits.svg\n[traits-d]: https://docs.rs/num-traits/\n[traits-db]: https://docs.rs/num-traits/badge.svg\n", "readme_type": "markdown", "hn_comments": "", "gh_updated_time": "", "gh_accessed_time": "", "hn_accessed_time": ""}, {"name": "aws/s2n-quic", "link": "https://github.com/aws/s2n-quic", "tags": ["quic", "rust", "cryptography", "s2n"], "stars": 833, "description": "An implementation of the IETF QUIC protocol", "lang": "Rust", "repo_lang": "", "readme": "# s2n-quic\n\n`s2n-quic` is a Rust implementation of the [IETF QUIC protocol](https://quicwg.org/), featuring:\n\n- a simple, easy-to-use API. See [an example](https://github.com/aws/s2n-quic/blob/main/examples/echo/src/bin/quic_echo_server.rs) of an s2n-quic echo server built with just a few API calls\n- high configurability using [providers](https://docs.rs/s2n-quic/latest/s2n_quic/provider/index.html) for granular control of functionality\n- extensive automated testing, including fuzz testing, integration testing, unit testing, snapshot testing, efficiency testing, performance benchmarking, interoperability testing and [more](https://github.com/aws/s2n-quic/blob/main/docs/ci.md)\n- integration with [s2n-tls](https://github.com/aws/s2n-tls), AWS's simple, small, fast and secure TLS implementation, as well as [rustls](https://crates.io/crates/rustls)\n- thorough [compliance coverage tracking](https://github.com/aws/s2n-quic/blob/main/docs/ci.md#compliance) of normative language in relevant standards\n- and much more, including [CUBIC congestion controller](https://www.rfc-editor.org/rfc/rfc8312.html) support, [packet pacing](https://www.rfc-editor.org/rfc/rfc9002.html#name-pacing), [Generic Segmentation Offload](https://lwn.net/Articles/188489/) support, [Path MTU discovery](https://www.rfc-editor.org/rfc/rfc8899.html), and unique [connection identifiers](https://www.rfc-editor.org/rfc/rfc9000.html#name-connection-id) detached from the address\n\nSee the [API documentation](https://docs.rs/s2n-quic) and [examples](https://github.com/aws/s2n-quic/tree/main/examples) to get started with `s2n-quic`.\n\n[![Crates.io][crates-badge]][crates-url]\n[![docs.rs][docs-badge]][docs-url]\n[![Apache 2.0 Licensed][license-badge]][license-url]\n[![Build Status][actions-badge]][actions-url]\n[![Dependencies][dependencies-badge]][dependencies-url]\n[![MSRV][msrv-badge]][msrv-url]\n\n## Installation\n\n`s2n-quic` is available on `crates.io` and can be added to a project like so:\n\n```toml\n[dependencies]\ns2n-quic = \"1\"\n```\n\n**NOTE**: On unix-like systems, [`s2n-tls`](https://github.com/aws/s2n-tls) will be used as the default TLS provider and requires a C compiler to be installed.\n\n## Example\n\nThe following implements a basic echo server and client. The client connects to the server and pipes its `stdin` on a stream. The server listens for new streams and pipes any data it receives back to the client. The client will then pipe all stream data to `stdout`.\n\n### Server\n\n```rust\n// src/bin/server.rs\nuse s2n_quic::Server;\nuse std::error::Error;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box\n | \n |
\n \n \n \n
\n\n## Features\n\n- Clean UI: consecutive join/part/quit messages are shown in a single line, time\n stamps for a message is omitted if it's the same as the message before.\n (inspired by [irc-core](https://github.com/glguy/irc-core))\n\n- All mentions to the user are collected in a \"mentions\" tab, including server\n and channel information. \"mentions\" tab solves the problem of missing mentions\n to you in channels after hours of inactivity.\n\n- Mentions to the user in a channel is highlighted (the channel tab is also\n highlighted in the tab list)\n\n- Simple config file format for automatically connecting to servers, joining\n channels, registering the nickname etc. See [configuration\n section](#configuration) below.\n\n- Nick tab-completion in channels\n\n- Nicks in channels are colored.\n\n- Disconnect detection and automatic reconnects. You can keep tiny running on\n your laptop and it automatically reconnects after a sleep etc.\n\n- Configurable key bindings inspired by terminal emulators and vim. See [key\n bindings section](#key-bindings) below.\n\n- Configurable colors\n\n- SASL authentication\n\n- Configurable desktop notifications on new messages (opt-in feature behind a\n feature flag, see below)\n\n- znc compatible\n\n- TLS support\n\n## Installation\n\ntiny works on Linux and OSX. Windows users can run it under Windows Subsystem\nfor Linux.\n\nFor pre-built binaries see [releases]. To build from source make sure you have\nRust 1.48 or newer. By default tiny uses [rustls] for TLS support, and desktop\nnotifications are disabled.\n\n[releases]: https://github.com/osa1/tiny/releases\n[rustls]: https://github.com/ctz/rustls\n\n- To use system TLS library (OpenSSL or LibreSSL), add `--no-default-features\n --features=tls-native` to the command you're using. Note that this requires\n OpenSSL or LibreSSL headers and runtime libraries on Linux.\n\n- To enable desktop notifications add `--features=desktop-notifications`. This\n requires libdbus on Linux.\n\nTo install in a clone:\n\n```\ncargo install --path crates/tiny\n```\n\nIf you don't want to clone the repo, you can use\n\n```\ncargo install --git https://github.com/osa1/tiny\n```\n\nIf you have an older version installed, add `--force` to the command you're\nusing.\n\nArch Linux users can install tiny from [AUR].\n\n[AUR]: https://aur.archlinux.org/packages/tiny-irc-client-git/\n\ntiny is tested on Linux and OSX.\n\n## Configuration\n\ntiny looks for these places for a config file:\n\n- On Linux: `$XDG_CONFIG_HOME/tiny/config.yml`, on macOS:\n `$HOME/Library/Application Support/tiny/config.yml`\n- (when not found) `$HOME/.config/tiny/config.yml`\n- (when not found, deprecated) `$HOME/.tinyrc.yml`\n\nWhen a config file is not found in one of these locations tiny creates one in\nthe first path above with defaults and exits, printing path to the config file.\nEdit that file before re-running tiny to change the defaults.\n\n**A note on nick identification:** Some IRC servers such as ircd-seven (used by\nFreenode) and InspIRCd (used by Mozilla) support identification via the `PASS`\ncommand. This way of identification (rather than sending a message to a service\nlike `NickServ`) is better when some of the channels that you automatically\njoin require identification. To use this method enter your nick password to the\n`pass` field in servers.\n\n### Using external commands for passwords\n\nWhen a password field in the config file is a map with a `command` key, the\nvalue is used as the shell command to run to get the password.\n\nFor example, in this config:\n\n```yaml\nsasl:\n username: osa1\n password:\n command: 'pass show \"my irc password\"'\n```\n\ntiny runs the `pass ...` command and uses last line printed by the command as\nthe password.\n\n## Command line arguments\n\nBy default (i.e. when no command line arguments passed) tiny connects to all\nservers listed in the config. tiny considers command line arguments as patterns\nto be matched in server addresses, so you can pass command line arguments to\nconnect to only a subset of servers specified in the config. For example, in\nthis config:\n\n```yaml\nservers:\n - addr: chat.freenode.net\n ...\n\n - addr: irc.gnome.org\n ...\n```\n\nBy default tiny connects to both servers. You can connect to only the first\nserver by passing `freenode` as a command line argument.\n\nYou can use `--config\n \n
\n\n\n \n
\nNatural language detection for Rust with focus on simplicity and performance.
\n\n\n\n\n[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua/)\n\n## Content\n* [Features](#features)\n* [Get started](#get-started)\n* [Who uses Whatlang?](#who-uses-whatlang)\n* [Documentation](https://docs.rs/whatlang)\n* [Supported languages](https://github.com/greyblake/whatlang-rs/blob/master/SUPPORTED_LANGUAGES.md)\n* [Feature toggles](#feature-toggles)\n* [How does it work?](#how-does-it-work)\n * [How language recognition works?](#how-language-recognition-works)\n * [How is_reliable calculated?](#how-is_reliable-calculated)\n* [Running benchmark](#running-benchmarks)\n* [Comparison with alternatives](#comparison-with-alternatives)\n* [Ports and clones](#ports-and-clones)\n* [Donations](#donations)\n* [Derivation](#derivation)\n* [License](#license)\n* [Contributors](#contributors)\n\n\n## Features\n* Supports [69 languages](https://github.com/greyblake/whatlang-rs/blob/master/SUPPORTED_LANGUAGES.md)\n* 100% written in Rust\n* Lightweight, fast and simple\n* Recognizes not only a language, but also a script (Latin, Cyrillic, etc)\n* Provides reliability information\n\n## Get started\n\nExample:\n\n```rust\nuse whatlang::{detect, Lang, Script};\n\nfn main() {\n let text = \"\u0108u vi ne volas eklerni Esperanton? Bonvolu! Estas unu de la plej bonaj aferoj!\";\n\n let info = detect(text).unwrap();\n assert_eq!(info.lang(), Lang::Epo);\n assert_eq!(info.script(), Script::Latin);\n assert_eq!(info.confidence(), 1.0);\n assert!(info.is_reliable());\n}\n```\n\nFor more details (e.g. how to blacklist some languages) please check the [documentation](https://docs.rs/whatlang).\n\n## Who uses Whatlang?\n\nWhatlang is used within the following big projects as direct or indirect dependency for language recognition.\nYou're gonna be in a great company using Whatlang:\n\n* [Sonic](https://github.com/valeriansaliou/sonic) - fast, lightweight and schema-less search backend in Rust.\n* [Meilisearch](https://github.com/meilisearch) - an open-source, easy-to-use, blazingly fast, and hyper-relevant search engine built in Rust.\n\n## Feature toggles\n\n| Feature | Description |\n|-------------|---------------------------------------------------------------------------------------|\n| `enum-map` | `Lang` and `Script` implement `Enum` trait from [enum-map](https://docs.rs/enum-map/) |\n| `arbitrary` | Support [Arbitrary](https://crates.io/crates/arbitrary) |\n| `dev` | Enables `whatlang::dev` module which provides some internal API. \n \n
It exists for profiling purposes and normal users are discouraged to to rely on this API. |\n\n## How does it work?\n\n### How does the language recognition work?\n\nThe algorithm is based on the trigram language models, which is a particular case of n-grams.\nTo understand the idea, please check the original whitepaper [Cavnar and Trenkle '94: N-Gram-Based Text Categorization'](https://www.researchgate.net/publication/2375544_N-Gram-Based_Text_Categorization).\n\n### How is `is_reliable` calculated?\n\nIt is based on the following factors:\n* How many unique trigrams are in the given text\n* How big is the difference between the first and the second(not returned) detected languages? This metric is called `rate` in the code base.\n\nTherefore, it can be presented as 2d space with threshold functions, that splits it into \"Reliable\" and \"Not reliable\" areas.\nThis function is a hyperbola and it looks like the following one:\n\n\n\nFor more details, please check a blog article [Introduction to Rust Whatlang Library and Natural Language Identification Algorithms](https://www.greyblake.com/blog/introduction-to-rust-whatlang-library-and-natural-language-identification-algorithms/).\n\n## Make tasks\n\n* `make bench` - run performance benchmarks\n* `make doc` - generate and open doc\n* `make test` - run tests\n* `make watch` - watch changes and run tests\n\n## Comparison with alternatives\n\n| | Whatlang | CLD2 | CLD3 |\n| ------------------------- | ---------- | ----------- | -------------- |\n| Implementation language | Rust | C++ | C++ |\n| Languages | 68 | 83 | 107 |\n| Algorithm | trigrams | quadgrams | neural network |\n| Supported Encoding | UTF-8 | UTF-8 | ? |\n| HTML support | no | yes | ? |\n\n\n## Ports and clones\n\n* [whatlang-ffi](https://github.com/greyblake/whatlang-ffi) - C bindings\n* [whatlanggo](https://github.com/abadojack/whatlanggo) - whatlang clone for Go language\n* [whatlang-py](https://github.com/cathalgarvey/whatlang-py) - bindings for Python\n* [whatlang-rb](https://gitlab.com/KitaitiMakoto/whatlang-rb) - bindings for Ruby\n* [whatlangex](https://github.com/pierrelegall/whatlangex) - bindings for Elixir\n\n## Donations\n\nYou can support the project by donating [NEAR tokens](https://near.org).\n\nOur NEAR wallet address is `whatlang.near`\n\n## Derivation\n\n**Whatlang** is a derivative work from [Franc](https://github.com/wooorm/franc) (JavaScript, MIT) by [Titus Wormer](https://github.com/wooorm).\n\n## License\n\n[MIT](https://github.com/greyblake/whatlang-rs/blob/master/LICENSE) \u00a9 [Sergey Potapov](http://greyblake.com/)\n\n\n## Contributors\n\n- [greyblake](https://github.com/greyblake) Potapov Sergey - creator, maintainer.\n- [Dr-Emann](https://github.com/Dr-Emann) Zachary Dremann - optimization and improvements\n- [BaptisteGelez](https://github.com/BaptisteGelez) Baptiste Gelez - improvements\n- [Vishesh Chopra](https://github.com/KarmicKonquest) - designed the logo\n- [Joel Natividad](https://github.com/jqnatividad) - support of Tagalog\n- [ManyTheFish](https://github.com/ManyTheFish) - crazy optimization\n- [Kerollmops](https://github.com/Kerollmops) Cl\u00e9ment Renault - crazy optimization\n", "readme_type": "markdown", "hn_comments": "", "gh_updated_time": "", "gh_accessed_time": "", "hn_accessed_time": ""}, {"name": "chiselstrike/chiselstrike", "link": "https://github.com/chiselstrike/chiselstrike", "tags": ["framework", "javascript", "runtime", "typescript", "backend", "rust"], "stars": 822, "description": "ChiselStrike abstracts common backends components like databases and message queues, and let you drive them from a convenient TypeScript business logic layer", "lang": "Rust", "repo_lang": "", "readme": "![banner](imgs/logo.png)\n\n---\n\n[![Build Status](https://github.com/chiselstrike/chiselstrike/workflows/Rust/badge.svg?event=push&branch=main)](https://github.com/chiselstrike/chiselstrike/actions)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](https://github.com/chiselstrike/chiselstrike/blob/master/LICENSE)\n[![Discord](https://img.shields.io/discord/933071162680958986?color=5865F2&label=discord&logo=discord&logoColor=8a9095)](https://discord.gg/GHNN9CNAZe)\n[![Twitter](https://img.shields.io/twitter/follow/chiselstrike?style=plastic)](https://twitter.com/chiselstrike)\n\n## What is ChiselStrike?\n\nChiselStrike is a complete backend bundled in one piece. Your one stop-shop for all\nyour backend needs, powered by TypeScript.\n\n## Why ChiselStrike?\n\nPutting together a backend is hard work. Databases? ORM? Business logic? Data\naccess policies? And how to offer all of that through an API?\n\nLearning all that, plus figuring out the interactions between all the\ncomponents can be a drain on an application developer's time. Low-code\nbased approaches allow for super fast prototypes, but as you need to scale and\nevolve, the time you saved on the prototype is now owed with interest in refactorings,\nmigrations, etc.\n\nChiselStrike provides everything you need to handle and evolve your backend,\nfrom the data layer to the business logic, allowing you to focus on what you\ncare about \u2013\u00a0your code, rather than worrying about databases schemas,\nmigrations, or even database operations.\n\nAll driven by TypeScript, so your backend can evolve as your code evolves.\n\n## How does that work?\n\nChiselStrike keeps things as close as possible to pure TypeScript, and a\n[translation\nlayer](https://blog.chiselstrike.com/my-other-database-is-a-compiler-10fd527a4d78)\ntakes care of index creation, database query generation, and even communicating\nwith external systems like Kafka.\n\nInternally, ChiselStrike uses a SQLite database so there's no need to set up\nany external data layer (although it is possible to hook up an external\nPostgres-compatible database). ChiselStrike also abstract other concepts\ncommon to complex backends, like\n[Kafka-compatible](https://blog.chiselstrike.com/dear-application-developer-how-far-can-you-really-go-without-a-message-queue-d9e5385fab64)\nstreaming platforms.\n\n![](imgs/diagram.png)\n\n## Quick start\n\nTo get a CRUD API working in 30 seconds or less, first create a new project:\n\n```console\nnpx -y create-chiselstrike-app@latest my-app\ncd my-app\n```\n\nAdd a model by writing the following TypeScript code to `models/BlogComment.ts`:\n\n```typescript\nimport { ChiselEntity } from \"@chiselstrike/api\"\n\nexport class BlogComment extends ChiselEntity {\n content: string = \"\";\n by: string = \"\";\n}\n```\n\nAdd a route by writing the following TypeScript code to `routes/comments.ts`:\n\n```typescript\nimport { BlogComment } from \"../models/BlogComment\";\nexport default BlogComment.crud();\n```\n\nStart the development server with:\n\n```console\nnpm run dev\n```\n\nThis server will provide a CRUD API that you can use to add and query instances\nof the BlogComment entity.\n\n```console\ncurl -X POST -d '{\"content\": \"First comment\", \"by\": \"Jill\"}' localhost:8080/dev/comments\n\ncurl localhost:8080/dev/comments\n```\n\nFor a more detailed tutorial about how to get started with ChiselStrike, follow\nour [Getting started tutorial](https://docs.chiselstrike.com/tutorials/getting-started/).\n\n### Is ChiselStrike a database?\n\nNo. The [founding team at ChiselStrike](https://chiselstrike.com/about-us) have written databases from scratch before and\nwe believe there are better things to do in life, like pretty much anything else. ChiselStrike comes bundled with SQLite,\nproviding developers with a zero-conf *relational-like abstraction* that allows one to think of backends\nfrom the business needs down, instead of from the database up.\n\nInstead, you can think of ChiselStrike as a big pool of global shared memory.\nThe data access API is an integral part of ChiselStrike and offers developers a way to just code, without\nworrying about the underlying database (anymore than you worry about what happens in each level of the memory hierarchy,\nmeaning some people do, but most people don't have to!).\n\nIn production, ChiselStrike can also hook up into a\n[Kafka-compatible](https://blog.chiselstrike.com/dear-application-developer-how-far-can-you-really-go-without-a-message-queue-d9e5385fab64)\nstreaming platform when available, and transparently drive both that and the database from a unified TypeScript/JavaScript abstraction.\n\n### Is ChiselStrike an ORM?\n\nKind of. ChiselStrike has some aspects that overlap with traditional ORMs, in that it allows you to access database abstractions\nin your programming language. However, in traditional ORMs you start from the database, and export it up. Changes\nare done to the database schema, which is then bubbled up through *migrations*, and elements of the database invariably leak\nto the API.\n\nChiselStrike, on the other hand, starts from your code and automates the decisions needed to implement that into the database, much\nlike what a [compiler](https://blog.chiselstrike.com/my-other-database-is-a-compiler-10fd527a4d78) would do.\n\nLet's look at [ChiselStrike's documentation](https://docs.chiselstrike.com/Intro/first) for an example of what's needed to create a comment on a blog post:\n\n```typescript\nimport { ChiselEntity } from \"@chiselstrike/api\"\n\nexport class BlogComment extends ChiselEntity {\n content: string = \"\";\n by: string = \"\";\n}\n```\n\nThe first thing you will notice is that there is no need to specify how those things map to the underlying database. No tracking\nof primary keys, column types, etc.\n\nNow imagine you need to start tracking whether this was created by a human or a bot. You can change your model\nto say:\n\n```typescript\nimport { ChiselEntity } from \"@chiselstrike/api\"\n\nexport class BlogComment extends ChiselEntity {\n content: string = \"\";\n by: string = \"\";\n isHuman: boolean = false;\n}\n```\n\nand that's it! There are no migrations and no need to alter a table.\n\nFurthermore, if you need to find all blog posts written by humans, you\ncan just write a lambda instead of trying to craft a database query in TypeScript:\n\n```typescript\nconst all = await BlogComment.findMany(p => p.isHuman);\n```\n\n### Is ChiselStrike a TypeScript runtime?\n\nChiselStrike includes a TypeScript runtime - the fantastic and beloved [Deno](https://github.com/denoland/deno). That's the last piece of the puzzle\nwith the data API and the database bundles. That allows you to develop everything locally from your laptop and integrate\nwith your favorite frontend framework. Be it Next.js, Gatsby, Remix, or any others - we're cool with all of them!\n\n### That's all fine and all, but I need more than that!\n\nWe hear you. No modern application is complete without authentication and security. ChiselStrike integrates with [next-auth](https://next-auth.js.org/)\nand allows you to specify authentication entities directly from your TypeScript models.\n\nYou can then add a policy file that details which fields can be accessed, and which endpoints are available.\n\nFor example, you can store the blog authors as part of the models,\n\n```typescript\nimport { ChiselEntity, AuthUser } from \"@chiselstrike/api\"\n\nexport class BlogComment extends ChiselEntity {\n content: string = \"\";\n @labels(\"protect\") author: AuthUser;\n}\n```\n\nand then write a policy saying that the users should only be able to see the posts that they themselves\noriginated:\n\n```yaml\nlabels:\n - name: protect\n transform: match_login\n```\n\nNow your security policies are declaratively applied separately from the code, and you can easily grasp what's\ngoing on.\n\n## In Summary\n\nChiselStrike provides everything you need to handle your backend, from the data layer to the business logic, wrapped in powerful abstractions that let you just code and not worry about handling databases schemas, migrations, and operations again.\n\nIt allows you to declaratively specify compliance policies around who can access the data and under which circumstances.\n\nYour ChiselStrike files can go into their own repo, or even better, into a subdirectory of your existing frontend repo. You can code your presentation and data layer together, and turn any frontend framework into a full-stack (including the database layer!) framework in minutes.\n\n## Contributing\n\nTo build and develop from source:\n\n```console\ngit submodule update --init --recursive\ncargo build\n```\n\nThat will build the `chiseld` server and `chisel` utility.\n\nYou can now use `create-chiselstrike-app` to install a local version of the API:\n```console\nnode ./packages/create-chiselstrike-app --chisel-version=\"file:../packages/chiselstrike-api\" my-backend\n```\n\nAnd then replace instances of `npm run` with direct calls to the new binaries. For example, instead of\n`npm run dev`, run\n\n```console\ncd my-backend\nnpm i esbuild\n../target/debug/chisel dev\n```\n\nAlso, consider:\n\n[Open (or fix!) an issue](https://github.com/chiselstrike/chiselstrike/issues) \ud83d\ude47\u200d\u2642\ufe0f\n\n[Join our discord community](https://discord.gg/GHNN9CNAZe) \ud83e\udd29\n\n[Start a discussion](https://github.com/chiselstrike/chiselstrike/discussions/) \ud83d\ude4b\u200d\u2640\ufe0f\n\n\n## Next steps?\n\nOur documentation (including a quick tutorial) is available at [docs.chiselstrike.com](https://docs.chiselstrike.com)\n", "readme_type": "markdown", "hn_comments": "", "gh_updated_time": "", "gh_accessed_time": "", "hn_accessed_time": ""}, {"name": "tyrchen/geektime-rust", "link": "https://github.com/tyrchen/geektime-rust", "tags": [], "stars": 820, "description": "\u6211\u7684\u6781\u5ba2\u65f6\u95f4 Rust \u8bfe\u7a0b\u7684\u4ee3\u7801\u4ed3\u5e93\uff0c\u968f\u8bfe\u7a0b\u66f4\u65b0", "lang": "Rust", "repo_lang": "", "readme": "#geektime-rust\n\nMy Geekbang Time [Rust Lesson 1](https://time.geekbang.org/column/intro/100085301) code repository, updated with the course\n\n![rust Lesson 1](images/rust_qr.jpg)", "readme_type": "markdown", "hn_comments": "", "gh_updated_time": "", "gh_accessed_time": "", "hn_accessed_time": ""}, {"name": "anp/moxie", "link": "https://github.com/anp/moxie", "tags": ["rust", "ui", "declarative-ui", "incremental"], "stars": 820, "description": "lightweight platform-agnostic tools for declarative UI", "lang": "Rust", "repo_lang": "", "readme": "\n\n# moxie\n\n![crates.io](https://img.shields.io/crates/v/moxie)\n![License](https://img.shields.io/crates/l/moxie.svg)\n[![codecov](https://codecov.io/gh/anp/moxie/branch/main/graph/badge.svg)](https://codecov.io/gh/anp/moxie)\n\n## More Information\n\nFor more information about the moxie project, see the [website](https://moxie.rs).\n\n## Contributing and Code of Conduct\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for overall contributing info and [CONDUCT.md](CODE_OF_CONDUCT.md)\nfor the project's Code of Conduct. The project is still early in its lifecycle but we welcome\nanyone interested in getting involved.\n\n## License\n\nLicensed under either of\n\n * [Apache License, Version 2.0](LICENSE-APACHE)\n * [MIT license](LICENSE-MIT)\n\nat your option.\n", "readme_type": "markdown", "hn_comments": "Frame rate probably