libera/#commonlisp - IRC Chatlog
Search
13:21:33
gilberth
noffi uses the host C compiler only to figure out the include path. Provide it the path by other means and all it would need is the header files.
13:24:01
gilberth
I considered using libclang but what it gives you is incomplete. It is only meant for xref purposes to be used by editors and the like. It's useless. Besides: Will it still be around in 20 years? I mean how many patched GCCs are out there for dumping an AST? None survived because RMS didn't want that GCC can be helpful in making FFIs for political issues.
13:24:57
_death
I wouldn't be surprised if clang will still be around.. worse software has been around for much longer ;)
13:25:19
Shinmera
the issue with clang/llvm more is it changing to a degree where it's unrecognisable
13:25:55
gilberth
Is libclang so important to them that they would keep it stable. And again: It's not meant to give you the real AST with all the information you would need.
13:26:57
gilberth
I'm happy with doing it myself. This way I also can parse Microsoft's headers and won't need to rely on msys/mingw to have hopefully correct headers.
13:27:55
_death
Shinmera: this is true, and I don't like llvm for this and other reasons.. but once the bindings are generated there's no need for an external tool anymore
13:30:30
gilberth
Besides what is named e.g. a "REAL" might be a float here and a double there. Headers might depend on the ABI or host used. Packing might differ, aligment, etc, etc. It's best to just include the header that comes with our version of a lib you link against.
13:43:02
_death
sometimes it just makes sense to write a C module that exposes a small and stable interface.. there are many useful libraries with a large and elaborate interface, but sometimes you can work around the issue this way for your particular use case.. the big stuff usually requires a lot of lisp to create something looking sane and relatively seamless to a lisp programmer
13:45:14
gilberth
I'd rather write that part in Lisp instead of in C. Besides when I write it in C I have the issue that there is an additional library, namely those C stubs, that I must make sure my user has.
13:52:51
_death
yeah.. I used that approach with some C++ libraries though.. exposing a simple C interface
14:13:55
fe[nl]ix
Shinmera: I have an SBCL statically linked with libfixposix and openssl: https://github.com/sionescu/sbcl-goodies
14:33:22
younder
Is there any spec on what libfixposix does? All I see is fix problems moving between *NIX platforms.
17:01:53
cage
someway I was able to remove the osicat ad dependency of the project, seems to works so far 🙂
0:30:13
nij-
Question. When the compiler must evaluate a form at compile time, how does it evaluate? Must it compile the form and execute the compiled result? Or could it use an interpretter? Is this behavior specified in the standard?
0:54:06
yitzi
Please note in the definition of evaluation: "...such execution might be implemented directly in one step by an interpreter or in two steps by first compiling the form and then executing the compiled code; this choice is dependent both on context and the nature of the implementation, but in any case is not in general detectable by any program. ..."
0:56:44
pillton
From CLHS 3.1: Evaluation: "Evaluation is the process by which a program is executed in Common Lisp. The mechanism of evaluation is manifested both implicitly through the effect of the Lisp read-eval-print loop, and explicitly through the presence of the functions eval, compile, compile-file, and load. Any of these facilities might share the same execution strategy, or each might use a different one. The behavior of a conforming program
0:56:44
pillton
processed by eval and by compile-file might differ; see Section 3.2.2.3 (Semantic Constraints)."
0:57:12
pillton
Years ago you could type clhs 3.1 and a link to the standard would be posted in the channel by a bot.
1:02:53
nij-
For example, I would expect that (funcall (compile-file (lambda () FORM)) should have the same behavior of (eval FORM).
1:03:05
pillton
Of course it specifies their semantics. It has a definition of a conforming program.
1:03:48
yitzi
In general, the spec leaves ambiguity where optimization is possible by an implementation.
1:05:46
yitzi
The spec wasn't written like the w3 specs, as documentation of "existing practices," but as a comprimise by actual implementers, i.e. companies and researchers that had actual experience with the difficulties and issues associated with writing an efficient LISP implementation.
1:08:58
yitzi
The committee and the industry reps, in other words. It was very expensive to do at the time.
1:12:32
pillton
nij-: I think EVAL and COMPILE differ in their requirement to apply compiler macros so I don't think they would be the same.
1:13:45
pillton
Also, (compile nil (lambda () FORM)) is different to (compile nil '(lambda () FORM)).
1:15:10
nij-
But forming such a committee is quite expensive. There must be some main funders behind.
1:15:58
nij-
pillton The compiler macros are supposed to have the same effect of the corresponding function. So except this, the rest shoudl still be the same?
1:20:04
pillton
It depends on your definition of same. A compiler macro may cache a value in the global environment for example. The cached value may have no effect on the result of the form, but the environment is certainly impacted.