sarascript

Crates.iosarascript
lib.rssarascript
version0.1.0
sourcesrc
created_at2024-01-09 16:43:22.351847
updated_at2024-01-09 16:43:22.351847
descriptionA declarative scripting language for HTML web development
homepage
repository
max_upload_size
id1094215
size79,252
(sizeru)

documentation

README

A lightweight declarative language for HTML

Please note that this software is in alpha, and many features have not been implemented yet.

SaraScript is a simple declarative language which can be used to extend an HTML document. SaraScript can be used as:

  • A static-site generator.
  • A server-side renderer1.
  • An asynchronous client-side renderer1.

Use Cases:

Since SaraScript can be used in three distinct ways, this table compares each version:

Version Use Case Pros Cons
Server Server-side rendering No client scripts & Reduced Server Storage Increased Server CPU & Increased Network Traffic
Client Client-side rendering Reduced server storage & Minimal server CPU Client-side scripts
Standalone Static-site generation No client scripts & Minimal server CPU Larger Server Storage
Library Used in custom webservers N/a N/a

How is SaraScript different from alternatives? (Like PHP or JavaScript)

  • Security: SaraScript puts security first. Like most HTML-related languages, Sarascript's core library is designed to be secure. However, unlike most similar languages, SaraScript will not allow you to create vulnerabilities in your website.
  • Declarative: SaraScript is a declarative language. This means that rather than defining a series of steps taken to retrieve a piece of data, you define the data that you'd like to retrieve and let the program handle the actual retrieval. Why is this a benefit? A developer only needs to focus on creating the layout and design of their webpage, rather than optimizing how their data is retrieved. Furthermore, as time goes on and the language improves, your queries will become faster.
  • Ease-of-Use SaraScript is a focused project. It seeks to provide a way to query the backend declaratively and seeks to do it well. As a result, the project is small, unambiguous, and easy-to-use.

How to Install?

This section needs a redo. This is just a placeholder.

Version Instructions
Client or Server Install the daemon, edit the config, and run the daemon
Standalone Download or build the binary
Library Add the cargo package

Examples

Note: Each example should link to an example file.

  • Adding a navbar/footer/etc. to every page
  • Adding a user's profile picture to the page.
  • Generating static web pages

Misc

This project practices semantic versioning: https://semver.org/spec/v2.0.0.html

Name

The hero shrew is a small cute mouse-like creature with an incredibly strong spine. Though they are the size of a deck of cards - they are said to be able to support the weight of an adult male without harm. The animal is native the the DRC. musaraigne is the word for shrew in French - I was unable to find the name in Kituba.

Footnotes

  1. "Rendering" in a web context is typically just modifying the HTML so that the browser may render it properly 2

Commit count: 0

cargo fmt