Automatic Steve to Python
In breve 2.6 beta 3 release there's a small description at the beginning of each Python script saying that the code was automatically converted from the steve language.
It seems to me that converting from one language to another is straightforward, but is breve itself capable to do such a thing?
»
Submitted by cesargm on Sat, 2007-10-06 18:48.
- Login to post comments

Python Conversion
The code was likely translated using a UML case tool, or a script built from scratch. There are a few open source apps that can convert your own language into another one. I was going to invest some considerable time to learn one that is used by a few thousand developers, working on four languages is enough for me.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
But steve is a scripting
But steve is a scripting language developed specifically for breve. It is unlikely that there are any general purpose automatic conversion tool to include steve (I might be mistaken though)
The Water is Deep!
Eclipse is an open source IDE with UML code specification, next to maybe three or four good BNF grammars. Eclipse is big with to much to get lost in your imagination with, with all its add-ons. Eclipse is really good open source but don't loose your focus. The forge must have a few hundred tools to convert languages. AWK is also a good tool in the right hands. Read it "...from the original steve-language source code" not specifically steve. A BNF is comparable to raw SQL, there is also Cyc Engine. I just don't have the time to learn all these good tools so I stick with what works best. I have used PHP and MySQL for years.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Steep learning curve.
It says its from the steve source-code not steve, is what I understand it to mean. If I had the time I would learn AWK, it can handle a lot more than the conversion, and the learning curve is not as sharp as the BNF Parsing grammars, or some foreign 200MB install that takes three weeks to get a handle on the editor. Finding the balance between learning and getting projects finished is the challenge. Fish or Cut Bait, leads most of my decisions. AWK is not specifically designed for conversion, but if you ever worked in Forth, and learned how to write Forth in Forth, AWK looks good to write your own parsing scripts.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Make one
Honestly I would write my own. Five Months one person for a good beta.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
This is undocumented and not
This is undocumented and not officially supported, but in the latest CLI beta, you can try running: breve -Y MySim.tz
That will create a MySim.py. There are some special cases which may require additional editing though... Post here if you run into any troubles.
- jon
breve -y errors
I took hellowalker.tz straight from the getting started demos and tried to convert it:
C:\breveIDE_2.7.2>breve -Y hellowalker-test.tz
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "lib/classes\breve\__init__.py", line 3, in ?
import sys, os, math, random, array
ImportError: No module named os
Failed to initialize Python frontend. breve will not be able to execute Python
files.
Setting up the simulation.
C:\breveIDE_2.7.2>
The simulation runs normally in the GUI, but doesn't run on the CLI:
C:\breveIDE_2.7.2>breve hellowalker-test.tz
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "lib/classes\breve\__init__.py", line 3, in ?
import sys, os, math, random, array
ImportError: No module named os
Failed to initialize Python frontend. breve will not be able to execute Python
files.
Setting up the simulation.
^C
C:\breveIDE_2.7.2>
(The last Control-C exited the simulation window, which popped up, but nothing happened afterwards.)
You should be able to recreate this by using the hellowalker.tz file and running the breve CLI on it. Let me know if I'm in error.
Thanks for the nice (usable, friendly, Python scriptable) 3d agent-based modeling software!
Adam