freenode/#lisp - IRC Chatlog
Search
13:06:43
shrdlu68
https://imgur.com/a/hy7tRe4, screenshot from https://youtu.be/Z4oYSByyRak?t=11m40s
13:07:38
shrdlu68
His assertion is that it is not possible to handle heap exhaustion in Lisp, among other languages he mentions, and thus "it is impossible to write perfect software in these languages">
13:08:07
jmercouris
what does it mean to write "perfect software"? of course it is possible to prove lisp programs
13:09:07
jackdaniel
perfect software is the software which meets criteria subjectively chosen by the person who presents the topic ;)
13:09:34
jackdaniel
shrdlu68: in principle yes, implementation may raise a condition (and they often do)
13:13:05
jmercouris
better usage of your time might be reading about how to prove programs, and the set of languages that exist for proving programs/algorithms
13:13:17
jmercouris
of course, they have not lived up to the hype, but they are still interesting ideas
13:13:32
shrdlu68
His argument is, that function will always return the correct output for the correct input - there won't be malloc errors, etc.
13:14:06
jmercouris
just because a program has state or memory does not mean that it cannot be proven
13:15:18
jackdaniel
that reminds me a discussion whenever CL allows arbitrary big integers or the physical computer limitation counts here and CL can't have arbitrary big integers
13:16:29
shrdlu68
If one attempted to add two large bignums on a system that's running out of memory, what exception would a lisp implementation raise?
13:16:52
_death
it's like saying 1+1=2 is false because some gamma ray flipped a bit.. different levels of reality
13:18:15
jackdaniel
which is a condition inheriting from storage-condition, which inherits from serious-condition
13:20:56
jackdaniel
jmercouris: you may say whatever you want – that doesn't mean people will understand you
13:22:48
jmercouris
jackdaniel: I am asking, IF we can agree that this condition is not defined in the CLHS and it results in undefined behavior, based on that youtuber's definition, can we say that CL is "non-perfect"?
13:28:26
jmercouris
jackdaniel: yeah, the perfection crtieria is that one guy's perfection criteria, not myo wn
13:29:15
jmercouris
I think my sentence is pretty clear, though I also understand the point your making, "what is perfection"
13:29:53
shka
is it correct? http://www.crategus.com/books/closer-mop/pages/sb-mop_fun_slot-definition-type.html
13:29:54
jackdaniel
if it is: doesn't have threads in the specification, CL is not perfect. if it is: doesn't have defined behavior for memory exhaustion in the spec, CL is not perfect. ;) fwiw he was talking about a perfect software, not a perfect language (judging from the screenshot)
13:31:19
jackdaniel
copy-paste from http://metamodular.com/CLOS-MOP/slot-definition-allocation.html ?
13:34:00
p_l
until it's pulled from under you externally, like typical case for C program on Linux, or the essentially equivalent case of people disabling GC on early LispMs
13:34:55
jackdaniel
p_l: I don't know about other implementations, but ECL has preallocated memory for reporting memory conditions
13:35:46
p_l
jackdaniel: well, it's *ECL*, not "le random C/C++ crap written on and tested on only on Linux" ;)
14:37:32
vindarel
Hello (common) lispers, little question on capturing standard output. I know with-output-to-string, but this doesn't suit my need because I'd like to return the string immediately, to not break the printing of the application. I'd like something like a defadvice, but this doesn't exist in SBCL. Do you think of something ? thx
14:38:40
Bike
do you mean that you want to print to standard output but also capture it in a string?
14:40:04
vindarel
Actually I don't care to capture to a string, I'd like to change it before it is printed (to highlight stuff).
14:42:50
vindarel
A reader macro ? I'd like to change output from third party code, that won't use the reader macro.
14:44:35
dlowe
You could set *standard-output* to an echo-stream, then use a thread for reading from that echo-stream and writing your changed version to standard output.
14:44:48
vindarel
Well ok thanks, this is what I needed to know. I'll re-think my programmatic interface then.
14:45:02
dlowe
You could also use the gray streams extension, which would allow you to make a different kind of stream
14:47:13
dlowe
Typically, though, you want to keep your data as structured as you can until just before you display it, to avoid munging text like this.
14:48:01
vindarel
looking at gray-streams can be a good exercise. Still, I imagine it'd have been easy with a defadvice… maybe.
14:49:36
dlowe
You will find that Younder actually has not written any lisp at all and is a poor source of information.
14:52:19
Younder
oh, I see. I should have read the context better. I have however worked with read macro's.
16:18:26
jackdaniel
you need to keep things straight – if you want to call C (or C++) from CL, then you use FFI (scenario when your application is written in CL and you want to use C library)
16:19:29
jackdaniel
if you want to call Common Lisp (and use it) from C application, you probably need ECL (or MKCL)
16:20:10
jackdaniel
Fare: well, usually when I see someone forking software something tells me, that there ought be a reason
16:21:02
Fare
I believe Jean-Claude had ideas on how to handle interrupts and other low-level details in C++
16:21:43
jackdaniel
from my reading of the old mailing lists it is not the case, but I was not around to argue about that
16:23:46
jackdaniel
black_13: either way, if you want to call C/C++ from Common Lisp – use FFI, if you want to call Common Lisp from C/C++ use one of the mentioned implementations. If you simply want to write application, you may use Common Lisp all the way down
16:24:05
Fare
As far as porting ASDF goes, it looks like MKCL fixed some of the bundle issues that I had with ECL (I believe that ECL fixed them since, but I've lost track.)
16:36:04
jmercouris
quick update, my issues were most definitely related to the version of asdf that I had
20:18:18
White_Flame
to add to the discussion around https://imgur.com/a/ws1VDeU , his own thesis completely fails, because calling that function might cause a stack overflow in trying to push the return address & parameter. It's still a "hidden allocation"
20:29:39
pjb
White_Flame: indeed. The C standard defines a not-turing complete programming language, since it's not guaranteed that you can call functions.
20:30:43
jackdaniel
loosely related: http://www.yodaiken.com/2018/05/20/depressing-and-faintly-terrifying-days-for-the-c-standard/
20:34:27
pjb
There is newbie lisp code around, but there's also a lot of good CL code, and even very nice CL code.
20:34:41
p_l
recent brouhahaha with Mono developers finding out that XLc maps page 0 as read-only page full of zeroes is a nice example
20:35:12
White_Flame
wow, this guy just basically reinvented java-style explicitly required exception handlers
20:42:18
rpg
Is there some way to use conditional compilation (#+) to include code that is dependent on SBCL version?
20:47:04
TMA
rpg: #+sbcl (pushnew (intern (lisp-implementation-version) :keyword) *features*) and then you can #+(and sbcl 1.3.18) for example
20:48:06
aeth
p_l: Well... there's always (declare (optimize (speed 3) (safety 0))) for when you want to pursue a level of brokenness due to hacks done in the name of speed.
20:48:28
rpg
TMA: that *almost* works, but I need a comparison ("older than 1.4.7," for example). I can do this with version< but am running into nightmarish issues with when exactly bits of ASDF are read....
20:48:56
p_l
aeth: and any safe subset of C is pretty much a forked language, like the language used to write Linux kernel is a fork of C (it's neither standard nor GNU C)
20:51:21
p_l
(optimize (speed 3) (safety 0)), even when it let me overwrite function object metadata by mistaken SETF, I think still gives safer code than C does under normal rules
20:57:21
rpg
TMA: the problem for me is that all of ASDF is read so I need to get something into the *features* at the start, before anything additional is read....
21:02:49
TMA
rpg: older than can be expressed by listing all previous version numbers in an #+(and sbcl (or 1.0.0 1.0.1 ...)) ... it gets unwieldy rather quickly, but it can be done in principle
21:04:48
rpg
This really doesn't seem like a big ask. Don't people have code that uses SBCL APIs that have changed? I'm boggled that this isn't supported.
21:06:45
TMA
rpg: you can intern not just 1.2.3 but 1.2 and 1 too ... that would cut the list down considerably
21:08:55
rpg
Bike: My problem is that the COMPILER-ERROR-CONTEXT structure has changed in 1.4.7, which is causing extreme pain in ASDF's deferred warnings code.
21:13:24
TMA
#+(and sbcl (or sbcl-0 sbcl-1.0 sbcl-1.1 sbcl-1.2 sbcl-1.3 sbcl-1.4.0 sbcl-1.4.1 sbcl-1.4.2 sbcl-1.4.3 sbcl-1.4.4 sbcl-1.4.5 sbcl-1.4.6)) old code
21:17:24
TMA
rpg: the alternative: (eval-when (:compile-toplevel :load :execute) (when (version< (lisp-implementation-version) "1.4.7") (pushnew :sbcl-old-compiler-error-context *features*)))
21:18:19
rpg
TMA: That would work if I wasn't fixing ASDF -- until ASDF is successfully loaded, VERSION< isn't available. And... VERSION< has a big dependency tail throughout ASDF. So there's a chicken-and-egg problem there.
21:19:40
TMA
maybe you will need to implement trivial-version< for this in the very same eval-when, then
21:20:19
nirved
rpg: an easier check would be (cl:find-symbol "COMPILER-ERROR-CONTEXT-ORIGINAL-FORM" "SB-C")
21:20:28
rpg
TMA: I tried copying hunks of ASDF and UIOP into LABELS for that, but the hunks got very big, very fast (parsing the version string, splitting the version string, lexicographic sort...)
21:25:58
pjb
I use: #+(COM.INFORMATIMAGO.SBCL.VERSION:RT-VERSION< "1.5" (cl:lisp-implementation-version))
21:26:50
rpg
pjb: Right, but that relies on loading ASDF to load COM.INFORMATIONIMAGO which.... I can't do because I'm compiling ASDF!
21:29:25
rpg
ACTION appreciates the irony: stassats broke the legacy ASDF on SBCL, and it's stassats who refuses to update the ASDF version in SBCL.
21:52:16
rpg
I wish I knew if anyone *used* the deferred warnings in ASDF... It seems to be disabled by default. Maybe maintaining it is just a waste of my time...
21:58:06
rpg
It slurps up warnings -- especially undefined function warnings -- over the course of an ASDF operation, and then squelches ones that aren't relevant. I suspect that this was introduced in the hopes of later parallelizing compilations and dispensing with the outer WITH-COMPILATION-UNIT.
22:04:47
rpg
aeth: gotta go, sorry -- leave me a note (or post to asdf-devel) if you have more questions!
22:43:15
aeth
The future of programming is source code that compiles one of two things depending on whether or not the human at the computer managed to win a game of chess at compile time.
22:43:41
jmercouris
(defun make-thread (bt:make-thread (lambda () (make-thread)))) (eval-when (:compile-toplevel) (make-thread)) ; do you want to play a game?