Giter Club home page Giter Club logo

szl's Introduction

         _
 ___ ___| |
/ __|_  / |
\__ \/ /| |
|___/___|_|

Overview
========

szl is a tiny, embeddable scripting engine inspired by Tcl and shell. It's a
balanced mix of their key features: szl combines the simplicity of shell
scripting with the power of a dynamic, Tcl-like type system, minimalistic
syntax and programming language features missing in the shell, like exceptions.

szl comes with a rich standard library that includes bindings for
permissively-licensed libraries. Therefore, it can run processes, parse text
with transparent Unicode support, manipulate data structures like dictionaries,
operate on binary data, interface with C code through scripts, multiplex
non-blocking I/O at scale, call REST APIs and much more, at a fraction of the
memory and size footprint of other scripting languages, while achieving
reasonable efficiency.

szl can be used both as a standalone (either interactive or non-interactive)
interpreter or as part of other projects, via the libszl library.
   ___________________________________
  /                                   \
  | >>> $global msg {Hello, world!}   |
  | Hello, world!                     |
  | >>> $load zlib                    |
  | >>> $zlib.crc32 $msg              |
  | 3957769958                        |
  | >>> [$exec {uname -s}] read       |
  | Linux                             |
  | >>> [$open /bin/gunzip rb] read 9 |
  | #!/bin/sh                         |
  | >>> $map i [$range 1 4] {$+ $i 3} |
  | 4 5 6                             |
  \___________________________________/

For more information, see the user manual at http://dimakrasner.com/szl.

Building
========

On Debian (http://www.debian.org) based distributions:

  $ apt-get install git gcc make pkg-config zlib1g-dev libcurl4-gnutls-dev
                    libarchive-dev libssl-dev libffi-dev valgrind

Then:

  $ git clone --recursive https://github.com/dimkr/szl
  $ cd szl
  $ make
  $ make install

Under some CPU architectures (most notably, x86_64 and ARMv7), -fPIC is required
to produce shared libraries:

  $ make clean
  $ CFLAGS="-fPIC" make

By default, szl is built with core functionality built-in to the interpreter,
while a big part of the standard library resides in dynamically-loaded shared
objects. This way, the memory consumption of szl scripts that don't use the
entire standard library is lower.

However, in some use cases (for example, when szl is embedded into another
project), this is undesirable.

To build szl as a single executable file, with all extensions linked statically
into the interpreter:

  $ STATIC_ALL=1 make

In addition, built-in extensions can be chosen individually, e.g.:

  $ STATIC_CURL=1 STATIC_FFI=1 make

To embed szl into other projects, use the API defined in szl.h and link with
libszl.

Running
=======

To run an interactive interpreter:

  $ szlsh

Or, to run a script:

  $ szlsh $path

Or, to run a one-liner:

  $ szlsh -c $snippet

Documentation
=============

To build the user manual:

  $ cd doc; make szl.html

To build the API documentation:

  $ cd doc; make api_docs

Credits and Legal Information
=============================

szl is free and unencumbered software released under the terms of the MIT
license; see COPYING for the license text. For a list of its authors and
contributors, see AUTHORS.

The ASCII art logo at the top was made using FIGlet (http://www.figlet.org/).

szl's People

Contributors

dimkr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.