Closed kubikaugustyn closed 1 year ago
This would allow us to make JIT (Just In Time) execution in Mindustry logic, which would let us do a lot more.
I'd add it myself if I knew how :|
It would be good for universal multi-bind and things like call stack I'm planning to add in my MPPL project (Mindustry Processor Programming Language), which isn't done yet. It would introduce functions as jumps and returns, not things like subroutines in MLOG+1
Should I take my Java toolkit out of the trash and try to make this? It would be bad but it might work...
I can code it myself. But I don't want it to be part of some mod, but to be in vanilla Mindustry
I'm worried what will Anuke do Hopefully it won't be rejected
I'll take a stab at this during the weekend. Wish me luck.
in background ran as
isnt this concurrency? youll have to add some synchronization primitives too then, right?
Wdym? What synchronization primitives? How hard is it to just add a new instruction?
well, in the case of
set x 45
eval "set x 25"
evalflush
set x 15
what is x?
well, in the case of
set x 45 eval "set x 25" evalflush set x 15
what is x?
X would become 45, and then 15. eval
s would run in a sandbox without the same variables as the host- just the same links.
For my variant of eval, it would look like this:
set x 45
eval "set x 25"
set x 15
oh so its just spawn a new processor?
well, in the case of
set x 45 eval "set x 25" evalflush set x 15
what is x?
I like more this option containing evalflush
, so you can create the commands dynamically. If no, what's the point?
After instruction 0, x = 45
After 1, no change
After 3, set x 25
is evaluated, so x = 25
After 4, x is set to 15
That repeats indefinitely
oh so its just spawn a new processor?
@Erisfiregamer1 , I don't think creating some sort of VM processor would have any point. I need something that just evaluates instruction using evalflush
entered by one or more eval <part of instruction>
.
oh so its just spawn a new processor?
@Erisfiregamer1 , I don't think creating some sort of VM processor would have any point. I need something that just evaluates instruction using
evalflush
entered by one or moreeval <part of instruction>
.
No, it has the same links. Since we can write our own mlog, we just need some separator... Maybe ;
?
The current mlog separator is \n
, just write newlines.
I don't want to create a new MLOG separated by ";", I just want to run normal MLOG instructions that are dynamically generated.
For custom commands etc. there are things such as MLOG+1 or MPPL, which bendn knows about and didn't like it. MPPL is my project, that isn't fully working yet. EDIT: Check documentation for functions that are currently available
what do you mean i didnt like it? ive contributed a little to pyndustric myself
also, where is the conversation on custom commands, i dont see anything.
I saw @Erisfiregamer1 talk about ";", you've denied it and said the separator is "\n".
Hey, I'm going to sit here and talk a little bit on my idea, and the fact that yes I am doing this at some point.
1: ";" is a valid separator in mlog parsing, so you can use that.
I don't understand what do you want to do I want to run single instruction and you're planning some virtual processor, in which you can have 1000 instructions inside single M-LOG instruction, and have that indefinitely, so from 1000 instructions limit we're going to infinity
This suggestion is now stale, and will be automatically closed.
It's not completed GitHub!!!!
Describe the content or mechanics you are proposing.
Add eval instruction, which will evaluate single instruction (as if it was just another line of code in the background) from an inputs Example:
eval "set a "
,eval 6282
andevalflush
, in background ran asset a 6282
Describe how you think this content will improve the game. If you're proposing new content, mention how it may add more gameplay options or how it will fill a new niche.
Processors are necessary part of many Mindustry servers and singleplayer games. Addition of the ability to evaluate expression would add new possibilities for MLOG programming. I'd recommend some variable amount cap (like 250), so some bad guys don't spam processor with additional variables --> data --> possibly lag, larger save file
Before making this issue, check the boxes below to confirm that you have acknowledged them.