(Obsolete) Archive of Rant 3.x.

Overview

NOTICE: Repository Archived

As of 26.6.2020, Rant 3 is no longer supported and the repository is archived.

Check out Rant 4, a complete redesign and reimplementation of the Rant language!


Original readme:

Rant logo


Rant is an all-purpose procedural text engine that is most simply described as the opposite of Regex. It has been refined to include a dizzying array of features for handling everything from the most basic of string generation tasks to advanced dialogue generation, code templating, automatic formatting, and more.

The goal of the project is to enable developers of all kinds to automate repetitive writing tasks with a high degree of creative freedom.

Build status Build status
Join us on the official Discord server!

Features

  • Recursive, weighted branching with several selection modes
  • Queryable dictionaries
  • Automatic capitalization, rhyming, English indefinite articles, and multi-lingual number verbalization
  • Print to multiple separate outputs
  • Probability modifiers for pattern elements
  • Loops, conditional statements, and subroutines
  • Fully-functional object model
  • Import/Export resources easily with the .rantpkg format
  • Compatible with Unity 2017
  • And much, much, much more...

Examples

Liven up a narrative with a few simple queries.

<name-male> likes to <verb-transitive> <noun.pl> with <pro.dposs-male> pet <noun-animal> on <noun.pl  -dayofweek>.
Alick likes to mount shuttlecocks with his pet bat on Mondays.

Count to ten and spell it out.

[case:sentence][numfmt:verbal][rs:10;\s]{[rn].}
One. Two. Three. Four. Five. Six. Seven. Eight. Nine. Ten.

Write a poem

[rhyme:perfect]
The <noun(1)::&a> <verb.ed(1)-transitive::&a> the <adj::&a> <noun(1)::&a>.
The bread fed the red head.
The drug dug the smug plug.

NuGet

Rant is also available as a NuGet package. Enter this command in your package manager, and the latest version of Rant will automagically get installed in your project:

PM> Install-Package Rant

Or if development builds are your thing:

PM> Install-Package Rant -Pre

License

Rant is provided under The MIT License.

Improve Rant

If there is something you want fixed, added, or changed, feel free to submit an issue/pull request; I will try to get back to you within a day. If you would like to translate Rant into your native language, simply write a .lang file for it like this one here.

See CONTRIBUTING.md for a full guide on how you can help.

Rant Resources

