-
HI. Clog comes with a really nice seat of tutorials. I would like to learn how to dump an image of clog and have the image automatically run demo 1. I want to learn how an executable binary could be created and run. I have tried:
When I do this, the sbcl command prompt is utterly controlled by the demo and I cannot get another command prompt to evaluate the dump image form. Here is the output for reference:
sbcl is stuck at the part, no new command prompt ever appears so I can dump theimage.
Accoding to google, you cannot dump an image from slime, you are supposed to switch to the inferior-lisp buffer and evaluate the dump image form there to dump the image. However, here to, I have no access to a command prompt of any kind. Instead the entire buffer is completely owned by some kind of signal from sbcl or slime or whatever this might be. Here is what it looks like: ; compilation unit finished ; file: /usr/share/common-lisp/source/slime/contrib/swank-arglists.lisp ; file: /usr/share/common-lisp/source/slime/contrib/swank-arglists.lisp Does anyone know / have instructions on how to dump a clog image and have it run a specific demo / app? I am running Debian 11 + default emacs + default slime from the Debian repos. NOTE: My apologies if this post is a dupe of an earlier post about the same issue from a few minutes ago. I posted this question earlier and it either did not appear or dissapeard, so I am posting once again to see how the discussion forums on github work. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
Does "dumping an image" mean compiling? |
Beta Was this translation helpful? Give feedback.
-
Code is actually compiled as loaded in most cases to CL environments. An
image is the entire environment packaged as an executable.
Yes it can be done. I will see if can add directions or a tutorial soon.
…On Tue, Oct 19, 2021 at 10:56 AM smvamse ***@***.***> wrote:
Does "dumping an image" mean compiling?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#74 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYUEFL5IE523MF3LUWDV7TUHWBKBANCNFSM5GEGM2FQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
I haven't had time yet to produce a sample. I did take a moment to read your post more thoroughly. First to do a dump you have to do it from the command line not in emacs. Second here is an example using sbcl (defun main () (sb-ext:save-lisp-and-die "hello.exe" :toplevel #'main :executable t) |
Beta Was this translation helpful? Give feedback.
-
Okay here is the working solution for dumping a clog image to an executable for total noobs:
(sb-ext:save-lisp-and-die
:executable t)
a) You will get an executable called "clog". Just change the "clog" part above to whatever you want to name your executable b) You can run whatever demo you want with this line: (clog:run-demo 3) Just read the README here and some of the manuals to figure out how to run some of the demos and tutorials. c) Apparently, with a common lisp image, we can start up the application and then connect to it using SWANK and fiddle with the running binary. I haven't tried that yet, I guess that will be the next dumb thread that I start here. :)
If we do decide to use js / html / media resources though, it should be no problem either, you can have all of them in a folder structure and use relative paths for the binary to access. Lastly, I have to try and compile CLOG now on an arm device of some sort. SBCL already runs sooooo ... this should be fun! I just love having a web server and framework all in one binary. This is so nice. Thanks SMVAMSE, greatly appreciate that insight. Thanks to Rabbi Botton for CLOG. |
Beta Was this translation helpful? Give feedback.
-
So, I just managed to dump a clog image on one of these: https://shop.pocketchip.co/collections/frontpage/products/pocket-c-h-i-p-new Details:
However, the image was dumped successfully and does actually execute and stay running. None of the demos / tutorials run because (I think) the key issue is threading support in SBCL on the sbcl version available in the ARMHF release of Debian. So, while it doesn't actually render out pages successfully, the code compiles and an image can successfully be dumped and started up. Why? Because. :) |
Beta Was this translation helpful? Give feedback.
Okay here is the working solution for dumping a clog image to an executable for total noobs:
Start sbcl: user@computer >> sbcl
Quickload clog: (ql:quickload :clog)
Copy / paste this code to your sbcl command prompt:
(sb-ext:save-lisp-and-die
"clog"
:compression t
;; this is the main function:
:toplevel (lambda ()
;; tell clog to run one of the demos
;; you can use (clog:run-demo 1) or (clog:run-demo 2), etc.
(clog:run-demo 3)