Site Menu



Linux Kernel

 NullLogic Embedded Scripting Language  

NSP: the scripting language for C programmers.

      NSP is the complete object-based scripting language written in just a few thousand lines of ANSI C. It's portable, thread-safe, flexible, embeddable, expandable and easy to understand (as a language and as an API). NSP scripts can and often do look very much like JavaScript, but NSP is Not an ECMA Scripting Language.

      0.9.4 is a long overdue update to the NSP language. This release includes major changes to object management, including the addition of support for classes and inheritance. Other major changes include improvements to TCP/IP and extensions (OpenSSL, mbed TLS, libSSH2, etc.), and improved interfaces to access various SQL databases and other data sources. Last but not least, there's a whole new script editor with built-in script execution support.

      NSP was originally written as a configuration file parser and lightweight object model. Low maintenance memory management, hierarchical data storage, a complete c-syntax script parser, and a core package size of less than 5K lines of code are just nice bonuses.

      API extensions currently offer support for several other software packages, including:

      Note: Please don't ask them for support for NSP-specific issues. If there is a bug, it's probably not theirs, and they probably can't help you resolve it.


      NSP is free to use and distribute subject to the terms of the GNU GPL.


      Some basic documentation is here.


      Want to see what working NSP scripts look like? Well, here is a working web server. Here is a script to sync a pop3 mail account, and here is the class it uses. Samples ranging from poker and blackjack to a chat bot can be found here:

_ajax.nsincluded file used to add AJAX functions
_cards.nsincluded file used to define playing cards
ansi.nssimple ANSI codes
class.pop3.nsClass file providing POP3 client support
current.nsdownload latest test release of NSP (via http)
dirhash.nsfinds all changed files in two directory trees, including cryptographic hashes of file contents
factorial.nscalculates the factorial of a number
fbsql.nsFirebird SQL example
hello.nsthe first program in every language
ht-bj.nsblackjack game for web servers using AJAX (try it)
ht-cms.nsA _very_ crude Content Management System
ht-index.nsHTML file listing script
ht-poker.nspoker game for web servers using AJAX (try it)
ht-shell.nssimple shell for web servers
http-proxy.nsfunctioning demo web proxy server
httpc.nssimple HTTP client using sockets
httpd.nsfunctioning demo web server
lis-l.nslanguage file for lis.ns
lis.nspsychiatry for the lonely and desperate
mysql.nsMySQL/MariaDB SQL example
odbc.nsODBC SQL example with a MySQL data source
pgsql.nsPostgreSQL SQL example
pop3.nsPOP3 client to sync mail account with a local dir
smoketest.nsplays the first few bars of Smoke on the Water using a PC speaker
smtpc.nsSMTP client
sqlite.nsSQLite example
sqrt.nssimple square root algorithm


      A summary of changes can be found here.


      If you find a bug, some weird behaviour, or just come up with a cool test script, show me. I want scripts I can use to see the bug in action now, and test for possible recurrences later.