Находки в опенсорсе
10.6K subscribers
11 photos
1 video
3 files
816 links
Привет!

Меня зовут Никита Соболев. Я занимаюсь опенсорс разработкой полный рабочий день.

Тут я рассказываю про #python, #c, опенсорс и тд.
Поддержать: https://boosty.to/sobolevn
РКН: https://vk.cc/cOzn36

Связь: @sobolev_nikita
Download Telegram
​​A blazingly fast static web server in a single binary you can set up with zero code - written in #rust.

Features:
- Single binary with no dependencies and everything built-in.
- Blazingly fast! It's built on top of Actix, one of the fastest web frameworks in the world and of course, written in Rust.
- Everything in a single config file - everything you need to setup is in the binserve.json, just change it, run it!
- Epic Portability - just carry the binary around and all you have to change is the host and port in the binserve.json.
- Easiest Routing - you just have to enter the route and the static file to respond in the binserve.json to add a route entry!
- Handlebars template engine - renders every static file with Handlebars on the first run improving performance!
- Template Variables in one place - that too in the one and only config file!
- Secure by design - runs security validation checks on the first run and will only run the server once configuration is confirmed secure! (See Security)
- Config & Static File Assistance - just running it will create the configuration file and the static directory boilerplate for you!
- Supports Any Static Files - just give any static file of your choice to routes and response will match it's Content-Type.
- Straightforward Directory Structure - static files falls under the static directory, you can even change that! And images, css, and js falls under the assets directory which should all be created for you in the first run itself!
- Custom Error Page Support - you can design your own fancy error pages!
- Actix Logging Middleware - Logging is powered directly from Actix.

https://github.com/mufeedvh/binserve
​​Secure and fast microVMs for serverless computing.

Firecracker is an open source virtualization technology that is purpose-built for creating and managing secure, multi-tenant container and function-based services.

Firecracker enables you to deploy workloads in lightweight virtual machines, called microVMs, which provide enhanced security and workload isolation over traditional VMs, while enabling the speed and resource efficiency of containers. Firecracker was developed at Amazon Web Services to improve the customer experience of services like AWS Lambda and AWS Fargate .

Firecracker is a virtual machine monitor (VMM) that uses the Linux Kernel-based Virtual Machine (KVM) to create and manage microVMs. Firecracker has a minimalist design. It excludes unnecessary devices and guest functionality to reduce the memory footprint and attack surface area of each microVM. This improves security, decreases the startup time, and increases hardware utilization. Firecracker currently supports Intel CPUs, with AMD and Arm support in developer preview.

Firecracker is integrated with Kata Containers , Open Nebula , UniK , Weave FireKube (via Weave Ignite ), and containerd via firecracker-containerd It's also used by fly.io . Firecracker can run Linux and OSv guests.

https://github.com/firecracker-microvm/firecracker

#rust #devops
​​Cache the dependencies of your #rust project and speed up your Docker builds up to 5 times.

https://github.com/LukeMathWalker/cargo-chef

Announcement: https://www.lpalmieri.com/posts/fast-rust-docker-builds/
​​An independent #rust text editor that runs in your terminal!

Ox is a code editor. It was written in Rust using ANSI escape sequences. It assists developers with programming by providing several tools to speed up and make programming easier and a refreshing alternative to heavily bloated and resource hungry editors such as VS Code and JetBrains. Ox is lightweight so it can be used on older computers.

Bear in mind, this is a personal project and is nowhere near ready to replace your existing tools just yet.

It runs in the terminal and runs on platforms like Linux and macOS but doesn't work on Windows directly (it works if you use WSL) due to a lack of a good command line. There are many text editors out there and each one of them has their flaws and I hope to have a text editor that overcomes many of the burdens and issues.

Ox is not based on any other editor and has been built from the ground up without any base at all.

https://github.com/curlpipe/ox
​​Fast, consistent builds for Python and more. Pants v2 is a fast, scalable build system for growing codebases. It's currently focused on Python, with support for other languages coming soon.

