Scripting / Extension Language
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: Scripting / Extension Language
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.
Re: Scripting / Extension Language
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).
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).
Re: Scripting / Extension Language
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?
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?
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: Scripting / Extension Language
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.
Re: Scripting / Extension Language
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.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.