[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
newlispfanclub.alh.net • View topic - Building and using a shared newlisp.so library

Building and using a shared newlisp.so library

Q&A's, tips, howto's

Building and using a shared newlisp.so library

Postby twotaters » Sun Oct 12, 2014 7:30 am

I'm trying to build the newlisp.so shared library on Red Hat Linux. Section 24 of the Code Patterns says "On all platforms, newLISP can be compiled as a shared library. On Win32, the library is called newlisp.dll, on Mac OS X newlisp.dylib and on Linux and BSDs, the library is called newlisp.so. Makefiles are included in the source distribution for most platforms." I haven't found anything that says which of the makefiles it should be.

I used "configure-alt" to build the static newlisp binary. The "--disable-static" flag doesn't seem to be the right option. It builds the the executable as shared, but doesn't build the newlisp.so library.

After running configure-alt, I've update makefile_build to add -fPIC to the .o rule and -shared -o newlisp.so. That creates a shared library. I don't see a simple way to check it though - it looks like it's impossible to build a newlisp that dynamically loads newlisp.so. It seems that driving newlisp from a C program isn't a common use case, so I'd like to step back and make sure that I'm approaching this sanely.

I have an application written in C. Currently, it has Lua embedded in it. It's a shebang executable, so script files with "#!/path/to/ox" are the most common entry point. When it executes, it initializes the environment, loads the Lua interpreter from shared libraries, does the same for Oracle and SQLite3. Once all the shared libraries are in place, it loads the text of the script, strips off the shebang, and executes the script. As it reads in the script, it does some basic substitutions so that the users can run the same script on different servers (dev/test/qa/production). The processed text is feed into Lua and Lua is the glue to run the various bits and pieces against the database.

I want to replace the Lua bits with newlisp. I have to keep the external interface the same - I can't change the name of the job script or the invocation. Going from "/path/to/there/aJobName" to "/path/to/bin/newlisp aJobName" isn't acceptable. Heck, I can't even have them set up their environment to add the library paths newlisp needs. There's no technological reason for that constraint, it's budge. There are about a thousand users working in many different departments and my group doesn't have the budget to pay them to change their jobs.

Other than that, I have a good degree of freedom. As long as the system is always operational, that is, so I plan on reusing the current system's C code that does the initialization and script substitution logic. After testing that, I can roll out changes as quickly as I can update the Lua code in a job script to newlisp.

I looked at the option of changing "/path/to/there/aJobName" to a bash script that does something like set up the new lisp environment then run "newlisp /path/to/there/aJobName.lsp." I'd prefer not to if it's reasonable to have that preference.

Sorry for the big build-up to a simple question: What's the "best practice" - embedding newlisp or extending newlisp?
twotaters
 
Posts: 1
Joined: Sun Oct 12, 2014 6:36 am

Re: Building and using a shared newlisp.so library

Postby Lutz » Sun Oct 12, 2014 7:47 am

Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: Building and using a shared newlisp.so library

Postby TedWalther » Sat Oct 18, 2014 9:51 pm

Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.
TedWalther
 
Posts: 605
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC

Re: Building and using a shared newlisp.so library

Postby ralph.ronnquist » Sun Oct 19, 2014 12:18 pm

Inspirational it is, indeed, even if I'm not yet at a stage of wanting to slice all my bread with the newlisp knife :-) Though, considering the recent bash scare, it's even so more refreshing to recall the well-balanced lack of bloating in newlisp. "Practical makes perfect"?

Veering back towards the initial topic, I thought to add my opinion in chorus with Lutz, that extending is the better option.

And, though I suspect I missed a point here, you'd typically do this by writing "#!" scripts with newlisp code, instead of and without intermediate shell scripting. For me it usually ends up in a collection of .lsp snippets that get used and reused in various constallations to make up the individual "commands", so I have my final "distribution packaging" to make each "command" a self-contained "#!" newlisp script.
ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron