Site Menu



Linux Kernel


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.


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


      Using Web Assembly, NSP can run in your web browser! Try it here.


      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
coroutines.nssimple test of experimental coroutine 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
fnmap.nsCreate a list of all functions in memory.
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
objects.nsintro to objects, classes, and constructors in NSP
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
testlib1.nsprimary test library for base NSP language rules


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


      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.