Scripting / Extension Language

Programming, for all ages and all languages.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Scripting / Extension Language

Post by NickJohnson »

I know: thread-safety is important because I will have many threads each executing Lua scripts at once. All the important structures (i.e. thread-shared structures) in a daemon or tool will be mechanism, and therefore will be implemented in C anyway.
nedbrek
Member
Member
Posts: 44
Joined: Tue Dec 15, 2009 6:36 pm

Re: Scripting / Extension Language

Post by nedbrek »

I am considering something similar. I am going to build something Tcl-like (if I don't just import Tcl directly). Tcl has simple parse rules, and was designed for embedding and extensions. It is thread safe, and supports a safe interpreter. The language spec is very stable (some might say too stable :)

The main drawback is that not many people know it, and some find it a little odd (it is actually more Lisp-like than C-like).
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: Scripting / Extension Language

Post by Candy »

Why should your scripting language be thread safe? Can't you start multiple scripts at a time to compensate for that?

Most of the stuff I would script on a system are long-running tasks that take a long time because of external dependencies (backups f.ex.) that would absolutely not benefit from any threading in my scripting. If you need threading, can't you do it separately?

Concrete example: Shell scripts (bash) aren't multithreaded. They're used the world over for the kind of tasks that I think you're targeting.

Do you really really need threading?
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Scripting / Extension Language

Post by NickJohnson »

The whole idea is to use it as a scripting language (no threads needed) *and* an extension language for system daemon policy (threads are really, really needed, because daemons are really, really threaded). Bash is never used as an extension language: it is always either called from a process, creating a separate bash process, or run standalone as an executable shell script.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: Scripting / Extension Language

Post by Candy »

NickJohnson wrote:The whole idea is to use it as a scripting language (no threads needed) *and* an extension language for system daemon policy (threads are really, really needed, because daemons are really, really threaded). Bash is never used as an extension language: it is always either called from a process, creating a separate bash process, or run standalone as an executable shell script.
You've got a good point. If you want to use it for daemons non-threaded is starting to look pointless. I didn't consider the option of writing daemons in non-compiled languages.
Post Reply