00:00:00 --- log: started forth/19.11.08 00:06:47 --- join: proteus-guy joined #forth 00:27:20 --- join: mtsd joined #forth 01:03:39 --- quit: deesix (Ping timeout: 240 seconds) 01:43:20 --- join: xek_ joined #forth 01:52:38 --- join: xek joined #forth 01:53:03 --- quit: xek_ (Read error: Connection reset by peer) 02:08:22 --- quit: rdrop-exit (Quit: Lost terminal) 02:11:28 loops can be so annoying if you want to have accumulated result(s) 02:12:15 since at the end of the loop you have something like (max acc val) and you can't put val anywhere 02:20:41 my current solution is to just use a variable instead because its easier/simpler but it would be nice to eventually have some higher level constructs to make looping better 02:22:04 i know a lot of forths will just stash stuff on the return stack too 02:22:52 can't put val anywhere ? how about keeping it on the data stack ? 02:24:21 i'll give my concrete example 02:24:50 i'm trying to parse a buffer (specified by fst, end) to a number 02:25:30 so my stack is (end fst), then in my loop i do 'over' and check if they're <= in order to continue 02:27:06 so then i dup the current address, get the character, parse the digit, and add it to my final number (end fst num), but now when it's time to loop again end/fst are one level down. so i'd have to rot to move it between comparisons 02:27:36 at my stage of Forth I often write the program using variables then I redo it to use the data stack if I can 02:28:21 yeah so my current approach is to just not have num on the stack but in a variable 02:28:33 yeah, deep stack data does seem to need a some stack gymnastics, but that can also be a sign the program design isnt optimal 02:28:48 and often a variable may be more efficient 02:29:04 the next problem is that i want more than just the num on the stack, i want to have a true/false indicating if the parsing succeeded 02:29:30 it's hard to know until one becomes intimately acquainted with the problem 02:29:34 so i would have to deal with 2swap instead of rot 02:29:56 sure, but all those stack jugglers are provided so you can do that 02:30:37 it feels like i haven't sussed out the problem enough 02:30:48 I was doing a fair bit of stack juggling the other day because I was using fixed point which needs doubles 02:31:02 then you probably havent, Forth is great that way 02:31:32 i solved the problem and it was the most complex stack juggling I've done yet, and I felt as you do now 02:31:39 the solution of having a variable containing the number and having my parser just return whether it failed or not seems 'right' 02:32:14 the next morning when I awoke I realised my design was all wrong and the new design was only a few lines and two stack jugglers 02:33:18 Im finding that when my solution is sub optimal, my code looks ugly, but when the solution is optimal, the code looks beautiful 02:33:44 i feel like the even more 'correct' solution is to have better looping so i'm not managing looping and what i'm doing 02:33:59 like a FOREACH or something 02:34:16 Forth is a bit strange like that to me because C just always looked like C to me, I cant say any of my C code looked 'beautiful'. The best it looked was neat and well formatted 02:34:22 --- join: iyzsong joined #forth 02:35:02 how many times have you refactored your working solution to date ? 02:35:42 none atm ;) 02:36:48 I find I have to refactor at least three times after my solution is working and the design is good 02:37:01 i'm still bootstrapping so i don't even have a dictionary yet 02:37:21 luckily I'm not OCD about it as Im a technician not a programmer, so good enuf is ok to me 02:38:04 some Forth people just cant stop refactoring until the code is perfect I have read, and apparently Chuck was like that 02:54:16 --- join: f-a joined #forth 03:48:44 --- join: rdrop-exit joined #forth 03:50:59 --- quit: Jookia (Remote host closed the connection) 03:52:32 --- join: Jookia joined #forth 03:54:33 --- quit: f-a (Read error: Connection reset by peer) 03:59:02 --- join: f-a joined #forth 04:17:13 --- join: Jookia1 joined #forth 04:19:22 --- quit: Jookia (Ping timeout: 260 seconds) 04:27:33 --- join: deesix joined #forth 04:28:16 --- join: dddddd joined #forth 04:55:16 --- quit: dave0 (Read error: Connection reset by peer) 05:00:32 --- join: dave0 joined #forth 05:43:32 --- quit: iyzsong (Quit: ZNC 1.7.1 - https://znc.in) 05:56:36 --- quit: f-a (Ping timeout: 265 seconds) 05:58:25 --- join: f-a joined #forth 06:35:58 --- part: mtsd left #forth 06:58:01 --- quit: Keshl (Read error: Connection reset by peer) 06:58:06 --- join: Keshl_ joined #forth 07:07:28 --- quit: dave0 (Quit: dave's not here) 07:13:27 --- quit: ryke (Ping timeout: 265 seconds) 07:22:36 --- quit: rdrop-exit (Quit: Lost terminal) 07:24:25 --- quit: reepca (Ping timeout: 240 seconds) 07:36:05 --- quit: tabemann (Ping timeout: 245 seconds) 07:36:37 --- join: ryke joined #forth 07:49:39 --- join: dys joined #forth 07:57:20 --- quit: f-a (Ping timeout: 268 seconds) 07:58:45 --- join: f-a joined #forth 08:30:26 --- join: X-Scale` joined #forth 08:31:45 --- quit: X-Scale (Ping timeout: 265 seconds) 08:32:22 --- nick: X-Scale` -> X-Scale 09:57:35 --- quit: f-a (Ping timeout: 268 seconds) 09:58:52 --- join: f-a joined #forth 10:11:02 --- quit: f-a (Quit: leaving) 10:14:50 --- quit: ryke (Ping timeout: 264 seconds) 10:32:46 --- quit: Jookia1 (Remote host closed the connection) 10:47:06 --- quit: dys (Ping timeout: 252 seconds) 11:09:07 --- quit: gravicappa (Ping timeout: 268 seconds) 11:14:23 --- join: creat1001 joined #forth 11:28:43 --- join: gravicappa joined #forth 11:41:11 --- quit: gravicappa (Ping timeout: 268 seconds) 11:43:50 --- join: xek_ joined #forth 11:43:59 --- quit: xek (Read error: Connection reset by peer) 11:44:16 --- part: jdavidboyd left #forth 11:51:06 --- join: WickedShell joined #forth 13:11:31 --- part: creat1001 left #forth 13:36:10 --- join: jdevoo joined #forth 13:36:48 --- quit: jdevoo (Client Quit) 13:36:48 --- join: Labu joined #forth 14:42:10 --- join: heredoc joined #forth 15:16:24 oh yeah, my dev system is working nicely now :) 15:17:29 yesterdays litany of bug fixes resulted in the overall system running smoothly without drama 15:24:01 --- quit: xek_ (Ping timeout: 240 seconds) 15:41:43 --- join: TonySidaway joined #forth 16:00:17 --- join: dave0 joined #forth 16:05:41 --- quit: TonySidaway (Quit: TonySidaway) 16:32:18 --- join: rdrop-exit joined #forth 17:15:56 --- join: tabemann joined #forth 17:35:26 --- quit: inode (Quit: ) 17:52:33 --- join: iyzsong joined #forth 18:40:16 --- quit: Labu (Quit: Leaving.) 19:05:24 --- quit: tabemann (Ping timeout: 265 seconds) 19:17:56 --- quit: iyzsong (Quit: ZNC 1.7.1 - https://znc.in) 19:37:08 --- quit: dave0 (Quit: dave's not here) 19:40:37 --- quit: rdrop-exit (Quit: Lost terminal) 20:07:15 --- join: tabemann joined #forth 20:31:52 --- join: iyzsong joined #forth 21:21:01 --- join: gravicappa joined #forth 21:30:42 --- quit: dddddd (Remote host closed the connection) 21:43:16 tp 22:19:55 tabemann, :) 22:21:08 I figured out a good use for OO 22:21:24 yeah ? 22:21:34 with my OO implementation I can make it so field names for classes are class-specific 22:21:42 so multiple classes can share the same field names 22:22:59 you're mistaking me for someone familiar with OOP 22:23:10 I'm all hardware 22:23:28 i have a scant idea of what you probably mean 22:24:40 I mean that let's say you have class A and class B 22:24:50 and you have a field .foo in class A 22:24:59 you can also have a field .foo in class B 22:25:00 I dont know what a class is 22:26:16 do you use structures at all? 22:26:30 no 22:26:35 like many Forths provide a means for conveniently defining structures containing fields 22:26:47 I'm a very simple machine code/forth programmer 22:27:22 I have *some* idea what a structure is, and I know that it is the main mechanism that C programmer deal with bits 22:27:45 i have always seen them as incredibly complicated and messy 22:28:16 well think like this - just like C, with my OOP layer you can define multiple "structures" where the fields share the same names 22:28:29 ok 22:37:18 the only thing is I'm not sure if I should introduce metaclasses or not 22:37:25 --- join: jedb_ joined #forth 22:38:42 in Mecrisp-Stellaris I have no problem dealing with fields 22:38:56 i dont have the same problem that C does 22:39:21 which is why Ive probably never needed to learn oop 22:39:54 in most Forth fields are just words that add offsets to pointers 22:40:15 --- quit: jedb__ (Ping timeout: 276 seconds) 22:41:51 sorting out the thousands of bitfields was the first thing I did when I strted using Forth in embedded 22:42:06 to a embedded person, bitfirlds are everything 22:43:33 luckily ARM provides XML fields which detail all these bitfields 22:43:38 *files 22:45:36 yes, exactly, and from that I do stuff like this 22:45:38 STM32F0xx.svd 22:45:53 37 peripherals 22:45:53 413 registers 22:45:53 3044 bitfields 22:46:21 I can read,write and test every single bitfield by name 22:47:28 i mean 3044 of anything is a LOT of work, and this is a very small mcu 22:50:31 --- quit: WickedShell (Remote host closed the connection) 22:51:14 I wonder if there are any MCUs with more bitfields than bytes of RAM 22:52:24 thats hard to answer as they are so disparate 22:53:09 STM32F437x 22:53:25 80 peripherals 22:53:25 1453 registers 22:53:25 11811 bitfields 22:54:21 --- join: jedb__ joined #forth 22:54:47 tabemann, I often treat classes or structures as namespaces which are easiest to implement as vocabularies in forth. 22:54:49 STM32F7x7 22:55:00 93 peripherals 22:55:01 2093 registers 22:55:01 17051 bitfields 22:55:36 proteus-guy, Mecrisp-Stellaris has "vocs" written by Manfred Mahlow 22:55:59 vocs are vocabularies I presume? 22:56:33 proteus-guy: what I've done is have the OOP layer automatically define words for methods, which each have an index which it looks up an xt for that method in an intmap associated with a given class 22:56:49 --- quit: jedb_ (Ping timeout: 240 seconds) 22:56:58 proteus-guy, yes 22:57:19 tabemann, that's for you to resolve at runtime then, right? dynamic dispatching? 22:57:28 yes 22:57:58 the advantage to this approach is that different classes with no connection to each other can share the same method names, which are resolved at runtime 22:58:13 this eliminates much of the need for inheritance 22:58:51 certainly if you need dynamic resolution at runtime that's an approach. most often for me - there's really only one correct word to be called and being able to overload the word name makes my code more readable and semantically correct but the resolution can happen at compile time - thus vocabularies during compile time do that without any runtime overhead. 23:00:16 to me at least, if there is only one possible word, why not just use normal Forth words combined with separate wordlists 23:00:41 (I'm mostly working on OOP because I'm bored rather than because i plan on actually using this - heh) 23:01:31 (the other reason is that I find that how I am doing it is neat compared with the traditional Java/C++-type OOP) 23:07:52 --- join: ryke joined #forth 23:09:15 --- join: rdrop-exit joined #forth 23:09:20 hey 23:09:29 c[] hi tabemann 23:10:44 I'm actually going to go hit the sack shortly 23:11:13 I'm trying to stay awake after a heavy lunch 23:11:48 I was working on my OOP implementation earlier, made it so that field names were the same as methods 23:12:09 so they are dynamically dispatched 23:12:29 so different classes can share the same field names transparently 23:12:37 --- join: f-a joined #forth 23:12:45 hey f-a 23:12:47 Do you find its worth the trouble? 23:13:31 o/ friends of the DUP 23:13:49 hi f-a 23:14:05 I feel it's worth the trouble 23:14:31 I'm using a method lookup mechanism that is faster than using a wordlist 23:14:48 because it's just using integers as keys to intmaps 23:15:05 and intmaps are fast 23:16:13 and from the user's perspective it provides a nice runtime model 23:17:18 like one thing I like is that the methods of a class are not a closed set 23:17:28 unlike in Java, C#, or C++ 23:17:37 you can always add methods to classes after the fact 23:18:06 (albeit you cannot retroactively add fields, for obvious reasons) 23:22:20 okay, I'm gonna actually go to bed 23:22:25 g'night guys 23:22:32 OOP doesn't really appeal to me 23:22:38 goodnight tabemann 23:22:43 night tabemann 23:22:55 --- join: jedb_ joined #forth 23:23:19 rdrop-exit, oop makes me feel tired 23:23:36 I want less not more complexity 23:24:21 kqnight 23:24:22 I gave up on it decades ago 23:25:01 I have words, don't need objects 23:25:28 f-a, heyhey 23:26:02 --- quit: jedb__ (Ping timeout: 268 seconds) 23:26:03 It feels weird that to write OOP you have to read countless books on "how to oop" 23:26:45 The only OOP books I ever read were the Smalltalk-80 books and the Eiffel book ages ago 23:27:24 And the first edition of the Sosstroup (SP?) book 23:28:26 Stroustrup 23:29:18 --- quit: gravicappa (Ping timeout: 265 seconds) 23:29:21 --- join: jedb__ joined #forth 23:31:37 --- quit: jedb_ (Ping timeout: 240 seconds) 23:33:36 I would like to learn a "pure" oop language 23:33:40 just to get the gist of it 23:36:45 I always end up going back to Forth and C, mostly because they get in my way the least. 23:38:15 C because its the lingua franca of POSIX, Forth because it fits the way I think. 23:38:33 the "sad" thing about new languages is that you need to write something substantial with them to understand them 23:39:11 I'm too old to drink new Kool-Aid or get on any new bandwagons. 23:41:15 --- join: reepca joined #forth 23:41:44 --- quit: f-a (Read error: Connection reset by peer) 23:42:32 --- join: f-a joined #forth 23:59:59 --- log: ended forth/19.11.08