IRC channel logs
2024-11-04.log
back to list of logs
<ArneBab>Is there a way how we could see for a given procedure (or more general: for a specific place in the code) which type the Guile compiler calculated there? Something like the reverse of the compilation: from tree-il or cps soup to this variable I see at this place? <ArneBab>It would be cool if we could do actual gradual typing by adding a guard (when (wrong-type? foo) (error "wrong!"))) and then seeing how the calculated types change. <old>ArneBab: something like `typeof' in C? But more general <ArneBab>and in a way that allows integration in Emacs <old>it would be nice to have gradual typing in general and to see the type of a variable when the cursor is over it for example <ArneBab>In the compiler we actually have gradual typing, afaik — that’s how dthompson gets such awesome performance. But we can’t access it from the Editor. <old>yes and it is not explicit enough imo <old>I know the trick of putting a predicate and throwing an error if not matching. But what would be nice is explicit annotation of type on parameters/variables <old>just like GOOPS for example <old>it has the effect of self-documenting the API at the same time and hiding away the predicate check which is cumbersome. Furthermore, the predicate only work across module if the function is inlinable AFAIK. With explicit types paramaters, the call-sites could be checked for type as well across module boundaries <old>it is still type check at runtime <ArneBab>I think this mixes up two uses for types: performance and static declaration. What the compiler does is typing for performance. <ArneBab>It is type check at runtime, yes, but those type checks transform into optimizations in compiled code. <old>in the code itself. but when calling from another module you don't have that performance. For example with floats, you get boxed float I think <ArneBab>I’d think you do, if the procedure in your module does the check. <ArneBab>⇒ you’ll want an interface in the module that does the type checks. <ArneBab>Then when you use something like define-typed you could also provide static declaration for documentation, because the procedure generated then has the promerty 'argument-types with the predicate procedures of the types. <ArneBab>But I’ve been struggling to find a good level of typing. When complex types are provided, people tend to build type pyramids that require lots of changes when requirements change. <lispmacs[work]>hi, I am trying to troubleshoot a guix bug, since nobody more qualified has time to look into it. I wondering if maybe some code in the .scm file did not make it into the corresponding .go file, do to an eval-when form. Is there a quick way to figure out what is defined in a .go file? <lispmacs[work]>I trying to figure out this bug in emacs-guix which, after a half-dozen function calls, ends up using code in guix/scripts/deploy, which uses g-expresses. The first g-expression chokes as though gexp reader syntax is not defined (#~, etc.) <lispmacs[work]>The actual calls to read-hash-extend are in guix/gexp, which in turn are embedded in an eval-when block