freenode/#lisp - IRC Chatlog
Search
11:44:18
heisig
One can even slow down existing implementations by orders of magnitude, just by adding a single innocent method at the wrong place :)
12:01:45
francogrex
Hi I want to compile a C code (or assembly code) but don't want to install gcc or any other C compiler. is there a lib in CL that lets me compile to an object file? it's won't be lisp code it's C or simply just machine code? does cffi allow?
12:06:12
no-defun-allowed
(defun compile-c-program (input-source output-object) (with-open-file (input input-source) (with-open-file (output output-object) (loop for line = (read-line input nil nil) until (null line) do (write-line line output)))))
12:08:20
beach
francogrex: I have thought for a very long time that C compilers should be written in Common Lisp, as opposed to in C or C++. But I don't think anyone has done it yet.
12:10:52
francogrex
no-defun-allowed: Vacietis yes that seems ok though limited but appears to be in the spirit
12:11:13
beach
By the way, didn't GCC end up using the Boehm-Weiser GC after many years of attempting to avoid automatic memory management?
12:13:45
no-defun-allowed
https://gcc.gnu.org/onlinedocs/gccint/Type-Information.html says there is a garbage collector, but I don't know if it's conservative if it needs a preprocessor to emit some kind of tracing information.
12:16:39
francogrex
yes indeed vacitis is a good proof of concept but very poor to produce anything of use
12:23:00
francogrex
but how about sbcl or any lisp used just as an assembler? from handwritten asm code to object code... that in theory should be easy maybe exists already?
12:24:53
beach
You can probably grab the assembler from any of the major Common Lisp implementations, like SBCL, or CCL, and probably also Mezzano.
12:27:21
heisig
I know of programmers that wrap handcrafted assembler snippets in SBCL VOPs for the very performance critical parts of their code.
12:31:29
flip214
francogrex: https://pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/
12:32:00
francogrex
heisig: hmm yes i know vops and i know how to use them, but not interested in that. I would like to output an .o object file. vop doesn't do that not made for it
12:39:33
francogrex
I have a feeling CFFI might be able to do that i mean if one has the opcodes how dfficult would it be to compile them to an object file?
12:43:37
heisig
Yes, one could do that, too. But in 90% of the cases you can get the very same assembler code just by compiling Lisp with the right declarations.
12:44:27
heisig
And I'm trying to boost that to 95% of the cases by writing a proper SIMD interface for SBCL.
12:55:45
beach
francogrex: The hard part, at least for x86 is to select a machine instruction, given a source instruction, and also generating the bytes for that selected machine instruction.
13:33:58
nwoob
If someone makes an api that gives dynami response in structure and to parse that structure can metaprogramming be helpful?
13:42:38
nwoob
what if there is a project that build websites from a documentation that user can edit? Given that we have templates of design... The documentation data will be parsed and will become response of API or APIs
14:17:49
splittist
Forget the x86, the new hotness to target is PowerPoint https://www.youtube.com/watch?v=LArkm4v5mWA
16:23:39
jcowan
edgar-rft: There were those crank-powered laptops: that's "power" to a physicist, but not the rest of us.
16:34:31
jcowan
apparently the hand crank on the XO laptop was basically vaporware: actually shipped XOs used ordinary power adapters.