All Projects → dimkr → Szl

dimkr / Szl

Licence: mit
A lightweight, embeddable scripting language

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
script
160 projects
scripting
82 projects
c99
33 projects

Projects that are alternatives of or similar to Szl

Libonnx
A lightweight, portable pure C99 onnx inference engine for embedded devices with hardware acceleration support.
Stars: ✭ 217 (+61.94%)
Mutual labels:  embedded-systems, library, lightweight, embedded
Sod
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: ✭ 1,460 (+989.55%)
Mutual labels:  library, iot, embedded
Swupdate
Software Update for Embedded Systems
Stars: ✭ 711 (+430.6%)
Mutual labels:  embedded-systems, iot, embedded
Wasm Micro Runtime
WebAssembly Micro Runtime (WAMR)
Stars: ✭ 2,440 (+1720.9%)
Mutual labels:  iot, embedded, interpreter
Fbg
Lightweight C 2D graphics API agnostic library with parallelism support
Stars: ✭ 349 (+160.45%)
Mutual labels:  library, lightweight, embedded
Wasm3
🚀 The fastest WebAssembly interpreter, and the most universal runtime
Stars: ✭ 4,375 (+3164.93%)
Mutual labels:  iot, embedded, interpreter
Lib Python
Blynk IoT library for Python and Micropython
Stars: ✭ 140 (+4.48%)
Mutual labels:  library, iot, embedded
Flashdb
An ultra-lightweight database that supports key-value and time series data | 一款支持 KV 数据和时序数据的超轻量级数据库
Stars: ✭ 378 (+182.09%)
Mutual labels:  lightweight, iot, embedded
Printf
Tiny, fast, non-dependent and fully loaded printf implementation for embedded systems. Extensive test suite passing.
Stars: ✭ 1,157 (+763.43%)
Mutual labels:  embedded-systems, iot, embedded
Geotic
Entity Component System library for javascript
Stars: ✭ 97 (-27.61%)
Mutual labels:  engine, library
List of robot electronics
A curated list of awesome open source electronic resources for robotics
Stars: ✭ 106 (-20.9%)
Mutual labels:  embedded-systems, embedded
Yeelightapi
C# API (.Net) to control Xiaomi Yeelight devices
Stars: ✭ 106 (-20.9%)
Mutual labels:  library, iot
Slowpoke
Low-level key/value store in pure Go.
Stars: ✭ 98 (-26.87%)
Mutual labels:  engine, embedded
Lwmem
Lightweight dynamic memory manager library for embedded systems with memory constraints. It implements malloc, calloc, realloc and free functions
Stars: ✭ 92 (-31.34%)
Mutual labels:  lightweight, embedded
Ot Rtos
OpenThread RTOS, an integration of OpenThread, LwIP, and FreeRTOS.
Stars: ✭ 90 (-32.84%)
Mutual labels:  iot, embedded
Samples
🍬 Code samples from the nanoFramework team used in testing, proof of concepts and other explorational endeavours
Stars: ✭ 108 (-19.4%)
Mutual labels:  embedded-systems, iot
Sciter Sdk
Sciter is an embeddable HTML/CSS/scripting engine
Stars: ✭ 1,690 (+1161.19%)
Mutual labels:  engine, embeddable
Utensor
TinyML AI inference library
Stars: ✭ 1,295 (+866.42%)
Mutual labels:  iot, embedded
Embedos
EmbedOS - Embedded security testing virtual machine
Stars: ✭ 108 (-19.4%)
Mutual labels:  iot, embedded
Indicators
Activity Indicators for Modern C++
Stars: ✭ 1,838 (+1271.64%)
Mutual labels:  library, lightweight
     _

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

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 and OOP.

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 an integral part of other projects, via the libszl library. In addition, the feature set and behavior of szl can be easily fine-tuned to meet the size and memory consumption limitations under various usage scenarios and hardware platforms.


/
| >>> $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 meson zlib1g-dev libcurl4-gnutls-dev libarchive-dev libssl-dev libffi-dev

Then:

$ git clone --recursive https://github.com/dimkr/szl $ cd szl $ meson build $ cd build $ ninja $ ninja install

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:

$ mesonconf -Dbuiltin_all=true

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

$ mesonconf -Dwith_curl=builtin -Dwith_ffi=no

Embedding

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

The size and performance of szl can be tuned using advanced build options:

$ mesonconf -Duse_int=true

This build option replaces the large integer type used by szl to represent integers, to the standard C int. This may improve performance under platforms without native support for 64 bit integers, at the cost of a limited range of valid integer values.

$ mesonconf -Duse_float=false

This build option changes the precision of floating-point numbers in szl from double to single precision. This may improve performance under platforms without native support for double-precision floating point numbers, at the cost of precision.

$ mesonconf -Dwith_float=false

This build options disables support for floating-point arithmetic. This reduces szl's size.

$ mesonconf -Dwith_unicode=false

This build options disables support for Unicode strings and cancels szl's internal distinction between encoded byte strings and arrays of Unicode code points. This reduces szl's size and may improve performance with zero side effects, if szl is guaranteed not to perform any sort of Unicode string slicing.

Security

Support for dynamic loading of szl extensions can be disabled:

$ mesonconf -Dwith_dl=false

When dynamic loading is disabled, szl will refuse to load extensions, unless they are linked statically into the interpreter.

This way, a szl interpreter embedded into another program does not make it vulnerable to dynamic loader hijacking (e.g. LD_LIBRARY_PATH) during extension loading.

Running

To run an interactive interpreter:

$ szlsh

Or, to run a script:

$ szl $path

Or, to run a one-liner:

$ szl -c $snippet

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/).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].