Skip to content

rainlanguage/rain.string

Repository files navigation

rain.string

Low-level string and parsing primitives used to build Rainlang. Specialised parsing logic lives in dedicated Rainlang repos; this is the broadly-applicable, gas-efficient base.

Parsing in Rainlang works like a bloom filter over individual characters. Read a byte from memory, bit-shift, compare against a 32-byte mask representing characters of interest (e.g. 0-9, or a-zA-Z0-9). No regexes, in-memory sets, or loops — every ASCII char fits unambiguously in a single 32-byte EVM word.

Install

Via soldeer:

forge soldeer install rain-string~<version>

Develop

This repo uses nix. The default shell is the slim sol-shell from rainix.

nix develop          # enter the shell
forge soldeer install # install deps declared in foundry.toml
forge test

Tasks:

  • rainix-sol-testforge test
  • rainix-sol-static — slither
  • rainix-sol-legalreuse lint

Use the nix-pinned forge for all development.

Publish

Tag v<x.y.z> on main. The Publish to Soldeer wrapper delegates to rainix's reusable workflow, which derives the package name from the repo name (rain.stringrain-string).

License

DecentraLicense 1.0 (DCL-1.0) — full text in LICENSES/. Roughly CAL-1.0 (opensource.org) plus user-data disclosure obligations consistent with permissionless-blockchain assumptions.

This repo is REUSE 3.2 compliant. Verify locally:

nix develop -c rainix-sol-legal

Contributions

Welcome under the same license. Contributors warrant that their contributions are compliant.

About

Broadly applicable tools for working with strings that are needed if you're writing an onchain language.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors