Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Small, fast embeddable interpreter
I'm looking for a small, fast, embeddable--in C--language interpreter. I
don't care which language, just small, fast and Free Software. The
operations involve simple manipulation on strings; nothing more, nothing
less, though the ability to create subroutines would be nice.

I haven't found anything really lightweight, suitable for a very large
number of very small, short executions.

What I'm currently writing is an embeddedable interpreter for a sub-set of
Bourne Shell syntax. I had written a shell variable parser (e.g.
${xxx}, ${xxx-${yy}}) but have come to need the ability for more complex
conditionals than simple variable existence tests.

I'll continue reinventing the wheel for my own sake, but would rather use
something more mature for my other projects.

TIA,

Bill

Report this thread to moderator Post Follow-up to this message
Old Post
William Ahern
01-07-05 08:58 AM


Re: Small, fast embeddable interpreter
William Ahern <william@wilbur.25thandClement.com> writes:

> I'm looking for a small, fast, embeddable--in C--language interpreter. I
> don't care which language, just small, fast and Free Software.

TCL is about as small as they come.
http://www.tcl.tk/advocacy/whytcl.html

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

Report this thread to moderator Post Follow-up to this message
Old Post
Paul Pluzhnikov
01-07-05 08:58 AM


Re: Small, fast embeddable interpreter
William Ahern wrote:

> I'm looking for a small, fast, embeddable--in C--language interpreter. I
> don't care which language, just small, fast and Free Software. The
> operations involve simple manipulation on strings; nothing more, nothing
> less, though the ability to create subroutines would be nice.
>
> I haven't found anything really lightweight, suitable for a very large
> number of very small, short executions.

Someone else mentioned Tcl.  Io would also probably be a good choice.

--
Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
I needed sunshine in my day / Something to wash away the pain
-- Zhane

Report this thread to moderator Post Follow-up to this message
Old Post
Erik Max Francis
01-07-05 08:58 AM


Re: Small, fast embeddable interpreter
William Ahern wrote:
> I'm looking for a small, fast, embeddable--in C--language interpreter. I
> don't care which language, just small, fast and Free Software. The
> operations involve simple manipulation on strings; nothing more, nothing
> less, though the ability to create subroutines would be nice.
>
> I haven't found anything really lightweight, suitable for a very large
> number of very small, short executions.
>
> What I'm currently writing is an embeddedable interpreter for a sub-set of
> Bourne Shell syntax. I had written a shell variable parser (e.g.
> ${xxx}, ${xxx-${yy}}) but have come to need the ability for more complex
> conditionals than simple variable existence tests.
>
> I'll continue reinventing the wheel for my own sake, but would rather use
> something more mature for my other projects.

TCL or Lua: http://www.lua.org/ or guile: http://www.gnu.org/software/guile/

Report this thread to moderator Post Follow-up to this message
Old Post
Russell Shaw
01-07-05 08:58 AM


Re: Small, fast embeddable interpreter
William Ahern <william@wilbur.25thandClement.com> writes:

> I'm looking for a small, fast, embeddable--in C--language interpreter. I
> don't care which language, just small, fast and Free Software. The
> operations involve simple manipulation on strings; nothing more, nothing
> less, though the ability to create subroutines would be nice.
>
> I haven't found anything really lightweight, suitable for a very large
> number of very small, short executions.
>
> What I'm currently writing is an embeddedable interpreter for a sub-set of
> Bourne Shell syntax. I had written a shell variable parser (e.g.
> ${xxx}, ${xxx-${yy}}) but have come to need the ability for more complex
> conditionals than simple variable existence tests.
>
> I'll continue reinventing the wheel for my own sake, but would rather use
> something more mature for my other projects.

On the mini-tiny side:
http://modeemi.cs.tut.fi/~chery/lisp500/
a "Common-Lisp" in 500 lines of C code...

Otherwise, just use ecls, the embeddable Common-Lisp
http://ecls.sourceforge.net/

(I believe clisp http://clisp.cons.org is embeddable too, and should
not be much bigger than ecls).

Otherwise, there's always the guile option if you prefer scheme...

--
__Pascal Bourguignon__                     http://www.informatimago.com/

In a World without Walls and Fences,
who needs Windows and Gates?

Report this thread to moderator Post Follow-up to this message
Old Post
Pascal Bourguignon
01-07-05 08:59 PM


Re: Small, fast embeddable interpreter
On Thu, 6 Jan 2005 19:22:37 -0800, William Ahern
<william@wilbur.25thandClement.com> wrote:

>I'm looking for a small, fast, embeddable--in C--language interpreter. I
>don't care which language, just small, fast and Free Software. The
>operations involve simple manipulation on strings; nothing more, nothing
>less, though the ability to create subroutines would be nice.
>
>I haven't found anything really lightweight, suitable for a very large
>number of very small, short executions.
>
>What I'm currently writing is an embeddedable interpreter for a sub-set of
>Bourne Shell syntax. I had written a shell variable parser (e.g.
>${xxx}, ${xxx-${yy}}) but have come to need the ability for more complex
>conditionals than simple variable existence tests.
>
>I'll continue reinventing the wheel for my own sake, but would rather use
>something more mature for my other projects.

Perl has "microperl" which I have used for small scripts.

It compiles to about 900k stripped, and after upx'ing it,
it is about 350k.  It supports most of the math and trig operations.


From the Perl source tree, README.micro
 ########################################
#######
microperl is supposed to be a really minimal perl, even more
minimal than miniperl.  No Configure is needed to build microperl,
on the other hand this means that interfaces between Perl and your
operating system are left very -- minimal.

All this is experimental.  If you don't know what to do with microperl
you probably shouldn't.  Do not report bugs in microperl; fix the bugs.

We assume ANSI C89 plus the following:
- <stdlib.h>
- rename()
- opendir(), readdir(), closedir() (via dirent.h)
- memchr (via string.h)
- (a safe) putenv() (via stdlib.h)
- strtoul() (via stdlib.h)
(grep for 'define' in uconfig.sh.)
Also, Perl times() is defined to always return zeroes.

If you are still reading this and you are itching to try out microperl:

make -f Makefile.micro

If you make changes to uconfig.sh, run

make -f Makefile.micro regen_uconfig

to regenerate uconfig.h.





--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html

Report this thread to moderator Post Follow-up to this message
Old Post
zentara
01-07-05 08:59 PM


Re: Small, fast embeddable interpreter
William Ahern wrote:
> I'm looking for a small, fast, embeddable--in C--language interpreter. I

http://directory.google.com/Top/Com...ati
ons/

Forth is very compact, simple and, compared to other
byte code interpreting languages, fast.

best wishes
Andreas Klimas


Report this thread to moderator Post Follow-up to this message
Old Post
Andreas Klimas
01-17-05 01:58 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:43 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.