IRC channel logs

2023-12-29.log

back to list of logs

<euouae>Hlelo
<sneek>Welcome back euouae, you have 3 messages!
<sneek>euouae, tsmish says: I've tracked down why test doesn't run correctly. The reason is guix has broken load paths which prioritize system directories over the repo directory. To solve this add "(add-to-load-path source)" to etc/system-tests.scm:78 (right after (define source ...))"
<sneek>euouae, tsmish says: or alternatively add "-L$(top_srcdir)" as an argument to guix build at Makefile:7039 (check-system definition)
<sneek>euouae, tsmish says: running "make scripts/guix" before running the test would have also worked, albeit for a different reason.
<euouae>So I've figured out one way to mix C and guile is this:
<euouae>use guile wrappers over a C library and load the guile library inside guile
<euouae>So now I'm exploring the other way: To embed Guile inside a C program
<euouae>I'm not sure how exactly to do this however. What I have so far, <https://termbin.com/iyrf>, is just loading a guile shell with scm_shell()
<euouae>instead of the scm_shell() call, I'd like to run Guile code that also has my-negate (from C) available
<euouae>I imagine this would be used e.g. with users of the C program able to "script" it by modifying Guile source files
<euouae>e.g. Guile plugins loaded on-the-fly
<euouae>ah maybe with scm_primitive_load
<euouae>yup I got it working
<euouae>so now my question is, how to deal with C++ programs and libraries? Is there some way?
<euouae>I suppose I just have to create my own C wrapper
<freakingpenguin>Hey all! Does guile have a code formatter/linter tool? I'm thinking something like rubocop or python-black, for cleaning up unused imports and whatnot.
<euouae>code formatter?
<euouae>In Emacs you can do C-M-q
<euouae>As for a linter, aside from cleaning imports, I can't think of many uses for it. Python makes use of linters via type hints doesn't it?
<euouae>and AFAIK the imports issue cannot be answered perfectly because it would be equivalent to the halting problem as the symbol can change at any point dynamically. Right?
<euouae>The generally useful features are described in <https://www.gnu.org/software/guile/manual/html_node/Using-Guile-in-Emacs.html#Using-Guile-in-Emacs> together with paredit and geiser's docs
<euouae>If you'd like a binary tool that formats lisp, e.g. you can use <https://github.com/eschulte/lisp-format>
<freakingpenguin>euouae: Thanks! Yeah, Emacs handles indentation very well. My default indentation fix is C-x h TAB. I've only used Guile for a few months so it's not always clear to me when I'm following best practices (or when said practices exist)
<freakingpenguin>I can see why a traditional linter wouldn't be very helpful. Not like there's, say, ambiguous order of operations.
<mwette>In (unreleased) guile repo code is option to emit unused-modules, if I read the it right.
<mwette>s/emit/emit warnings for/
<mwette>There also seems to be unused-toplevel warning.
<freakingpenguin>Oooh, shiny upcoming feature. Thanks for the heads up.