00:00:00 --- log: started forth/14.04.18 00:20:20 --- quit: kumool (Quit: Leaving) 00:55:19 --- quit: asie (Quit: I'll probably come back in either 20 minutes or 8 hours.) 01:01:53 --- join: aranhoide (~aranhoide@204.Red-83-57-124.dynamicIP.rima-tde.net) joined #forth 01:12:13 --- join: asie (~textual@078088168214.elblag.vectranet.pl) joined #forth 01:30:41 --- join: true-grue (~quassel@95-25-84-159.broadband.corbina.ru) joined #forth 01:37:46 --- quit: aranhoide (Remote host closed the connection) 01:51:58 --- join: mnemnion (~mnemnion@c-98-210-219-91.hsd1.ca.comcast.net) joined #forth 01:52:01 --- quit: aksr (Ping timeout: 276 seconds) 01:54:31 --- quit: adu (Quit: adu) 01:56:56 --- quit: mnemnion (Ping timeout: 258 seconds) 02:29:41 --- join: aksr (~aksr@unaffiliated/aksr) joined #forth 02:34:06 --- quit: kludge` (Ping timeout: 258 seconds) 02:38:51 --- join: kludge` (~comet@unaffiliated/espiral) joined #forth 03:08:48 --- quit: asie (Quit: I'll probably come back in either 20 minutes or 8 hours.) 03:20:58 --- join: nighty-_ (~nighty@lns-bzn-49f-62-147-170-46.adsl.proxad.net) joined #forth 03:34:19 --- quit: xpte (Quit: Connection closed for inactivity) 03:40:30 --- join: ASau` (~user@46.114.18.54) joined #forth 03:43:50 --- quit: ASau (Ping timeout: 258 seconds) 03:49:37 --- quit: aksr (Quit: aksr) 03:51:32 --- quit: carc (Quit: QUIT) 03:52:15 --- join: carc (~carc@unaffiliated/carc) joined #forth 04:03:19 --- join: asie (~textual@078088168214.elblag.vectranet.pl) joined #forth 04:12:22 --- quit: asie (Quit: I'll probably come back in either 20 minutes or 8 hours.) 04:22:07 --- nick: ASau` -> ASau 04:30:17 --- join: asie (~textual@078088168214.elblag.vectranet.pl) joined #forth 04:32:07 --- quit: asie (Client Quit) 04:54:47 --- join: asie (~textual@078088168214.elblag.vectranet.pl) joined #forth 06:28:49 --- quit: asie (Quit: I'll probably come back in either 20 minutes or 8 hours.) 06:34:18 --- join: Zarutian (~zarutian@194-144-84-110.du.xdsl.is) joined #forth 07:21:29 --- join: mnemnion (~mnemnion@c-98-210-219-91.hsd1.ca.comcast.net) joined #forth 08:13:40 --- quit: Zarutian (Read error: Connection reset by peer) 08:20:02 --- join: asie (~textual@078088168214.elblag.vectranet.pl) joined #forth 08:26:04 --- join: dessos (~dessos@c-174-60-176-249.hsd1.pa.comcast.net) joined #forth 08:38:11 --- quit: asie (Quit: Textual IRC Client: www.textualapp.com) 08:43:26 --- quit: ASau (Remote host closed the connection) 08:44:20 --- join: ASau (~user@46.114.18.54) joined #forth 09:04:36 --- join: asie (~textual@078088168214.elblag.vectranet.pl) joined #forth 09:07:38 --- part: dkcl left #forth 09:40:15 --- join: xpte (uid17782@gateway/web/irccloud.com/x-yrjfwzluluulobcm) joined #forth 09:42:45 --- join: xyh (~user@2001:250:3002:5550:5642:49ff:fe5f:39f7) joined #forth 09:47:58 --- quit: asie (Quit: I'll probably come back in either 20 minutes or 8 hours.) 09:49:23 --- part: xyh left #forth 09:50:09 --- join: kumul (~mool@173.215.134.98) joined #forth 10:02:13 --- quit: joneshf-laptop (Ping timeout: 245 seconds) 10:05:01 --- join: asie (~textual@078088168214.elblag.vectranet.pl) joined #forth 10:06:34 --- join: pvt_petey (~pvt_petey@cpc11-colc6-2-0-cust131.7-4.cable.virginm.net) joined #forth 10:13:03 --- quit: cataska (Ping timeout: 240 seconds) 10:36:12 --- join: karswell (~user@87.114.18.190) joined #forth 10:42:42 --- quit: karswell (Read error: Connection reset by peer) 10:44:08 --- join: karswell (~user@87.114.18.190) joined #forth 11:01:45 --- join: aranhoide_ (~aranhoide@204.Red-83-57-124.dynamicIP.rima-tde.net) joined #forth 11:24:00 --- quit: asie (Quit: I'll probably come back in either 20 minutes or 8 hours.) 11:25:11 --- join: mark4 (~mark4@cpe-68-203-183-77.tx.res.rr.com) joined #forth 11:25:35 4294967296 . 0 ok 11:25:43 lol 11:26:18 i guess number input doesnt account for overflow :P 11:26:46 --- quit: mnemnion (Read error: Connection reset by peer) 11:26:53 my actual error however is a 0 variable that im dotting and it displaying the above non zero zero value wtf 11:27:11 --- join: mnemnion (~mnemnion@c-98-210-219-91.hsd1.ca.comcast.net) joined #forth 11:32:37 --- join: impomatic (~digital_w@39.123.125.91.dyn.plus.net) joined #forth 11:40:10 --- join: ASau` (~user@46.114.18.54) joined #forth 11:40:38 --- quit: ASau (Remote host closed the connection) 11:49:16 --- quit: ASau` (Remote host closed the connection) 11:49:45 --- quit: aranhoide_ (Read error: Connection reset by peer) 11:51:00 --- join: ASau` (~user@46.114.18.54) joined #forth 11:52:43 --- join: kumool (~mool@adsl-64-237-224-156.prtc.net) joined #forth 11:54:10 --- quit: kumool (Client Quit) 11:56:07 --- quit: kumul (Ping timeout: 252 seconds) 11:57:49 --- quit: ASau` (Remote host closed the connection) 11:58:45 --- join: ASau` (~user@46.114.18.54) joined #forth 11:59:26 --- join: asie (~textual@078088168214.elblag.vectranet.pl) joined #forth 12:00:55 --- nick: ASau` -> ASau 12:32:17 --- quit: asie (Quit: I'll probably come back in either 20 minutes or 8 hours.) 12:38:01 --- quit: mnemnion (Remote host closed the connection) 12:53:26 --- join: egp_ (~egp_@164.215.89.135) joined #forth 13:44:53 --- join: xyh (~user@2001:250:3002:5550:5642:49ff:fe5f:39f7) joined #forth 13:52:23 --- join: mnemnion (~mnemnion@c-98-210-219-91.hsd1.ca.comcast.net) joined #forth 13:55:45 --- join: csl (~csl@2a01:79d:53ab:2954:1c9b:46f8:adb:9a85) joined #forth 13:56:29 may I ask how error is handled in a modern forth ? 13:56:36 the way described in POL is not so good IMO. 13:57:14 CATCH/THROW? 13:57:27 I have introduced a dynamic type system in my forth-like language, 13:57:32 for example : is a type tag 13:57:38 a fixnum in the ArgumtStack is like : 666, 13:57:44 let's say, 13:57:49 a list processing function ``length'' find the argumt in the ArgumtStack is a but not a 13:57:53 how should I handle this kinds of error ??? 13:57:54 --- quit: tangentstorm (Ping timeout: 240 seconds) 13:58:00 ??? dump the two stacks ??? 13:58:08 how you guys prefer ??? 14:01:47 CATCH/THROW are for non-local exit 14:04:25 I am I asking stupid question ? 14:04:33 Correct me if I'm wrong, but I think that you just trying to reinvent Factor: http://factorcode.org/ 14:05:33 Forth per se does not generally have type errors 14:05:47 plenty of errors resulting from treating numbers incorrectly 14:12:33 can anyone recommend a good unix forth written in c that I can embed? I've tried various, but many seem to be very old or does not compile cleanly. 14:12:46 or c++ 14:13:24 --- quit: true-grue (Read error: Connection reset by peer) 14:13:41 pforth compiles for me 14:13:57 mnemnion: yes, actually that's at the top of my list so far 14:14:06 and the only one that compiled cleanly 14:14:30 --- join: kumul (~mool@adsl-64-237-224-156.prtc.net) joined #forth 14:14:46 I've tried 4tH, PFE (which tries to use global registers, which clang doesn't lke), etc. 14:14:55 can one create bytecode with pforth? 14:16:09 csl: reva ficl fina 14:16:35 xyh: thanks, will have a look 14:17:30 no but Retro is embeddable and runs a very clean bytecode 14:17:53 mnemnion: good, will try it 14:18:21 I was also thinking about Factor, but it doesn't seem to be embeddable. And I want something small... 14:19:29 csl: write one 14:19:42 xyh: already did, but this is for a thesis, so I need something a bit more mature. 14:20:46 csl: what's not mature about yours ? 14:21:42 csl: I just want to learn some thing from you, for I am writing mine. 14:21:50 xyh: it's not really a forth, can't define words the way you do in forth and has no if-statements (it has conditional jumps instead) 14:22:00 xyh: https://github.com/cslarsen/stack-machine if you're interested.. years since I made it 14:24:42 csl: after written the basic part, I define a new function to handle if-statements within 50 lines of my language 14:25:09 xyh: yeah, but I've got no time to make that in my own :) it's thesis time for me 14:25:22 xyh: is your code up anywhere? 14:25:51 --- join: tangentstorm (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #forth 14:27:22 csl: no , but it will publishing...^_^ 14:27:45 csl: no , but it will publish with my thesis too ^_^ 14:28:04 csl: in about 2 weeks 14:28:24 xyh: ah nice, good luck then! 14:28:44 csl: thx 14:28:59 xyh: your thesis is writing a forth implementation? 14:29:57 csl: my thesis is about directed-graph-processing 14:30:18 csl: I write my language to do it 14:30:24 xyh: doing what with the graph? 14:31:05 csl: basic processing 14:31:55 csl: to implement a directed-graph-processing language to do basic processing 14:34:08 do you need someone to test it out, xyh ? 14:34:25 csl: i am watching your code, i fail to understand how you define words ! 14:35:34 tangentstorm: of course, that's way I am here, to meet you guys ! 14:36:48 xyh: it's *dead* simple.. you have complete read/write access to 1M cells.. when you write "foo:" then "foo" will be a reference to that cell location.. so I do "foo: noop" which inserts a noop (bytecode 0x0) at that location.. now I can store data there by doing "10 &foo store" (or something like that, can't remember) 14:37:32 The application I'm working on is a graph database / hypertext editor with a small forth-like scripting language. I haven't done much work on the language part. 14:37:39 xyh: so you just write "square: dup * popip" to define a square "word" 14:38:01 xyh: popip pops the instruction stack and jumps back.. 14:38:58 xyh: in earlier versions of the project you had to use self-modification to jump back, but that was kinda ugly (I think Knuth does that in MIX actually) 14:39:32 tangentstorm: cool, maybe i can help 14:40:14 xyh: may I demo my way? 14:40:26 csl: may I demo my way? 14:40:30 xyh: sure 14:42:24 csl: : kkk + Exit ; defineFunction, ":" read a WordList into a buffer , "kkk" is the function name 14:43:01 xyh: Why isn't Exit implicit at the point of the ending ";" ? 14:44:22 csl: then i can use "Exit" in conditional ``if,then'' 14:45:35 csl: : factorial ( n -- n! ) duplicate one? if toDoNothing Exit then duplicate sub1 factorial * Exit ; defineRecursiveFunction 14:46:14 xyh: yeah, I get it, but ";" could still imply Exit, for terseness.. what happens if you do ": foo + ;" and call foo ? 14:47:43 csl: 14:48:08 csl: do ": foo + ; defineFunction" and call foo , will core dump 14:48:23 csl: do ": foo + Exit ; defineFunction" and call foo , is ok 14:48:53 xyh: ok.. well, if you want my two cents, I think you should always add an Exit implicitly when you see "; defineFunction".. but doesn't matter 14:49:25 csl: sorry about core dump ... 14:49:41 xyh: where are you studying? 14:50:33 csl: unknown place in China ... 14:50:57 xyh: ok, cool :) 14:52:45 csl: not cool actually ... I am a bad student, maybe bad forther too ... 14:52:57 xyh: doesn't sound like it.. keep working 15:17:07 --- quit: dandersen (Remote host closed the connection) 15:21:53 --- join: dandersen (~user@unaffiliated/dandersen) joined #forth 15:23:25 --- join: adu (~ajr@pool-108-28-107-114.washdc.fios.verizon.net) joined #forth 15:25:57 csl: http://bazaar.launchpad.net/~crc-x/retro-language/retro/view/head:/examples/languages/assembler.rx 15:26:41 tangentstorm: thanks.. so I use this to assemble bytecode for Ngaro? 15:27:01 tangentstorm: been looking at retro, I really like it so far. 15:27:36 yes. there's also assembler_lib.rx in the same directory. 15:28:28 tangentstorm: do you know if I can get away with just passing the bytecode for mye program, send it over the wire and then "link" it with the default image containing Forth words etc.? 15:28:48 (I'm happy to do that work myself in code, if not too much work) 15:30:01 hrm. not sure how you'd do the linking part. 15:30:24 tangentstorm: if the memory layout is flat I could perhaps just concatenate the two buffers? 15:31:02 it is flat, but the jump instructions are all absolute. 15:31:14 oops 15:31:42 well, doesn't really matter for a thesis.. the retro image, when shrunk, is about 90k uncompressed, 14k compressed with gzip 15:31:49 it should do nicely 15:31:57 thanks for the pointers 15:32:11 np. there's also an external assembler in http://bazaar.launchpad.net/~crc-x/retro-language/retro/view/head:/test/ngaro/ngarotest.py 15:35:36 i guess it wouldn't be /that/ hard to make a set of relative jump instructions, which you could then turn into primitives. 15:35:40 the ngaro vm, is that the stuff in retro.c ? 15:36:00 there are a bunch of implementations. 15:36:26 yes retro.c 15:36:33 anything under here: http://bazaar.launchpad.net/~crc-x/retro-language/retro/files/head:/vm/complete/ 15:36:46 plus ../experimental and ../partial 15:36:51 retro.c is only 778 lines! I almost can't believe it... 15:37:17 well there are only 30 instructions. 15:37:39 yeah, and I shouldn't be surprised, but when I *use* it it all works so nicely.. I'm very impressed 15:37:41 plus a handful of system queries. :) 15:38:09 yep, crc is quite the craftsman 15:38:58 Ngaro is so cool ! so many things to learn from you. 15:39:00 maybe I can use FPGA to make a cpu to play with it !!! 15:39:12 is there one ? 15:39:28 an fpga implementation? i don't believe so 15:39:38 hard to do ?? 15:40:07 no idea. i have an fpga but i've not learned to build things with it yet. 15:41:16 I have friend who hack hardware, i will ask him to do so, hehe 15:43:23 Xyh: I've wanted an Ngaro in fpga for years, but have never had the necessary hardware to actually pursue this myself 15:46:51 --- quit: karswell (Ping timeout: 276 seconds) 15:47:48 crc: I will learn it with my friend! Moore has a lots of forth cpu! maybe we can make poor men's forth cpu .. 15:48:04 i bet you could do a relative call with something like: : relcall ( q - ? ) + do ; 15:48:28 : pc drop dup push ; should give you the current program counter... i think... 15:48:50 : pc pop dup push ; whopps 15:49:31 tangentstorm: I think you are correct. 15:49:58 (I can't test since I'm afk, and have a very weak cellular connection only at present) 15:50:13 * tangentstorm could test but is being lazy. :) 15:51:03 Heh, I can understand :) 15:51:31 so if you gave each loadable 'module' a name that pushed its address on the stack, then you could say: 15:52:16 is crc the creator of Retro ??? 15:52:45 and ngaro ? 15:52:52 xyh: yes 15:53:35 Well, I need to go to sleep. I was working on my thesis (due mid-May) and just came in here on a whim. You've all been very friendly and super helpful. Thanks, and we may meet again later! 15:53:50 'function modulename relcall 15:53:59 seeya 15:54:49 hehe seeya 15:55:14 hrm you could make a prefix and do: [ word1 word2 word3 ] bye 15:55:29 --- quit: csl (Quit: Leaving) 15:55:52 Are relative calls really needed? 15:56:17 the question was about concatenating two images 15:57:05 Hmm, so something like a binary module? 15:57:06 i've also been thinking about how to implement dynamically loadable modules for pascal. 15:57:14 yeah 15:57:29 * crc will consider this 15:58:25 Since I'm working on a new major release it might be worth trying to support something like this. 15:59:09 free pascal has a flag that tells it to produce "position independent code", which (as far as i can tell) means making all the jumps relative. 16:00:41 there's probably other ways to do it. beats me. :) 16:01:35 Yes, you can have link editor in your run time. 16:02:25 It makes little sense when every native dynamic modules are implemented using PIC. 16:03:02 Difficulty is that Ngaro has no relative addressing in the instruction set 16:16:51 --- quit: mnemnion (Remote host closed the connection) 16:22:15 --- join: karswell (~user@87.114.18.190) joined #forth 16:30:39 --- join: mnemnion (~mnemnion@c-50-174-246-184.hsd1.ca.comcast.net) joined #forth 16:49:46 crc: I am reading the intro of retro, the idea about ``class handler'' is great ! 16:49:53 crc: ``Retro uses a floating, rotating buffer for temporary strings.'' is that means you better use the temporary strings quickly, for it is ``temporary'' 16:50:13 crc: how big is the buffer ??? 16:50:21 crc: and how ``quote'' is implemented ?? is there also a buffer ??? 16:52:45 quote compiles a function. 16:52:52 --- quit: mnemnion (Remote host closed the connection) 16:53:04 i wondered about this myself and actually went through every line of the implementation for quotes and annotated it. 16:53:28 * tangentstorm looks for the code 16:53:57 http://bazaar.launchpad.net/~crc-x/retro-language/retro/view/head:/image/kernel.rx#L324 16:54:13 tangentstorm: push a ``quote'' to the ArgumtStack compile a function too ??? 16:55:29 Quotes compile a jump over the code within themselves and a reference to the quote. The exact mechanics have changed a few times in the past. 16:56:02 There's no real size limit, and they can be nested freely. 16:56:31 if you type "[" anywhere in retro (except in a string or comment) then it will push the current compiler state and turn the compiler on. 16:57:04 [ also compiles the stub to jump over the code in the quote 16:57:23 yeah 16:58:07 and then when you type the "]" it pops the compiler state and either leaves the address of the start of the code on the stack or compiles a literal depending on the restored state. 16:58:20 * crc can't remember the exact mechanics off the top of his head 16:58:30 oh thx for explaining 16:59:01 hrm... i'm wrong. 16:59:15 but is it true that implements string data type in retro's way will prohibit big string processing 16:59:38 it leaves it on the stack if you're interpreting, but in compile mode it drops it, because the quote itself has code that leaves the address on the stack for you. 16:59:45 by ``big string processing'' i mean a lot of string to process 17:00:14 there's a function called keepString 17:00:26 The number of temporary strings and the max length are configurable 17:00:41 that'll take it out of that temporary buffer... i don't know exactly how it works, but it's never caused a problem for me. 17:02:03 http://retroforth.org/docs/Core_Functions.html 17:02:45 See STRING-LENGTH and STRING-BUFFERS functions 17:05:39 [ 100 ] is STRING-BUFFERS 17:05:50 Would give you 100 temporary buffers 17:06:33 (Some care needs to be taken to ensure that you don't exceed the max mem in the image. Or build a vm with larger memory area.) 17:09:06 is this the meaning of ``floating'' ? 17:09:32 i am thinking about garbage-collection actually ... 17:09:32 when i am thinking about implementing string data type, i am thinking to implement it as double-linked-list with a garbage-collecter ... so i am being stupid again ??!! 17:12:31 that's a perfectly logical way to implement strings, too... 17:15:24 The buffers are allocated in a round robin fashion, so addresses 'float' 17:15:25 that is to complex compare to retro's way 17:22:51 tangentstorm: are you using retro's string implementation to write a text editor ? 17:22:58 no 17:23:10 i actually don't have retro hooked up yet. :( 17:23:42 my system is written in free pascal. i ported ngaro over but i don't have it hooked up to my app yet. 17:24:52 tangentstorm: so, I should learn some thing about free pascal now ! 17:25:10 --- join: Zarutian (~zarutian@194-144-84-110.du.xdsl.is) joined #forth 17:25:58 i've been very slowly working my way up to a pascal compiler that targets either retro or something very much like it. 17:26:21 tangentstorm: how you buffer text ? gap-buffer ?? 17:26:36 tangentstorm: is your code publish now ? 17:26:45 https://github.com/minneron/minneron 17:26:54 it's very very very very very rough. 17:27:02 tangentstorm: thx for link 17:27:20 the ngaro implementation is at https://github.com/sabren/b4/tree/master/ng 17:27:28 s/the/my pascal/ 17:28:33 tangentstorm: i use org-mode too ^_^ 17:28:58 :) yay!! 17:29:34 one of the main things on my list for the next iteration is to get import/export working for org-mode. 17:31:07 --- quit: egp_ (Quit: Ухожу я от вас (xchat 2.4.5 или старше)) 17:40:46 --- join: joneshf-laptop (~joneshf@98.255.30.38) joined #forth 17:44:56 tangentstorm: i have no practice on string processing at all ... 17:44:59 tangentstorm: want to learn some thing with you, 17:45:02 tangentstorm: do you think string implemented as double-linked-list with a garbage-collecter is helpful ??? 17:45:08 tangentstorm: say, we are writing a text editor, is it cool to buffer text as double-linked-list ??? 17:46:55 maybe, but it seems a bit wasteful to me. 17:47:12 well.. 17:47:28 do you mean a doubly linked list of lines/paragraphs, or a doubly linked list of characters? 17:47:38 xyh: depends on how big the text chunks are, how you can implement a gap buffer in a chunk (or handle insertation anywhere in a chunk) 17:47:38 tangentstorm: in one element of a double-linked-list, there can be 21 bytes binary-safe-chars 17:48:06 why 21 bytes? 17:48:22 xyh: what happens when an byte is inserted into such element? 17:48:27 because my garbage-collecter is stupid ... 17:48:38 doubly-linked lists of chunks makes sense to me. at first i thought you meant doubly linked lists of characters. 17:50:51 Zarutian: a new chunk (as you call it) is created, there is a 3 bytes mask on the chunk, to tall which part (substring) of the chunk is been masked 17:51:35 masked? 17:51:52 xyh: doesnt that put a tremendus pressure on memory and the garbage collector? 17:51:59 3 bytes mask + 21 bytes substring , for example : 17:52:57 Zarutian: maybe I need advice 17:54:11 xyh: I am imagining that text editor example of yours. Typically people write more than one character per second. 17:54:16 tangentstorm: for example : say, we have 4 bits mask and 4 bytes substring, 17:54:26 tangentstorm: mask : 1011 17:54:30 substring : "abcd" 17:54:32 == "acd" 17:54:47 huh 17:55:26 have you implemented this and tested it? 17:56:17 my intuition is telling me that you're doing this as an optimization but that it probably isn't one. but i could be wrong. 17:56:26 Zarutian: yeah! speed is important 17:57:52 xyh: that's canonical way of representing text in editors. 17:58:30 tangentstorm: i am thinking to implement this, but with great hesitation 17:58:37 (if you mean DLL of lines) 17:59:25 xyh: i like your basic idea, but i don't think the bit masking part is going to save you much. 17:59:38 ASau: it will be cool for me if it is the canonical way !!! 17:59:56 because, for the cost of setting an individual bit, you can just move the bytes around. 18:01:11 unless you are using this to also generate diffs. 18:01:43 (which can make for interesting unlimited undo implementations) 18:01:45 like i said, i could be wrong though. you'd have to test it. 18:01:49 tangentstorm: without masking, how can I insert a char in a string as double-linked-list ? 18:02:48 tangentstorm: i have to think is through first ... 18:02:56 tangentstorm: i have to think it through first ... 18:02:59 You create a new string and replace the whole line. 18:03:24 ^-( abcef )-$ --> ^-( abc )-( d )-( ef )-$ 18:03:26 --- join: saml_ (~saml@pool-71-190-4-101.nycmny.east.verizon.net) joined #forth 18:03:39 Because line length has reasonable upper bound in texts, it is effective enough. 18:03:51 yeah, or just replace the whole line. 18:04:15 or you could have various standard-sized chunks and leave some padding in them. 18:04:41 tangentstorm: basicly an doubly linked list of gap buffers? 18:05:03 well i was picturing counted strings, but whatever. 18:05:04 ``padding in them'' then not binary-safe 18:05:28 what do you mean, xyh ? 18:05:35 haha ``doubly linked list of gap buffer'' 18:06:03 xyh: not nescisarly. Just two lengths instead of one. (The length of the former part used and the length of the latter part used) 18:06:07 it is not char-string it is byte-string 18:06:22 like, just for an example, you could say every chunk is a standard size of 255 bytes. then you add 1 extra byte to say how many bytes are actually used. 18:07:09 it's no different from your masking concept, except instead of one bit per byte, you have 1 byte per 255 bytes. 18:08:20 tangentstorm: yes, you are right 18:08:20 or, yeah, two bytes if you made it into a gap buffer. 18:08:35 hrm 18:08:49 2 bytes 18:09:31 but in practice i didn't do any of this in my actual editor. :) 18:09:46 i just have linked list of strings and completely replace the individual strings as i edit them. 18:10:07 so far, it's been fast enough for me. 18:11:06 all my so called ``masking concept'' is for my stupid garbage-collector, 18:11:10 and due to that I do not know how to write a good gc about string 18:12:41 me either. :) 18:15:43 one advantage of having fixed size chunks is that they're interchangeable and your memory won't get fragmented. 18:16:42 so you can allocate a big block of chunks and just reuse them when you're done. 18:17:13 recycle them i mean. 18:18:13 i think that's how i'd approach it if i were writing in forth and didn't have a pre-built memory manager to handle things for me. 18:21:14 hmm... I have wondered. How does a garbage collector know which datums of an object are pointers and which are primitive values? 18:21:47 Zarutian: there should be type-tag 18:22:00 tangentstorm: which part of your code is about text editor ? 18:23:04 xyh: in the datum. Yes, I am familiar with tagged pointers ;-) But here is another way to do it, if the objects arent too big: use an type bitmask. 18:24:33 Zarutian: ``type bitmask.'' ? 18:25:47 xhy: in the minneron repo, mnbuf.pas is the buffer, mned.pas is the editor widget. both use a bunch of libraries that are here: https://github.com/tangentstorm/xpl/tree/master/code 18:25:58 xyh: instead of using an type-tag in each datum of an object (each datum assumed to be one machine word big) use an bitmap (one machine word big usually) that say which are primitive and which are pointers. 18:27:11 look for the 'uses' line to see the dependencies, or i try to use the unit names in the code when i refer to something defined in another file (like rings.TRing is in the xpl repo under code/rings.pas) 18:27:33 the forth-like language is in uimp.* in the minneron directory. 18:27:49 really it's kind of a mess. i only just released the code yesterday. 18:27:52 tangentstorm: thx for the info 18:29:45 here's a screenshot. you can see the little repl/shell widget for the forth-like language in the foreground: http://imgur.com/gallery/zMvxYZ0/new 18:31:31 Zarutian: this is not cool, this is like ``allocate and free'' 18:32:30 xyh: the doubly linked list of gap buffers or objects using type bitmasks? 18:34:08 Zarutian: bitmap is like ``allocate and free'' 18:35:16 Zarutian: when type is changed, the map should be change 18:36:03 Zarutian: just as when a block of memory is unused i say it is free 18:36:12 xyh: naah, you misunderstood me. The bitmap only tells which words of the object are pointers and which are primitive data. 18:36:34 Zarutian: oh. sorry 18:36:41 --- quit: adu (Quit: adu) 18:37:12 xyh: bascily moving the type-tag out of each word in the object and into an bitmap. 18:37:15 Zarutian: then, that bitmap will save memory 18:38:22 or increase numerical range of integers (if that is the primitive type) and also allow many more objects (increasing the addresses that an pointer in the object can point to) 18:40:40 Zarutian: but, there are many types of value, to know ``is pointer or is not pointer'' is not enough 18:41:15 Zarutian: bitmap can only distinguish two types 18:42:25 --- join: adu (~ajr@pool-108-28-107-114.washdc.fios.verizon.net) joined #forth 18:43:07 Zarutian: you have to store type with non-pointer value anyway 18:43:08 xyh: depends. I have seen graph data storage format where there were only two types: integers and pointers to objects inside the storage. These were composed together in objects. 18:44:45 so ususally three bits per word inside an object (modulo housekeeping words such as used for gc marking) are used as type-tag. 18:47:56 Zarutian: yes, when we want less general but to save memory, it is good. maybe I am just using memory to buy more ``general'' 18:48:28 it is a trade off like many other such 18:49:02 Zarutian: yes, good optimization for memory 18:49:07 in picolisp, everything is in a 64-bit cell, and all pointers point to a cell, so you have free 4 bits at the end of every pointer. 18:49:43 and it uses those for both typing the pointer (there are only a handful of types) and i think one bit for garbage collection. 18:51:57 whoops. 3 free bits. http://software-lab.de/doc/ref.html#cell 18:54:35 tangentstorm: i implement lisp like ``cons'' as 34 bytes ``pair element'' with a ``ctr [1byte] : tag field'', a ``clr [1byte]: color field (for gc)'', and good old ``car[16bytes] and cdr[16bytes]'', [16bytes] : 8 for type(great waste) 8 for value ... 18:55:49 --- quit: nighty-_ (Quit: Disappears in a puff of smoke) 18:56:43 type(great waste) eh? :) 18:57:15 tangentstorm: there can never be 2^64 kinds of types 18:59:07 tangentstorm: totally 34bytes, that is why my substring should be 21 bytes .. with 3 bytes mask ... 19:03:02 :) 19:07:31 tangentstorm: why you are not actually using org-mode babel to write code and tangle them ? 19:10:36 tangentstorm: too many code? hard for org-mode to parse ??? 19:15:41 i was early on, xyh 19:16:21 i still have a couple places where i write code in org-babel but it's annoying to match up line numbers on errors 19:17:04 also, it was just one more thing making it harder for other people to get into my code. 19:17:25 (it's bad enough that i'm using the latest versions of free pascal) :/ 19:18:12 part of the reason i'm writing a /hypertext/ editor is that i want to be able to browse and edit both the tangled and untangled views of the same code 19:18:45 tangentstorm: i see 19:18:58 tangentstorm: harder for me without org-mode ^_^, any recommend intro about free pascal ? 19:26:57 http://freepascalanswers.wordpress.com/2012/09/ <- nice pdf 19:28:01 yes i much prefer to be writing code in org-mode. lazarus has folding but it's not the same. i do most of my retro coding in org-mode though. :) 19:28:44 eg my minesweeper game :) http://tangentstorm.github.io/mineswpr.html 19:32:03 --- quit: adu (Quit: adu) 19:41:06 --- quit: xyh (Ping timeout: 245 seconds) 19:48:51 --- join: adu (~ajr@pool-108-28-107-114.washdc.fios.verizon.net) joined #forth 19:56:11 --- quit: joneshf-laptop (Read error: Connection reset by peer) 19:56:49 --- join: joneshf-laptop (~joneshf@98.255.30.38) joined #forth 20:05:12 --- quit: Zarutian (Quit: Zarutian) 20:23:07 --- quit: adu (Quit: adu) 20:28:00 --- join: mnemnion (~mnemnion@c-98-210-219-91.hsd1.ca.comcast.net) joined #forth 20:49:32 --- quit: Eth|cal (Ping timeout: 240 seconds) 20:53:00 --- join: Eth|cal (~sam@139.216.253.31) joined #forth 20:54:30 --- join: ttmrichter_ (~Michael@101.36.76.123) joined #forth 20:59:05 --- quit: ttmrichter_ (Client Quit) 21:15:24 --- quit: saml_ (Quit: Leaving) 21:23:20 --- quit: malyn (Ping timeout: 250 seconds) 21:23:47 --- quit: Eth|cal (Ping timeout: 265 seconds) 21:25:09 --- join: Eth|cal (~sam@139.216.253.31) joined #forth 21:32:00 --- quit: Eth|cal (Ping timeout: 265 seconds) 21:36:36 --- join: malyn (~malyn@unaffiliated/malyn) joined #forth 21:44:31 --- quit: kumul (Quit: Leaving) 22:02:57 --- join: Eth|cal (~sam@139.216.253.31) joined #forth 22:15:19 --- join: adu (~ajr@pool-108-28-107-114.washdc.fios.verizon.net) joined #forth 22:17:29 --- quit: karswell (Ping timeout: 250 seconds) 22:35:40 --- quit: malyn (Ping timeout: 250 seconds) 22:59:11 --- join: malyn (~malyn@unaffiliated/malyn) joined #forth 23:22:15 --- join: karswell (~user@127.161.125.91.dyn.plus.net) joined #forth 23:38:39 --- quit: adu (Quit: adu) 23:46:30 --- join: egp_ (~egp_@164.215.89.135) joined #forth 23:59:59 --- log: ended forth/14.04.18