freenode/#lisp - IRC Chatlog
Search
13:13:33
hjudt_
i've added "RUN localedef -i en_US -c -f UTF-8 en_US.UTF-8" to the dockerfile, now it works.
14:45:05
jdz
scymtym: I recently got burned by C.UTF-8 locale because it is defined only in Debian (and derived) distros.
14:46:45
jdz
Yes, and my understanding is that it is hard-coded in glibc and cannot be generated using /etc/locale.gen.
14:47:40
jdz
My gripe with the software that unconditionally uses such locale is that said software does not first check if the current locale has UTF-8 support.
14:48:52
jdz
But then again, most software up until recently only supported ASCII, and even now most software does not support left-to-right and top-to-bottom writing systems.
14:49:51
loke
jdz: Using that locale is bad. But assuming that you have a UTF-8 locale is becoming a reasonable thing to do.
15:41:50
skidd0
also, do I need to structure my code so that macros are defined before they are used?
15:46:51
pfdietz
Macros get executed at compile time, so they absolutely must be defined before use.
15:53:08
gendl
Hi, I'm having trouble completely understanding an :around method for an asdf:perform (tried reading ASDF manual but I'm still a bit lost). Here's the file in question:
15:53:33
_death
skidd0: update your quicklisp dists.. this should update the project nibbles, which ironclad uses.. it used sbcl internals that were changed, and had to be patched
15:53:51
gendl
The way this is written, after that asdf-tricks.lisp is compiled/loaded into Lisp, it will affect any file of type "cl" forever more, is that right?
15:54:20
gendl
If possible, I'd like to have it affect only a certain ASDF system, which is gonna be named "zaserve" or "aserve"
15:55:46
gendl
otherwise, what that `with-zacl-build-environment' does is bind a modified readtable around its body -- i'd prefer not to make that start happening with any and all .cl files which get processed after zacl is loaded...
15:58:27
_death
skidd0: also, if you've already updated nibbles, then the patch is not backwards compatible and you should update sbcl..
16:00:17
_death
(ql:update-client) to make sure you have latest quicklisp, then (ql:update-all-dists)
16:00:17
gendl
pfdietz: I see... so anyway the only way it would be a problem as it is now, would be if someone else is also using :cl-file as a class in their .asd file.
16:00:38
gendl
it won't affect all files of type "cl" unless they're using the same class name to specify that file type
16:01:33
gendl
but still, it seems like it would be safer to have a more specific and guaranteed unique class name.
16:03:48
gendl
But, in order for :components ((:cl-file ...)) to work, the class cl-file _has_ to be put into the asdf package, right?
16:04:33
gendl
similarly if we do (defclass asdf::zacl-cl-file (asdf:source-file) ...) it necessarily has to be in the asdf package... right?
16:05:16
pfdietz
I don't know. If it's a keyword being translated to a class name, they probably yes. But can the class name itself be used there?
16:06:24
gendl
pfdietz: good question. I'll play around with it. I've only ever seen it be a keyword, tagging those :components.
16:09:15
spm_
silly question: Where in the hyperspec do I look to see the rules around string formatting that allow the cl reader to convert into object/structs? i.e. If I want to read a stream and have the reader be able to convert directly into CL objects, where do I find those rules.
16:10:21
HighMemoryDaemon
Anyone here use both Common Lisp and Racket? What do you love about both languages? I'm still a beginner and learning about ASDF/Quicklisp. I like that package management is quite simple and familiar in Racket. Great documentation around Racket as well.
16:19:09
pfdietz
It is. And if you are invoking sbcl from slime, you should set it. The emacs variable slime-lisp-implementations allows one to specify its value in the :env part of list members.
16:21:25
beach
HighMemoryDaemon: One of the great strengths of Common Lisp is that it has a standard, published by an independent standards organization. It is independent, in the sense that the standards organization does not supply any Common Lisp implementations, and the people writing the implementations can not influence that standard. As I often say, the project leader for a software project who chooses a language without an independent
16:23:37
gendl
pfdietz: ok it works to use a non-keyword symbol (naming a class) instead of e.g. :cl-file
16:25:40
gendl
Apparently it's not universally kosher to redefine packages at will - e.g. SBCL always throws a warning when redefining a package.
16:26:12
gendl
(or is it only if the redefinition is somehow not compatible with the previous definition?)
16:27:02
Bike
"If the new definition is at variance with the current state of that package, the consequences are undefined" from clhs defpackage.
16:27:31
gendl
Bike: Ok. So that means that if the new definition is _not_ at variance, then we're kosher. Right?
16:29:07
Bike
gendl: that handles most basic cases, like loading a system twice with no changes in the middle
16:29:26
skidd0
is there anything other that the directories in local-packages that I should also remove
16:33:25
_death
please show a transcript of ls ~/quicklisp/dists/quicklisp/software , sbcl --eval '(ql:quickload "ironclad")'
16:38:10
pjb
(setf *error-output* (open "/tmp/stderr" :direction :output :if-does-not-exist :create :if-exists :append)) ; why stderr? in CL, it's *error-output*.
16:38:47
pfdietz
It means SBCL could benefit by offering public APIs for some things that both sides could agree would not change often. There's demand there. A project on my back burner is to characterize these trespasses to prioritize possible APIs.
16:39:07
skidd0
_death: https://bin.0x00sec.org/?991731ad9b75cda2#u//C19bBps2faueVhesd3J0cyy7/B1RUUEYgnZavk1I=
16:46:13
_death
you should either remove ironclad from local-projects and update quicklisp dists or clone both ironclad and nibbles and work with those
16:57:24
dim
about ironclad failing to compile, as in https://github.com/dimitri/pgloader/issues/834, do we know what to say to our dear users?
17:02:58
pjb
To implement the restart part, you could write a little script: #/bin/bash \n while true ; do sbcl ; done Call it /usr/local/bin/lisp, and (setf inferior-lisp-program "/usr/local/bin/lisp") in ~/.emacs
17:07:52
dim
you can use ,restart-inferior-lisp, thanks to autocompletion it's only 3 keystrokes here (, r RET) from the SLIME prompt
17:31:14
gendl
Hi, is there something like ccl:lookup-hostname and ccl:ipaddr-to-hostname in sbcl, or in usocket or another standard library?
17:31:18
dim
I can't wait until we have a good story with the McClim editor/IDE solution that some people are working on here, btw, as a solid alternative to Emacs/SLIME
17:33:29
skidd0
but my workflow was slower and I struggled trying to set up spacemacs in a way i liked
17:33:46
skidd0
i spent more time configuring the thing than using it, which i've heard is common with all emacs types
17:34:41
dim
well I've spent way more time than I care to admit until I had my Emacs setup as I like it, and I have now been using that for years without a change
17:42:01
dim
if you're using a macos you might want to try the Clozure-CL IDE too, it might work for you
17:43:58
gendl
Hi, is there something in usocket or another library for finding a hostname based on an IP (dotted or undotted), or vice versa?
17:46:35
Bike
there's sb-bsd-sockets, which despite the name is supportedon at least three implementations
17:49:44
anamorphic
gendl, there is also https://common-lisp.net/project/iolib/manual/iolib.html#Address-Functions
17:53:53
gendl
but i'm not sure if I want to introduce all these C and lib dependencies just for a couple functions...
17:58:00
gendl
Ah, I'm seeing stuff like get-host-by-name. Missed those the first time through the manual somehow, sorry.
17:59:15
makomo
skidd0: i'm using spacemacs and i'm quite happy with it. anything in particular that bothered you?
18:01:39
gendl
_death: it has an unexported usocket::host-to-hostname, but that is returning just dotted IP in stringified form.
18:03:48
jcowan
beach: So it's your view that only Ada, APL, APT (a numerical control language), Basic, C, C++, Cobol, Common Lisp, Dibol, Forth, Fortran, Mumps/M, PANCM, Pascal, PL/B (aka Databus), PL/I, Rexx, Smalltalk, and SQL are fit for purpose?
18:04:51
jcowan
That would cause a pretty serious slaughter among the leaders of programming projects.
18:11:28
_death
jcowan: I think you can add JavaScript there though, which shows that it's not the whole story ;)
18:30:34
jcowan
_death: The question is then what counts as an independent organization. ISO, ANSI, IEEE certainly, but that doesn't get you very far nowadays
18:30:39
sukaeto
in the case of Ada, the "[compiler writers] can not influence [the standard]" clause might rule it out
18:34:42
sukaeto
yeah, Ada 2012 is the latest revision. I believe there'll be a new one in 2020. I was just pointing out that some of the things adopted by the standard over the years were originally extra libraries offered by a particular implementation
18:37:48
makomo
skidd0: hm, this is the first time i heard of vim-wiki. taking a quick look and it seems like 0.01% of what org-mode offers you :-)
18:39:08
makomo
skidd0: well, then just don't use it :-), but sooner or later i think you'll want to use at least some of it
18:41:08
makomo
skidd0: for example, i have all of my phone contacts stored in an org-mode file (and it's readable as well, trust me). using org-vcard, i export the contacts into a vcard format and import them on my phone. easy peasy
18:42:20
makomo
i'm using org-mode to store them because (1) i don't want to store them in the cloud and (2) it serves as a backup if my phone dies or i acidentally format it (which i did once...)
18:43:08
makomo
skidd0: yeah, correct. if someone else wants to work on org-mode files, they can use any text editor, but they'll have the best experience with emacs of course
18:43:52
makomo
except that maybe vim-wiki is simpler and has less features, so it would be easier to do "bare handed"
18:44:12
makomo
you don't have to live in it of course, but where else would you take your notes? :-D
18:46:31
makomo
skidd0: oh, that's neat i guess, but i was thinking of "notes" in the "plain text" sense. i'm not sure what i would go with if i stored my hand-written stuff (such as notebooks) digitally
18:50:48
skidd0
I'm trying to milk my education for all it's worth. But i get the sense that there are major holes
18:54:59
pjb
ACTION is wondering what kind of cheese you can make from the milk milked from an education…
19:00:43
skidd0
they teach "here's a linked list" but none of the context around why it was designed
19:04:37
Bike
it's not a full history exactly, but it's at least a starting point, which is more than what most math texts do
19:06:59
oni-on-ion
apparently the guy is taking it further into big talks and such, ive only seen the original article, but personally very relate
19:10:00
oni-on-ion
also this i came across last night, half-read but very enjoy much inspire, not language-specific, from linus torvalds https://www.brynmawr.edu/cs/resources/beauty-of-programming
19:10:36
TMA
skidd0: from my experience: the missing things are patience and the ability to think out a bigger chunk of code without trying to actually run it on a computer A bigger chunk of code is on the order of APPEND (two list version only) for this purpose
19:14:11
oni-on-ion
LdBeth: it is a very useful skill for C coding. especially back in the day when the edit-compile-run cycle was a big taxing
19:14:41
skidd0
TMA do you mean like, mentally walk through the types, the methods, why it *should* work?
19:15:11
oni-on-ion
it feels good to write a bunch of bug free code and see it happen all at once than small increments of carefully asking the compiler for guidance at each baby step
19:16:37
oni-on-ion
well since the computer can be seen as an external manifestation of our existing sequential computation abilities, all u need is to have no life, and its like english where it becomes natural. where we can "see" ahead, to know how someone will react, in real time while we are talking [programming]
19:16:42
TMA
skidd0: actually perform _any_ reasoning about the code. normally it is just woodoo programming -- change this or that based off some random snippet from the internet -- and try it -- without any mental model
19:16:56
oni-on-ion
skidd0: i am only on that level for C/c++/objc and Haskell and somewhat Ocaml and smalltalk, really.
19:17:38
oni-on-ion
its like watching a movie where we can be almost sleeping and still see whats happening. when we read a book that is challenging we need to internalise stuff and digest and visualise and let our mind become changes etc.
19:17:55
skidd0
the only time i end up trying out 'snippets' is when i've hit a wall trying to reason through the issue
19:19:29
LdBeth
skidd0: the general idea is programming should be friendly enough for people from other fields to utilize it
19:19:51
TMA
some people are like the ancients though, thinking before doing, but I seem to encounter mostly the described kind
19:21:01
skidd0
but when first dipping into the water, i'm certainly more likely to flap my arms around
19:21:44
oni-on-ion
TMA i often wonder how much time is spent thinking back in the day, zoning out, really getting into the zone of creativity..
19:22:25
jasom
I think doing it properly requires having a mental model, and then changing the mental model whenever reality contradicts the mental model. Some people never really form a mental model, others insist on not making any changes until their mental model is 100% correct; one results in bugs, the other results in low productivity.
19:23:25
jasom
right. I see a function called "rename-file" and I assume it renames a file. If I observe it *not* doing so then I need to do some more investigation.
19:24:07
jasom
perhaps it silenty fails when the rename target exists, for example. That would be surprising and require an update to my mental model.
19:24:53
jasom
It's totally okay to have an incomplete and wrong mental model as long as you are on the alert for evidence that contradicts it.
19:25:15
oni-on-ion
always good to keep mental model in sync with reality , never really a time where it is good to not do that unless we are going insane.
19:25:47
jasom
oni-on-ion: if your mental model needs to be perfectly in sync with reality then that greatly constrains the complexity of problems you can tackle.
19:29:10
jasom
humble hubris though, if that's not a contradiction in terms. Act as though you are right while remembering you are probably wrong about at least something.
19:29:39
jasom
If you wait until you know everything before you act as if you know everything, then you won't ever act.
19:30:53
jasom
OTOH if you continue to act as if your initial thought was correct *after* reality has shown you to be wrong, you're not acting with hubris, but just stupidity.
19:32:38
oni-on-ion
yeah no this is important though =) because with lisp we got to be careful to not let it destroy our minds with its power
19:33:53
oni-on-ion
i would like to just add, that hindsight is 20/20, its near-impossible to figure out or define what is currently going on, without destruction and murder of it.
19:43:40
jcowan
skidd0: The point of general education requirements is that a university is not, nor is it intended to be, a vocational training school.
19:44:20
skidd0
they sold it to all my generation as "you want a job programming? to to college to become one"
19:56:06
pfdietz
In light of Griggs vs. Duke Power, it's surprising employers in the US still can ask if you have a college degree. https://en.wikipedia.org/wiki/Griggs_v._Duke_Power_Co.
20:07:52
jasom
pfdietz: if you want to continue talk, Griggs v. Duke is actually part of why colleges are now a gateway
20:09:09
Shinmera
paradoxical would be a program that clears itself out of the icache as it's being executed.
20:10:07
phoe
unless we literally define a program that cleans up all parts of Lisp that are no longer needed in its execution
20:23:48
phoe
(progn (set-macro-character #\( nil) (fmakunbound 'progn) (fmakunbound 'set-macro-character) (fmakunbound 'fmakunbound))
20:24:24
phoe
Unless you have some symbol macros bound just in case, I think that's a finishing move
20:58:21
russellw
Okay, what's the difference? At least if you are going to standard output, they both write all the characters of the string?
20:58:36
Shinmera
write-string only accepts strings. princ is a shorthand for write with print-escape and print-readably being false
20:59:26
Bike
not sure. i think princ in the middle of something else might hit print circle and stuff
20:59:29
Shinmera
or in other words, write-string copies the contents of a string to the character stream. princ prints a representation of an object to the stream
21:00:12
Shinmera
russellw: whether they do the same thing or not is irrelevant. They're there for different purposes.
21:01:23
russellw
Okay so they do the same thing if the argument is a string, but are there for different purposes, that's fine
21:19:33
aeth
russellw: You can think of the print functions as having three layers of abstraction (although terpri seems to occupy the bottom two layers). The bottom layer is write-foo (where write-foo is writing to a character stream and not a byte-stream). The middle layer is prinfoo. The top layer is format.
21:21:21
russellw
aeth, cool. But does Lisp distinguish between character and byte streams? If so, are character streams implemented on top of byte streams? If so, does that mean byte streams are a fourth level of abstraction?
21:22:55
aeth
Oh, I should clarify that write-foo on a character stream expects strings or characters, with the exception of write-sequence, which for character-streams expects sequences of characters (so '(#\A #\B #\C) is apparently valid there)
21:23:30
aeth
prinfoo and format foo could handle conversions, and could be built on something of the lower level
21:25:38
aeth
But now you have the situation where your string is utf32 and your character stream is reading/writing utf8 or something along those lines.
21:29:35
jasom
russellw: many implemenations provide bivalent streams (character & byte), and there are 3rd party libraries that implement bivalent streams on top of byte streams.
21:30:12
aeth
afaik (write-string "abc") could be taking in #(00 00 00 97 00 00 00 98 00 00 00 99) and writing #(97 98 99)
21:30:56
jasom
aeth: lisp actually allows more metadata on characters than just the character code IIRC
21:31:21
russellw
Yeah, that stuff is a headache in every language, so lisp certainly cannot be blamed for the headache
21:32:02
aeth
jasom: I'm assuming that if it's the byte representation of the string, the metadata is probably at the start, once. Similar to how you can get ([un]signed-byte 64) arrays without boxing
21:33:42
jasom
of course utf-32 leaves room for 8 bits of metadata should the implementation wish to use it.
21:34:26
aeth
oh, and I say *could* be writing #(97 98 99) because when (with-output-to-string (*standard-output*) (write-string "abc")) it'll be writing the longer 00 00 00 97 ...
21:35:22
jasom
russellw: anyways see http://edicl.github.io/flexi-streams/ for portable flexible streams. Note that there is some performance overhead though.
21:37:18
aeth
I assume what's comme is internal storage as utf32 and external non-string reading/writing as utf8, but that doesn't have to be the case, and I think some implementations have the encoding configurable. (For the rest I guess you have to use things like babel and work with byte streams?)
0:30:02
aeth
(The part that reads UCI input from a chess AI, not the part that sends UCI output from a chess AI, although that might be the next logical step.)
0:53:09
aeth
I want to (defclass foo-file (source-file) ...) or (defclass foo-file (cl-source-file) ...) and write the absolute minimum necessary to get the file to load and compile via ASDF.
0:54:00
aeth
For the sake of simplicity, I'll do this with cl-brainfuck since I already have a function that turns a foo.bf file into a foo.lisp file.
0:56:16
aeth
So I have (defclass brainfuck-file (source-file) ((type :initform "bf"))) (but might need to turn that into a subclass of cl-source-file and use a cleverly-placed :before method) and I have a function that when given the pathname for a .bf brainfuck file reads it and creates a .lisp Common Lisp file.
0:58:02
aeth
What I want to do is have an ASDF component (:brainfuck-file "foo") that creates an intermediate .lisp file and then handles that created file like a .lisp (:file "foo")
1:00:18
aeth
(Is the Brainfuck version of this useful? No, but what it is is 100% complete. I can already go hello.bf => hello.lisp => hello.fasl and then #'load that fasl and have SLIME say "Hello World!" I just cannot do that through ASDF.)