Comments
  • Compiler rewrite

    Compiler rewrite

    Oh boy. It's working. See issue #83. Right now it's in a "the first properly working" state, so it still has work to do. The compiler-rewrite branch is now fully using this new one, there's no trace of the old, horrible switch-clause.

    I will keep on improving it, most likely refactoring some parselets (I'm looking at you, queries and functions).

    Feel free to ask anything about it, I'll try my best to justify my weird decisions for things. Do tell me if I forgot to implement something.

    There's a bunch of tests related to the compiler that fail, not too sure what to do with them. Make test follow the new compiler, make compiler follow the tests?

    You can merge this PR if you so wish, I'll keep working on this branch or on a new branch (something like compiler-improvement).

    (I set the milestone to Rant 3 as the original issue had it as well.)

    YESSS NOICE! 
    opened by Spanfile 13
  • .NET Standard support

    .NET Standard support

    I ran the migrate-2017 cli to update to the new csproj format (minimum requirements is now VS2017), and changed the Rant lib to .Net standard.

    Also changed the other projects to NET 4.7 (so it works with Standard)

    I haven't tested this properly in production yet, but the 244 tests ran absolutely fine.

    test-image

    The only thing I had to change manually was the Post-build event command-line, since docpal seems to exit with 9009 (might just have something weird with the path there)

    I'll comment on here if I find any issues after my changes.

    And a huge thanks for making this in the first place! Such a cool idea 👍

    I'm pretty glad .NET Core has matured a bit since this issue was posted, and allowed for a fairly quick and simple conversion.

    opened by igniuss 0
  • Console: fix crash on input EOF/redirection

    Console: fix crash on input EOF/redirection

    The Rant console currently crashes when the standard input is either manually closed (e.g. CTRL+D in a linux terminal) or redirected. This happens because the input loop doesn't check for EOF, and as a result can pass a null string to PrintOutput.

    The fix checks whether the string returned by Console.ReadLine is null, and returns gracefully if so.

    opened by Robzz 0
  • Output chain

    Output chain

    I replaced the entire output system with a new, better system that uses a linked list to store outputs buffers. It is designed to be easily extended for upcoming features.

    opened by TheBerkin 0
  • Precompute RantPattern tokens for huge perf boost

    Precompute RantPattern tokens for huge perf boost

    RantPattern's constructor uses GenerateTokens to split the given pattern into a lazy sequence of lexer tokens. When RantEngine.Do is called, it creates a new VM, which creates a new RantState, which creates a new PatternReader, which finally evaluates the given pattern's token sequence using .ToArray(). However, the results of the evaluation are not cached (IEnumerable won't do that automatically). This makes using RantPattern.FromString/FromFile mostly useless, since the pattern is parsed again and again for each iteration.

    The performance issue is fixed by calling .ToList() after GenerateTokens in RantPattern's constructor. This patch improves pattern evaluation performance by at least 15-25x in synthetic benchmarks.

    NOICE! 
    opened by paavohuhtala 0
  • Rhyme update!

    Rhyme update!

    Here's the rhyme update, giving you all sorts of rhyming power! It adds different rhyme modes, which will work with the rhyme carrier to generate rhymes of varying degrees of correctness. You can use the [rhymemode] function to select your modes. Separate multiple modes with a space (ex. [rhymemode: perfect forced slant_rhyme]). Here are the valid rhyme modes:

    • perfect - What everyone thinks of when they think of a rhyme. lime / sublime, picky / icky. This means that the first vowel sound after the primary stress and everything after it matches. This is the only default mode.
    • weak - Where the penultimate syllable is stressed and the final syllable rhymes. hammer / carpenter, coffin / raisin.
    • syllabic - The last syllables rhyme. senator / otter, knuckle / tentacle
    • semirhyme - Where the words would rhyme if not for the last syllable. broom / broomstick, viking / flamingo
    • forced - If you really, really need something that rhymes, try this. It's a bag of worms, but it can be funny.
    • slant_rhyme - The ending consonants match. trunk / skunk, rant / ant.
    • pararhyme - All the consonants match. tuna / teen, man / money, boat / bat.
    • alliteration - The beginning consonants match. leg / lady, dog / dude.
    opened by dialupnoises 0
  • Fix items without classes in the tree not being exported.

    Fix items without classes in the tree not being exported.

    Classes that have three or fewer items don't get their own directives. However, this would lead to items with those classes being unable to find a directive to put themselves under, and would just be ignored. This has been fixed and now FindDirectiveForClasses returns the "best match" (it returns itself if all of its children don't have the class).

    I actually am kind of confused why this works, but it does?

    opened by dialupnoises 0
  • Support class directives in dictionary table export.

    Support class directives in dictionary table export.

    I've finally (with the help of Stack Exchange) managed to create a way to regenerate class directives when exporting dictionary tables. It essentially generates a tree of class directives based on the method described in the Stack Exchange question I linked before, and then populates them with the dictionary entries. It's a whole bunch of recursion and Rohan would probably cry but it works (as far as I can tell)!

    opened by dialupnoises 0
  • Rant 3.0.0 Update

    Rant 3.0.0 Update

    • New arithmetic literal syntax
    • New carriers (associative, match-associative)
    • Carrier resetting
    • Exclusive query improvements
    • Optional classes
    • Lots of bugfixes
    opened by TheBerkin 0
Releases(v3.0.0)
  • v3.0.0(Apr 18, 2017)

    Rant 3.0 is a complete overhaul of many aspects of the previous major release. It includes a massive array of new features for blocks, queries, and text formatting, as well as a brand-new scripting system that integrates directly into the Rant framework, adding conditional statements, loops, variables, and more.

    Compiled patterns can be saved!

    You can now save compiled patterns as .rantpgm files so that you don't have to compile them every time they're loaded. Hooray for efficiency!

    Better error messages

    The compiler can now return multiple compiler errors, the runtime now includes a stack trace with runtime errors, and the snozzberries taste like snozzberries!

    Supercharged queries

    Along with significant improvements to query filters and the addition of the plural subtype, queries can now be dynamically constructed through "query-builder" functions for even more flexibility when making use of external dictionaries.

    Verbose character literals and better escape sequences

    A new language feature, the verbose character, has been introduced in v3, which enables users to insert any Unicode 9.0 character into their output by using its name (e.g. LATIN SMALL LETTER A WITH DIAERESIS). Escape sequences have been extended to allow surrogate pairs, as well.

    Arguments

    You can now pass arguments to patterns. This enables you to, for example, pass game state data to a pattern about player health to display a custom status message. Any C# object can be turned into an argument set.

    Extended synchronizer features

    Three new synchronizer modes have been added: ping, pong, and no-repeat. These modes complement the numerous other options with more diverse selection behaviors that simplify the creation of specific output patterns.

    Formatting

    RantFormat has been extended to allow customization of alphabet, number verbalization, and spacing. With the addition of a German preset, you can now use [numfmt:verbal] to count in German!

    Improved package workflow

    With this release is included a slick new command-line utility (RCT.exe) which includes a package builder. Packages now have unique IDs and can include dependencies, tags, author names, and more!

    New variable system

    The new variable system is built on top of the function framework, so you no longer have to learn a second scripting language to use it. This means that it is also opened up to all of the powerful string generation tools offered by Rant. With this system you can create, store, and manipulate numbers, strings, booleans, callbacks, and lists. You can even get/set global variables through Rant's C# API.

    Now in NEW German flavor!

    This version also includes a German localization of all warnings and error messages. Rant will automatically detect your system language and choose the appropriate translation.

    Source code(tar.gz)
    Source code(zip)
    Rant.3.zip(521.27 KB)
  • v2.0.0(Jun 29, 2015)

    What did we do in 2.0?

    • Rewrote the compiler.
    • Rewrote the runtime.
    • Created a scripting language.
    • Probably some other things too.

    Binaries are on NuGet!

    Source code(tar.gz)
    Source code(zip)
Owner
Robin Pederson
C# / Rust, mainly backend. Creator of @rant-lang
Robin Pederson
Multi-format archive and compression library

Welcome to libarchive! The libarchive project develops a portable, efficient C library that can read and write streaming archives in a variety of form

null 1.9k Dec 26, 2022
Import of the DIY Dynamic Template v2, retrieved from the Internet Archive

Dynamic Templates This is a copy of the D*I*Y Planner Dynamic Template application that was posted to diyplanner.com/node/6210 back in 2009,

Trammell Hudson 21 Aug 7, 2022
BakePKG is a package archive that can install itself without without a package manager.

BakePKG A bad way of packaging applications. Introduction BakePKG is a package archive that can install itself without without a package manager. The

bread 3 Sep 3, 2022
Archive of rendering applications.

RenderingArchive Archive of my old rendering applications. SoftwareRaytracer DeferredRenderer Deferred renderer with Blinn-Phong shading model. Has sh

null 1 Nov 10, 2021
Archive Extension Loader is a Cyberpunk 2077 mod that allows you to expand game resources that are currently not suitable for modifications without conflicts.

ArchiveXL Archive Extension Loader allows you to expand game resources that are currently not suitable for modifications without conflicts. Installati

Pavel Siberx 16 Nov 21, 2022
An archive of previous go-tun2socks version.

tun2socks A tun2socks implementation written in Go. forked & modified from eycorsican/go-tun2socks Preview Tun2socks status web view (-monitor option

Jason Lyu 4 Jul 5, 2022
The module for my life story archive that gives data and statistics for the family Kindle Fire.

By: Top README.md Read this article in a different language Sorted by: A-Z Sorting options unavailable ( af Afrikaans Afrikaans | sq Shqiptare Albania

Sean P. Myrick V19.1.7.2 2 Oct 24, 2022