PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Updates on the new compiler / interpreter in 0.7.

Just a quick update to let you guys know that I was hard at work with PPL (hence my less active posts here).

As a lot of you have read in a previous email, I rewrote the compiler and the interpreter in total C code instead of using the dynamic compiler to solve a really agravating problem with memory addressing.

Tests shows that the new interpreter is the same speed (faster in some cases) as the old interpreter and is obviously more portable and I can now make PPL compatible with SH3 and MIPS.

After a few weeks of head bashing, I finally found out why PPL was slowing down in some weird situations. Each time a proc or a func was called, PPL created new variables to memory dynamically and freed them after the proc or func exited. This proves to be a very bad design decision when done automatically (by the garbage collector). What I do now is I keep the variables (not the content that is allocated by the user but the internal variable structure content which is about 76 bytes per variable) in memory at all time and reuse them when needed. This technic improves the speed and also it's great for game development. Games need to run at the same speed all along. Memory will not get fragmented as much, therefore speed won't suffer.

I still have to work on the issue of structures. They are still running at variable speed. This should be fixed soon, now that I found out about the bad memory allocation in PPL.

Hope this post makes sense.
Kornalius,

Well done! It's good to hear that you've sorted the issues out. Now you can get back to work on new features and other improvements! We're a selfish lot aren't we? :twisted:
It'll all be worth it when you get it to final release.

Kind regards,
Andy
Hi,

Actually, I did more testing last night and the problem isn't solve completely yet. I thought it was yesterday. I still have to work on it! :cry: I hope to sort everything out very soon.

Regards,
Kornalius
After more testing and debugging I finally was able to fix most of it. The speed seems to be constant for now but it still is slower in some programs by just adding a form to the program.

I will do more testing tonight with other ppl programs to see if it actually works in all scenarios.

I will optimize the parser and linker to use a large block of memory instead of using small blocks for each token. This should improve speed somehow. Well, I hope!

Regards,
Kornalius
Well, finally, I have reprogrammed some parts of the compiler, interpreter to use their own heaps. This improve the problems I had with memory fragmentation. The speed is now constant in all my tests.

I have optimized the interpreter quite a lot and I still have a few things to optimize tomorrow. So far, in Simple2.ppl, I was getting around 67-70 fps at the most in previous versions, I am now getting 76-78 fps and with the stuff I will do tomorrow I should reach 80 fps. This is a good improvement. I have major improvements in the benchmark.ppl too.

Starting tomorrow, I will start fixing bugs that have been piling up in the last few weeks and will implement new features.

Expect 0.7, next week if nothing major happens.

Regards,
Kornalius
Kornalius,

You must be coding like a man possesed! :twisted:

Well done with your enhancements - I'll look forward to version 0.7.

Regards,
Andy
Possessed? MUAAAAHHHAAAAAHHHAAAA. :D I am "totally normal". Grrrr.... Weeeeeee.... Haaaaaa... :x :D 8) :o :cry:

Regards,
Kornalius
Todays updates:

1. Optimization of the interpreter, getting 79-80 fps in Simple2.ppl.

2. Forward procedure or functions declaration with the forward statement.

ex:

Code:
forward proc test (x$, y$)

proc test2
test (10, 20);
end;

proc test (x$, y$)
end;


3. NewButton() function to add buttons (user-defined possible) to the form menu bar.

4. Better error handling at runtime. Gives lots of information and is catched at all time.

5. Ability to search for a proc or func by its name and then call it later on:

ex:

Code:
func test (x$, y$)
return ((x$+y$)/2);
end;

proc main
p$ = GetProc("test");
ShowMessage(Call(p$, 10, 20));
end;


5. Fixed the local() function to create a new local variable if a global variable is passed in the list.

6. Many bug fixes.


I still have a lot on my plate but it looks promising for a release next week.

Regards,
Kornalius
Today's updates so far:

1. GetFile and PutFile dialogs have enhanced. (Very nice!)

2. Accelerator keys support in menu items.

3. Toolbar buttons added to the main.ppl, editor.ppl and progman.ppl programs.

4. Editor.ppl support for font selection and added an ini file to store editor's preferences.

Regards,
Kornalius
PointOfLight · 21 Jul 2004, 17:07 UTC
Man, you're making me drool. I can't wait until this version comes out!
Will be out next week for sure now.

Btw, did you finish your libraries? I would like to include them with this version.

Regards,
Kornalius
PointOfLight · 21 Jul 2004, 17:55 UTC
I actually haven't had much chance to work on them since last we spoke about it, but I will send you an email tonight with my WIP. If nothing else, maybe we can include them with a "warning", and I can update them as you update releases of PPL. Even in the state they are in now, I think they will be useful to most users.
Sounds good to me but you still have about a good week to play with them if you want. :wink:

Regards,
Kornalius