3 ms·
My only gripe with Forth is that whenever I ask Forth people "what software do you build in Forth?" they say "Forths". I guess that means they are making their
by bowsamic 4y ago
My only gripe with Forth is that whenever I ask Forth people "what software do you build in Forth?" they say "Forths". I guess that means they are making their own specific Forth for their purposes. I tried to make some basic TODO list style app that reads and writes to a file as a basic exercise and came up against some pretty major hurdles. Specifically, managing a dynamically changing list was basically a nightmare. When I asked a group of Forth programmers why it is so difficult they just said "Forth is not suited for that problem". So I suppose Forth is not seen as a general purpose programming language by Forth fans, but then what do they use it for?
- Buffout 4y ago> "what software do you build in Forth?" they say "Forths" When you learn that Forth is a broad term that can mean a shell, programming language, application, operating system. compiler, editor, block system, style, etc..., it becomes a little clearer. Those that ask of purpose of FORTH, is same as those that ask purpose of above mentioned things.
- bowsamic 4y agoOkay but what are they doing with that? Is it just the fun of buildings tools with tools?
- Buffout 4y agoFor me it's good to know the inner details of the tool I'm using. And when I compile executable I know purpose of every byte in it. That's not possible with other languages like GO, that gives you 2MB hello world executable
- astrobe_ 4y ago> "what software do you build in Forth?" Like others I indeed started with making my own Forth dialect (actually more than one try; and yes one of them could compile itself), but now it is my go-to scripting language. My latest script for instance was about converting some flat files format into an SQlite database. I also use it to prototype and test things, and I have a program that run and works for me 24/7. Can't really say more because it is partly work-related. > Specifically, managing a dynamically changing list was basically a nightmare So don't do it. Or do as everyone else does: use some C library/do it in C. You don't have to do everything in pure Forth, there's no law about that and being able (or not) to do anything in pure X doesn't prove anything. Or just allocate 1Mb for your todolist file (or limit the number of entries) and accept that if you need more, you'll have to edit one constant in your program. I don't see anything wrong with that. Some of my scripts have hard-coded parameters and I can imagine a user would be reluctant to edit something in alien incantations, but I can also imagine using the flexibility of Forth to create a more familiar "syntax" and make it so that those parameters are in a separate script, so that it looks more-or-less like a configuration file to the profane. You have no idea how we actually are narrow-minded, not creative and driven by habits about how things should be done. Forth won't get you a job, but at least it can open your mind and this reportedly is a portable (to other languages) quality. Also, avoid "what if" - especially with practice programs you don't plan to actually use. "what if" is the FUD device by excellence. > When I asked a group of Forth programmers why it is so difficult they just said "Forth is not suited for that problem" The whole point of Forth is that it is, in essence, a recipe for a language you can make yourself. If your Forth is not suited to the problem, then adapt it. Forth is not a dogma.
- veltas 4y agoCan you elaborate on what kind of TODO app you wanted? I might try this in Forth as an example (and if I do I'll email you).
- bowsamic 4y agoJust writing and reading to a file and a list where you can check off elements pretty much
- Buffout 4y agoThere's program much like that in the book Starting Forth, called "File system" it has 3 screens, if you take only what you need , you may be done in 1 or two screens, and you can store other data in that system like names and phone numbers. trick is you erase record memory you don't need , which then gets reused on next record add, it checks if it is empty.