2024-01-19 19:04:59 hi all. For a work project, I have access to this twenty year old computer running QNX. Memory is a little tight, but it has a POSIX 1003.1 compatible Watcom C compiler already installed. I was wondering if I could get a useful forth installed on it. 2024-01-19 19:05:18 probably 2024-01-19 19:05:19 useful, as far as, can interact with files and that sort of thing 2024-01-19 19:05:32 any thoughts on which forth system to try? 2024-01-19 19:07:20 I get the impression gforth is wrapped close to GCC, so not sure if that would be a good place to start 2024-01-19 19:07:38 gforth is kinda huge 2024-01-19 19:35:25 PForth (Portable Forth) - that sounds promising 2024-01-19 19:36:01 posix interface 2024-01-19 19:56:03 When I was exposed to it (a bit over 20 years ago) I found pforth quite easy to work with. Built from source readily, was easy to modify, etc. 2024-01-19 19:57:00 It did have the non-Forthy termios settings, though, and I had to fight a little to change that. 2024-01-19 20:07:57 how tight are the memory limits? 2024-01-19 20:32:39 a few more options on forth in c to try: 2024-01-19 20:32:44 https://github.com/MitchBradley/cforth 2024-01-19 20:32:44 https://gist.github.com/lbruder/10007431 2024-01-19 21:30:50 I gave pforth a try. A problem I'm running into is that pforth uses stdint.h and that doesn't seem to be provided by this old version of watcom 2024-01-19 21:32:54 looks like stdint.h is a C99 addition 2024-01-19 21:33:01 foiled! 2024-01-19 21:34:21 I suppose I could make one 2024-01-19 21:41:17 look like cforth depends on stdint also 2024-01-19 21:41:56 lbForth doesn't but also doesn't include an file i/o functionality 2024-01-19 21:42:24 forth is generally more DIY than batteries included 2024-01-19 21:42:38 stdint should be easy to replace 2024-01-19 21:43:12 I moved away from trying to do this stuff in C some years ago. i find it all much more straightforward in assembly. 2024-01-19 21:43:37 There's no really good way to use the registers to full benefit otherwise. 2024-01-19 21:44:38 it looks like I'll need to come up with a stdint if I want to compile an modern C stuff 2024-01-19 21:44:45 seems reasonable enough 2024-01-19 21:45:26 probably most C programmers don't want just a vague notion of the size of their types 2024-01-19 21:46:06 C programming must have been interesting before that 2024-01-19 21:47:47 Isn't one of the points of structs to let you reference members of a set of things sharing a memory region without having to know their specific sizes? 2024-01-19 22:07:24 stdint is not that useful when everything is 8 or 16 bit 2024-01-19 22:12:08 I mean if architectures are 8 or 16 bit. you can still have 32 bit types. 2024-01-19 22:45:46 most codebases would define their own size typedefs. it's annoying to see people continue to do it in modern code when they could just include stdint.h