00:00:00 --- log: started forth/20.10.13 02:24:14 --- join: dave0 joined #forth 03:08:14 --- join: gravicappa joined #forth 03:26:34 --- join: TCZ joined #forth 03:51:29 --- quit: lisbeths (Ping timeout: 260 seconds) 05:23:46 --- quit: TCZ (Quit: Leaving) 05:44:26 --- quit: sts-q (Ping timeout: 240 seconds) 05:48:13 --- join: TCZ joined #forth 05:52:45 --- join: sts-q joined #forth 06:09:30 --- join: f-a joined #forth 06:29:40 --- quit: dave0 (Quit: dave's not here) 07:24:26 --- quit: jsoft (Ping timeout: 240 seconds) 08:59:59 --- quit: TCZ (Quit: Leaving) 09:27:45 --- quit: djinni (Ping timeout: 240 seconds) 09:33:18 --- join: djinni joined #forth 10:00:41 --- quit: f-a (Ping timeout: 265 seconds) 10:00:53 --- join: f-a joined #forth 10:19:23 --- join: WickedShell joined #forth 10:19:46 ware there any reasonable standards compliant forth tcp/ip stacks? 10:20:57 or would it make more sense wrap something like the lwIP stack with a forth interface? 10:50:29 --- quit: gravicappa (Ping timeout: 246 seconds) 10:52:52 --- join: gravicappa joined #forth 11:06:58 you mean wrap C code in forth?? *gasp* 11:23:02 --- join: TCZ joined #forth 11:38:52 Not necessarily C. As there are lots of small OS around nowadays, it would be fun to make a forth on top of OCaml (MirageOS), Rust (RustOS), C++ (HelenOS) or something in order to obtain a tcp/ip stack. 11:38:52 Right? 15:08:34 --- log: started forth/20.10.13 15:08:34 --- join: clog joined #forth 15:08:34 --- topic: 'Forth Programming | logged by clog at http://bit.ly/91toWN backup at http://forthworks.com/forth/irc-logs/ | If you have two (or more) stacks and speak RPN then you're welcome here! | https://github.com/mark4th' 15:08:34 --- topic: set by proteusguy!~proteusgu@cm-58-10-208-146.revip7.asianet.co.th on [Mon Dec 30 10:43:28 2019] 15:08:34 --- names: list (clog dave0 WickedShell djinni sts-q boru X-Scale Keshl Blue_flame siraben jimt[m] jedb rpcope _whitelogger kori mjl FUZxxl tabemann iyzsong WilhelmVonWeiner svt remexre guan cheers tolja phadthai bluekelp a3f cp- ptrkriz DKordic C-Keen Vedran arrdem spoofer crc ecraven MrMobius patrickg rann ovf pointfree dnm veltas deesix dddddd lonjil Lord_Nightmare irsol heredoc_ neuro_sys inode jn__ rprimus presiden routeveg cmtptr nmz ggVGc crest APic ornxka Kumool crc-) 15:08:34 --- names: list (pareidolia tangentstorm dys dzho fiddlerwoaroof diginet2 koisoke catern Chobbes +KipIngram klys) 15:08:36 I also thought about a fully typed forth 15:08:48 but that never went anywere; the programming style would be quite a bit different 15:10:24 --- join: TCZ joined #forth 15:11:34 Im working on a small forth for a calculator that is garbage-collected 15:12:22 if you do ' to get an address it stores the pointer to the word, an offset of 0, and the sum of the pointer and offset 15:12:45 then if you add to the pointer it adds to the offset and recalculates the base+offset 15:13:14 and when you garbage collect, search for any occurence of that pointer as base and change the base then update the base+offset 15:13:48 but it requires a type system keep garbage collectable pointers separate from regular old hex numbers since those shouldnt be modified 15:14:23 and something like @ and ! work on the base+offset 15:15:52 MrMobius, how do you manage type metadata? are only things on the stack typed, or do things written to the dictionary also get metadata written with them? and if so, how does that not break assumptions about memory contiguousness? 15:16:37 metadata is easy each 8 byte stack element has a 9th bit to store type 15:17:23 and the thread is tokenized, so anything in a word that needs to be adjusted can be recognized by the preceding token 15:18:01 like if you have a token for pushing that type of pointer on the stack in a word, you know that the next 6 bytes contain the pointer data that needs to be adjusted since you know any time that token is found its followed by 6 bytes of data 15:18:11 *9th byte 15:18:23 the cool thing about static typing 15:18:38 is that you can get away with not having to add tags to the stack when running non-interactive words 15:18:48 so you do var x x ! x @ (is the type preserved here?) 15:19:26 cmtptr, this is where it diverges from classic forth 15:19:50 : foo 3.5 $ABCD ' bar ; 15:20:37 numbers are floats, anything starting with $ is a 16 bit hex value, and the value produced by ' is the complicated type with base and offset 15:21:09 so in your case, var x 3.5 x ! x @ 15:21:37 it would see that 3.5 is a float and tag that when it's put on the stack 15:21:58 and ! would write 9 bytes to x and @ would restore 9 bytes 15:22:28 where 8 bytes are float data and 1 byte is metadata 15:23:58 --- quit: svt (Quit: ZNC 1.7.5 - https://znc.in) 15:24:07 FUZxxl, ya you can lay down a different token for each type and not gave to store the type byte 15:24:49 and even have several tokens for the same type like if you have a 1 digit float number, only store one byte instead of 8 and have a special token that loads 1 byte and fills the next 7 bytes with zeroes 15:25:01 not really what I mean 15:25:25 rather, if you have static typing, the compiler can type check words as they are being compiled and then run them without attaching type information 15:25:35 as all components will do the right thing 15:25:55 hmm, I dont see how you can do that reliably 15:26:23 basically, each word has a defined stack effect 15:26:35 IF float_val ELSE int_val THEN @ + 15:26:35 there are no words like pick with undefined stack effect 15:26:45 that kind of code would be forbidden 15:26:55 the compiler would reject it during type checking 15:26:57 right 15:27:06 there is a lot you need to forbid to do that type of optimization 15:27:09 IF 5 THEN 15:27:19 or, depending on the type system, it would coerce the float value into an integer 15:27:38 I though about calling this a "shape system" instead of a "type system" 15:27:53 since we only really care about how the data is organised, i.e. which words are pointers to data of what shape 15:28:02 it doesn't really matter what type the non-pointer words have 15:28:07 but then youre back to keeping the metadata to do the coercion since that IF statement could have been preceded by another IF so there could be any combination on the stack before + 15:28:18 nope 15:28:33 the coercion doesn't generate any code, it just means that int and float are effectively the same type 15:29:18 so then would you have separate words like d+ and f+ or just one +? 15:29:48 MrMobius> and ! would write 9 bytes to x and @ would restore 9 bytes 15:29:50 yes, you would have separate words 15:30:03 I mean really, it depends on how exactly you'd do it 15:30:16 where i struggle with this is that if i'm trying to write a binary structure to the dictionary, then you've interleved type data in there and screwed up my data structure 15:31:34 my thought was that it should be that x (the variable) is what's typed, so anything retrieved through x or some offset from x inherits that type. that would be analogous to how c works 15:32:07 cmtptr, actually I take back what I said. I have a different word called STO like this that writes 9 bytes: var x 3.5 x STO 15:32:23 and ! just writes a 16 bit value 15:32:28 ah, okay 15:32:54 does that O stand for octo (for very large values of 8)? 15:33:04 so you solved it with just explicitely different words - some for writing/reading raw memory, and others for working with tagged objects 15:33:11 you can also check that x is actually a variable as well so you dont store the value in a word accidentally 15:33:20 cmtptr, right 15:33:30 --- join: Zarutian_HTC joined #forth 15:33:49 so the hope is you can stick to a known set of words for calculator stuff and never crash the calculator which is much more castrophic than crashing a PC forth program 15:33:57 and you still have ! and @ to use at your own risk 15:34:28 octo? nah just short for STOre 15:34:35 following historical calculator usage :P 15:35:26 presumably the inverse is called LOD? 15:35:53 you could use RCL for recall 15:36:04 ah 15:36:06 or let STO work like ' and have the name of the variable just return its value 15:36:13 like 5 STO foo 15:36:21 then foo just returns 5 15:36:39 yeah that makes sense 16:08:10 --- quit: Zarutian_HTC (Remote host closed the connection) 16:14:43 --- join: Zarutian_HTC joined #forth 16:24:35 --- quit: spoofer (Ping timeout: 260 seconds) 16:25:00 --- join: spoofer joined #forth 17:03:33 --- quit: dave0 (Quit: dave's not here) 18:05:42 --- quit: TCZ (Quit: Leaving) 18:13:12 --- join: jsoft joined #forth 18:34:20 --- join: boru` joined #forth 18:34:23 --- quit: boru (Disconnected by services) 18:34:25 --- nick: boru` -> boru 18:58:31 --- quit: Zarutian_HTC (Remote host closed the connection) 19:20:09 --- quit: lonjil (Ping timeout: 258 seconds) 19:20:28 --- join: lonjil joined #forth 20:32:19 --- join: Zarutian_HTC joined #forth 20:35:30 --- quit: sts-q (Ping timeout: 272 seconds) 20:40:13 --- join: gravicappa joined #forth 20:41:35 --- join: sts-q joined #forth 21:04:18 --- quit: tabemann (Ping timeout: 265 seconds) 21:19:14 FUZxxl, cmtptr, MrMobius: 21:19:14 I think you know the Factor Programming Language. 21:19:14 Do you know about the Joy-Programming-Language ? It is half way between Forth and Lisp. 21:19:14 http://www.kevinalbrecht.com/code/joy-mirror/index.html 21:19:14 Rabbit-vm is an implementation of the Joy Programming Language. It is GCed, written is x86-64 assembly (FASM), 21:19:15 and knows about the types Int, List, Symbol and Float. 21:19:15 https://bitbucket.org/sts-q/rabbit-vm/src/master/ 21:53:53 --- quit: Zarutian_HTC (Quit: Bye) 22:36:24 --- quit: _whitelogger (Remote host closed the connection) 22:39:23 --- join: _whitelogger joined #forth 22:46:49 --- join: proteusguy joined #forth 23:30:27 --- quit: Keshl (Read error: Connection reset by peer) 23:30:35 --- join: Keshl_ joined #forth 23:31:05 --- quit: Keshl_ (Read error: Connection reset by peer) 23:31:29 --- join: Keshl_ joined #forth 23:59:59 --- log: ended forth/20.10.13