Our hobby is to create Nim libraries that end with y. Here is a list of our libraries and short description on why you should is them:
Most of them only depend on Nim Standard library or our other libraries.
All MIT licensed!
Pixie is a 2D graphics library similar to Cairo and Skia written entirely in Nim.
- Typesetting and rasterizing text, including styled rich text via spans.
- Drawing paths, shapes and curves with even-odd and non-zero windings.
- Pixel-perfect AA quality.
- Supported file formats are PNG, BMP, JPG, SVG + more in development.
- Strokes with joins and caps.
- Shadows, glows and blurs.
- Complex masking: Subtract, Intersect, Exclude.
- Complex blends: Darken, Multiply, Color Dodge, Hue, Luminosity... etc.
- Many operations are SIMD accelerated.
Simple WebSocket library for nim.
- Client and Server Side WebSocket
- Async/Await Support
- WebSocket Protocols
- Timeouts and Disconnects
- SSL support
- Jester support
- Compliant with the WebSocket protocol.
Zippy is an implementation of DEFLATE, ZLIB and GZIP data compression formats.
Zippy can also open ZIP archives (.zip) and Tarballs (.tar, .tar.gz, .tgz, .taz).
The goal of this library is to be a pure Nim implementation that is small, performant and dependency-free.
A loose, direct to object JSON parser and serializer with hooks.
Real world json is never what you want. It might have extra fields that you don't care about. It might have missing fields requiring default values. It might change or grow new fields at any moment. Json might use camelCase or snake_case. It might use inconsistent naming.
With this library you can use json your way, from the mess you get to the objects you want.
- Parses and serializes JSON very fast.
- newHook, postHook, enumHook, renameHook, parseHook, dumpHook, skipHook
- Support for JSON-in-JSON and raw JSON.
Mummy is a multi-threaded HTTP 1.1 and WebSocket server written entirely in Nim. Mummy has been written specifically to maximize the performance of your server hardware without compromising on programmer happiness.
- Supports HTTP keep-alive and gzip response compression automatically.
- Built-in first-class WebSocket support.
- Multiplexed socket IO without the {.async.} price.
Generate Nim library bindings for many languages
So you made a cool Nim library but you want it to be available to other languages as well. With genny
you can generate a dynamically linked library with a simple C API and generated bindings for many languages. In some ways its similar to SWIG project for C or djinni for C++.
Fetch resources via HTTP and HTTPS.
Puppy does not use Nim's HTTP stack, instead it uses WinHttp
API on Windows , AppKit
on macOS, and libcurl
on Linux. Because Puppy uses system APIs, there is no need to ship extra *.dll
s, cacert.pem
, or forget to pass the -d:ssl
flag. This also has the effect of producing slightly smaller binaires.
Reliable UDP connection for Nim.
Netty is a reliable connection over UDP aimed at games. Normally UDP packets can get duplicated, dropped, or come out of order. Netty makes sure packets are not duplicated, re-sends them if they get dropped, and all packets come in order. UDP packets might also get split if they are above 512 bytes and also can fail to be sent if they are bigger than 1-2k. Netty breaks up big packets and sends them in pieces making sure each piece comes reliably in order. Finally sometimes it's impossible for two clients to communicate direclty with TCP because of NATs, but Netty provides hole punching which allows them to connect.
Nim to GPU shader language compiler and supporting utilities.
Shady can compile a subset of Nim into OpenGL Shader Language
used by the GPU. This allows you to test your shader code with echo
statements on the CPU and then run the exact same code on the GPU.
- Write vertex and fragment/pixel shaders for games and 3d applications.
- Write compute shaders for offline processing and number crunching.
Everything you want to do with colors.
- Color spaces:
CMY
,CMYK
,HSL
,HSV
,YUV
,XYZ
,LAB
,CIELCh
,LUV
,CIELCH
,Oklab
- Easily parse and transform colors.
FFFFFF
,#FFFFFF
,rgb(255, 255, 255)
,rgba(255, 255, 255, 1.0)
- Optimized to be fast and consistent.
Windy will work great for 2D and 3D OpenGL games as well as GUI apps using OpenGL. Using this library should feel similar to GLFW or SDL.
Features:
- Multi-platform (Windows, macOS, Linux)
- Manage one or many windows
- Customizable windows (resizable, hidden, fullscreen and more)
- Use custom window icons and cursors
- DPI and content-scaling aware
- Mouse input (position, clicks, scroll)
- Double-click, triple-click and quadruple-click events
- Keyboard input (key events + unicode)
- Easy polling of keyboard state via buttonDown[Button] and more
- IME support (for Chinese, Japanese etc text input)
- System clipboard (copy and paste) support
- Show a system tray icon and menu (Windows only)
- Non-blocking HTTP requests and WebSockets
- Basic Example
Boxy is an easy to use 2D GPU rendering API built on top of Pixie.
The basic model for using Boxy goes something like this:
- Open a window and prepare an OpenGL context.
- Load image files like .png using Pixie.
- Render any dynamic assets (such as text) into images once using Pixie.
- Add these images to Boxy, where they are put into a tiling atlas texture.
- Draw these images to screen each frame.
Serializer and tools for flat binary blobs.
- Aim of
flatty
is to be the fastest and simplest serializer/deserializer for Nim. - Also includes
hexprint
to print out binary data. - Also includes
binny
a simpler replacement for StringStream (no IO effects, operates on a string) - Also includes
hashy
a hash for any objects based on the flatty serializer. - Also includes
encode
a way to convert to/from utf16 BE/LE and with BOM and utf32.
Vector math routines for 2d and 3d graphics.
- Pure Nim with no dependencies.
- 2D & 3D matrix math
- Transform, Rotation and Scale Matrixes
- All (
vec3
,ivec3
,dvec3
,uvec3
,bvec3
, ...) GLSL types! - Very similar to GLSL Shader Language with extra stuff.
- Extensively benchmarked.
Supersnappy is a pure Nim implementation of Google's Snappy compression algorithm. The goal of this library is to be small, straightforward, dependency-free and highly performant.
Benchmarking shows this library performs significantly better in all cases than alternatives even the original C++ reference implementation.
Timestamps, Calendars, and Timezones library for nim.
- Parse Timestamps
- Format Timestamps
- Manipulate Calendars
- Use Timezones
- In JS mode: only ship the Timezones you use.
Simple benchmarking to time your code.
Just put your code in a timeIt
block. Also put result of your computation into keep()
so that compiler does not optimize it out. Don't forgot to run with -d:release
or better yet -d:danger
.
Spatial data structures for Nim.
Spatial algorithms are used to find the "closest" things faster than simple brute force iteration would. They make your code run faster using smarter data structures. This library has different "Spaces" that you can use to speed up games and graphical applications.
- BruteSpace (for loop)
- SortSpace (quick sort)
- HashSpace (2d hash table)
- QuadSpace (Quad-tree)
- KdSpace (KD-tree)
Orbits are beautiful, with their gentle curves and sweeping arcs. They have captivated astronomers for thousands of years and have made mathematics and physics to what they are today. There is so much to the orbits if you dig dipper. Where do you get most accurate data? How do you compute transfer windows? Can you plot trajectories of spacecraft? This is what this library is about. An exploration of deep beyond with Nim at your side.
- Simple Elliptical Orbits
- Kernel Files Orbits (NASA's .bsp SPICE SP-kernels)
- JPL Horizon Orbits
- Simulations
- Astrometry
2D geometry intersections library for Nim.
- Point
- Circle
- Rectangle
- Segment
- Polygon
- Line
Webby is a collection of common HTTP data structures and functionality. This includes things parsing and generating:
- Url
- HTTP headers
- Query Parameters
3D Sound API for Nim.
.wav
and.ogg
loading.- 3d positions of sounds.
- 3d position of listener.
- Doppler shift.
- Acoustic attenuation.
1D and 2D bit arrays and operations.
If you have types like seq[bool]
in your code, switching to bit arrays will cut down on space used.
Hide data inside an image. Encode and decode images.
- HTML Parser/Serializer
- XML Parser/Serializer
- Static HTML Generator
- Static CSS Generator
Fast CSV parser with hooks.
This library parses .csv
or .tsv
files directly into Nim objects. This is different from how Nim's standard library parsecsv works which first parses them into an intermediate representation. This makes tabby
generate fewer memory allocations.
Pleasant Nim bindings for various SIMD instructions.
- SSE
- SSE2
- SSE3
- SSSE3
- SSE4.1
- SSE4.2
- AVX
- AVX2
- PCLMULQDQ
Redis client that is built to work well in multi-threaded programs. A great use-case for Ready is in a multi-threaded HTTP server like Mummy.
Crunchy provides pure Nim implementations of common hashes and data integrity checks (cyclic redundancy checks and checksums). These implementations are intended to be high-performance, including amd64 and arm64 SIMD implementations or using instruction set intrinsics.
- SHA-256
- CRC-32
- CRC-32C
- Adler-32
Blocking WebSocket client. This library provides an alternative to async for situations where it is easier or more comfortable to write blocking code.
Curly makes pooling and reusing libcurl
handles easy.
Why pool and reuse libcurl
handles? Doing so enables reusing Keep-Alive connections. This is especially beneficial for servers frequently making requests to HTTPS endpoints by skipping the need to open a new connection and do a TLS handshake for every request.
JWTea enables the creation of JSON Web Tokens in pure Nim, without any dependency on OpenSSL or other external libraries. OpenSSL is one of the truly legendary sources of programmer pain so this repo was motivated by refusing that dependency.
- HS256
- RS256
A pretty prettying, better echo.
Use pretty
.print
the same way you would use echo
for pretty-debugging. It pretty prints objects the "Nim way" with syntax highlighting. Even with refs, pointers, or cycles!
We have written some libraries that we are not longer maintaining:
- Urlly - use Webby instead.
- Typography - use Pixie instead.
- StaticGLFW - use Windy instead.
- Flippy - use Pixie instead.
- Print - use Pretty instead.