freenode/#lisp - IRC Chatlog
Search
13:15:41
pjb
nij: the closed stream still carry some information you may want to use, notably the pathname (pathname closed-stream).
13:16:19
pjb
nij: you can just use OPEN in dispatch and close the stream in the thread (but use an unwind-protect to ensure you will close it!)
13:17:04
pjb
nij: however, some impementations have protections against sharing streams in threads. notably ccl. You may want to read the implementation documentation about opeon and see if there's an option to deal with those cases (cf :sharing option in ccl OPEN).
13:18:36
pjb
nij: therefore it may be better, easier and more portable to open and close the stream in the thread that uses it.
14:22:47
jcowan
beach: You asked about how C++ compilers do multiple inheritance. The answer is in Stroustrup's book, but more accessibly at https://shaharmike.com/cpp/vtable-part2/ (which is about clang, but gcc uses the same strategy)
14:32:41
beach
What I do remember asking is whether the C++ standard requires a particular implementation. If not, they should replace their vtables and use my generic-dispatch technique instead. :)
14:36:44
pfdietz
I really liked the code snippet idea for SICL presented at ELS. This should make SLOT-VALUE as fast as struct field access in common cases.
15:13:57
jmercouris
hello everyone, Nyxt 2, pre-release 7 is now available: https://nyxt.atlas.engineer/article/release-2-pre-release-7.org
15:14:11
jmercouris
I would appreciate any feedback about bugs since this is the final release we'll do before 2.0.0
16:01:27
frgo
Hello all. I have that question again ... Yes, I know out there are thousands of Lisp interpreters written in C. But ... I am looking for recommendations from you people. I can use C or C++ - on ARM (this is going to be deployed on a XILINX ZYNG FPGA). So - anyone recommend a specific one? Big thanks!
16:13:12
jcowan
There are some choices I would have made differently, like using defparameter rather than defvar, though in the environment they are the same thing.
16:21:13
scymtym
does anybody know whether the sources of the X3J13 cleanup issues which are referenced in dpANS and included in CLHS are available anywhere and if so under which terms? the "X3J13 document archives" link on http://www.nhplace.com/kent/CL/ looks promising but seems dead
16:23:43
edgar-rft
frgo: Tom Almy's XLISP-PLUS interpreter (original author is David Betz) is a Lisp-2 written in C -> https://almy.us/xlisp.html
16:29:07
theothornhill
scymtym: I've been looking around as well, but couldn't find it either. Are you working on the dpANS now?
16:31:09
theothornhill
No, not yet. We've only been chatting about what to do with the dpANS itself. Still struggling a little with how to parse the thing "easily". Did you work on that, and if so, any progress?
16:32:32
nij
How to hack the reader or by handling error for #'read-from-string to return (1 (:unreadable "#<:abc>") (2 (:unreadable "#<:def>"))) while reading "(1 #<:abc> (2 #<:def>))" for example?
16:33:07
nij
Namely, I want to replace each unreadable block by a plist (:unreadable STR-OF-APPEARANCE").
16:33:09
phoe
http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/doc/standard/ansi/cleanup/
16:33:33
theothornhill
phoe: scymtym at least I've found a million and two ways to parse the spec into unusable html...
16:33:36
Bike
nij: that said, in general there is no way tell where to continue after a reader error
16:34:40
scymtym
phoe: possibly. i don't know about the legality of just taking it from there, though
16:39:07
theothornhill
phoe: Thats what I understand as well. And if not, a suit seems very unlikely, given that most lisp vendors probably would want this to live on
16:40:43
scymtym
phoe: looks very good. briefly comparing with CLHS, i didn't spot any differences so far
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)