What is the "scripted arithmetic" module about?
It seems, that the input of the script is not possible in WIN10 R815.
It seems, that the input of the script is not possible in WIN10 R815.
That's the "universal" component.What is the "scripted arithmetic" module about?
dvarkin likes this post
I suggest to use LuaJIT instead. If you can wait a while, I can try to embed it.arcachofo wrote:Similar to "Function component", but you load a javascript program.What is the "scripted arithmetic" module about?
So in theory you could create any component with it.
Nice that it does not work ...
Why?I suggest to use LuaJIT instead. If you can wait a while, I can try to embed it.
IMHO it's much smaller, faster and has less dependency problems than JS.arcachofo wrote:Why?I suggest to use LuaJIT instead. If you can wait a while, I can try to embed it.
Does this mean another dependency?
About dependency, now it's using Qt Script , not exactly JS.IMHO it's much smaller, faster and has less dependency problems than JS.
That sounds interesting...Yet another advantage, Lua is special language for embedding, it is isolated from host application environment by default.
"Isolated" can mean many things...Qt's script language is special language for interaction with Qt application environment, it's not isolated by definition.
Thanksarcachofo wrote:I'm going to fork the scripting talk to it's own thread:
https://simulide.forumotion.com/t422-scripted-component
Ok, i misunderstand this sentence:arcachofo wrote:But is has no access to Qt application
arcachofo wrote:EDIT:
The good part about this QT Script is that it only has access to the objects you pass to the Script engine, so it's much safer than just embeding code.
I mean "by default". So Lua scripts can interact with outer C program only by rules, described in this C program.arcachofo wrote:And the whole point of this component is interacting with the application.
So a completely isolated script is not very useful.
NO, Lua includes as a libraryarcachofo wrote:Then the cuestion of dependencies, you need Lua installed in your system, isn't it?
#include <lua.h>
And where is that library?NO, Lua includes as a library
Ok, I see...and has standalone app primarily for testing. Lua sources size is 350KB . It's a scripting language too and it execute scripts without compilation. LuaJIT, however, doing Just In Time compilation for speed.
Follow the link below, there is a 350 KB lua-5.4.3.tar.gz, in that archive there is a lua.h file. Lua isn't distribuable library, it must be included in the sources of the host program, so it doesn't need to be presented in system - system's Lua is for other (not embeddable) purpose.arcachofo wrote:And where is that library?NO, Lua includes as a library
Whatever it is, it must be present in your system.
The same link:arachofo wrote:The main problem I see in this aproach is the dependency.
Shipping a language and a compiler just for this component sounds like an overkill...
So, this 350KB is all Lua.Building
Lua is implemented in pure ANSI C and compiles unmodified in all platforms that have an ANSI C compiler. Lua also compiles cleanly as C++.
No, no, no, no, if you don't add to the host program additional Lua functions (or libs) that does it.arachofo wrote:But there are other things I'm not sure:
- Can the script access the filesystem?
- Can it access the network?
- Can it access the registry in Windows systems?
- Can it do requests to the system?
Ok, but that header must be in you system in order to include it.Follow the link below, there is a 350 KB lua-5.4.3.tar.gz, in that archive there is a lua.h file. Lua isn't distribuable library, it must be included in the sources of the host program, so it doesn't need to be presented in system - system's Lua is for other (not embeddable) purpose.
arcachofo wrote:Whatever it is, it must be present in your system.
Yes I got the idea.Lua is a interpreter, only LuaJIT is like compiler, if it means anything.
arcachofo wrote:Then LuaJIT must be installed in your system or simuilde should ship it.
I suggest to use Lua (not JIT) firstly - they aren't very different in speed.LuaJIT executable: in order to compile the script you need the compiler executable
By The Application Program Interface.Making functions accesible to the script.
I suggest to look at QtLua sources for a reference.Dealing with Qt data types.
Thanks. That looks interestingI suggest to look at QtLua sources for a reference.
Fizik_S wrote:I propose to think and discuss: is it possible to put a Verilog, VHDL processor of digital hardware description languages in this component. I think this opportunity will increase interest in the program.
That would be nice, but very complex.Fizik_S wrote:I propose to think and discuss: is it possible to put a Verilog, VHDL processor of digital hardware description languages in this component. I think this opportunity will increase interest in the program.
The idea of the scripted component came from that suggestion.dvarkin wrote:I suggested similar idea https://simulide.forumotion.com/t95-spld-simulation too
JS for a low level thing that works with 40 ns input to output delays at hardware, nah.If you remember, I asked you if you can write a javascript program to do something (i don't remember what).
Today I think that make a triggered outputs option for a function component will be enough for SPLD-like behaviour. Tri-state SPLD outputs are used rarely and mostly for microprocessors' buses, I think.With Function component you can create combinational logic, but it has not memory.
Scripted component is basically the same but you can add memory and create sequential logic... and much more.
It might sound counterintuitive, but input to output delays don't matter too much in the simulation.JS for a low level thing that works with 40 ns input to output delays at hardware, nah.
Qt Script, not exactly JS, but it is almost the same for this purpose.dvarkin wrote:Which of JS did you mean?
I don't understand exactly what you mean, can you elaborate a bit more? perhaps with some simple example case.So, what about make a "triggered" option for a function block? It will be sequencial logic at one block.
Similar topics
Permissions in this forum:
You cannot reply to topics in this forum