IRC channel logs


back to list of logs

<ahungry>hi all - if one wanted to extend guile with a new language / syntax support, is there an existing guide for that? Maybe a "hello world" type sample?
<ahungry>Would it require writing a file into the languages/ directory in guile source and recompiling, or is it possible to do just in the "userspace" for prototyping such a thing?
<daviid>str1ngs: i pushed a few patches, one offers a new gi-import-by-name interface that you might be interested to use, like: (gi-import-by-name "Gtk" "Widget"), (gi-import-by-name "Gtk" "init") ...
<str1ngs>daviid: ah that's handy thank you. I kind wrote my own but I'll switch. mine didn't do any error handling lol
<str1ngs>daviid: I'll test this out tomorrow for sure
<nalaginrut>wingo: It seems suspendable-port has bug in 2.9.4
<nalaginrut>Internal ERROR wrong-type-arg (bytevector-copy! Wrong type argument in position ~A (expecting ~A): ~S (3 mutable bytevector 1024) (1024))!
<nalaginrut>The location is "In ice-9/suspendable-ports.scm:
<nalaginrut> 340:16 1 (get-bytevector-some! _ _ 0 _)"
<nalaginrut>I think I have to fallback to 2.2, and I'll try to figure out what's wrong
<chrislck>question for g-golf hackers... from my understanding it's meant to be a forever-glue to gtk3; are there any hello world? like racket/gui?
<str1ngs>chrislck: g-golf uses gobject introspection as long as something has GObject typelibs g-golf can introspect it and it's now available to scheme. so yes it's kinda like forever-glue to gtk3 but it's not limited to gtk3 either.
<str1ngs>chrislck: did you need a hello world example for gtk3?
<chrislck>it would be nice yes, for people who are new to hacking guile
<chrislck>s/guile/guile programs
<chrislck>I could write applets that interface to/from gnucash *dreams*
<str1ngs>actually g-golf doesn't not support signals yet. so I proper example would be buggy
<str1ngs>does gnucase use gtk_main or does it use GtkApplication?
<str1ngs>err gnucash*
<chrislck>uh no idea, looks like gtk_main()
<str1ngs>I'm using g-golf with nomad, but I provide my own typelibs to handing signals and some other limitations meantime. just keep in mind g-golf is still in development.
<str1ngs>I can put a gtk_main example together for you
<chrislck>this looks like the main loop:
<chrislck>(the wrapping gnc:set-ui-status is my hack to upgrade error-logging from console to use gtk <g>)
<str1ngs>I will put a basic gtk helle-world together for you. just keep in mind that closing the window won't stop the main process. since there is no way to attach a signal
<str1ngs>also I'm only a g-golf user. Daviid is the author.
<chrislck>guile needs a wiki IMO
<str1ngs>chrislck: also the g-golf introspected API very close to the C API so you should be able to get going pretty easily
<str1ngs>is very*
<chrislck>guile needs an *opininated wiki IMO... not easy to know if something is obsolete, bitrotted, or in development
<str1ngs>chrislck: a basic hello world
<chrislck>hmm so small...
<str1ngs>if you need a more complete example I can add to this if you like
<chrislck>gi-import can't be found, where's this from?
<chrislck>have libgirepository1.0-dev and libgirepository-1.0-1 already
<str1ngs>gi-import is part of g-golf
<chrislck>ah i'd compiled master rather than devel
<chrislck>my ubuntu has Makeinfo6.5 only :(
<str1ngs>chrislck: in change the MAKEINFO_PROG([6.5]) to MAKEINFO_PROG
<str1ngs>also you might need to change GUILE_PROGS([2.0.14]) to GUILE_PROGS
<str1ngs>this is a hack for ubuntu.
<str1ngs>chrislck after that run ./
<str1ngs>and then ./configure
<str1ngs>err 6.6 not 6.5 I meant
<chrislck>ok finally did it.. that was painful
<str1ngs>chrislck: can you verify that you needed to modify GUILE_PROGS. if so I'll let daviid now this might be a bug
<chrislck>don't think i had to... first time round it did compile
<str1ngs>MAKEINFO_PROG can't be helped since 6.6 is a requirement. so that's an issue with ubuntu
<chrislck>ok GUILE_PROGS does work with 2.0.14
<str1ngs>okay good to know, what is your ubuntu version. cat /etc/lsb-release will give you the version
<chrislck>DISTRIB_RELEASE=19.04 disco
<chrislck>ideally i'd restart with a clean minimal ubuntu and make it work. the dependencies list is fine but CLI commands would be better
<str1ngs>I have a docker file for g-golf if you needed an isolated test environment
<chrislck>sudo apt install guile-library guile-2.2 autoconf
<chrislck>oh yes
<spk121>so, no such thing as marking a bytevector read-only?
<daviid>spk121: how would that even be possible? I mean unless another data strucutre has that information ...
<daviid>which is what guile struct offers if i'm not mistaken
<spk121> daviid: dunno. Add an object property to the bytevector. Some magic with mprotect and read-only pages. ;-)
<daviid>does that exists, in the kernel?
<spk121>Sure. On Linux you can set and unset a page read-only but a page is 4KB. OpenBSD has a better mprotect with no 4KB minimum
<daviid>spk121: meanwhile, why don't you just rely on your uers not to mutate? you inform them not to, if they do that , it crashes or produces unreliable results ... sounds perfectly ok to me
<daviid>chrislck: g-golf works 2.0.14, but that is becoming quite old, and is also quite slower then the latest 2.2 stable releases. g-golf also works with 3.0
<janneke>hmm, what's the name of latin1 encoding for ice-9 iconv in 2.0.9? these work on 2.0.14 but not on 2.0.9... (string->bytevector "bla" "latin1") (string->bytevector "bla" "ISO-8859-1")
<janneke>`#f' does not work :-(
<daviid>chrislck: g-golf currently lacks a few fundamental pieces - g-iddle-*, g-timeout-*, gclosures and signals, mainly, working on it ...
<janneke>hmm, maybe "ascii" ?
<janneke>or would i lose bits
<daviid>chrislck: you must (currently) checkout the devel branch indeed, and pull/make once a day or so ... just keep an eye here and on the repo ...
<daviid>chrislck: feedback welcome of course - ultimately, you should be able to get rid of most if not all your C code, gnome/gtk wise at least
<daviid>chrislck, str1ngs, whe you want to define a module, you need to import at expand time
<daviid>spk121: in your browser example in guile-gi, line 47, you call (run app (command-line)), is run from Gio or from guile-gi? what would be a good example for (command-line)? i'm trying to port this example to g-golf ... though without signal, but i wanted to see ...