--- Log opened Thu Jun 01 00:00:31 2017 |
00:21 | <&ToxicFrog> | Ok, actually emitting the code to make sure all the word definitions are registered turns out to be kind of grody |
00:21 | <&ToxicFrog> | So far the least bad option I've come up with is: |
00:22 | <&ToxicFrog> | - emit function definitions to <file>.nf.c and prototypes to <file>.nf.h |
00:23 | <&ToxicFrog> | - emit the fragment of DICTIONARY to allwords.c, e.g. { 0, word_dup, NULL, "dup" }, |
00:23 | <&ToxicFrog> | And then have something like |
00:23 | <&ToxicFrog> | const Word DICTIONARY[] = { ...a few builtin word definitions..., #include "allwords.c", } |
00:24 | <&ToxicFrog> | Which is awful, so hopefully I'll think of a better way before I get to that point |
00:24 | <@TheWatcher> | Jessikat: I find your ideas intriguing, and have subscribed to your newsletter! |
00:53 | <&McMartin> | I haven't actually figured out how mutual recursion works in forth proper |
00:53 | <&McMartin> | Because words don't exist tuntil you hit the ; |
00:54 | <&McMartin> | And there's a special word RECURSE to slot it quietly into place |
00:56 | <&ToxicFrog> | I have it running on the AVR! |
00:56 | <@celmin|sleep> | Yay, UQM reference. \o/ |
00:57 | <&ToxicFrog> | It doesn't do anything useful as yet, but it gives me a repl |
00:57 | | celmin|sleep is now known as celticminstrel |
00:58 | <&ToxicFrog> | Unexpected occurrence: the serial terminal is not line buffered by default, so the repl is reading and executing code as it's typed in, and if you get it wrong it will output the error message and re-prompt you the instant you finish typing the word that it had trouble with |
01:07 | <&ToxicFrog> | This also means backspace doesn't work. |
01:07 | <&ToxicFrog> | I might need an actual input buffer of some kind. |
01:08 | <@celticminstrel> | Heh. |
01:18 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
01:18 | | mode/#code [+o mac] by ChanServ |
01:21 | | macdjord [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
01:47 | <&ToxicFrog> | Argh |
01:47 | <&ToxicFrog> | Wordfinding is working on the host but not the target |
01:47 | <&ToxicFrog> | the code is the same |
01:48 | <&ToxicFrog> | wryyyyyyyyyyyyyyyyyyyyyyyy |
01:51 | <&ToxicFrog> | whups |
01:51 | <&ToxicFrog> | how did this ever work on any platform |
01:51 | <&ToxicFrog> | Word* word = malloc(sizeof(word)+strlen(name)+1); |
01:51 | <&ToxicFrog> | Issue #1: Word no longer has a VLA at the end, so +strlen(name)+1 is wrong |
01:51 | <&ToxicFrog> | Issue #2: sizeof(Word) and sizeof(word) are not the same |
01:53 | <&ToxicFrog> | It's alive! |
01:53 | <&ToxicFrog> | Initialization complete. |
01:53 | <&ToxicFrog> | Pointer size: 2 |
01:53 | <&ToxicFrog> | Word size: 6 |
01:53 | <&ToxicFrog> | ] 1 2 + . |
01:53 | <&ToxicFrog> | 3 |
01:55 | <~Vornicus> | 48bit numbers now |
01:57 | <&ToxicFrog> | "Word size" is sizeof(struct Word), i.e. a dictionary entry |
01:57 | <&ToxicFrog> | Not machineword size. |
01:59 | <&ToxicFrog> | I have it remind me how big they are every time it starts up because those pretty much have to go to RAM. |
02:00 | <&ToxicFrog> | I might be able to move the builtin parts of the dict to flash eventually, if I can come up with a static initialization for them -- which may not be practical since they form a linked list -- and am willing to eat the performance hit of copying them from flash into RAM every time the dictionary is traversed. |
02:01 | <~Vornicus> | oh |
02:05 | <&ToxicFrog> | In practice it's actually 6 bytes + length of name + 1 (which is nontraditional, usually forth embeds the name in the dictionary entry as a counted string, but this is not at all a traditional forth, which is why the project is called "notforth") |
02:06 | | * McMartin fiddles with gforth, understanding maybe 70% of what he's doing |
02:07 | <&ToxicFrog> | But I now have a REPL, running on the arduino, which lets me do simple math and peek and poke arbitrary addresses. |
02:07 | <&McMartin> | Best result so far: |
02:07 | <&McMartin> | : fib 1 1 ROT 1 U+DO DUP ROT + LOOP SWAP DROP ; |
02:08 | <&McMartin> | Note that changing U+DO to DO is fine unless the argument is less than 2 at which point it infinite loops and I'm not yet clear on the semantic distinction here |
02:08 | <&ToxicFrog> | Total size is 412 lines (and that includes host-specific code), 4k of flash and ~400 bytes of RAM. |
02:09 | <&ToxicFrog> | I can probably cut down that RAM usage (but it's higher than that in practice, because right now the dictionary gets put together at runtime) |
02:09 | <&ToxicFrog> | flash usage is going to go waaaaay up but I've got 32k of that, so I'm not terribly worried. |
02:10 | <&ToxicFrog> | I'm planning a more postscript-ish approach to flow control (flow control words take anonymous functions on the stack), which may turn out to be terribly unwise from a RAM usage perspective. We'll see. |
02:12 | <&McMartin> | Aha, I see the issue now |
02:12 | | * McMartin rewrites. |
02:12 | <&McMartin> | : FIB DUP 2 < IF DROP 1 ELSE 1 1 ROT 1 DO DUP ROT + LOOP SWAP DROP THEN ; |
02:13 | <&McMartin> | Goodness, I have no idea how this got a reputation as a write-only language >_> |
02:16 | <&[R]> | I thought you were making a song reference. |
02:19 | <&McMartin> | It turns out x x DO LOOP loops MAX_INT times, not zero. |
02:20 | <~Vornicus> | D: |
02:21 | <~Vornicus> | I wonder if I can still read my catan postscript |
02:25 | <&ToxicFrog> | I find postscript more readable than forth, but I also have spent a lot of time in postscript and very little in forth, despite using the latter much more recently |
02:25 | <&ToxicFrog> | And a large part of this, I think, is how postscript flow control and block structure works |
02:25 | <&ToxicFrog> | It doesn't really have special parsing modes like forth, or at least, if it does, they're much more well hidden and consistent with the rest of the language |
02:26 | <&ToxicFrog> | Whereas forth has things like : and IF...LOOP/DO...LOOP which are traditionally implemented by taking over the parser and reading ahead |
02:28 | <&ToxicFrog> | so like, in forth it's: expr IF code ELSE other-code THEN |
02:28 | <&ToxicFrog> | And in ps it's: expr code other-code IFELSE |
02:29 | <&ToxicFrog> | Where code and other-code are functions (anonymous or otherwise). |
02:30 | <&ToxicFrog> | Similarly, function definitions in forth are : <name> <flags> <code> ; |
02:30 | <&ToxicFrog> | And in ps it's: <symbol> <anonymous function or other callable value> def |
02:31 | <&ToxicFrog> | (`def` has the more general form <key> <value> def, so it's used for e.g. variable assignment as well; function definition is just binding an anonymous function to a variable like any other value. Which I find appealing.) |
02:41 | <&McMartin> | You're much further along in your understanding of Forth than I am |
02:43 | <&McMartin> | I have noticed that mismatched IF/THEN gets caught at ; time. |
02:45 | <~Vornicus> | I did find it fun to write though I was definitely in its neighborhood at the time. |
02:46 | <&ToxicFrog> | Oh yeah, that's the other thing -- flow control constructs in forth can't be used except in function definitions. You can't just use them "naked" in the REPL. |
02:47 | | * ToxicFrog deploys the slep |
02:49 | <~Vornicus> | No fun |
02:53 | | * McMartin heads off to the train station. |
03:06 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Operation timed out] |
03:14 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code |
03:14 | | mode/#code [+ao McMartin McMartin] by ChanServ |
03:33 | | macdjord [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
03:33 | | mode/#code [+o macdjord] by ChanServ |
03:36 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
03:57 | | ion [Owner@Nightstar-gmbj85.vs.shawcable.net] has quit [[NS] Quit: whup] |
03:57 | | ion [Owner@Nightstar-gmbj85.vs.shawcable.net] has joined #code |
04:08 | | ion [Owner@Nightstar-gmbj85.vs.shawcable.net] has quit [Ping timeout: 121 seconds] |
04:11 | | ion [Owner@Nightstar-gmbj85.vs.shawcable.net] has joined #code |
04:14 | | Alek [Alek@Nightstar-7or629.il.comcast.net] has quit [Ping timeout: 121 seconds] |
04:17 | | Alek [Alek@Nightstar-7or629.il.comcast.net] has joined #code |
04:17 | | mode/#code [+o Alek] by ChanServ |
04:37 | | Jessikat` [Jessikat@Nightstar-c57.tcr.132.82.IP] has joined #code |
04:37 | | Jessikat [Jessikat@Nightstar-9qn.jtr.132.82.IP] has quit [Ping timeout: 121 seconds] |
04:49 | | celticminstrel is now known as celmin|sleep |
05:36 | | Turaiel is now known as Turaiel[Offline] |
07:44 | | Kindamoody[zZz] is now known as Kindamoody|afk |
08:35 | | * McMartin gets to the point in his Forth research where all the authors start hailing Xenu. |
08:35 | <&McMartin> | ... I recognize this attitude. |
08:36 | <&McMartin> | Forth is what happens when scientists and engineers get infested with the Scheme brain virus 20 years before Scheme exists |
08:36 | <&McMartin> | And it's definitely Scheme and not other Lisps |
08:46 | <~Vornicus> | what is the difference between the scheme brain virus and the lisp brain virus |
08:46 | <&McMartin> | Scheme exults in how few primitives it has because they are all unnecessary |
08:47 | <&McMartin> | Also wacky mini-dsls |
08:47 | <&McMartin> | Which are even wackier becuase everything's RPN |
08:48 | <&McMartin> | But, like, I can also totally feel the same smug satisfaction here that I had when I wrote the "now their doom is sealed; continue the action" function in I7 |
09:01 | | * Vornicus discovers the existence of DRAKON |
11:05 | | Jessikat [Jessikat@Nightstar-t6e.tcr.132.82.IP] has joined #code |
11:07 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
11:09 | | Jessikat` [Jessikat@Nightstar-c57.tcr.132.82.IP] has quit [Ping timeout: 121 seconds] |
12:23 | < Jessikat> | TheWatcher: I feel privileged |
12:36 | <@TheWatcher> | ? |
13:01 | <&[R]> | <TheWatcher> Jessikat: I find your ideas intriguing, and have subscribed to your newsletter! |
17:34 | | Alek [Alek@Nightstar-7or629.il.comcast.net] has quit [Ping timeout: 121 seconds] |
17:35 | | Jessikat` [Jessikat@Nightstar-v8rmaq.dab.02.net] has joined #code |
17:37 | | Jessikat [Jessikat@Nightstar-t6e.tcr.132.82.IP] has quit [Ping timeout: 121 seconds] |
17:38 | | Alek [Alek@Nightstar-7or629.il.comcast.net] has joined #code |
17:38 | | mode/#code [+o Alek] by ChanServ |
17:48 | | Kindamoody|afk is now known as Kindamoody |
20:10 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
20:10 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
20:14 | | ErikMesoy [Bruker@Nightstar-hq72t5.customer.cdi.no] has joined #code |
20:14 | | mode/#code [+o ErikMesoy] by ChanServ |
20:30 | | * abudhabi fixes skype. By restarting it. |
20:35 | <&[R]> | It's an MS product |
20:35 | <@abudhabi> | Yes. I was momentarily fooled by using the Linux version. |
20:44 | <@ErikMesoy> | Dear Python, please include more batteries. |
20:44 | <@ErikMesoy> | Batteries included is awesome. But I find myself wanting more of it. |
20:49 | | * Vornicus gives ErikMesoy pip |
20:49 | <~Vornicus> | now available by default on all python installs |
20:56 | | * ErikMesoy drives the reconstructor tractor as he tries to put together the pieces of an old project built in a different version of Python with a now unsupported library under a different OS. |
20:57 | <@ErikMesoy> | I'm going to have to rewrite this and pick new libraries, aren't I. |
21:05 | <@ErikMesoy> | how stable is tkinter? is ten-year-old documentation likely still good? |
21:05 | <@gnolam> | Pretty sure it hasn't seen any development in ten years, so. :P |
21:08 | <@gnolam> | ErikMesoy: Not to be That Guy, but... tkinter? OH DEAR GOD WHY? |
21:09 | <&McMartin> | "It's actually there" |
21:09 | <@ErikMesoy> | gnolam: I am open to being dissuaded! Tentatively, "why" because it is Python's default. I used to use WxPython, but that is apparently having Rewrite Issues where I can pick between ultra-old version and beta version. |
21:13 | <@ErikMesoy> | What I'm looking to do is roughly GUI sans images: button-, menu- and window- driven interface. |
21:13 | <@ErikMesoy> | Is there a term for that? |
21:13 | <~Vornicus> | "gui" |
21:14 | <~Vornicus> | I'm always directed to QT |
21:14 | <@ErikMesoy> | heh |
21:14 | <~Vornicus> | But I've never gotten around to making a GUI for anything that wasn't actually in HTML so |
21:15 | <@gnolam> | Yeah. So. Having used all - that I know of - GUI toolkits for Python, my vote is still firmly on PySide (Qt). |
21:15 | <@gnolam> | If you can use it, that is. |
21:16 | <@gnolam> | As the PyPI version doesn't have anything for > 3.4. |
21:16 | <@gnolam> | (PySide2 is on its way) |
21:19 | <@gnolam> | But I would still prefer a half-broken wxPython over tkinter. |
21:19 | <@ErikMesoy> | Maybe I should drop back to python 2.7, use old stable wxPython, and check back for updates later after I have done content. |
21:31 | <@ErikMesoy> | gnolam: Explain "doesn't have anything", my pokes at QT are leading me to a twisty little maze of wiki pages. |
21:32 | <@ErikMesoy> | "Category:LanguageBindings::PySide::Downloads" (Redirected fromĀ Get-PySide) |
21:32 | | Jessikat [Jessikat@Nightstar-v8rmaq.dab.02.net] has joined #code |
21:33 | | Jessikat` [Jessikat@Nightstar-v8rmaq.dab.02.net] has quit [The TLS connection was non-properly terminated.] |
21:48 | <@ErikMesoy> | Fun. Some experimentation has led me to discover a possible interpretation, that "pip install pyside" got me the Py2 version of PySide rather than the Py3 version. |
22:24 | <&ToxicFrog> | I've used tkinter and while it's basic it's not bad for simple things. The API is straightforward and it's available ~everywhere. |
23:05 | | * ToxicFrog finishes Ghost in the Wires |
23:06 | <&ToxicFrog> | That was lighter on technical details than I would have preferred but was nonetheless a fantastic read |
23:07 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
23:23 | | Kindamoody is now known as Kindamoody[zZz] |
23:55 | | himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
--- Log closed Fri Jun 02 00:00:14 2017 |