freenode/#lisp - IRC Chatlog
Search
14:32:23
pjb
paule32: (there's not a lot of syntax in lisp, but there's still some syntax, and syntax matters!)
14:33:19
paule32
end of file on #<SB-INT:FORM-TRACKING-STREAM for "file /home/jens/Projekte/ai/test/kallup.lisp" {1004A40C53}>
14:33:19
Bike
maybe paule32 can find a nice community somewhere that uses a language they can understand and react to, rather than hanging out here for a year and still not knowing what an error is
14:34:47
pjb
paule32: could read clhs make-hash-table and notice that it's possible to use another test… But this may be over his IQ level.
14:36:02
whoman
sigh. humans can live in any conditions as long as we get used to it. Bike is very right we should be mindful. it doesnt pay anyone else to be strong, so we dont need to prove we can deal with things that arent even necessary. i do that often, i am very stubborn and lone wolf style. =P
14:39:04
whoman
oh i only feel smart when i am programming actually.. the rest of life is mostly thumbs down.
14:40:31
Bike
it's not about intelligence, it's about communication. specifically, none of us are able to communicate with paule32.
14:41:47
jackdaniel
that's not it. we understand him, he just doesn't understand us (nor listens to advices)
14:43:23
pjb
paule32: good. What about this error message: (print (gethash "you" *word-table")) #| ERROR: Unexpected end of file on #<string-input-stream :closed #x302003D7ECED> |#
14:44:05
pjb
paule32: or what about: *** - READ: input stream #<INPUT CONCATENATED-STREAM> ends within a string ?
14:44:30
pjb
paule32: the point here is that different implementations have different error messages, and some may be friendlier and more understandable than others.
14:44:58
pjb
paule32: what about: *** - READ: Eingabestream #<INPUT CONCATENATED-STREAM> endet innerhalb eines Strings.
14:45:00
ecraven
why is most of the code for the MIT CADR uppercased? wouldn't it have been easier to read if converted to lowercase?
14:45:32
pjb
paule32: what about: *** - READ: Eingabestream #<INPUT CONCATENATED-STREAM> endet innerhalb eines Strings.
14:46:51
paule32
the problem is, sometimes, i spent my time under terminal consoles text based, and sometimes under gui - where you can get eye cancer
14:46:56
pjb
paule32: but since this is something I told you to do last year, we don't have any hope.
14:48:24
whoman
tie yourself in a bag and roll off the docks -- like houdini, life is at stake -- you will find the way if the pressure is high enough. otherwise why get in the bag ?
14:49:42
ecraven
pjb: but all the docstrings are properly cased, so it can't be for printing. did the MIT CADR actually use a card reader?
14:51:14
warweasle
I'm sure someone else has mentioned it, but hackaday had a lisp article: https://hackaday.com/2017/12/02/lisp-in-200-lines/
14:51:56
ecraven
it might just be tradition, no deeper reason :-/ I find it harder to read than mixed or lower-case
14:52:05
pjb
ecraven: I would say it depend on the terminals they hard. Not all the early terminals (the first virtual teletypes) had lowercase, since teletypes had only uppercase.
14:52:35
pjb
ecraven: happily, you can use my downcase-lisp and downcase-lisp-region emacs commands.
14:52:40
ecraven
well, the actual *interface* (at least judging from running it with the usim simulator) supported lower-case characters alright
14:55:39
ecraven
yea, but the user interface of the CADR definitely supported lower case, so I'm just wondering why it's only used in the docstrings, not in the actual source code
14:57:43
pjb
Well, I would say that, plus we used to love uppercase. It gave a very computery style!
14:58:20
pjb
It's only those millenium youngster babygirls who can't stand uppercase, and who believe they're yelled at, which is not the case at all.
14:59:52
ecraven
hehe, I have fond memories of the C64, I don't remember there being a lower-case in the BASIC interpreter there either
16:06:13
pjb
With their dumb names, imagine the confusion when Apple will release an iRetina computer…
16:09:11
borodust
XachX: i'm starting to think that coudl be the source of the issue (so far that's the only difference between machines that has the bug and the ones that doesn't)
21:18:43
drmeister
How do people use (defsystem ... :build-operation asdf:monolithic-compile-bundle-op ...)?
21:19:31
drmeister
I'd like to use it like a regular asdf system where if the monolithic bundle doesn't exist - then it's built and if it does exist - then it is loaded - is that possible>
21:20:09
Xach
drmeister: the folks i know who use monolithic-bundle-op use it as an op at runtime, not in the definition
21:21:19
drmeister
How do they work with the product? Do they set :build-pathname to where they want it installed?
21:22:05
Xach
drmeister: no, the monolithic-bundle-op produces a number of monofasls, and a later script is called that loads all those monofasls and saves an image, iirc.
21:22:20
Xach
the script is a simple loader, does not involve asdf, hardcodes paths to the monofasl output
21:22:41
Xach
then the deliverable is a binary thing that is a saved image built from that script, iirc
21:23:27
drmeister
I think it works a little differently in ECL and Clasp - because they can't save an image. My recollection (a few weeks ago I implemented this) was that it generates a lot of object files and links them into a single library.
21:25:01
drmeister
Ok, so I see that I'm in new territory with a new implementation of an uncommonly used feature.
21:26:04
jackdaniel
in ecl monolithic-bundle-op produces either executable or a shared object (disguised as fasb which may be loaded) which are constructed indeed from many *.o files
21:26:35
jackdaniel
which are results of calling (compile-file "foo.lisp" :system t) ; (or something very similar) by a higher level interface
21:27:03
Shinmera
drmeister: I use monolithic-concatenate-source-op to create a single lisp file of some systems that can just be loaded standalone.
21:27:23
drmeister
jackdaniel: Do you use monolithic-bundle-op - if so - how do you direct where the output goes?
21:27:59
drmeister
I want to bundle up a bunch of ASDF systems into a single library and load that when Clasp starts up to minimize startup time.
21:28:59
drmeister
jackdaniel: I've probably asked this a dozen times - ECL cannot create images - correct?
21:29:31
drmeister
We are having some trouble optimizing things because of how Clasp starts up and builds itself - I've always thought that ECL had the same issues.
21:29:40
jackdaniel
it can't *but* it's not impossible. GCL has save-lisp-and-die function and it has common roots as ECL
21:30:07
jackdaniel
afair it uses same function which was removed from glibc a while ago (which was used also by emacs), but I'm not sure about that
21:31:16
jackdaniel
(internally of course, don't force people to use dlopen - (load "foo.fasb") should do)
21:31:30
drmeister
What about starting up an ECL system? Clasp evaluates every top level form in order of how they were COMPILE-FILE'd - does ECL do that?
21:32:26
jackdaniel
in ECL you have libecl.so (which is *the* implementation) and ecl binary, which opens it. additionally in /usr/lib/ecl-xx/ you have fas files, which may be loaded (or required), which are also libraries
21:33:38
jackdaniel
that is a very fine quality imo, that you can compile arbitrary system into a shared library (which could be used from other languages)
21:33:49
drmeister
Right - there is no compilation in Clasp except for fastgf has forced it on us until I can figure out how to get around it.
21:34:45
drmeister
I'll say that a bit more clearly: there is no compilation at startup in Clasp either, except for fastgf.
21:35:47
drmeister
But for instance. Every DEFUN that is compile-file'd leaves code in the fasl so that at startup the DEFUN code is evaluated to bind the each function to its symbol.
21:35:58
jackdaniel
ECL doesn't evaluate top-level forms at startup, it has vv internal structure which may be used to populate side effects though
21:36:33
jackdaniel
I'm not able to describe details, it's complex and I don't understand it very well
21:38:02
drmeister
What does a fasl file do at load time then? Does it somehow bind the final symbol value slots and function slots, classes and other system configuration info?
21:39:46
jackdaniel
drmeister: I don't remember. I have debugged this code and fixed some issues, but there are too many details to remember
21:41:10
jackdaniel
any good recipes how to throw away being shy and record McCLIM video at instant? :)
21:42:40
drmeister
jackdaniel: Is there a way to get quicklisp in ECL to save the intermediate C files when it builds systems?
21:43:54
jackdaniel
yes, you have to (ext:install-c-compiler) and set c::*delete-files* (name may be a little different) to nil
23:11:44
phoe
There was a somewhat recent blogpost on SBCL's type inference and such, I remember an example about integers. Does anyone have a link anywhere handy?
23:12:23
larsen
I'm facing a problems using a couple of packages because package A's nickname clashes with the name of package B. what's the practice in such cases?
23:14:55
larsen
(in general, I'm puzzled because IMHO defining a nickname should be a choice of the user, not of the author of the package)
23:16:10
phoe
you could nonetheless file an issue on https://github.com/borodust/cl-flow/blob/master/packages.lisp#L5
23:17:31
phoe
larsen: the general way is RENAME-PACKAGE to remove the conflict manually, but that's a destructive operation.
23:18:58
larsen
ok. I found rename-package but it was not clear to me *when* I was supposed to call it, because so far I only have a set of dependencies in the .asd file for my system
0:00:24
jasom
I haven't found an implementation that *doesn't* like it, and it seems correct with my first reading of the spec
0:01:31
phoe
I think it's valid, AFAIK the variables are first collected and bound, and only then computation progresses
0:01:33
Bike
"The var argument is bound as if by the construct with to a zero of the appropriate type."
1:11:30
aeth
There's https://github.com/sharplispers/clx/blob/master/extensions/gl.lisp and there's https://github.com/3b/cl-opengl/
1:15:05
aeth
Is there anything that stops a CL X client from using cl-opengl? It looks like there's something called DRI that bypasses the X server. https://en.wikipedia.org/wiki/Direct_Rendering_Infrastructure
1:16:07
aeth
Unless I'm mistaken, it looks like it might be possible to write a pure CL 3D application for Linux except for OpenGL (and sound?) by writing an X client.
1:18:08
aeth
The Windows backend would still have to use more foreign code, either directly or through something like cl-sdl2.
1:30:48
aeth
I'm starting to think that the only way I can get the level of control I want for my game engine is to either write my own X client or write my own wrapper to xlib and then keep the cl-sdl2 backend for Windows until I eventually replace it with something built on the Windows API directly.
1:39:32
pfdietz_
Time prints to a stream, so with-output-to-string lets you bind the appropriate stream variable to a string-stream, then return the string.
1:39:37
aeth
(with-output-to-string (string-stream) (let ((*trace-output* string-stream)) (time (+ 1 2))))
1:40:01
emaczen
aeth: I was looking for *trace-output* -- I literally tried all streams except that one!
1:40:21
aeth
The hyperspec says trace output. http://www.lispworks.com/documentation/HyperSpec/Body/m_time.htm
1:44:58
aeth
Generally, for timing you want this (* (/ internal-time-units-per-second) (get-internal-real-time)) unless its precision is too low (then you might need a foreign library? strange how its precision in SBCL is lower than SBCL's time precision)
1:46:33
aeth
Except you probably don't want rational, so you probably want to define a constant that's e.g. (coerce (/ internal-time-units per-second) 'double-float) because otherwise SBCL will complain (at max optimization level) that it can't really optimize it.
1:47:45
aeth
double-float will almost certainly cons under normal circumstances, which could affect your timing. One way to avoid this that might work on some implementations (it works in SBCL) is to work with double-floats stored to arrays of :element-type double-float.
1:49:26
aeth
e.g. (defconstant +seconds-per-time-unit+ (coerce (/ internal-time-units-per-second) 'double-float)) (declaim (inline %current-second)) (defun %current-second () "Converts internal CL time to a double-float second." (* (get-internal-real-time) +seconds-per-time-unit+))
1:50:03
aeth
You'll want to inline that function because (1) it's trivial arithmetic that should never change and (2) otherwise you'll allocate a double-float when you can avoid that by setting to double-float arrays
1:52:37
aeth
#'%current-second will appear to cons if you disassemble it, but if you use it in a setf to an array of :element-type 'double-float it should potentially be non-consing, depending on if the implementation is that advanced. SBCL handles it afaik.
1:54:12
aeth
You can define a struct that's really just a vector if you want to have a higher level interface above the array, e.g. (defstruct (times (:type (vector double-float)) (:conc-name nil)) (current-time 0d0 :type double-float) ...) and make sure to always setf values of that struct with no non-constant intermediate doubles.
2:03:48
aeth
This portable code should be non-consing in SBCL for a time struct of 3 values: (defun time-diff (times) (declare ((simple-array double-float (3)) times) (optimize (speed 3))) (setf (new-time times) (%current-second) (time-diff times) (- (new-time times) (current-time times)) (current-time times) (new-time times)) times)
2:10:58
aeth
single-floats should be non-consing in most if not all 64 bit implementations, but it afaik depends on the time interval you're working with. If you do a short non-consing workaround and then coerce the end result to 'single-float, if you're careful, you shouldn't cons anywhere along the line
2:14:54
aeth
The custom function should be update-time-diff and then you can add one more function to get the single-float value, which won't cons: (defun time-diff-to-single (times) (declare ((simple-array double-float (3)) times) (optimize (speed 3))) (coerce (time-diff times) 'single-float))
2:17:29
aeth
I use something very similar and I just tested these in the REPL and they should be non-consing in SBCL. (Other implementations might cons, but if they do, someone should probably submit a patch. The hardest one to patch would be CLISP because it doesn't even have double-float arrays.)