IRC channel logs

2023-12-13.log

back to list of logs

<jfred>Doing a bit of debugging this morning on the last remaining test failure in my Horton implementation and I'm facepalming a bit right now at the bug I just figured out
<jfred>I like to think I've largely gotten the hang of the higher-order programming methods you use a lot in Scheme, but every so often something catches me off-guard haha
<jfred>the bug's in these lines right here: https://gitlab.com/jfrederickson/guile-horton/-/blob/78d7c19f58f3414f8dced1e442bd6d4b04b6edd1/horton.scm#L99-106
<jfred>oooops https://gitlab.com/jfrederickson/guile-horton/-/commit/dbdf5ea7970f651c8659b2959b14a6a499329510
<cwebber>jfred: heh, oops :)
<cwebber>there was a bug in Goblins at one point where methods *did* re-run extends every time
<cwebber>that created the opposite problem
<jfred>Aha
<cwebber>in Terminal Phase there were enemies who kept having certain effects applied over and over
<cwebber>even though they shouldn't have been
<cwebber>oops! did extends wrong
<jfred>sounds like a nice way to track down bugs in goblins!
<jfred>writing a space shooter :P
<cwebber>it also has been a nice reason to track down bugs in Hoot :)
<cwebber>ask dthompson :)
<cwebber>"you don't really know if a design works until you write a game in it"
<jfred>oh right haha, I bet
<jfred>side note, I think I'd either not realized or had forgotten that you can write (lambda args ...) and you'll just get the args as a list. nice and simple but took me a bit to find that
<jfred>it makes sense too, the parenthesized form just destructures it I guess
<dthompson>cwebber: heh yup! games are great for raising bugs to the surface
<encryptedwhisper>I've been working on a "guiledocs" website a la "clojuredocs". the hope is to get guile's documentation a bit more accessible to folks less acquainted with gnu Info, and improve other issues with ux of the documentation
<cwebber>:D
<isaneran>that's awesome
<sneek>isaneran, you have 1 message!
<sneek>isaneran, jfred says: you can build a digital house out of parentheses ;)
<isaneran>jfred: hehe
<jfred>:P
<encryptedwhisper>is there a standard way to share images here?
<isaneran>would be sweet to have something like hoogle for guile but
<isaneran>we don't really have type info on the args
<isaneran>or return type so
<cwebber>encryptedwhisper: link an http link ;P
<encryptedwhisper>well yeah, but any common hosts we use for this?
<isaneran> https://bin.disroot.org/
<isaneran>ah wait
<isaneran>thought privatebin supported images
<isaneran> https://upload.disroot.org
<encryptedwhisper> https://upload.disroot.org/r/SHEH2qDM#9kJ9bfpVbuoYWYSNy5AET/7UVHhJfeSfSEYufiNqpQE=
<encryptedwhisper>it uses sxml
<isaneran>nice!
<encryptedwhisper> https://upload.disroot.org/r/LgyKMPEZ#WTTbjwYIgTJC0IFLqlAa2/+tosw96gphIHoucbkYuRo=
<isaneran>I guess you're parsing it with the info thing?
<encryptedwhisper>I'm just using the built in guile documentation strings, not actually the guile manual
<encryptedwhisper>(yet)
<encryptedwhisper> https://git.solarpunk.moe/TakeV/guile-docs/src/branch/vivi
<encryptedwhisper> https://git.solarpunk.moe/TakeV/guile-docs/src/branch/vivi/guile-docs/docs.scm
<isaneran>oh I see
<encryptedwhisper>obviously it's all extremely wip and messy, it'll be a lot nicer very soon. just got it thrown together last night
<isaneran>good initiative :)
<encryptedwhisper>also! more relevant to this channel.
<encryptedwhisper>we are planning on using Hoot for all of the client side logic
<encryptedwhisper>and also using it for a Playground. folks will be able to contribute code examples, and then open the code in a playground / repl
<encryptedwhisper> https://janetdocs.com/ is where that idea comes from
<isaneran>cool!
<encryptedwhisper> https://janetdocs.com/playground/example/541
<isaneran>will be almost like a wiki type thing then
<encryptedwhisper>yeah.
<encryptedwhisper>i also like the "I'm feeling lucky" feature on there
<encryptedwhisper>good for learning new features
<encryptedwhisper>(i think Janet is a super cool language)
<encryptedwhisper>it's basically c clojure with Lua inspirations
<isaneran>does it support users upvoting code examples etc?
<encryptedwhisper>i don't think janetdocs has upvotes right now. but we are hoping that Goblins will allow us to have more flexible things like that
<Zarutian_iPad>why have upvotes and downvotes?
<isaneran>didn't say downvote
<isaneran>but likes or whatever could be useful for sorting code examples by popularity
<isaneran>to weed out less useful ones
<Zarutian_iPad>one must have the other otherwise there wont be balance.
<encryptedwhisper>hehe
<Zarutian_iPad>oh, I see.
<encryptedwhisper>yeah like "this was helpful"
<Zarutian_iPad>you mean love/heart feature
<isaneran>but then we need a hatred/brain feature to balance it out
<Zarutian_iPad>stuff like the dreaded Duffs Device and such would fall into that category
<encryptedwhisper>report feature would be good too. I'm not sure how clojure/janet do this but i suspect it's just an acl that allows for modification of the entries
<encryptedwhisper>but, the first step is getting a more static site running :)
<Zarutian_iPad>ACTION sees 'acl', loads his flamwaffer, and says shame.
<jfred>I still think it might be neat to one day see something like https://www.val.town/ but with programs speaking captp to each other
<jfred>of course in that case programs are run in response to HTTP requests and aren't long-running, so there may be an impedance mismatch there... not sure
<jfred>then again cloudflare durable objects is similar I think, and maybe it's fine so long as programs can be suspended/rehydrated in response to incoming captp messages
<Zarutian_iPad>jfred: been fiddling with how to do the suspend resume thing on val.town
<jfred>oh yeah?
<Zarutian_iPad>pretty much have to use js-in-js interpreter
<Zarutian_iPad>and some external storage such as a github gist or db row
<encryptedwhisper>oh yeah val.town, that looks cool
<Zarutian_iPad>or use cryptographic techniques of handing the http requestor a huge cake to get back at their next request
<Zarutian_iPad>(cookie is just too small)
<isaneran>Unbound variable: cookie
<jfred>I'm thinking an ocap-style val.town would likely be cleaner if you did the OO thing of making the "vals" classes and letting people spawn multiple instances of them, each with their own storage
<jfred>then capabilities would be associated with the instances rather than the code snippets themselves
<Zarutian_iPad>strike classes, use constructor functions instead.
<jfred>mmm sure - I guess that's what goblins does isn't it? (I'm admittedly not super clear on the distinction)
<dthompson>encryptedwhisper: that is quite the ambitious project! sounds very cool
<dthompson>you nerdsniped me with the janet playground
<dthompson>seems they compile janet's C source via emscripten to produce a janet.wasm file
<encryptedwhisper>yeah.
<encryptedwhisper>It feels like something like this is very needed for Guile, at least to get new users onboard
<dthompson>won't be possible for guile for some time
<encryptedwhisper>My current experience with docs on guile is very frustrating, and I am frustrated with the frustration.
<dthompson>but we'll be sharing a step along the way
<dthompson>what's frustrating about them?
<dthompson>I think they're quite good
<encryptedwhisper>very hard to discover things
<dthompson>hmmm for me it's easier to discover things than most manuals
<encryptedwhisper>like, I was trying to figure out how open a file to read text the other day, and it took me maybe a half hour and asking friends, looking all over...
<encryptedwhisper>really basic stuff is very hard to discover
<encryptedwhisper>It's fine if you know guile already
<encryptedwhisper>It's just not designed for a newcomer
<dthompson>there was a time that I didn't know guile
<dthompson>I'm curious what the disparity between our experiences is caused by
<dthompson>there are certainly things *missing* from the manual, but for the stuff that's adequately documented I can generally find what I'm looking for without much trouble.
<encryptedwhisper>If I go to janet, for example, I can look up IO, then go to janetdocs, and see a "see also" or an example that shows exactly how to use it
<encryptedwhisper>I don't get stuck on a solution that is suboptimal
<dthompson>oh so there was an example missing in the guile docs?
<encryptedwhisper>Okay. So here's a case study
<encryptedwhisper>My goal: Advent of code. I have done all the actual logic, and I need to actually load the input file line by line.
<dthompson>call-with-input-file :)
<encryptedwhisper>yeah
<encryptedwhisper>but
<encryptedwhisper>from the perspective of a newbie who isn't talking with dthompson.
<encryptedwhisper>I'm here: https://www.gnu.org/software/guile/manual/html_node/index.html
<encryptedwhisper>What do I do to find that function. I search for "load file"
<encryptedwhisper>no results
<encryptedwhisper>no search bar
<encryptedwhisper>"load" returns no results
<encryptedwhisper>"io" returns a bunch of text with io in the name but if I filter those out using the browser search
<encryptedwhisper>i get to https://www.gnu.org/software/guile/manual/html_node/rnrs-io-simple.html
<dthompson>ohhh well yeah the html view isn't the best out there. it's completely static. no js
<dthompson>but load up the manual in emacs and you've got everything at your fingertips and it's very easy to search
<encryptedwhisper>i see a very large number of procedures with a thing saying they are the same as the core library
<encryptedwhisper>linking to file ports
<encryptedwhisper>i am linked to the ports section
<encryptedwhisper>i have ot start reading what ports are
<encryptedwhisper>I see an example "open output file"
<encryptedwhisper>maybe i navigate up to "input and output"
<encryptedwhisper>okay, closer.
<encryptedwhisper>textual io
<encryptedwhisper> https://www.gnu.org/software/guile/manual/html_node/Textual-I_002fO.html
<dthompson>"Textual I/O" would be the thing, yeah
<encryptedwhisper>get-char, put-string...
<encryptedwhisper>none of the things on that page help though
<dthompson>get-line reads lines, isn't that what you were after?
<encryptedwhisper>or, perhaps I start trying to find out how to open a file, and call get-string on it or something
<encryptedwhisper>Yes but I'm doing a case study as a user who doesn't know
<encryptedwhisper>In an ideal world I would automatically find my way very easily to call-with-input-file
<dthompson>a modern web UI would be nice, I agree
<encryptedwhisper>Note above, the path I had to take
<encryptedwhisper>involved weird hacks with the browser search feature
<fjl>dthompson: Compared to Racket docs Guile docs are super hard to approach
<encryptedwhisper>you also have to train your brain to ignore all the extraneous text like "Scheme Procedure:"
<encryptedwhisper>and C Function:
<encryptedwhisper>If you didn't know scheme/lisp at all, it's really a very inaccessible experience compared to any other language
<fjl>When I was starting with Guile I used to be checking stuff in Racket docs for clear explanation and examples and then go to Guile Procedure index and check if it is present in Guile
<encryptedwhisper>from here: https://www.gnu.org/software/guile/manual/html_node/Input-and-Output.html - where do I get to call-with-input-file
<encryptedwhisper>(if I don't know what call-with-input-file is)
<encryptedwhisper>or that I need to use it
<dthompson>there are certainly things to improve :)
<fjl>compare with https://docs.racket-lang.org/reference/Filesystem.html#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3elines%29%29
<encryptedwhisper>I actually can't find it at all. The only way to really use the guile docs is either to use the full HTML page view, or GNU Info
<encryptedwhisper>unless you already know exactly how it's structured, and want to reference it
<encryptedwhisper>Now I'll do the same case study with JanetLang...
<dthompson>you've made your point.
<encryptedwhisper>homepage links directly to documentation page: https://janet-lang.org/docs/index.html
<dthompson>Janet has the advantage of being a brand new language
<fjl>in case of Guilie I'm using https://sr.ht/~brown121407/f.scm/ that is providing sugar similar to racket
<dthompson>I completely agree that the web view is not great. it's having the manual open in emacs that is very powerful.
<encryptedwhisper>click "file" -> file/lines
<encryptedwhisper>click community examples
<encryptedwhisper>well, no examples there :)
<dthompson>racket's manual has very nice typography
<encryptedwhisper>but yeah it's a loot easier
<encryptedwhisper>Anyway, the goal of our project is to bring this kind of modern UX to guile. Hopefully as a companion in the same way that janetdocs.com is a companion to janet-lang.org/api
<dthompson>the existing guile manual could be adapted to have a web export that looks more like racket's
<encryptedwhisper>not really to replace the core manual
<fjl>what is missing in texinfo comparet to racket scribble are the links to procedure definitons
<dthompson>the texinfo web export just sucks. for hoot and goblins we follow guix's lead and post-process the output.
<encryptedwhisper>I have a lot of problems with the manual in emacs too, but it's likely just because i use spacemacs
<dthompson>to make it look a lot better, add syntax highlighting, etc.
<fjl>guix postprocessing of docs should be upstreamned
<encryptedwhisper>i can't navigate with the keyboard
<fjl>to all trexinfo html
<dthompson>encryptedwhisper: sounds like a spacemacs thing.
<encryptedwhisper>For sure. I have to figure out what's up with it.
<dthompson>fjl: would be a better use of time to abandon texinfo
<encryptedwhisper>But, aside from that, I found the Emacs Info interface somewhat confusing and hard to navigate
<dthompson>I think there have been attempts to improve texinfo in this way that haven't gone well
<fjl>replace it with what?
<encryptedwhisper>Again, it's certainly very easy to use if you know how to use it
<fjl>guix got it to pretty decent astate
<encryptedwhisper>But, for a newcomer it's mostly headaches.
<dthompson>fjl: guile can parse a subset of texinfo, so improving that and having full control over the output, at least for the html version, would be better.
<dthompson>people have made alternative texinfo html viewers that are pretty darn good
<encryptedwhisper>Is there a way in emacs to search for something in the manual and show a list of results?
<fjl>Use one of existing markups, more scheme friendly?
<dthompson>rewriting the entire manual would be a hard sell
<encryptedwhisper>Also, the guile manual highlights function names in the documentation, but does not appear to make them links, which adds friction
<fjl>good example how it could look like
<fjl> https://docs.racket-lang.org/algorithms/index.html#%28def._%28%28lib._algorithms%2Fmain..rkt%29._scanr%29%29
<dthompson>encryptedwhisper: yes, the html export is not great.
<fjl>here you see scanr is similar to foldr,
<dthompson>I'm well aware of this :)
<fjl>scanr is not a link but foldr is
<fjl>it must be postprocessing
<fjl>as source is like that
<fjl>@racket[scanr] is similar to @racket[foldr], but returns a list of successive reduced values from the right.
<fjl>so scribble html renederer is handling taht
<dthompson>ah yeah if that's the source then it would be some kind of post-processing
<encryptedwhisper>if I'm looking here: https://upload.disroot.org/r/Ky9bA8Xp#I5LeCd4hBp4TXTZc/7J0ZxbAZeYA9fF1EYW9q1aYbW4= -- is there a way to navigate automatically to current-input-port's docs?
<fjl>there is a couple of nice procedures in guix docs build and guix artwork that could be upstreamed to Haunt and guile-syntax-highlight
<encryptedwhisper>I tried "g d" but that seems to have frozen emacs :-/
<encryptedwhisper>(which i canceled with ctrl-g)
<dthompson>'i' to search index
<dthompson>that's the single most useful keybinding in the info viewer
<encryptedwhisper>I think for me the friction mostly comes from the fractal of learning.. to learn guile you have to learn how to use the manual, to learn that you have to learn how to use emacs, to learn emacs comfortably you have to learn basics of lisp / elisp ... etc
<encryptedwhisper>specifically for Info, the main issue I encounter is I can't remember how to go back to the page I was just on.
<encryptedwhisper>like, I just hit 'i' and searched for current-input-port but now I want to go back to the page I was on and I can't remember how to.
<encryptedwhisper>(I did do the info tutorial thing, but it didn't stick in my mind so now I've forgotten)
<dthompson>encryptedwhisper: when you forget what keybindings are available, use C-h b
<dthompson>and you'll find Info-history-back mapped to the 'l' key
<dthompson>I 100% agree that a non-emacs learning route is needed. that's a direction we're trying to promote at spritely.
<dthompson>need non-emacs lispers to build the tools to make it pleasant
<encryptedwhisper>C-h b, very helpful
<dthompson>knowing some of the C-h _ commands is important for emacs. you can discover just about everything you need with them.
<encryptedwhisper>unfortunately spacemacs complexifies it
<dthompson>yeah I've never used spacemacs so I don't know what it does
<encryptedwhisper>I think we need an evil-info or something
<dthompson>ohh right vim bindings
<encryptedwhisper>well it's not really spacemacs per se, it's evil-mode
<fjl>dthompson: Ask Robin when guile-emacs, one level of lisp less then
<dthompson>when I switched from vim 10 years ago I just re-trained my hands
<dthompson>took a bit
<encryptedwhisper>because in evil-mode, 'l' just goes to the next character
<encryptedwhisper>I think I just have to set up info-mode to go into holy mode or w/e
<encryptedwhisper>(ctrl-z toggles)
<dthompson>if someone could make editing scheme pleasant in vscode or something, that would go a long way
<fjl>Heresy, here, when I need to scheme quickly I use Pycharm witch scheme plugin, as it is where my best muscle memory is :)
<dthompson>I thought LSP was going to be the answer, but apparently it's not built with REPL driven development in mind. it's more about static code analysis, which is unfortunate.
<fjl>and repl in another window
<dthompson>fjl: can you send stuff to the repl from the editor?
<dthompson>or are you stuck copy/pasting
<dthompson>copy/pasting is fine for small things, but REPL integration is a must-have for anything more serious.
<fjl>no
<dthompson>ah okay
<fjl>autosave and load
<fjl>but I have load in Ctrl+R so it is quick
<dthompson>that's good, at least.
<dthompson>true repl integration cuts out that save/recompile/load cycle
<dthompson>you can just eval a single expression in a module without having to reload the whole thing
<dthompson>anyway encryptedwhisper I think your project would definitely be a huge help so good luck with it and let us know how things go!
<dthompson>I'm working on something that is a small step towards having an in-browser REPL that we'll be sharing soon
<Zarutian_iPad>jfred: the distinction is that a constructor function can make more than one object at a time. Objects that are in cahoots with each other such as facets of a composite object. A class just describes and constructs one object at a time and only of that form.
<encryptedwhisper>very cool, excited about the in-browser repl for sure :)
<robin>fjl, i was actually tinkering with guile-emacs again in late 2022, but there's this "hoot" project that's been distracting me lately
<robin>(it's probably a programmer-year away from being up-to-date and reasonably usable, hard to find the right programmer and year though)
<fjl>Awesome. Is it at least constantly rebased?
<fjl>Anyway, any progress is better then stale code rotting.
<fjl>Hoot is the valid excuse.
<robin>nope, it's "stuck" on the release from my final summer of code, and the emacs side of rebasing always took a decent chunk of internship time (and guile-emacs essentially only changed emacs c code). the commit history is pretty clean though, i'd optimistically say three months for rebasing onto today's emacs
<robin>re: guile docs, i do think they could use a good overhaul, from the actual content to the web ui (texinfo just isn't that good outside of emacs, especially the lack of search)...
<robin>stephen michel (of hcoop.net and snowdrift.coop) pointed me to https://diataxis.fr/ which looks really good
<robin>("Diátaxis is an approach to quality in technical documentation. It describes an information architecture that emerges from a systematic approach to understanding the needs of documentation users.")
<fjl>Diataxis is a great documentation methodology. I participated in the workshop by the creator of it during the Djangocon year ago.
<fjl>That resulted in my patch to Django docs during the sprints after the conference.
<fjl>In the scheme land the best docs in my opinion is Racket. It is not strict Diataxis, but very close effectively.
<robin>oh wow, that's really cool re: djangocon
<robin>i'm still getting started with it but it looks very promising (i've got lots of doc work in the queue for hcoop (internet hosting consumer coop) and of course it would be useful for hoot/spritely/guile too)
<robin>and yeah, i don't use racket much personally but the docs are consistently excellent (i'd probably have to experiment with it more if they weren't!)
<fjl>But maybe the right direction to consider is postprocessing of texinfo for html presentation in direction of Racket docs. Scribble is bit nicer markup an the fact that it is just a DSL on top of Racket makes it even better, but we can live with texinfo.
<fjl>Could Hoot provide scheme replacement for the js tipue search?