2021-07-17 02:23:52 maw 2021-07-17 15:30:22 -!- ChanServ changed mode/#forth -> +o mark4 2021-07-17 15:30:22 -!- mark4 changed mode/#forth -> +o mark4 2021-07-17 16:25:44 siraben: Yeah small world (okay the community of people that comment on HN and care about axiom of choice is probably not that large, to be fair) 2021-07-17 16:25:57 I'm reading the B manual 2021-07-17 16:26:51 You can define a simple external variable by naming it, and then provide a value to initialise it, like: name 0; 2021-07-17 16:27:18 But if you add more values after it, they just get put directly after previous values in memory 2021-07-17 16:27:31 So you can create a vector by just doing: vals 0 1 2 3 4; 2021-07-17 16:27:43 And then access the vector through &vals 2021-07-17 16:27:56 Oh sorry with commas between the values 2021-07-17 16:28:19 Anyway it just struck me this syntax and functionality is extremely similar to Forth 2021-07-17 16:29:07 yup 2021-07-17 16:34:42 I'm trying to think about how to make a nice B successor without types (i.e. not C) 2021-07-17 16:36:04 I think the way to go might be to have a[b] <=> *(a + CELL*b) 2021-07-17 16:37:11 The reason I'm thinking about this is because B did not have pointers, it just had addresses, and it was designed for a word-addressed system 2021-07-17 16:37:52 So all the code broke on byte-addressed systems, and C was part of the effort to make B intelligent enough to still look mostly the same but generate good code 2021-07-17 16:38:33 And interestingly to me the interim B compiler they wrote for the byte-addressed PDP-11 was pretty much like a threaded forth implementation inside 2021-07-17 16:51:11 eris[m]1: What does the [m] mean? I've seen this on other nicks too 2021-07-17 16:51:24 matrix! 2021-07-17 16:51:32 Oh right 2021-07-17 16:59:52 id love to see a modern B 2021-07-17 17:00:17 would compile p well to C, maybe 2021-07-17 17:06:01 Some kind of regex might be able to convert it 2021-07-17 17:06:37 extrn to extern, put braces around initializer lists (and square brackets around automatic vector sizes) 2021-07-17 17:07:13 But I think the advantage of a modern B is it would be very easy to write an *actual* compiler for it 2021-07-17 17:10:21 I used to think that C++ was just C with more stuff and really bad taste for syntax 2021-07-17 17:10:35 Now I realise C is just B with more stuff and really bad taste for syntax 2021-07-17 17:21:46 does B tail call optimise? 2021-07-17 17:22:30 also, B's syntax is p nice 2021-07-17 17:22:53 considering any extensions for B? 2021-07-17 17:42:09 eris[m]1: I want to change some semantics to make addresses work 'nicely' 2021-07-17 17:42:24 And also the point of octal was that it was natural on the original machine 2021-07-17 17:42:45 So hex is more natural on current architectures, so I will just have 0 prefix be hex, rather than 0x 2021-07-17 17:43:07 So getting rid of octal completely 2021-07-17 17:43:34 I am considering making ++ add CELL rather than 1 2021-07-17 17:43:59 So you can use a++ to go to next address, but NOT use it to add 1 2021-07-17 17:44:41 And I am planning on using it with the C preprocessor 2021-07-17 17:45:23 "does B tail call optimise" I don't know, I'm sure some implementation might have. There were a number of implementations. 2021-07-17 17:46:19 i think a 0 prefix and another prefix would be nice yea 2021-07-17 17:46:31 i like ++ and -- as CELL+ and CELL- 2021-07-17 17:49:53 keep me updated on this 2021-07-17 17:50:13 Okay lol 2021-07-17 17:50:55 The updates will run out soon when I lose motivation 2021-07-17 17:58:45 and i'll try and take over! 2021-07-17 17:59:48 wasnt B interpretted? 2021-07-17 18:01:37 that wouldnt makw sense 2021-07-17 18:20:37 MrMobius: No, the PDP-11 version compiled to threaded code like Forth (so sort of interpreted) 2021-07-17 18:20:46 The original was compiled to machine code I belive 2021-07-17 18:21:33 The PDP-11 version did this because the language stopped making sense natively on that architecture 2021-07-17 18:24:37 I think another extension would be permitting constant expressions rather than just constants (B/C terminology for 'literal') in initializers 2021-07-17 18:25:04 Because I'm planning on doing basic constant folding in expressions already at least 2021-07-17 19:25:22 maw 2021-07-17 20:49:51 b's function array stuff is wau better than c's 2021-07-17 21:10:26 like god 2021-07-17 21:10:31 function pointers in c 2021-07-17 22:32:00 re maw 2021-07-17 23:39:46 whats wrong with function pointers?