> Installing, configuring and orchestrating the invocation of Python build tools like flake8, mypy, or tox—all while not re-executing work unnecessarily—is a hard problem, especially as your codebase grows. The lack of a robust, scalable build system for Python has been a problem for a long time, and this has become even more acute in recent years, with Python codebases increasing in size and complexity.

Some noteworthy features include:
- Minimal metadata and boilerplate
- Fine-grained workflow
- Shared result caching
- Concurrent execution
- A responsive, scalable UI
- Unified interface for multiple tools and languages
- Extensibility and customizability via a plugin API

https://www.pantsbuild.org/
Announcement: https://blog.pantsbuild.org/introducing-pants-v2/

Written in #python and #rust
​​Fuzzy Finder in #rust!

Half of our life is spent on navigation: files, lines, commands, etc. You need skim! It is a general fuzzy finder that saves you time. skim provides a single executable: sk. Basically anywhere you would want to use grep, try sk instead.

https://github.com/lotabout/skim
​​Command-line DNS #rust client

Dogs can look up!

dog is a command-line DNS client, like dig. It has colourful output, understands normal command-line argument syntax, supports the DNS-over-TLS and DNS-over-HTTPS protocols, and can emit JSON.

https://github.com/ogham/dog
​​Fast and simple Node #js version manager, built in #rust

Features:
- Cross-platform support (Mac, Windows, Linux)
- Single file, easy installation, instant startup
- Built with speed in mind
- Works with .node-version and .nvmrc files

https://github.com/Schniz/fnm
​​Type-safe, compiled Jinja-like templates for #rust

Askama implements a template rendering engine based on Jinja. It generates Rust code from your templates at compile time based on a user-defined struct to hold the template's context.

Feature highlights:
- Construct templates using a familiar, easy-to-use syntax
- Template code is compiled into your crate for optimal performance
- Benefit from the safety provided by Rust's type system
- Optional built-in support for Actix, Gotham, Iron, Rocket, tide, and warp web frameworks
- Debugging features to assist you in template development
- Templates must be valid UTF-8 and produce UTF-8 when rendered
- Works on stable Rust

https://github.com/djc/askama
An incremental parsing system for programming tools written in #rust

Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited.

Tree-sitter aims to be:
- General enough to parse any programming language
- Fast enough to parse on every keystroke in a text editor
- Robust enough to provide useful results even in the presence of syntax errors
- Dependency-free so that the runtime library (which is written in pure C) can be embedded in any application

https://github.com/tree-sitter/tree-sitter
My new article is out! It is all about typeclasses in Python and dry-python/classes.

Today I am explaining what typeclasses are and how to use them. I give examples in 4 very different languages: #rust, #elixir, #haskell, and #python to show that this concept is universal.

I am also showing that this idea is very pythonic by comparing our classes implementation with functools.singledispatch. There are lots of different details!

Check how easy it is to define a typeclass with classes:

from classes import AssociatedType, Supports, typeclass

class Greet(AssociatedType):
"""Special type to represent that some instance can `greet`."""

@typeclass(Greet)
def greet(instance) -> str:
"""No implementation needed."""

@greet.instance(str)
def _greet_str(instance: str) -> str:
return 'Hello, {0}!'.format(instance)

def greet_and_print(instance: Supports[Greet]) -> None:
print(greet(instance))

greet_and_print('world')


Check it out!
​​Flix: Next-generation reliable, safe, concise, and functional-first programming language.

Flix is inspired by OCaml and Haskell with ideas from Rust and Scala. Flix looks like Scala, but its type system is based on Hindley-Milner. Two unique features of Flix are its polymorphic effect system and its support for first-class Datalog constraints.

