2022-02-18 15:22:44 KipIngram: just saw your answer in the log 2022-02-18 15:23:14 there is a book/post similar to the forth fundamentals book? 2022-02-18 15:26:32 lagash: it's likely you'll have to write your forth in java/kotlin to have a forth able to let you make android applications 2022-02-18 15:27:03 it's one of my goals btw once I'll be sure I like forth 2022-02-18 15:28:09 I've tried with android sdk and jni, you can add ffi bindings of java trough c, but it's not nice 2022-02-18 15:28:23 vms14: Gforth supports Android, I also looked into 4tH, but besides net2o I haven't seen anything substantial yet.. 2022-02-18 15:28:24 the best approach seems to make a forth interpreter in java/kotlin 2022-02-18 15:28:40 lagash: supports android, but has bindings to create applications? 2022-02-18 15:29:02 they seem to just have compiled it and run, (I have it installed in my phone) 2022-02-18 15:29:17 vms14: there already is net2o, which is an app, and there are a few demos in the source, like a camera recording app that I can't get working on Android 10.. 2022-02-18 15:29:22 also I see once you install it installs some other apps 2022-02-18 15:29:36 oh 2022-02-18 15:29:40 it's nice 2022-02-18 15:29:53 I got amused on how easy was to provide ffi in gforth 2022-02-18 15:30:27 I'll see how far I can get with this. 2022-02-18 15:30:49 https://rosettacode.org/wiki/Draw_a_pixel#Forth 2022-02-18 15:31:18 lagash: I also want to do stuff with forth in android 2022-02-18 15:31:22 4tH has really nice bindings to Gtk I believe 2022-02-18 15:31:55 Supposedly 4tH comes with over 500 different libraries, although some of them only have one or two words, meh 2022-02-18 15:31:57 actually I think I'm coming to forth just because I want to put it in android 2022-02-18 15:32:26 I've put s7 scheme in android and was able to get a remote repl and to add a textview 2022-02-18 15:32:45 but the ffi is by using java jni trough c 2022-02-18 15:32:54 Scheme eh? I was hoping Clojure or Scala would get me a more lightweight experience but no luck with that so far 2022-02-18 15:33:07 an interpreter written in java/kotlin has much better ffi 2022-02-18 15:33:20 actually could just call the functions directly 2022-02-18 15:34:03 Played with Kawa yet? 2022-02-18 15:34:38 no 2022-02-18 15:34:43 I wanted to develop a J2ME game with it but then apparently it doesn't support something that old, not even its oldest release. 2022-02-18 15:34:47 I'm not a fan of scheme, but of common lisp 2022-02-18 15:34:56 s7 scheme is the only scheme I "like" 2022-02-18 15:35:10 it's two c files you just add to your code 2022-02-18 15:35:18 and it has some cl stuff 2022-02-18 15:35:37 https://www.mit.edu/afs.new/sipb/project/kawa/doc/kawa-tour.html 2022-02-18 15:35:47 lagash: still think if you want forth in android or X in android you'll have to roll your own 2022-02-18 15:35:56 I'm more of a CL fan myself 2022-02-18 15:36:03 I would like to, but first I have to understand forth 2022-02-18 15:36:15 lagash: s7 scheme has the format function and defmacro 2022-02-18 15:36:32 https://ccrma.stanford.edu/software/snd/snd/s7.html 2022-02-18 15:36:46 Yes I was going to play around with s7 sometime 2022-02-18 15:36:50 oh 2022-02-18 15:37:17 I love common lisp, but the lack of libraries fucks me a bit 2022-02-18 15:37:40 so I liked s7 scheme, because it meant I could add whatever I need, and no dependency more than what I choose 2022-02-18 15:38:03 but it won't never "my" language and won't be as I'd like it to be 2022-02-18 15:38:20 and I won't make a scheme/lisp implementation as good as this one 2022-02-18 15:38:23 Have you heard of Nyxt? I'm no official developer, but sent a dozen or so patches already, it's like the Emacs of browsers, but in CL :) 2022-02-18 15:38:34 nope 2022-02-18 15:39:05 oh I think I saw it some time ago 2022-02-18 15:39:15 https://github.com/atlas-engineer/nyxt 2022-02-18 15:40:00 problem is in NetBSD sbcl has no thread support 2022-02-18 15:40:36 so for example hunchentoot blocks once you start the server, so no realtime development and most libraries just don't work 2022-02-18 15:40:42 Oh no, a *BSD user! :P 2022-02-18 15:40:47 xd 2022-02-18 15:41:00 Have you tried other CL implementations? Or they too don't have threading? 2022-02-18 15:41:04 I'm just used to netbsd and now linux feels different 2022-02-18 15:41:08 they don't 2022-02-18 15:41:26 netbsd guys told me they're in contact with the ecl dev 2022-02-18 15:41:51 so if one implementation will have threads maybe will be ecl, btw ecl was compiled to android 2022-02-18 15:42:28 I don't know how to make a makefile to add it in android studio, but you can compile it without android studio 2022-02-18 15:42:39 https://github.com/atlas-engineer/nyxt 2022-02-18 15:42:45 https://gitlab.common-lisp.net/ecl/ecl-android 2022-02-18 15:42:46 xd 2022-02-18 15:43:08 I hate Android Studio. I'm sure most folks here will concur. 2022-02-18 15:43:35 I know at least one user got Nyxt working on Mobian on Pinephone. 2022-02-18 15:44:09 Now I'm looking at forth, people always told me about forth when I was asking about metaprogramming and bottom up 2022-02-18 15:44:35 I love common lisp just because the metaprogramming and it seems forth will make me happy too 2022-02-18 15:45:08 Have you seen LambdaNative? Saved it in my bookmarks, I think it's the best chance at Lisp-y apps in Android. 2022-02-18 15:45:42 I see also some posts of guys who liked forth at first but ended disliking it. For me I think I like forth because I like to reinvent the wheel and to build everything from scratch 2022-02-18 15:45:57 which post was that 2022-02-18 15:46:17 one of the plus of forth is the features/cost-of-implementation ratio 2022-02-18 15:46:44 didn't saw lambdanative 2022-02-18 15:51:03 lagash: there is waforth and some forths in js 2022-02-18 15:51:12 f-a: I try to find the link 2022-02-18 15:51:57 vms14: uh isn't that in WASM? 2022-02-18 15:54:36 f-a: https://yosefk.com/blog/my-history-with-forth-stack-machines.html 2022-02-18 15:54:39 lagash: yes 2022-02-18 15:59:31 thanks 2022-02-18 15:59:42 https://www.reddit.com/r/tinycode/comments/ze9x3/first_a_tiny_forth_in_just_791_bytes_of_c/ there is also this forth 2022-02-18 16:00:01 I'd like to have a forth where I can put xlib bindings 2022-02-18 16:00:19 maybe I should download pkgsrc and compile gforth 2022-02-18 16:00:45 but I'd like to have more control over that forth 2022-02-18 16:02:12 meh this forth does nothing 2022-02-18 16:05:54 lagash: there isn't a forth like s7 scheme? 2022-02-18 16:06:08 a .c file I can just add and put ffi in 2022-02-18 16:17:57 this one seems nice https://www.reddit.com/r/tinycode/comments/ze9x3/first_a_tiny_forth_in_just_791_bytes_of_c/ 2022-02-18 16:18:02 fck this not 2022-02-18 16:18:08 https://gist.github.com/lbruder/10007431 this* 2022-02-18 16:19:55 seems to work, I've just compiled it and tried to define a word 2022-02-18 16:20:06 seems to have inmediate words and alike 2022-02-18 16:20:39 and it's public domain, which is nice 2022-02-18 16:21:13 I see much more public domain stuff between forthwrights than any other software community 2022-02-18 16:21:38 which is nice, I don't like the gpl 2022-02-18 16:22:34 I don't know yet what immediate postpone and alike do 2022-02-18 16:22:59 I understand an immediate word gets executed at compile time instead of putting the address in the list 2022-02-18 16:23:13 idk what postpone does yet 2022-02-18 16:23:37 but I need to feel comfortable with basic forth stuff firrst 2022-02-18 16:24:00 I'll take this c implementation, seems nice 2022-02-18 16:24:22 I can start adding ffi while learning the language at same time 2022-02-18 16:50:03 vms14: postpone solves the problem of, what if I want to define a word @IF that's equivalent to @ IF 2022-02-18 16:50:15 if I write : @IF @ IF ; that'll run the code for IF at compile-time 2022-02-18 16:50:30 instead I write : @IF @ POSTPONE IF ; 2022-02-18 16:50:54 I think the "equational definition" is something like 2022-02-18 16:51:02 so postpone works only for immediate words? 2022-02-18 16:51:20 it works for immediate and unimmediate 2022-02-18 16:51:22 : ... [ ... POSTPONE X ... ] ... ; ==> : ... [ ... ] X [ ... ] ... ; 2022-02-18 16:51:38 it replaces older things that only work for immediate words 2022-02-18 16:51:45 and defer? 2022-02-18 16:51:54 DEFER is approximately global function pointers 2022-02-18 16:52:14 it's usually used to allow you to forward-reference things 2022-02-18 16:52:49 remexre: there is a simple C forth implementation which is only one file or alike and it's "good enough"? 2022-02-18 16:53:08 https://gist.github.com/lbruder/10007431 found this one, seems fine 2022-02-18 16:53:22 iunno, IMO it's easier to understand+implement forth in terms of asm than C 2022-02-18 16:53:32 I want something simple where I can start adding ffi while learning the language at same time 2022-02-18 16:54:04 yes, but I'm not able to implement forth as I don't understand it yet 2022-02-18 16:54:31 I have to understand forth and see what I want to take from it, then write a dirty forth-like language 2022-02-18 16:55:09 and anyways I'm not targeting asm, but other languages like js and java 2022-02-18 16:55:31 since js would let me write web applications in forth and java/kotlin in android 2022-02-18 16:56:31 and if I make some sort of vm and start writing almost all the code in forth itself will be easy to have several implementations 2022-02-18 16:57:22 yet I can start, but for example stuff like the return stack, compiling words, immediate and postpone I have to understand better how they work and how should I implement 2022-02-18 16:57:22 I think it'd make sense to make something token-threaded then? 2022-02-18 16:58:13 atm is better to do nothing, but to understand the language 2022-02-18 16:58:42 I could end having a forth with no compile features, just being some sort of transpiler that writes code when executes a word 2022-02-18 16:59:17 or I could make an interpreter, depending on what I really want of forth, but I'd really like to have a forth able to do metaprogramming 2022-02-18 17:00:16 that's why I look for a c implementation, to add some bindings to libraries I want to use and make learning forth even more funny 2022-02-18 17:00:43 I guess, what's the win from it being single-file? 2022-02-18 17:01:13 remexre: cc file.c 2022-02-18 17:01:27 vs just running make? 2022-02-18 17:02:44 vs https://github.com/MitchBradley/cforth/tree/master/src/cforth 2022-02-18 17:03:31 that has a makefile? 2022-02-18 17:03:42 https://github.com/MitchBradley/cforth/blob/master/src/common.mk 2022-02-18 17:04:22 has even a java translator or wtf is that 2022-02-18 17:04:31 https://github.com/MitchBradley/cforth/tree/master/src/cforth/java 2022-02-18 17:04:51 uh isn't this from 1994 2022-02-18 17:05:11 i would consider scrutinizing carefully whether this actually does what you want 2022-02-18 17:05:28 yes I have a lot of source code to read 2022-02-18 17:05:32 including your own 2022-02-18 17:05:56 there are a lot of forth implementations in a lot of languages 2022-02-18 17:09:20 for now I'll try the one I've found 2022-02-18 17:10:35 it seems it will be fine for most basic stuff and adding stuff looks easy as BUILTIN(26, "DUP", dup, 0) { push(tos()); } 2022-02-18 17:11:07 don't get what the 0 number does, and imagine the non string name is for the c function being defined 2022-02-18 17:11:39 but ADD_BUILTIN(docol); looks even easier 2022-02-18 17:12:19 oh, the 0 is because it's not an immediate word 2022-02-18 17:13:58 ok you have to do both, builtin and add_builtin 2022-02-18 17:18:52 this one seems more affordable https://github.com/flrl/froth 2022-02-18 17:24:29 http://fiji.sourceforge.net/ this is in java 2022-02-18 17:31:55 https://github.com/hcchengithub/jeforth.3we wtf 2022-02-18 17:33:24 http://hcchengithub.github.io/jeforth.3we/?cls_include_box2dweb-arrow.f :O 2022-02-18 17:33:35 the other examples don't work, but this one does 2022-02-18 17:35:40 and this one too http://hcchengithub.github.io/jeforth.3we/?cls_include_chipmunk-js-pyramidstack.f 2022-02-18 18:18:36 found exactly what I was looking for I guess 2022-02-18 18:18:45 https://github.com/paraplegic/OneFileForth/blob/master/src/OneFileForth.c 2022-02-18 18:33:19 vms14: you are about to go into a deep rabbit hole.. 2022-02-18 19:15:30 joe9: what? 2022-02-18 19:15:46 lagash: found 8th that seems to work on android 2022-02-18 19:15:53 but you have to pay :D 2022-02-18 19:16:19 the best is always roll your own 2022-02-18 19:21:27 joe9: you mean looking at all the forth implementattions and playing with them? 2022-02-18 19:22:02 it's like everyday you could use a different forth in a different platform and even implemented in a diffrent language 2022-02-18 19:24:49 but I only want a little c implementation I can add xlib and stuff 2022-02-18 19:25:08 and later something that runs on android 2022-02-18 19:25:19 but it seems I'll have to make my own 2022-02-18 19:26:04 actually I could use this forth in c and put it on android and provide bindings trough jni 2022-02-18 19:26:23 but it's much better to do one from scratch in java or kotlin than doing that 2022-02-18 20:13:58 there are a lot of variables that you are dealing with. xlib, android, java -- all huge code bases. 2022-02-18 20:16:31 veltas, you around? do you have any opinions on the usage of r> and >r from the interpreter prompt? 2022-02-18 20:16:48 joe9: oh 2022-02-18 20:16:56 I know some basic xlib stuff 2022-02-18 20:17:12 I just want to add some few bindings to play 2022-02-18 20:17:50 it's very fun when you open a window and start drawing pixels images etc, specially when you do interactively 2022-02-18 20:18:08 ok, if you say so. Anything with linux is never simple. 2022-02-18 20:18:27 What are you trying to achieve? learn or do you have a purpose? 2022-02-18 20:18:32 java I don't like it, which is the reason to implement a forth in it 2022-02-18 20:18:53 if you are learning, check out plan9front. The gui and api's are much more saner. 2022-02-18 20:19:28 actually I want to learn forth, the xlib bindings would be to just add fun in the process 2022-02-18 20:19:52 but what I'm really going to do is to test if I like forth 2022-02-18 20:20:13 because if I do, then I'll do everything in forth 2022-02-18 20:20:26 by implementing forth wherever I need it 2022-02-18 20:20:48 so this is why I think in java/kotlin 2022-02-18 20:21:27 to have a forth able to create android applications, but once I've learned forth and feel brave enough to implement it in java/kotlin 2022-02-18 20:22:10 atm I could do a basic implementation, but no immediate, postpone, return stack... 2022-02-18 20:22:36 just words being executed and compiling new words 2022-02-18 20:23:18 so the goal now is learn forth and see what I want to steal from it 2022-02-18 20:25:06 joe9: you mean this one https://github.com/8l/ff ? 2022-02-18 20:25:27 that is a forth implementation on plan9. 2022-02-18 20:25:47 vms14: I am suggesting that you take a step back and look at the os 2022-02-18 20:25:58 and, if there is a more-learnable os around. 2022-02-18 20:26:19 I had a look at 9plan some time ago 2022-02-18 20:26:35 installed it in raw hardware, I was amused when I saw it 2022-02-18 20:26:58 but meh, it died cause they've put a wrong license 2022-02-18 20:27:10 and later decided to rectify, but it was late 2022-02-18 20:27:50 9front I know is acttive, but I'm not interested in operating systems yet 2022-02-18 20:28:50 I think it's not my target, at most I could target embedded device stuff, but I would write a game there instead of a system 2022-02-18 20:29:29 btw iif you like the idea of plan9 and think is a nice case study there is a book from a guy I think it's named fernando ballesteros 2022-02-18 20:30:29 it's about operating systems and uses plan9 as study case, so if you recommend random people to look at plan9 you can also recommend the book, as it will provide the intended goal 2022-02-18 20:31:38 https://www.amazon.com/Introduction-Abstractions-Using-Plan-Bell/dp/B005D2S5H0 2022-02-18 20:31:50 francisco ballesteros* (almost xD) 2022-02-18 20:32:49 I think it's another book 2022-02-18 20:33:22 guess is this one https://github.com/fjballest/docs/blob/master/9notes.pdf 2022-02-18 20:33:56 joe9: idk if you were aware of those books and would be interested, but there you have 2022-02-18 20:36:25 and you guys don't do web development with forth? 2022-02-18 20:36:38 I had a look around and saw nothing but java applets 2022-02-18 20:36:54 which sure it had to be nice, but won't work today 2022-02-18 20:37:16 I saw some seerver in gforth, but not really much movement on the web 2022-02-18 20:37:58 forth could be embedded in apache as apache module 2022-02-18 23:34:18 >r does not work at the interpreter prompt?