IRC channel logs

2023-07-13.log

back to list of logs

<spk121>do hash values end up in *.go files? would changing that hash algo require regenerating all the *.go?
<rlb>Am I just missing it, or does nothing currently set the bytevector immutable flag?
<haugh>(cond ((values 'heck 'yeah)))
<haugh>What would be needed in order to replicate Gauche's support for a mult-value return here?
<lloda>rlb: the compiler sets it iirc
<lloda>module/system/vm/assembler.scm
<wingo>spk121: some hashes end up in go files.
<wingo>afair symbol hashes, for use in hash-based dispatch for `case` and related expressions
<spk121>wingo: thx
<RavenJoad>For new Guile code, are exceptions the way to go? Or throw and catch? I want an exceptional type (perhaps a srfi-35 condition) for when a database search returns no results.
<civodul>RavenJoad: hi! you can use SRFI-34/35 if you want to write portable code, or you can use the new exception object API that appeared in 3.0
<RavenJoad>It is not my intention to make this program portable right now, but that is a good thing to know for the future. But, should throw/catch be used at all any more?
<dthompson>you can still use them, but they are less expressive than the new exception system
<dthompson>the new exception system is good but I think the docs could be improved. kinda confusing imo
<RavenJoad>Ok. The expressiveness was my impression when reading the docs too.
<RavenJoad>Agreed. The docs for exceptions are pretty terse right now. Some examples of building a custom exception and raising it would be much appreciated.
<dthompson>define an exception type: (define-exception-type &foo-error &error make-foo-error foo-error (bar foo-error-bar))
<dthompson>raise a custom exception: (raise-exception (make-foo-error 'some-relevant-detail))
<dthompson>catch custom exception: (with-exception-handler (lambda (e) (pk 'caught e)) (lambda () ...) #:unwind? #t #:unwind-for-type &foo-error)
<dthompson>the manual should just show this. not unwinding and using continuable exceptions is cool but probably this basic case should be made crystal clear.
<dthompson>the other important detail is that exceptions are composable. (make-exception (make-foo-error 'some-relevant-detail) (make-exception-with-message "ruh oh, that's a error!") (make-exception-with-irritants '(i dunno)))
<dthompson>so you can make your custom error that has the stuff you want in it, and then compose it with a message, etc.
<dthompson>the end.
<RavenJoad>Awesome! I was struggling with how to handle the exception I raised. I did not know about pk.
<dthompson>pk is a secret (for unknown reason) handy little print debug tool
<dthompson>hope this was helpful
<RavenJoad>It was! Thank you! Now I have to figure out how I want to raise my no-match-exception and handle it.
<dthompson>have fun :)
<RavenJoad>I will definitely try! Plug to the project, in case anyone is interested: https://github.com/KarlJoad/gloa
<dthompson>if I wasn't so short on time I'd submit a patch to the manual. if anyone reading this wants to take my example and adapt it to a simple tutorial for the manual, pls do :)
<stis>Howdy guilers!
<dthompson>ACTION hacks on a wasm vm for guile
<stis>ACTION playing einstein with a little math model for the electron
<stis>I think I have a real breakthrough how to approach that
<stis>it's an amazing paper, a real gem, and you do not need to be a phd in theoretical physics ,,,
<stis>it's all calssical
<stis> https://drive.google.com/file/d/1w8wKkE8nQ68gwXpbMd6Qz-ReKhxb3cmX/view?usp=drive_link
<stis> https://vixra.org/abs/2307.0011
<stis>One can derive planc's constant, explain a meassured mass anommally, understand what the fine structure constant is ...