Forth Mecrisp IDE and decompiler.

Added by linuxpeppe 5 months ago

Thanks to Jcw i discovered forth approach to micro programming. I'm just new to this language. I was fascinating by RPN used in my loved HP48 calc, and forth is not so far.
Folie is a great tool because is very thin and portable but i'm also looking for an IDE that make it simpler read code, eg to jump from file to file looking for a word definition.
I found some forth implementation has word "see" or "(see)" to decompile a previous compiled word getting the relative source code. Has Mecrisp-stellaris something like that?
Actually i have installed atom editor plus forth support and terminal packages.
Any suggestion about Forth IDE/tools?

Replies (3)

RE: Forth Mecrisp IDE and decompiler. - Added by jcw 5 months ago

For cross-referencing, I use vim in combination with "exuberant tags", which creates a "TAGS" file. Pressing ctrl-] on a word takes me to its definition (in whatever source file), and pressing ctrl-t takes me back to the place I was before (and this nests). That's all very vim-specific, although some other editors do support this same tag-file mechanism.

One idea is to add some support for sending the current selection in the editor to Folie, to allow quick updates of single words and to send off little test snippets repeatedly. See also this discussion on GitHub about sending code directly to Mecrisp.

Yes, Mecrisp also has an implementaion of "see" (for M0 and M3, but keep in mind that this is not a threaded Forth but one which compiles directly to machine code. The output of see is a disassembly listing, not the Forth source, although you can usually see the general flow from the things it calls and references.

I know of no IDEs which support Forth. I'm not sure it would help a lot - you may be better off picking whatever editor you are comfortable with, learn to configure it as much as you can, and keep editor and Folie open in separate windows or panes. The way I see it, Folie will become more and more of a gateway to an attached board (whether USB or over a network link), and at some point I'll want to add ways to tie it to MQTT, so that the attached board can send its output there, and possibly also be controlled via MQTT. But that's just vapourware for now.

RE: Forth Mecrisp IDE and decompiler. - Added by skvery 2 months ago

On doze :-( I use Sublime. Folie seems a bit buggy on doze, it looses the lower case asdf keys. (Maybe it is just me :-)

Any suggestions for a MSP430 profiler that can work with Forth?

RE: Forth Mecrisp IDE and decompiler. - Added by jcw about 2 months ago

The asdf problem on Windows is really strange, and has been reported a while back (issue 44 on GitHub). The fact that it happens during key entry points to readline, since Folie only gets control back once a full line has been entered. I can't think of anything in Folie which could have any key-dependent behaviour.

We can only hope that the underlying readline package or Go compiler updates fixed this, or soon will.