Flix aims to offer a unique combination of features that no other programming language offers, including: algebraic data types and pattern matching (like Haskell, OCaml), extensible records (like Elm), type classes (like #haskell, #rust), higher-kinded types (like Haskell), local type inference (like Haskell, OCaml), channel and process-based concurrency (like #go), a polymorphic effect system (unique feature), first-class Datalog constraints (unique feature), and compilation to JVM bytecode (like #scala).

https://flix.dev/

Personal opinion: it has all the features new modern programming language should have. It has nice syntax, powerful ideas, and (hopefully) good JVM integration and code-reuse. That's a recipe for a success. I will keep an eye on this amazing language.

It also has a playground on its website, check it out!
I would love to highlight this example of polymorphic effects:
Rust Memory Safety & Undefined Behavior Detection.

Rudra is a static analyzer to detect common undefined behaviors in #rust programs. It is capable of analyzing single Rust packages as well as all the packages on crates.io.

Features:
- Panic Safety (Unsafe code that can create memory-safety issues when panicked)
- Higher Order Invariant (Assumed properties about traits)
- Send Sync Variance (Unrestricted Send or Sync on generic types)

https://github.com/sslab-gatech/Rudra
#rust 1.55 is here.

New features:
- Cargo deduplicates compiler errors
- Faster, more correct float parsing
- std::io::ErrorKind variants updated
- Open range patterns added

https://blog.rust-lang.org/2021/09/09/Rust-1.55.0.html
​​TODOs you cannot forget!

In the Bad Old Days, if you had a bit of code you knew you needed to change later, you might leave yourself a code comment to remind yourself to change it. For example, here's the real world code comment that inspired this method:

class UsersController < ApiController
# TODO: remember to delete after JS app has propagated
def show
redirect_to root_path
end
end


This was bad. The comment did nothing to remind myself or anyone else to actually delete the code. Because no one was working on this part of the system for a while, the continued existence of the redirect eventually resulted in an actual support incident (long story).

To use it, try replacing one of your TODO comments with something like this:

class UsersController < ApiController
TodoOrDie("delete after JS app has propagated", by: "2019-02-04")
def show
redirect_to root_path
end
end


Nothing will happen at all until February 4th, at which point the gem will raise an error whenever this class is loaded until someone deals with it.

#ruby: https://github.com/searls/todo_or_die
#rust: https://github.com/davidpdrsn/todo-or-die
​​Like jq, but for HTML. Uses CSS selectors to extract bits of content from HTML files.

https://github.com/mgdm/htmlq

#rust
​​KDL is a document language with xml-like semantics that looks like you're invoking a bunch of CLI commands! It's meant to be used both as a serialization format and a configuration language, much like JSON, YAML, or XML.

Features:
- Node-based, you won't have to mess with identation to make it work
- Type annotations
- Implementations in different languages: #python, #elixir, #rust, #java, #js, #ruby, #php, etc

https://kdl.dev/
​​Flowistry is a VSCode extension that helps you understand #rust programs with program analysis.

Flowistry uses dataflow analysis and pointer analysis to analyze Rust programs at a deeper level than just types can offer (e.g. as you can already find in rust-analyzer).

Flowistry has five commands:
- Flowistry: Backward Highlight: given a selected variable, this command highlights the backward slice of the variable.
- Flowistry: Backward Select: same as above, but this puts the slice in your selection rather than highlighting it.
- Flowistry: Forward Highlight and Flowistry: Forward Select: same as above, but for forward slices than backward slices.
- Flowistry: Effects: given your cursor is within a particular function, this command opens the effects panel for that function.

https://github.com/willcrichton/flowistry
​​Seed is a #rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

Seed allows you to develop the front-end with all the benefits of Rust, meaning speed, safety, and too many more things to count.

The Seed templating system uses a macro syntax that makes Rustaceans feel right at home. This means linting, formatting, and commenting will work, and it's all in Rust. This is opposed to a JSX-like syntax that relies on IDE extensions to improve the developer experience.

Seed has a batteries-included approach. This means less time writing boilerplate and less time installing dependencies.

Features
- completely written in Rust, including the templating system (e.g. div! macro).
- built-in state management that is based on the Elm architecture.
- a batteries-included approach with a focus on developer experience.
- clear and extensive documentation for Rust beginners and pros alike.
- WebAssembly.

https://github.com/seed-rs/seed
​​A #rust graphical tool to visualize binary data.

It colorizes bytes according to different rules and renders them as pixels in a rectangular grid. This allows users to identify interesting parts in large files and to reveal image-like regions.

The program allows you to control various parameters like the offset into the file, the stride, the width of the rectangular grid as well as the way in which (groups of) bytes are colorized.

https://github.com/sharkdp/binocle