Author Topic: Axe Interpreter  (Read 24566 times)

0 Members and 2 Guests are viewing this topic.

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Axe Interpreter
« Reply #15 on: December 20, 2011, 08:53:44 pm »
HEY THAT'S MY TECHNIQUE!! lol :P
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Interpreter
« Reply #16 on: December 20, 2011, 09:15:16 pm »
Scratch that -- longer then 10 mins.  I thought I had pyInstaller or cx_freeze all set up and everything, but that doesn't seem to be the case :P.

Plus, parents are calling for dinner.
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: Axe Interpreter
« Reply #17 on: December 20, 2011, 11:20:55 pm »
Well, I've tested it and it simply doesn't work, so....
But either way, I had a PyInstaller environment set up for Croquette building and testing, so I easily translated over my build script for this project! :)

Here's my script:
Code: [Select]
:: This is where PyInstaller is located on your computer. It should be the stable (1.5.x) version!
:: Do NOT use the trunk version; it will NOT work.
@set PYINSTALLER_PATH=C:\Users\arthur\Documents\pyinstaller-1.5.1
:: This is where you want the build files to be. You should set this to the source dir\build directory, but you're free
:: to choose any directory you wish - just make sure it exists.
@set BUILD_DIR=C:\SourceCode\axeinterpreter\build
:: File to compile (this should be the main one)
@set TO_COMPILE=C:\SourceCode\axeinterpreter\source\main.py
:: Basename of Python file that you're compiling - for example:
::    Compiling C:\bla\bla\bla\interesting.py
::    The basename for this file is "interesting"
::    (do not specify quotes)
@set BASENAME=main
:: Final base file name
@set FINALNAME=AxeInterpreterv0.0

:: Uncomment if you haven't used PyInstaller before
::C:\Python27\python %PYINSTALLER_PATH%\Configure.py
C:\Python27\python %PYINSTALLER_PATH%\MakeSpec.py --onefile --windowed -o %BUILD_DIR% %TO_COMPILE%
C:\Python27\python %PYINSTALLER_PATH%\Build.py %BUILD_DIR%\%BASENAME%.spec
move %BUILD_DIR%\dist\%BASENAME%.exe %BUILD_DIR%\dist\%FINALNAME%.exe
pause

Here's a Windows build for people to play with - again, the program seems to not work, but I release it anyway just in case someone does get it to work. ;)

Attached is a ZIP file - just decompress and enjoy! :) There are helper BAT files so that you will never have to open a console ever again :P
This should also work in Linux via WINE.

EDIT: Oops, forgot to include PyGame! :P It still doesn't work, but YMMV: http://dl.dropbox.com/u/1016340/AxeInterpreterv0.0_Windows_x86.zip (if link is not up immediately, it will be in a few minutes)
« Last Edit: December 20, 2011, 11:32:08 pm by alberthrocks »
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Interpreter
« Reply #18 on: December 21, 2011, 12:36:58 am »
Because I don't want people to play with broken exes, here are working ones!

I made a few minor tweaks.  Double-clicking the exe now starts the interpreter, you can drag and drop a text file over the exe to try and run it, and the program will drop into the interpreter mode after a text file finishes running (so that you can do a postmortem, dissect variables, etc.)

For some inexplicable reason, you need to add a 'import pygame._views' while using pyinstaller in windows but exclude it for linux.

Download Windows version: http://dl.dropbox.com/u/10645749/axe-interpreter-windows.zip
Download Linux version: http://dl.dropbox.com/u/10645749/axe-interpreter-linux.zip
« Last Edit: December 21, 2011, 12:44:22 am by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Axe Interpreter
« Reply #19 on: December 21, 2011, 03:31:07 am »
is it possible that you need other files than the exe? it searches for a file in a directory on your pc xp
« Last Edit: December 21, 2011, 03:31:20 am by Nick »

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Interpreter
« Reply #20 on: December 21, 2011, 03:39:33 am »
Really?  What do you mean?
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Axe Interpreter
« Reply #21 on: December 21, 2011, 03:45:02 am »
uh, wow wait, i tried it again and now it all works fine :) but the first time it gave like 1 minute long an error message in the commandline (but so fast you couldn't read it) and than it stopped saying something like c:\users\michael\dropbox\python files not found or so (i already closed it os it's not exact..ending with ,] that's all i can remember), but now it is ok
« Last Edit: December 21, 2011, 03:45:25 am by Nick »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Axe Interpreter
« Reply #22 on: December 21, 2011, 04:08:24 am »
Nice project. One bug I noticed is that even if you don't use DispGraph, entering anything in the interactive mode will cause the display to update.

