Low-level stuff supporting, Lua, and Forth
#1
Posted 05 August 2008 - 07:49 PM
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#2
Posted 06 August 2008 - 10:24 AM
#3
Posted 07 August 2008 - 08:25 AM
#4
Posted 07 August 2008 - 06:23 PM
: IF COMPILE ?-GOTO COMPILE-HERE ; IMMEDIATE : THEN HERE SWAP ! ; IMMEDIATE : ELSE COMPILE GOTO COMPILE-HERE SWAP HERE SWAP ! ; IMMEDIATE(in other Forth systems they may be defined a bit differently than this) In similar ways, many of the MegaZeux stuff can be defined also in Forth, such as zap and restore labels, message boxes, MegaZeux-style loops, and other things.
If I create a module in MegaZeux for some low-level stuff, and the ability to edit a object attribute table and other stuff so that you can define your own kind of pieces, would you include that module?
This post has been edited by zzo38: 07 August 2008 - 06:25 PM
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#5
Posted 07 August 2008 - 06:27 PM
Also, if I'm wrong about the above statement, PLZ INCLUDE PHP IN MZX KTHX :DDD
#6
Posted 07 August 2008 - 06:31 PM
mzxgiant, on Aug 7 2008, 10:27 AM, said:
Also, if I'm wrong about the above statement, PLZ INCLUDE PHP IN MZX KTHX :DDD
No, that isn't what I mean. Of course, I found and improved a Forth interpreter written in Lua so hopefully it will work on MZX as well. This way, Forth codes can be programmed on MZX even if the people who programmed MZX don't like Forth. But PHP is much harder to include in MZX and isn't as good as Forth. PHP is also very slow compared with Perl, Lua, and Forth.
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#7
Posted 07 August 2008 - 06:33 PM
zzo38, on Aug 7 2008, 02:31 PM, said:
Sarcasm, zzo... you should really pay attention to it, since a lot of people [around here] use it. Frequently, even!
#8
Posted 07 August 2008 - 08:56 PM
mzxgiant, on Aug 7 2008, 08:33 PM, said:
Of course they don't.
Wait.
Well, okay, maybe Forth could be useful, but I don't really think adding _any_ other programming languages to MZX is a very good idea. I mean, isn't Robotic good enough? Do we need fancy stuff like Lua?
#9
Posted 07 August 2008 - 11:51 PM
nooodl, on Aug 7 2008, 12:56 PM, said:
Wait.
Well, okay, maybe Forth could be useful, but I don't really think adding _any_ other programming languages to MZX is a very good idea. I mean, isn't Robotic good enough? Do we need fancy stuff like Lua?
You don't really need Lua, but Robotic is very limited. Adding something else, such as Forth or Lua would improve it (some people wanted to put Lua in MZX for this reason, I think, but please keep Robotic as well!). But still a lot of things are missing if you just do that, there are other things that should be improved in MZX as well, such as the ability to edit the internal structures, edit the pieces on the board in raw mode, the ability to add new types of things (some of the "__unused" ones can be changed to "CustomThing1", "CustomThing2", etc), editing the flags[] array for the CustomThing1 etc (and enter global codes for when that object is updated, pushed, etc), and so on.
Anyways I think in Forth, the Robotic commands can all be made into Forth commands as well, for example, you could be able to make a loop as in Robotic, like doing like this:
0 VARIABLE LOOP-START-MARK : (LOOP-START) 0 LOOPCOUNT ! ; : LOOP-START COMPILE (LOOP-START) HERE LOOP-START-MARK ! ; IMMEDIATE : (LOOP-FOR) SWAP LOOPCOUNT @ 1+ DUP LOOPCOUNT ! <= IF R> DROP >R ELSE DROP THEN ; : LOOP-FOR LOOP-START-MARK @ COMPILE-LIT-HERE ! COMPILE (LOOP-FOR) ; IMMEDIATE
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#10
Posted 08 August 2008 - 12:10 AM
: "loop" inc "loopcount" 1 wait 1 goto "loop"
Why use many words when few will do? In other words, why use Forth if you have to type in so many commands to accomplish what Robotic can already do in just four very short lines?
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
#11
Posted 08 August 2008 - 12:16 AM
weasel, on Aug 7 2008, 04:10 PM, said:
: "loop" inc "loopcount" 1 wait 1 goto "loop"
Why use many words when few will do? In other words, why use Forth if you have to type in so many commands to accomplish what Robotic can already do in just four very short lines?
No, no, no, no, NO. That isn't what it is (in fact, many people that do not understand Forth might think of that wrong things). The codes I posted DEFINE the looping commands. There is no Robotic codes that can DEFINE the looping commands in Robotic.
LOOP START DOUBLE "SOMETHINGVAR" LOOP FOR 6
might be written in Forth, using the definitions above, as:
LOOP-START SOMETHINGVAR @ 2 * SOMETHINGVAR ! 6 LOOP-FOR
(You might thing the line that doubles "SOMETHINGVAR" is long. But Lua doesn't have a "somethingvar*=2" command either.)
Of course, if you don't like that long codes, you can define DOUBLE in Forth as well:
: DOUBLE DUP @ 2 * SWAP ! ;
This post has been edited by zzo38: 08 August 2008 - 12:22 AM
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#12
Posted 08 August 2008 - 12:21 AM
zzo38, on Aug 7 2008, 04:16 PM, said:
Because you don't NEED to define the looping commands in Robotic. They're already there. I ask again, why use Forth at all if Robotic can already do this, in a far simpler fashion? What's in it for a simpleton such as myself? What makes Forth so great?
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
#13
Posted 08 August 2008 - 12:25 AM
weasel, on Aug 7 2008, 05:21 PM, said:
If you do not like Forth, then you do not have to use it. But really Forth is really great, but not everyone has to use if you don't like it! If you like Robotic then use Robotic! If you like Lua then use Lua! If you like COBOL then use COBOL! But I like Forth because I think Forth is better (in my opinion).
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#15
Posted 08 August 2008 - 02:42 AM
weasel, on Aug 7 2008, 04:32 PM, said:
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#16
Posted 08 August 2008 - 09:32 AM
But really, Forth is the kind of programming code which you look at and think "Jeez, that is unreadable". I can't make out anything of that basic loop code you posted.
However, I'd like an addition in normal Robotic (like a special kind of second global robot) that defines a large amount of text to one command. Like this:
"writenumbers %1" >loop start >write overlay c0f "&loopcount&" at 2 "loopcount" >loop for %1
And then when you put "writenumbers 20" in a robot, it executes the code above (and %1 is some kind of special changable variable).
#18
Posted 08 August 2008 - 01:34 PM
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#20
Posted 08 August 2008 - 10:25 PM
--JT
http://zhaymusic.com/
#21
Posted 08 August 2008 - 10:41 PM
--ajs.
#22
Posted 09 August 2008 - 06:06 PM
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#23
Posted 09 August 2008 - 08:40 PM
zzo38, on Aug 9 2008, 11:06 AM, said:
I might be misunderstanding things again, as I am prone to do, but wouldn't something like that be extremely dangerous as far as the damage that could be done if a malicious coder decided to try something with it?
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
#24
Posted 09 August 2008 - 10:35 PM
weasel, on Aug 9 2008, 01:40 PM, said:
No, I would code the module so it would be safe (and if someone still manages to break the game, restarting MegaZeux will reset those things). The low-level things I plan to write the module for aren't so low-level that you will permanently ruin everything if you use them. And malicious coders can already damage your file-system through the commands that MegaZeux already has. If you use Linux, you can make it more secure from file-system attacks using chroot, and creating a separate account for MegaZeux, and other things that can secure it more.
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#25
Posted 09 August 2008 - 11:12 PM
zzo38, on Aug 9 2008, 05:35 PM, said:
No they can't, unless you're dumb enough to run MZX from a directory that has other things in it, and even then it'd be nothing more than a total guessing game, so you'd have to be dumb enough to run MZX in your root directory to really let anyone damage anything.
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#26
Posted 09 August 2008 - 11:13 PM
Exophase, on Aug 9 2008, 03:12 PM, said:
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#27
Posted 10 August 2008 - 12:14 AM
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#28
Posted 10 August 2008 - 12:20 AM
Exophase, on Aug 9 2008, 05:14 PM, said:
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#29
Posted 10 August 2008 - 12:22 AM
zzo38, on Aug 9 2008, 07:20 PM, said:
You're not making any sense. You want to call a module from Lua or Forth interpreters in MZX, written in C, but you want the users to have to compile it for the architecture they're on? What?
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#30
Posted 10 August 2008 - 12:24 AM
Exophase, on Aug 9 2008, 05:22 PM, said:
No, I mean that any developers of MZX could look and see if my module is good, and then compile it in so that it will already be compiled when someone download MZX it will already be in.
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.

Help










