0 Members and 1 Guest are viewing this topic.
This actually wouldn't be hard to make a compiler in axe
+++++ +++++ initialize counter (cell #0) to 10[ use loop to set the next four cells to 70/100/30/10 > +++++ ++ add 7 to cell #1 > +++++ +++++ add 10 to cell #2 > +++ add 3 to cell #3 > + add 1 to cell #4 <<<< - decrement counter (cell #0)] > ++ . print 'H'> + . print 'e'+++++ ++ . print 'l'. print 'l'+++ . print 'o'> ++ . print ' '<< +++++ +++++ +++++ . print 'W'> . print 'o'+++ . print 'r'----- - . print 'l'----- --- . print 'd'> + . print '!'> . print '\n'This prints hello world
Quote from: Ashbad on December 08, 2010, 02:01:12 pmThis actually wouldn't be hard to make a compiler in axe A ON-CALC Compiler... Hum! That would be cool.
In case you don't find that challenging enough, there's always this programming language...
Actually it is very easy to compile. My compiler mentioned in the second post does just that. It almost directly translates to assembly in fact. > is inc hl, < is dec hl, + is inc (hl), and - is dec (hl). The other four commands are a little more complex, but not much bigger than 10 bytes a piece.
I went to the languages linked. OMG LOLCODE!!!!
It is interpreted, though that doesn't mean that it couldn't be compiled. I made a .NET interpreter recently: http://myserverathome.com/BFI.exe.