IRC channel logs
2025-07-28.log
back to list of logs
<rtmanne>I'm thinking about possibly using guile as an extension language for a program I'm pondering on making. Had a few questions about this. Compared to lua, how much smaller (or larger) is guile? <rlb>rtmanne: don't know about lua, but I think debian amd64 guile-3.0 (for example) may be about 50-60mb, at least looking at the dpkg --status installed-sizes. <rtmanne>I wasn't talking about the executable size. The size of (or perhaps maybe instead the complexity) of guile as in the language itself. <rlb>Of course that doesn't include non-guile dependencies, but there aren't very many of those. <rlb>That's what I meant. <rlb>An "executable" would be likely to be much smaller, since it would "just" be the scheme files. <rtmanne>I gotta say, I'm impressed on how simplistic the C API is. It's dead simple. <rlb>as with python/perl/ruby/etc. you'd generally amortize the size for the platform itself across many applications. <rlb>(That's historically been a focus -- i.e. the C api, and fairly tight integration when wanted.) <daviid>rtmanne: "... a program I'm pondering on making ..." - why not in scheme directly? <rlb>(On the lua side, there's also fennel fwiw, if you'd prefer a lisp either way, though I haven't used it much myself yet.) <rtmanne>daviid, it would have been a video game. And wanted to do the very heavy number crunching in C directly. Unless guile has reliable bindings, I rather just right now do it in C. <daviid>rtmanne: you might consider writing it in guile scheme, and use the ffi for the heavy crunching - fwiw, it is what i do in guile-cv <rtmanne>I've heard of chicken scheme. But I wasn't sure if the bindings were up to date or not. <rtmanne>Okay, you got my attention daviid. Thank you. :) <dodoyada>is there any extra performance cost for using `() over '()? <mwette>try: scheme@(guile-user)> ,optimize `() <mwette>I think as long as you don't use unquote the optmizer will generate a literal (unmutable) list. <ieure>dodoyada, Are you asking for `() / '() specifically, or for all quasi/quoted lists? If the latter, quasiquoting can be slower depending on what's inside the list, ex. `(hi ,(begin (sleep 1) 'hello)) is going to take 1s to evaluate. <dodoyada>`('a 'b "c") vs '(a b "c"), don't mind compile time but want the same run time <dodoyada>optimize looks like it's '('a 'b "c") vs '(a b "c"), not sure if it has to do any extra invocation there or not <humm>they’re different values <humm>Sure you don’t mean , somewhere? <Arsen>`(,'a ,'b "c")? but that's redundant <dodoyada>I know it'll be different if it has to eval something, I'm wondering about the case where quasi evals to the same as a quoted list <ieure>dodoyada, It's convention to use quasi/quote to communicate intent, I think it'd be surprising to find quasiquoted forms without any unquoting inside them. <dodoyada>oh no, I am an idiomatic zealot so I'll have to go back to using both <humm>dodoyada: so you mean `(a b "c") and '(a b "c"), not `('a 'b "c") <mwette>What ieure said. I make occasional exceptions in pattern->expression places where there are 99 `(foo ,bar) repressions and one lone `(baz) expression. <dodoyada>humm yeah, I was saying optimize makes `(a b "c") into '('a 'b "c") and I don't know if that's meaningfully, performantly different from '(a b "c") <ieure>What are you doing that you need microoptimizations like this? <ieure>If there is a performance difference, it's going to be negligable unless you're allocating vast numbers of sexps. <dodoyada>I don't NEED microoptimizations but I write a lot of sxml->html that uses both and like to simplify if it doesn't come at a cost