2022-01-14 13:05:37 what is a good forth for the raspberry pi 1 & 2? Preferably allowing generation of binaries. thanks in advance! 2022-01-14 13:07:24 I mean 2022-01-14 13:07:30 what forth is in your repos? 2022-01-14 13:16:36 f-a, what do you mean in my repos? you mean which ones have I looked at? mecrisp is very very good and fast but have not found a way yet to generate static binaries, github.com/mark4th doesn't start on arm, but works fine on x86, pforth is nice and portable but slow and doesn't have optimized code, spf4 is very very fast but only x86 2022-01-14 13:17:24 oh I see 2022-01-14 13:17:33 I meant in your OS repos 2022-01-14 13:21:09 the repost have gforth and pforth 2022-01-14 13:27:39 few forth target generation of binaries 2022-01-14 13:30:25 crc, regardless of generation of binaries, which ones would you say are the best forth that generate native code? 2022-01-14 13:32:00 (x86 and arm) 2022-01-14 13:35:04 uhh; what do you mean generate native code 2022-01-14 13:35:56 I mean when they compile a word the execution token points to machine code generated by the forth 2022-01-14 13:36:16 (they don't call a c function or something else) 2022-01-14 13:36:37 for turnkey / standalone purposes, assuming standard forth, if commercial is acceptable, it'd probably be vfx 2022-01-14 13:36:43 that would be most of them 2022-01-14 13:37:17 crc, I see, how about open source? 2022-01-14 13:38:11 not many that allow for generation of binaries 2022-01-14 13:38:16 crc, since you mentioned assuming ans forth, are there other good forths that are non-ans? 2022-01-14 13:38:22 reva, for x86: https://github.com/ronaaron/reva 2022-01-14 13:44:30 what are you trying to accomplish? 2022-01-14 13:55:05 also just curious, why is important to generate native code and to be optimized? looking for something you can use for anything you might end up wanting to do? 2022-01-14 14:14:20 in general yes, good for anything I may do; but I want the freedom to hook to the OS without going through C (I can easily make syscalls directly with spf4 for example) 2022-01-14 14:15:13 the speed, because who doesn't want speed? :) the only open source forth that is on par (or better) than vfx is spf4 in terms of speed 2022-01-14 14:15:40 but I was looking to see what options are out there 2022-01-14 14:19:09 crc, reva seems to have nice ability to make syscalls also but the author says he is not maintaining it anymore: https://github.com/ronaaron/reva/issues/1 2022-01-14 14:25:46 a88, you could make your own foth like a lot of people have :) 2022-01-14 14:27:40 :) making a toy forth is easy, making an optimized native code forth is not that easy :) 2022-01-14 14:28:23 doable, but a good amount of work. I would rather contribute to an existing one if that was the case. 2022-01-14 14:28:56 crc, btw, reva seems fast enough also. 2022-01-14 14:30:17 C is still 2-3x faster than optimized forth so you basically have to find what speed you can live with 2022-01-14 14:30:33 and for a lot of projects unoptimized forth is fast enough 2022-01-14 14:31:03 yes, trade-offs are needed always :) 2022-01-14 14:31:34 but I want to get a good idea about what forths are available (open source), their speed and what they do 2022-01-14 14:33:10 btw gforth has improved speed a lot in the 7.9 snapshot, but I have no idea why they don't make a new (stable) release 7.3 is many years old now 2022-01-14 14:40:28 gforth 7.9 also has nice help and locate and a nice status bar showing the stack always; it is slower than the other forths and you can only distribute gpl images (this is the biggest down side) but it (7.9) has the best user experience 2022-01-14 15:06:42 Reva had a focus on performance (side note, it started as a fork of my forth, with a shift to focus on performance and turnkey support) 2022-01-14 15:28:11 any recommendations for a forth csv library? 2022-01-14 16:08:25 crc, which one is your forth? 2022-01-14 16:13:25 Retroforth 2022-01-14 16:14:32 At the time Reva forked off it, it was written in x86 assembly; it now runs on a couple of emulated MISC architectures 2022-01-14 16:18:57 crc, very interesting I too think highly of the colorforth to use prefixes indicating the context of a word 2022-01-14 16:19:29 crc, can I run it on x86 somehow? 2022-01-14 16:20:03 What OS are you using? 2022-01-14 16:20:10 linux 2022-01-14 16:20:45 http://retroforth.org/latest.tar.gz 2022-01-14 16:21:57 (just built it from the github repo) 2022-01-14 16:21:58 Uncompressed, `make`, `./bin/retro` 2022-01-14 16:23:08 gotta read a little bit, just typed '1 1 +' and it exited word not found '1' 2022-01-14 16:23:58 Or `./bin/retro-repl` to use the minimal system w/o Linux/BSD additions 2022-01-14 16:24:08 Numbers need a # prefix 2022-01-14 16:24:29 ah 2022-01-14 16:25:30 reading through retro-book.md now 2022-01-14 16:27:53 On Linux and BSD, there is an optional retro-compiler binary that can generate turnkey executables (requires objcopy in $PATH and a host with ELF binaries); this is briefly covered in the manual 2022-01-14 16:28:13 crc, can you write assembly (e.g. in between CODE ... END-CODE or something similar?) 2022-01-14 16:29:48 ahh..I see you generate binaries too with retro-compiler.. 2022-01-14 16:31:05 There is a runtime assembler that can be used 2022-01-14 16:32:54 There’s a section in the manual on this, starting with “Working With Assembly Language” 2022-01-14 16:35:03 My binaries from retro-compiler combine the emulator and vm memory image into a single executable; it’s not as well tested as the main system (I’m not aware of any one other than me actually using this part of the system regularly) 2022-01-14 16:37:18 hmm...the vm is also available in javascript...it runs on the browser too? 2022-01-14 16:40:00 Yes 2022-01-14 16:41:33 I have a number of implementations of the vm; it’s important to me to be able to run at least the core functions on all the systems I use 2022-01-14 16:42:32 good, that is interesting...very useful -- what are the main use cases where people are using retro? 2022-01-14 16:42:48 can you compile the MISC op codes to x86 asm? 2022-01-14 16:43:58 MrMobius: Probably, but I've not tried this. 2022-01-14 16:44:40 Impexus might be a good starting point towards that (https://codeberg.org/jmf/impexus) if I decide to go back to x86 asm at some point 2022-01-14 16:47:10 x86 or arm 2022-01-14 16:47:30 x86; like in the readme 2022-01-14 16:47:36 wrong words 2022-01-14 16:47:41 as mentioned in the readme 2022-01-14 16:48:01 i don't think it'd be too hard to implement a naive compiler for retro's opcodes 2022-01-14 16:48:03 other than the IO ones 2022-01-14 16:48:10 crc...i see also you have unit testing built into the unu format...it's looking better and better. 2022-01-14 16:48:12 a88: I can't really answer for others, but for me: my personal software environment is mostly written in retro (text editor, command line tools, various servers & clients, small applications I use often) 2022-01-14 16:48:38 additionally, my employer uses a browser based system with a backend written in retroforth. We use this to manage/track orders in house. 2022-01-14 16:48:57 nice ! 2022-01-14 16:53:58 I might experiment with native code generation from the bytecode at some point; but this won't be anytime soon; I have a lot of things already started and planned. 2022-01-14 16:55:11 crc, how do you print the stack? the first 'anna palindrome? example doesn't show 2022-01-14 16:55:31 dump-stack 2022-01-14 16:55:56 thanks 2022-01-14 16:56:44 i really see the value in using sigils...looking great so far. 2022-01-14 17:43:50 crc, very nice language; i think it adds some heavily needed constructs like quotations thanks for making it available. 2022-01-14 17:44:38 thank you :) 2022-01-14 22:15:41 crc, by the way, you retro book has the most concise and clear explanation of the interpreter that I have seen anywhere (in chapter 12, syntax). That should help anyone wanting to learn forth properly (retro version or any other). 2022-01-14 22:21:26 Anyone know of someone getting FORTH working on the PineTime smartwatch? 2022-01-14 22:38:05 a88, crc, where is the retro book? 2022-01-14 22:43:19 http://forth.works/doc.html 2022-01-14 22:44:45 The comment I made about the interpreter is under Interacting->Syntax 2022-01-14 22:45:22 lagash, I don't know, but it would be nice 2022-01-14 22:52:09 lagash: iirc, mecrisp supports nRF52832, so could probably be adapted for pinetime 2022-01-14 22:53:29 is pinetime arm based? 2022-01-14 22:54:31 crc (and others) what is your opinion about mecrisp: pros/cons? 2022-01-14 22:54:37 joe9, you wear your watch on your leg? :3 2022-01-14 22:54:51 it uses an nRF52832, which is Cortex M4 core based 2022-01-14 22:57:26 a88: I haven't used it myself (I've done very little in the embedded realm), but it has an active community of users on the hackint irc network 2022-01-14 23:01:31 I see. I've played with it as it runs on linux (under qemu-static-arm in x86 and directly on arm linux) 2022-01-14 23:01:58 it is very fast, and has a register allocator which keeps the last five(?) values of the stack in registers 2022-01-14 23:02:07 this makes it very fast 2022-01-14 23:02:24 (in addition to the optimized native code) 2022-01-14 23:09:42 also the documentation is very good: https://mecrisp-stellaris-folkdoc.sourceforge.io/words.html 2022-01-14 23:27:30 a88, ya #mecrisp on hackint and also #mecrisp here. the creator is there and very helpful 2022-01-14 23:28:43 there are several flavors of mecrisp including riscv. i was interested in the one that uses an arm board to program an msp430. the assembly it produces for that is pretty darn good 2022-01-14 23:30:18 MrMobius, yes, from the little I've experimented with it; its compiler is very very good and produces very fast code. I only wish it had an x86 port 2022-01-14 23:46:18 a guy made an interpreter so he could run mecrisp arm code on his 286 2022-01-14 23:50:11 https://github.com/clausecker/palanqin 2022-01-14 23:54:11 ah, that's interesting, thanks for sharing it.