As for the name, what about AXE (Axe eXecutable Environment) or AXiE (Axe eXecuting interactive Environment)?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Axe Interpreter
« Reply #23 on: December 21, 2011, 05:51:23 am »
AXIS?
Axe
Interpreting
System

:D

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Axe Interpreter
« Reply #24 on: December 21, 2011, 06:14:06 am »
Or what about Axecutor?


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Axe Interpreter
« Reply #25 on: December 21, 2011, 06:24:40 am »
Oooh, I like! ;D

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: Axe Interpreter
« Reply #26 on: December 21, 2011, 10:08:22 am »
Because I don't want people to play with broken exes, here are working ones!

I made a few minor tweaks.  Double-clicking the exe now starts the interpreter, you can drag and drop a text file over the exe to try and run it, and the program will drop into the interpreter mode after a text file finishes running (so that you can do a postmortem, dissect variables, etc.)

For some inexplicable reason, you need to add a 'import pygame._views' while using pyinstaller in windows but exclude it for linux.
Good tweaks indeed. :)
Also, that bug you mention about has been fixed rather recently... O_O http://www.pyinstaller.org/ticket/406
There's a "hook" that had to be implemented for it to work. (pygame._view is considered as a "hidden" import.)

Some further suggestions...
1) I suggest you look into threading (you'll be seeing that very soon in Croquette!) for Pygame event pumping. If you don't "process" the events sent to the Pygame window, Windows will think it died and ask to terminate it. :P The Pygame portion MUST remain in the main thread (unfortunately), but the CLI interpreter can be handled in the thread, making things work out nicely. :) (Even if it's odd to do graphics processing first :P)
2) Add an option to hide/show the window? (As you've demoed, some commands do not need the screen shown.)
3) CLI commands - like when I do Output(1,1,"Hello world!"), it shows it in the console instead. A flag must be toggled for this to work, of course. If you want to implement this, you need to use a mix of the ncurses module and the Windows Console module.

Otherwise, it's pretty nice :D
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Interpreter
« Reply #27 on: December 21, 2011, 11:39:55 am »
Nice project. One bug I noticed is that even if you don't use DispGraph, entering anything in the interactive mode will cause the display to update.

Oh, that's intentional.  To turn that off, type '@DRAW 0' and to turn it back on, type '@DRAW 1'.  I thought that constantly having to type 'DispGraph' was a bit annoying.

Some further suggestions...
1) I suggest you look into threading (you'll be seeing that very soon in Croquette!) for Pygame event pumping. If you don't "process" the events sent to the Pygame window, Windows will think it died and ask to terminate it. :P The Pygame portion MUST remain in the main thread (unfortunately), but the CLI interpreter can be handled in the thread, making things work out nicely. :) (Even if it's odd to do graphics processing first :P)
2) Add an option to hide/show the window? (As you've demoed, some commands do not need the screen shown.)
3) CLI commands - like when I do Output(1,1,"Hello world!"), it shows it in the console instead. A flag must be toggled for this to work, of course. If you want to implement this, you need to use a mix of the ncurses module and the Windows Console module.

Otherwise, it's pretty nice :D

Thanks for the suggestions!  I ended up using multiple processes instead of threads, but the final effect was the same.  Never mind.  Should have tested on Windows.  Got threads working now.

I'll look into the other suggestions, thanks.
« Last Edit: December 21, 2011, 12:15:56 pm by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Interpreter
« Reply #28 on: December 21, 2011, 02:32:23 pm »
Or what about Axecutor?
That sounds like a Pokémon :P

Nice idea though lol

Also nice to see this worked on more :D

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Interpreter
« Reply #29 on: December 21, 2011, 03:50:05 pm »
Exe file yet?