can you put a Forth compiler into each DSP core?

Moderator: timpart

can you put a Forth compiler into each DSP core?

Postby eleitl » Mon Mar 18, 2013 10:46 am

32 kBytes is tight, of course.

An alternative would be running an crosscompiler on one or two of the ARM cores.
eleitl
 
Posts: 25
Joined: Mon Dec 17, 2012 3:22 am

Re: can you put a Forth compiler into each DSP core?

Postby timpart » Mon Mar 18, 2013 1:33 pm

I think this should be entirely feasible. The Forth compiler words don't occupy much space so providing you have the runtime in each core, it's not much extra. The Forth I'm working on as a casual project will do that, though it will keep the dictionary in external RAM. That will slow things down somewhat in compilation but saves some kilobytes of the precious 32K. I'm still budgeting for 4-6K of code for my kernel mostly in assembler, plus some K for user areas, stacks, buffers. A lot depends on what space speed tradeoffs you want to make. I'm using 32 bit addresses for threaded code, but these could be cut down to 16 bit with a speed penalty

As you say cross-compiling is possible too if you only want to execute a finished program in the cores. You could even do pure machine code rather than threaded code.

The only question that comes to mind is do you really want to have an interactive compiling environment in every core? If you want a different program in each then yes. (16, 64 or more consoles running at once???) If it is the same program a compile in one place and a replication mechanism would be handy.

Tim
timpart
 
Posts: 302
Joined: Mon Dec 17, 2012 3:25 am
Location: UK

Re: can you put a Forth compiler into each DSP core?

Postby Len » Wed Apr 17, 2013 7:27 pm

Forth is available written in "C" that is very tiny (search "Tiny Forth"). Thirty years ago 2K versions of Forth were created. I did some work in Forth and two things come to mind, one the way it was structured, when it was interpreted it would search for the name, but when it was compiled it would go to the address of the executable which was right after the name which would speed it up considerably. The second thing I remember is that it was stack oriented, like the old Hewlett Packard calculators and several months after writing a gem, it was very hard to remember. We called it a "Write only language".
Len
 
Posts: 21
Joined: Mon Dec 17, 2012 3:28 am
Location: Melbourne, Florida

Re: can you put a Forth compiler into each DSP core?

Postby ed2k » Thu Apr 18, 2013 3:59 am

I have a J1 VM running in ecore, right now don't have much functionality since I am still learning forth programming.
it is definitely possible to include the forth compiler.
ed2k
 
Posts: 113
Joined: Mon Dec 17, 2012 3:27 am

Re: can you put a Forth compiler into each DSP core?

Postby timpart » Thu Apr 18, 2013 6:33 am

ed2k wrote:I have a J1 VM running in ecore, right now don't have much functionality since I am still learning forth programming.
it is definitely possible to include the forth compiler.

Well done, that's great news! The J1 has simple instructions and does a lot of them. Will be interesting to see how fast it runs on actual hardware. I think the actual J1 has a relatively slow chip so Parallella might emulate about same speed.

Tim
timpart
 
Posts: 302
Joined: Mon Dec 17, 2012 3:25 am
Location: UK

Re: can you put a Forth compiler into each DSP core?

Postby vidarh » Fri Apr 19, 2013 2:42 pm

I love the sentiment that "32KB is tight".

The first computer we owned was a C64. There were a ton of compilers for it, including Forths.

Also, early versions of Turbo Pascal used 64KB for the editor *and* compiler.

Forth is a tiny language. Depending on the dialect you choose it can easily fit in 32KB including a compiler, editor and a bunch of code...
vidarh
 
Posts: 23
Joined: Mon Dec 17, 2012 3:25 am

Re: can you put a Forth compiler into each DSP core?

Postby timpart » Sat Apr 20, 2013 7:07 am

BBC Model B in my younger days. That had 32K RAM. Though the OS was in ROM which saved some space. The video RAM was part of the 32K though. On Parallella at least we have a handy I/O chip (Zynq) to do file and display stuff for us with little effort on our part.

Tim
timpart
 
Posts: 302
Joined: Mon Dec 17, 2012 3:25 am
Location: UK

Re: can you put a Forth compiler into each DSP core?

Postby simoninireland » Wed Jul 17, 2013 1:26 pm

I've had Forth running on an Arduino in about 7k including the C run-time, and either with or without word headers. (I didn't try it with a colon-compiler as well, but they're typically not all that much additional code.) Being able to log-in and run Forth interactively is fun, if rather pointless :-) Can't see any reason why one wouldn't be able to run it on multiple cores in the same sort of size.

--
-- Simon
simoninireland
 
Posts: 1
Joined: Wed Jul 17, 2013 1:21 pm

Re: can you put a Forth compiler into each DSP core?

Postby ysapir » Wed Jul 17, 2013 3:49 pm

vidarh wrote:I love the sentiment that "32KB is tight".

The first computer we owned was a C64. There were a ton of compilers for it, including Forths.

Also, early versions of Turbo Pascal used 64KB for the editor *and* compiler.

Forth is a tiny language. Depending on the dialect you choose it can easily fit in 32KB including a compiler, editor and a bunch of code...


Not to mention the crap load of amazing games built for those 80's "home computers". The Sinclair ZX-81 had a flight simulator with 16KB memory! I dare to say that C64's "Raid over Moscow" required lot more resources than a Forth compiler.
User avatar
ysapir
 
Posts: 393
Joined: Tue Dec 11, 2012 7:05 pm

Re: can you put a Forth compiler into each DSP core?

Postby 9600 » Thu Jul 18, 2013 10:23 am

ysapir wrote:Not to mention the crap load of amazing games built for those 80's "home computers". The Sinclair ZX-81 had a flight simulator with 16KB memory! I dare to say that C64's "Raid over Moscow" required lot more resources than a Forth compiler.


Right, so who's going to write the FPGA HDL to wire up 16x joysticks and UHF modulators? :D
Andrew Back (a.k.a. 9600 / carrierdetect)
User avatar
9600
 
Posts: 997
Joined: Mon Dec 17, 2012 3:25 am

Next

Return to Forth

Who is online

Users browsing this forum: No registered users and 0 guests