Source code causes Atalan to crash

7 views
Skip to first unread message

Michel Iwaniec

unread,
Mar 23, 2012, 4:14:30 PM3/23/12
to Atalan Programming Langugage
Hi, I just took some time to to check out Atalan for my NES project...
I'm really intrigued by it's goal to produce highly optimized code for
6502, and the flexibility of its rule rewriting system allowing you to
redefine how language commands are implemented in 6502.

But after trying out the Windows version downloadable from the project
webpage on my Windows7 netbook, I was up for a major letdown:
compiling *any* sort of program with the "-p nes" option would just
make Atalan crash. Even the 'hello world' example results in an
"Atalan has stopped working" window! (compiling for atari seemed to
work fine though...)

Not wishing to give up yet, I figured I should try compiling it from
SVN source to see if there's been any recent bugfixes. And thankfully,
'hello world' finally worked when selecting nes as the platform! :)

...but still no luck when I tried my bigger program. :(

After manually removing code piece by piece, I found my mistake:

-- begin compilerkiller code ---
const SpriteImageEditCursor:array = (
4,
0,EDIT_CURSOR_TILEID&$FF,$00,0
; 0,EDIT_CURSOR_TILEID&$FF,$40,8
; 8,EDIT_CURSOR_TILEID&$FF,$80,0
; 8,EDIT_CURSOR_TILEID&$FF,$C0,8
)
--- end compilerkiller code ---



Changing this to the more correct:

--- begin compilersurvivor code ---
const SpriteImageEditCursor:array = (
4,
0,EDIT_CURSOR_TILEID bitand $FF,$00,0
; 0,EDIT_CURSOR_TILEID&$FF,$40,8
; 8,EDIT_CURSOR_TILEID&$FF,$80,0
; 8,EDIT_CURSOR_TILEID&$FF,$C0,8
)
--- end compilersurvivor code ---

...would finally keep the compiler alive long enough to give me
an .asm file.

As a long-term Python enthusiast, I've grown to like serpents, but
from this short experience it seems as if Atalan the snake is very
eager to bite you in the foot if you're not *extremely* careful when
writing your code ;)

I'm still excited by Atalan and would really like to be able to use it
for my non-performance-critical code, but I must admit this first
experience is pretty scary... I think the scanner/parser would benefit
from some some serious error-checking, as you'll soon go nuts if you
have to deal with a crashing compiler every time you write a syntax
error.

So my number one question would be:
- How come it is so easy to crash the compiler by just giving it some
illegal code? I would have expected that should give me a syntax error
and tell me which the offending line is. "Atalan has stopped working"
is not very helpful for finding errors in your source.

And secondly, would you consider adding the '&' to denote bitwise and?
The 'bitand' operator seems a bit ugly to me, even if I guess you can
get used to it...

Regards,
Michel
Reply all
Reply to author
Forward
0 new messages