freenode/#lisp - IRC Chatlog
Search
16:44:02
pjb
frgo: depending on the capacity of your target, you may use ecl (which uses gcc to compile to binary). An alternative for smaller targets could be clicc, which is a CL translator to C, so you get C sources that you can compile on the target. A commercial product is MoCL (which targets Android and iOS, but C code is C code, you could use with other targets, if you provide the run-time library).
16:46:02
pjb
frgo: another alternative, is to do something similar to GOAL: use Common Lisp to generate the program for your target. Basically, you define your DSL, and write a translator or a compiler for your target.
16:47:13
pjb
frgo: notably, writing a LAP assembler in lisp (ie. an assembler that takes sexps as input), lets you use then the lisp macro system to define a higher level language (you get the macro assembler for free from the assembler).
16:47:43
pjb
this can be a good solution if you need to go low-level, but you want to retain some abstraction.
16:49:50
frgo
pjb: Currently, we are exploring what we need - hence the requirement to have a REPL into a predefined set of primitives (those are generated by the platform definition file generated by XILINX Vivado when the bitstream is exported).
16:53:00
pjb
frgo: it's mostly a matter of memory. For a usable CL system, you would need at least 512 MB.
16:53:37
pjb
But you can use a CL as a development environment to generate code for very small microcontrollers.
16:56:28
pjb
ecl needs a unix system below to fork gcc, but it can also work without gcc, it has a byte compiler like clisp. You could use ecl/gcc to cross compile binaries, and use ecl without gcc on the board for the REPL and "scripting". clisp could be an alternative. But in anycase, you'd need to port the implementation to the target.
16:57:17
edgar-rft
frgo: If I remember right then gilberth had a stripped-down XLISP interpreter suitable for running on microcontrollers, I don't see him here in the #lisp user list, but he's in #lispcafe
16:57:39
pjb
frgo: Marc Battyani at fractal concept uses CL to program FGPAs: http://www.fractalconcept.com/asp/JhHu/sdataQ0rXCq7mNwE1DM==/sdataQuEY-NQ=
17:27:37
nij
How do I ":use" an un-exported symbol from #:cl in a package? (defpackage nij.service (:use :cl) (:import-from :cl :print-backtrace)) ;; <= this doesn't work
17:35:08
jmercouris
there are many differences, for your purposes as a beginner, there is no difference
17:35:43
jmercouris
trust me when I say, for you to be asking such a question, it is not yet relevant
17:35:51
nabataeus
I don't think I'm really a beginner but I've trying to get the hang of it, I think I do understand the basic concepts of sexp and macros and such
17:36:39
jmercouris
CCL just comes with a great FFI framework that allows you to interface with Cocoa/Objective-C
17:44:47
pjb
(defpackage "FOO" (:use) (:intern "PRINT-BACKTRACE")) (defpackage "NIJ.SERVICE" (:use "COMMON-LISP") (:import-from "FOO" "PRINT-BACKTRACE")) (eq 'nij.service::print-backtrace 'foo::print-backtrace) #| --> t |#
17:45:47
pjb
nij: and uiop/image:print-backtrace is exported from "UIOP": (eq 'uiop:print-backtrace 'uiop/image:print-backtrace) #| --> t |#
18:23:07
Duuqnd
Well, after more work than I expected I can now plot pixels in Genera at what I think might be a reasonable speed but it also might not be.
18:48:58
pjb
Of course, now CL uses "place" to name what (car x) denotes in setf. It's not really a form, since it's not evaluated.
21:02:20
andreyorst`
can someone explain me the main difference between restart-case and restart-bind, besides that restart-bind is uded to implement the restart-case?
21:02:58
andreyorst`
Like I understand the difference between handler-bind and handler-case, but I can't gasp this for restart-case/bind
21:07:33
Bike
it's kind of the same thing. When a restart-bind restart returns nothing special happens, so invoke-restart returns, presumably into the condition handler it was called from.
21:07:48
Bike
whereas when a restart-case restart returns, control is transferred to the point of the restart-case.
21:10:28
andreyorst`
I'm implementing condition system for Lua, and I've already did restart-case, so now I'm unsure if I really need to add restart-bind as well, given that docs advice to use restart-case in almost every situation
21:11:34
Bike
i don't think i've ever seen restart-bind used in application code, but on the other hand i don't see any reason not to since you pretty much need it to implement restart-case anyway.
21:12:29
Bike
sure, and how'd you do it? if it's anything like how it's done in lisp, some kind of dynamic binding of restart functions
21:13:43
andreyorst`
yeah, I'm constructing fake dynamic scope at runtime with Lua tables, and do some trickery to turn errors into conditions that bubble up this fake dynamic scope stack
21:14:09
Bike
restart-bind is really very primitive. It pretty much just dynamically binds functions, like how flet lexically binds them.
21:15:58
andreyorst`
I have implemented restart-case, handler-bind, handler-case, ignore-errors, and unwind-protect
21:16:29
andreyorst`
and tried porting some examples from Common Lisp, it works exactly the same at the moment
21:18:12
andreyorst`
I've meant that when handler in handler-bind calls the invoke-restart I know where to transfer the control
21:19:07
andreyorst`
the trickiest part to implement was when handler inside handler bind itself signals the condition, I spent three days debugging C stack overflows :D
21:22:25
andreyorst`
Bike: thanks for explanations of restart-bind. I think I will leave it out for now
22:35:24
jackdaniel
jcowan: afair it was deliberely released to public domain by authors before ansi standard was accepted
22:36:01
jackdaniel
I think that this is described in detail on one of Kent Pitman website pages (don't remember which)
22:36:05
jcowan
Excellent. The Interlisp group wants to reformat it in Interlisp style now that Interlisp is moving toward ANS CL support.
22:40:02
jcowan
I know that Xach has it online in the original TeX at Github, and the same content is online as HTML at https://mr.gy/ansi-common-lisp
22:41:16
jackdaniel
you may also look for the cleaned up tex source - afair the repository is called clstandard-build on gitlab
22:41:40
jackdaniel
that said you my find it by accessing cvberry.com on internet archive (for some reason domain expired and the site is not up anymore)