Skip to content

Enhanced Duktape #2585

Description

@aflin

I love Duktape!!
Thanks for an awesome and easy to use api (I really didn't appreciate it fully until working with the python api).

Apologies in advance. I hope this self-plug is not unwelcome.

For the last six years I've been working on a javascript environment powered by Duktape.
You can find it at rampart.dev.

It uses Duktape 2.7 and the main executable includes features such as:

  • An event loop, with setTimeout().
  • C-like file utilities from Javascript (fopen, fprintf, etc).
  • require() to load c compiled or javascript modules.
  • template literals and tagged functions.
  • babel (javascript based) and tree-sitter(c based) transpilers built in.
  • Threading functions which use a setTimeout like calling mechanism.
  • Async event functions
  • process.* vars and functions
  • a limited set of vector functions.
  • REPL
  • Extended C api for writing your own modules.
  • Fully documented.

A partial list of C modules packaged with rampart include:

  • A sql/full text search engine
  • A multi-threaded web server
  • A curl client
  • Openssl based crypto functions
  • A html parser/manipulator
  • LMDB module
  • REDIS/ValKey client
  • Networking module
  • Python module - Load python modules and call functions from rampart using Javascript variables.
  • robots.txt parser
  • SIMSIMD, llamacpp and faiss for embedding based vector search. (Experimental. Only for some platforms. See here.

A partial list of Javascript modules:

  • Url utility to parse urls.
  • cmodule utility that compiles inline c to javascript functions
  • webserver module which makes the c based web-server easier to configure.

Everything is permissively licensed except the sql/full text module (but it is freely usable in many cases). So those interested are welcome to copy and adapt nearly any code therein into your own projects. The Github repo is here.

Enjoy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions