libera/#commonlisp - IRC Chatlog
Search
0:05:08
mfiano
By touching the asd file, or modifying a file early in the root module's dependencies
0:05:32
sweatshirt
Hello, anyone experienced with hunchentoot for web dev? Needing help with serving an html file per url req
0:07:22
antonv
I did (asdf:clear-system :cl+ssl) and removed all compiled fasls from ~/.cache/common-lisp
1:09:31
antonv`
I wish to have full warnings and style warnings in by CI buiilds, so that I can spot such errors, or just circular dependencies, when the code invokes a function defined in a file that comes later in the build sequence.
1:16:09
JonBoone[m]
[antonv](https://matrix.to/#/@antonv:libera.chat): are you saying you’re CI won’t print the warnings?
1:20:13
Alfr
antonv`, are you loading the "correct" system, meaning does (asdf:system-sources-file :foo) show the asd file you'd expect?
1:27:24
antonv`
But if the some-unknown-function exists, but is defined below the tmp-func, the warning disappears
1:29:25
antonv`
Yes, but I thought CL has this limitation (like in Pascal or C where forward declarations are needed)
1:30:38
antonv`
Also, the example above is artificial. I actually was looking at the case when the caller function is in one file and the called function is in enother, later file
1:31:14
mfiano
That would not work without warnings during compilation on some implementations, but no problem at runtime.
1:31:49
|3b|
ACTION can't find it in the spec, but implementations can defer warnings to end of file (for cases like that where they might be later corrected), and if so, that can be extended to end of compilation unit
1:34:53
Alfr
antonv`, are you worried that it may error in some implementation? That's not the case:
1:35:08
|3b|
with-compilation just specifies the bounds of "compilation", it looks like 3.2.5 "Some warnings might be deferred until the end of compilation."
1:38:10
|3b|
any implementation can call functions that were defined after the caller was compiled though, even if they warned about it at the time
1:40:11
|3b|
compiler-macros also must be defined already to take effect, though they can be defined and used before the function with the same name is defined (though compiler can always ignore them completely too)
1:40:37
Alfr
antonv`, |3b| if in the same file, implementations actually can, 3.2.2.3: A call within a file to a named function that is defined in the same file refers to that function, unless that function has been declared notinline. The consequences are unspecified if functions are redefined individually at run time or multiply defined in the same file.
1:40:39
edwlan[m]
At least for macroexpansion, you should eval-when any functions they call while expanding so they’re visible at the right time
1:43:27
|3b|
Alfr: true, i meant you shouldn't expect (declaim inline) to work for things appearing before it, but implementations can do some inlining on their own in some cases
1:48:29
|3b|
a more likely thing to do would be using a special calling convention that calls the function directly without looking it up through the symbol
1:49:32
|3b|
or it could optimize for information it knows at a particular call site (like skipping argument checks or keyword processing in the called function), though the called function still needs a "normal" entry point for callers outside that file
1:50:44
antonv`
Such optimizations is what I am afraid to miss, when my code has functions defined later than their callers
1:52:56
antonv`
As for the 3.2.2.3 quote, it seems to speak about freedom for compiler to ignore redefinitions of a function
1:54:05
antonv`
if recursive function redefines itself while inside of the recursion, the compiler is free to use the original definition during the wole execution
1:54:17
|3b|
normally it must call through the symbol lookup to allow for redefinition, and can't assume anything about the number or types of arguments the caller will accept, or what it will return
1:55:03
|3b|
well, people who redefine functions from inside themselves deserve whatever they get anyway :p
1:55:11
antonv`
O, good idea about arguments, let me chech arg number mismatch in forward references
1:57:32
|3b|
ACTION isn't sure many implementations take much advantage of that option for file optimization by default though, since it is somewhat annoying for developers if you can only recompile whole files at a time during development
1:57:56
|3b|
(or if you need to manually C-c C-c every single form in the file instead of loading the whole thing, or declaring everything notinline)
1:58:34
|3b|
i think cmucl and maybe sbcl (probably others?) have options to do that sort of optimization if specifically requested
2:10:35
antonv`
CCL utilizes the permission to ignore new definition of a recursive function while executing
2:14:50
antonv`
Unlike CMUCL, SBCL is able to open-code forward-referenced type tests while block compiling. This helps for mutually referential defstructs in particular.
2:16:52
antonv`
Block compilation allows calls to global functions defined by defun to be compiled as local calls. The function call can be in a different top-level form than the defun, or even in a different file.
2:16:52
antonv`
In addition, block compilation allows the declaration of the entry points to the block compiled portion. An entry point is any function that may be called from outside of the block compilation. If a function is not an entry point, then it can be compiled more efficiently, since all calls are known at compile time. In particular, if a function is only called in one place, then it will be let converted. This effectively inline expands the
2:16:52
antonv`
function, but without the code duplication that results from defining the function normally and then declaring it inline.
3:48:18
contrapunctus
edwlan[m]: after _years_ of reading the name "fiddlerwoaroof", I just realized that it means 'fiddler WITHOUT ("w/o") A roof' 🤦♀️️
5:52:35
mfiano
Does anyone know how Quicklisp registers itself with ASDF? I assume ASDF has some hook that it fires when a system could not be found
5:54:09
mfiano
I invoke a simple `#!/usr/bin/env sbcl --script` script (which implies no sysinit or userinit), upon upgrading asdf, reinstalling a fresh source registry without inheritance, rebinding its cache directory, and upon a missing system condition when calling asdf:load-systemit fetches from quicklisp servers still. This is because my attempt at constructing a pristine environment requires me to
5:54:09
mfiano
unset SBCL_HOME so that my custom core image with Quicklisp is not used. But if it is, is there a way to un-register Quicklisp from ASDF's missing system hook, wherever that might be?
5:55:20
mfiano
setup.lisp was loaded into the custom core image, before any sysinit or userinit is loaded by SBCL.
5:56:10
mfiano
I am not using it for this application though, and want to use ASDF vanilla, without handling the missing system error automatically somehow
5:58:47
mfiano
Well without using Quicklisp at all, just having it loaded into the image before I upgrade ASDF to the bundled copy in the project next to my script, causes #'asdf:load-system to fetch anything missing in my custom registry from Quicklisp's servers.
6:01:25
mfiano
Nowhere in my code am I invoking any quicklisp functionality. Infact, I do #+quicklisp (delete-package :ql) before anything, and it STILL tries to get things from its servers.
6:08:12
edwlan[m]
If I reinstall quicklisp so I don't have any systems downloaded, this doesn't work: sbcl --core with-quicklisp --no-userinit --disable-debugger --eval '(asdf:load-system :data-lens)'
6:09:14
mfiano
Define doesn't work. I fear we are talking past each other, becuase that is not how I invoke it.
6:10:36
mfiano
I wouldn't expect it to. I'm not using it. ASDF must though, or Quicklisp is globally a condition type of ASDF's somehow.
6:12:31
edwlan[m]
All I did was create an sbcl core with quicklisp and then use sbcl with that core and a system I didn't have downloaded
6:25:19
mfiano
I guess also --script as a toplevel option like I'm using adds --noinform and --no-sysinit to your flags.
6:31:42
mfiano
even after upgrading asdf, clearing the registry and installing my own asdf:*central-registry* is pointing to a list with only quicklisp's path.