freenode/#lisp - IRC Chatlog
Search
14:29:19
schweers
I’m trying to figure out what’s wrong with the what yegortimoshenko asked and it is weird. I have the return value of open-timporary-file in a global variable. So I can inspect it. It is an fd-stream. Yet, when I pass it to PATHNAME, it says that NIL is not a pathname!?
14:31:28
schweers
I supposed that would be the case, that is why I tried it. I find the error a little confusing though. But ok, I understand now.
14:31:37
oleo
why would pathname know anything about the stream, until the stream was yelling i'm the file located blabla
14:32:22
oleo
you have to capture information of the path additionally, at the time you are opening it....
14:49:47
yegortimoshenko
schweers: https://gist.githubusercontent.com/yegortimoshenko/445aa9c7e8d61790eb3cead3240c7903/raw/e1d7918fc1002362ae6d18e0f6416fe08d451a72/osicat.log
14:53:11
schweers
btw: if you’re on linux you might find out where the file lies by checking the contents of /proc/self/fd/
14:55:11
yegortimoshenko
schweers: thanks, nice hack. really perplexed what/why pathname on fd-streams is so broken
15:13:24
fiddlerwoaroof
phoe: as far as the "extend the standard" question goes, my sense is that the Python community has discovered that the standard library is where libraries go to die
15:13:57
fiddlerwoaroof
Once a library gets incorporated into a "standard", it can no longer develop at its own pace, but only at the pace of the various implementations of the standard
15:14:21
fiddlerwoaroof
Whereas, if you implement the library in terms of other language features and maintain it, it can evolve as necessary
15:20:58
fiddlerwoaroof
Supposedly rust people have also found this... https://news.ycombinator.com/item?id=12177545
15:21:46
loke
I know nothing about the python ecosystem, but it cannot possibly be any worse than the Javascript one.
15:25:01
whoman
cliffhanger! i grew up on C, didnt like JS for the longest time, then seen some functional stuff, played with its "hackable" ways, and i like it now. if there wasnt lisp or haskell or erlang or ocaml (in that order) i would be in JS land
15:26:48
fiddlerwoaroof
I think so, I forget all the details, but there are a couple weird edge cases for automatic semicolon insertion
15:27:03
fiddlerwoaroof
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return#Automatic_Semicolon_Insertion
15:27:10
loke
ACTION has been using Kotlin recently, and while it's overall a better language than Java (and Javascript), it also has the same "optional semicolon" rule, and I'm not sure what will happen if you do return\n123 in it.
15:27:41
loke
Since you have to declare the return value from a function, I guess it could infer the intent (which wouldn't be out of place given the language as a whole)
15:27:51
fiddlerwoaroof
The general rule of Javascript is that you can't implement any feature in the expected way: you have to implement it in the "Javascript" way.
15:37:39
fiddlerwoaroof
I don't understand why webassembly didn't start out with a DOM integration story
15:40:39
whoman
the first two forms from: https://kratofragments.wordpress.com/2014/04/26/defstruct-vs-defclass-a-2x-difference/
15:50:02
edgar-rft
whoman: defstruct and defclass are no Elisp built-ins, they are implemented in Elisp libraries, what is known for not being really fast
17:23:38
gremdrus
yesterday someone was talking about bootstrapping sicl, and I really didn't understand their argument. Was it that host-based clos could be used instead of a proto one?
17:25:19
jackdaniel
first version was compiled with some other compiler (or bootstrapped from assembly, it doesn't matter)
17:25:20
kora9
jackdaniel: I've always had issues wrapping my head around that stuff. It's very chicken and egg for me :)
17:26:22
vtomole
kora9: Me too. I've been writing a toy compiler and its starting to make sense now.
17:26:30
Bike
well, when you compile-file you get a fasl file. you can then load the fasl file in a (slightly) different lisp implementation. sicl does the same thing writ large. or will.
17:26:32
jackdaniel
but imagine situation: you have ECL bootstrapped from C (assuming you have C compiler), and using ECL you compile SICL
17:26:34
kora9
jackdaniel: Yeah I understand it on a basic level, that it makes sense that at some point, with any language that's not machine code you're going to have to compile it using something else the first time
17:27:12
kora9
jackdaniel: What I have issues wrapping my head around is how there can be performance improvements and not performance degradation when you just layer things like that
17:28:21
kora9
jackdaniel: Here's where I'm lost, because I don't get how the new compiler can produce better machine code than the one that compiled it
17:28:31
jackdaniel
compiler doesn't have to compile to the language it was bootstrapped from, it may produce native code
17:29:10
jackdaniel
what Bike said, compiler is just ordinary program, which takes as input program, and outputs machine code
17:29:19
kora9
I didn't think about that. I figured that the machine code produces would somehow be derived from the machine code used in the original compiler used to compile the new one
17:29:48
jackdaniel
kora9: for instance cross-compilers produce machine code, which is most probably impossible to run on host machine
17:30:49
jackdaniel
it doesn't matter what you compile your program (compiler) in, because what you are interested is input and output
17:31:06
jackdaniel
of course, if you compile your compiler with non-performant compiler, than compilation process may be slow
17:31:31
jackdaniel
because it doesn't matter what you compile in statement "print 'hello world'", it will always have the same result
17:32:21
jackdaniel
I think I've said everything I know about compilers, so I'm going to take a break, have a nice evening :-)
17:32:35
kora9
I've mainly used Java and Lisp and so I kind of think of programs as not being compiled in that sense
17:33:01
kora9
jackdaniel: Have a nice evening, and thanks for explaining. I'm learning, gradually :)
17:33:03
TMA
kora9: it was done previously (in the sixties) -- an assembler was written in assembly language, then a high level language (fortran) compiler was written in assembly...
17:33:57
TMA
kora9: the first lisp was written by translating the interpreter (as written on paper) to assembly by hand
17:34:53
TMA
kora9: the first LISP, it was customary to name languages with uppercase names then (as is the case with e.g. FORTRAN)
17:34:58
phoe
I remember the fun I had when compiling GCC once; I think I had GCC 4.3, I needed to compile GCC5 with GCC4, then GCC6 with GCC5, then GCC7 with GCC6, oh boy
17:35:04
kora9
phoe: I didn't know that! I've heard the term bootstrap a lot, but I never knew what it meant
17:35:46
jackdaniel
I imagine how beach is glad that he doesn't have to explain this stuff *once again* ;-)
17:36:01
TMA
kora9: originally it's from a tale about a man that pulled himself from a swamp by pulling on the straps on his boots :)
17:36:14
phoe
So either you grab an already compiled SBCL, or you need another Common Lisp implementation.
17:37:08
TMA
kora9: it is impossible to do that in reality. but the existence of that story about Munchhausen is a fact :)
17:37:48
kora9
TMA: Though when I was younger I always wondered if it would work to jump in an elevator that was crashing, to survive :)
17:39:26
kora9
TMA: That if you jump close to when the elevator crashes, you'll decrease your velocity. Probably not enough, but some :)
17:40:05
TMA
kora9: well, in theory it might (as it is the rapid deceleration that kills you. if you jumped just right you would be decelerating slower) but the timing is tricky, and you probably do not jump fast enough
17:41:08
oleo
kora9: and even if you jumped high enough, the rest kinetic energy would very probably still be too high.....
17:41:48
oleo
kora9: if you spared 10km/h from 50 km/h you'd still be jammed with 40 km/h on the ground
17:42:57
kora9
Kind of as surprising as what he said about lift and airplanes. That the theory that planes fly because of airflow being different speeds over and under the wing is wrong. They taught that at my school!
17:46:26
dlowe
yeah, airplanes fly because the wings are slanted with respect to the direction of force
17:46:44
kora9
I don't understand it exactly, because tetro said it was wrong, wait I have the link he said
17:48:38
kora9
He gave me this, I don't understand it, he tried explaining it but I'm not good with physics things :)
17:53:57
vtomole
kora9: I was a new programmer over a year ago. #lisp is a very helpful and friendly place and the people here have helped me grow a lot :)
17:55:10
kora9
vtomole: Yeah, people here are great. I'm very happy that people who are very knowledgable has the patience to put up with some of my questions. I know that sometimes they're stupid. :-P But i'm trying and I'm learning every day.
18:02:42
dlowe
well, "You might want to additionally join #clnoobs" seems like a common-sense suggestion
18:02:43
kora9
Personally I don't take offense in being called a noob unless it's being used in a derogatory fashion. I /am/ a noob
18:03:05
Shinmera
dlowe: Sure, but I mean, that's only after the question has already been addressed in here, heh
18:06:00
kora9
I think I'll ask my questions there first before bothering this channel. That seems like the polite thing to do
18:06:03
dlowe
Has value anyway, just because the people in there are a) beginners or b) experienced lispers who are there specifically to help
18:06:29
Shinmera
Right. It's just not as good at segregating traffic as one might desire it to be is all I'm saying.
18:06:52
kora9
Shinmera: Maybe it would work better to make #lisp the noob channel and #lisp-notnoobs the not noobs channel :D
18:07:13
Shinmera
That'll work as well as trying to make #lisp about all dialects and not just common lisp
18:07:37
kora9
That /was/ confusing for me when I first joined! I didn't even know the difference between Lisp/Common Lisp
18:09:21
Shinmera
Have you heard about the parens in that other language? They have edges. What do you think?
18:18:37
zulu_inuoe
I graduated school as an idealistic Computer Scientist, demanding everything be perfect. It's not until a year later that I became a "This is good enough" practical Engineer. I think you need a little of both!
18:21:49
zulu_inuoe
Unfortunately, no. I learned all my source control, working with teams, devops, etc at my first job. My school did not have a very good focus on real-world projects, and at that time I was not smart enough to reach out for myself.
18:22:15
jsjolen
I had to re-install roswell, how the heck do I set up sbcl source locationsnow again :-/?
18:23:21
zulu_inuoe
That's not the ideal, but I was lucky to land a job at a -very- practical company, so the contrasting viewpoints between me and my colleagues I think really helped me grow.
18:23:57
zulu_inuoe
^I mean to say, a lot of the people I worked with went to schools (one school in particular) that was pretty much all hands-on, and very little theory
18:30:27
sukaeto
zulu_inuoe: fwiw, a degree in computer science isn't meant to prepare you for work as a software developer (though some departments are expanding their program in that direction these days)
18:32:08
zulu_inuoe
sukaeto: Yes. That is 100% correct and a thing some people often misunderstand. I don't regret the school not giving me more hands-on experience, I regret not going out and getting it myself. But again, it all worked out well for me
18:34:45
zulu_inuoe
jsjolen: A lot of schools (including the one I went to, -after- I graduated) will have a "Senior Project", which is a big, open-ended development project. You get aquainted with source control, working in a team, documentation, setting goals, dealing with third-party libraries and tools, etc.
18:35:40
jsjolen
zulu_inuoe: Nice. We had the same in 2nd year, with the addition of working with a company to produce some sort of product/deliverable
18:59:41
ptdel
hello, could somebody tell me why when I run this, only the second make-instance is returned? I think I am misunderstanding how to use defmethod, my understanding was i could redefine the method multiple times http://sprunge.us/FgiY
19:03:11
Bike
even if you didn't, it's a progn method combination, you're only getting one thing out of it
19:04:20
ptdel
ah ok, I was looking at the yason example code and it defines a few classes and then makes multiple defmethods from yason:encode-object
19:04:50
Bike
kind of seems like you meant them to specialized on LIST-NAMED-QUERIES and LIST-QUERY-EXECUTIONS
19:06:24
Bike
if encode slots has two methods, one on list-named-queries and one on list-query-executions, and neither of those classes inherits from the other, and you call encode-slots an object of type list-named-quries
19:12:43
ptdel
ACTION shrugs trying to bootstrap myself into the language i still dont know the full spec of most keywords offhand
19:49:12
gremdrus
this is my horrible code: https://gist.github.com/gremdrus/7b03dad2fdaffe472d3d978700bb2a5f
19:49:28
_rumbler31
I bet the function you're calling is expecting to see the symbol :path "somepath" and you're not giving it that
19:50:49
gremdrus
(defun foo (&key ((:apple a)) ((:box b) 0) ((:charlie c) 0 c-supplied-p)) (list a b c c-supplied-p))
19:53:50
_rumbler31
additionally, isn't a keyword argument to a function exposed by the name, not the keyword?
19:57:59
gremdrus
now I am getting: odd number of &KEY arguments https://gist.github.com/gremdrus/aed0062155d44b48286d15bedcfca084
19:58:52
sjl
gremdrus: it would help if we had the full error, like where is it complaining about an odd number of key args?
20:18:12
phoe
and the first thing I'll do after publishing it is posting it to /r/lisp and hackernews
20:37:44
phoe
There: https://gist.github.com/phoe/d93f968f22bbcc87070cdc5831762021 <- this is a non-public preview.
20:38:14
phoe
tl;dr: I grabbed all the comments I found and reparsed them into something more readable, and also added mine.
20:50:01
pjb
phoe: re: github, one problem is that github is github.COM and is located in the USA ; gitlab on the other hand was gitorious.ORG and was located in Europe. At a time when network or github failures meant that European workers were stuck half a day without being able to push to the central repository, and considering that most CL libraries are freedom software, and not privative COMmercial software, it would seem more logical to
20:50:28
pjb
phoe: on the other hand, nowadays, gitorious has been bought by gitlab.COM, but there's framagit.ORG which is located in France.
20:51:46
pjb
phoe: there are also licensing restrictions that were imposed by github with some self generated FUD. (It seems they're cleared it up, but still, the point remains that if you use only one such repository, you're at the mercy of the US enterprise and their shareholder).
21:02:56
phoe
(I'll gladly accept some HN upvotes, too. https://news.ycombinator.com/item?id=15012678)
21:15:43
fiddlerwoaroof
This is a bit naïve, but I think it solves most of my html sanitization problems:
21:17:03
fiddlerwoaroof
Shinmera: I'm using a variant of TeMPOraL's code in this issue: https://github.com/Shinmera/plump/issues/7 I'm not sure what the best way to add an html-compliant serialization mode is.
21:17:10
fiddlerwoaroof
https://github.com/fiddlerwoaroof/html-sanitizer/blob/master/html-sanitizer.lisp#L6
21:20:28
sukaeto
fiddlerwoaroof: fwiw, that looks similar to approaches I've applied in the past (except I just changed tags not on the whitlelist into <div>s or some such)
21:21:12
sukaeto
just in case validation from some dude on the internet, who's presented no credentials, and who hasn't particularly considered/researched in depth the security implications of such an approach means anything to you at all :-D
21:21:56
fiddlerwoaroof
Yeah, with this sort of things the best thing is to get a bunch of eyes on it
21:55:30
Shinmera
fiddlerwoaroof: Though I'm not sure myself, hence why I haven't resolved the issue yet.
21:57:07
fiddlerwoaroof
Yeah, I don't really want to depend on the server's configuration for proper operation. It might be a good idea to add an optional serializer argument to the serialize function?
21:57:21
Posterdati
I do not know why lispers don't like openbsd as develop platform... For certain things is far superior to linux
21:57:45
fiddlerwoaroof
That way, if you defined a protocol for such objects, users could add whatever features they need.
22:00:36
fiddlerwoaroof
Also, I don't know if anyone here is in the LA / Santa Barbara area, but it would be great to have some more lispers at https://www.meetup.com/codecraftgroup/events/242348019/
22:13:19
fiddlerwoaroof
Every once in I while, I wish I had the ability to create anonymous generic functions
22:17:09
fiddlerwoaroof
I don't know :) I suspect one could create a generic function metaobject and then add methods to it using the MOP
22:46:35
Bike
usually you use defgeneric, and that's kind of oriented in a different way since it can reinitialize existing functions.
22:47:53
phoe
I kind of wish there was a (make-generic) that creates a new generic function object, ready to funcall
22:48:42
phoe
that you can then extend with (add-anonymous-method generic-instance ((foo string) (bar integer)) (print string) (* 2 integer))
23:12:09
dim
with SLIME it's really easy to type in a .lisp file and C-M-x your expressions to load them in the running image
23:12:36
dim
you even have C-c C-y to write a function call on the REPL for you from your source file
23:15:23
fiddlerwoaroof
Think of a generic function that maps a callback over a tree containing nodes of different classes: the callback could be something you define with defgeneric but, in some cases, but (a) that requires giving the generic function a name, which isn't always easy and (b) it adds a lot of boilerplate for a "throwaway" function
23:15:41
fiddlerwoaroof
But, also, (c) anonymous generic functions are a great excuse to play with the MOP
0:09:25
schoppenhauer
is anyone using quicklisp on nixos? is it possible to have an isolated quicklisp-install for a nix-shell?
0:10:57
Fare
I'm pretty sure MichaelRaskin has some helpers to import quicklisp packages into nixos already
0:21:10
schoppenhauer
I found https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/lisp-modules/from-quicklisp
0:22:18
fiddlerwoaroof
I've done a bit of work to prevent asdf/quicklisp from writing to standard directories
0:23:47
fiddlerwoaroof
jasom: that's too bad, Codecraft generally happens the last Wednesday of every month
0:24:32
schoppenhauer
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lisp-modules/README.txt i don't really get this file
0:25:46
fiddlerwoaroof
schoppenhauer: here's a builder I've used with some moderate success (Nix / OSX): https://github.com/fiddlerwoaroof/uclip/blob/master/builder.sh
0:25:55
jasom
plus, getting to Thousand Oaks by a reasonable time in the evening is ... not so easy.
0:25:59
fiddlerwoaroof
Here's the nix file: https://github.com/fiddlerwoaroof/uclip/blob/master/uclip.nix
0:26:47
jasom
oh, I don't have my laptop with me, but I have a reasonably complete program to generate nix exrpessions from quicklisp
0:29:38
jasom
Fare: it greps the output of the failure to load; I have manual rules for determining which nix package is needed to resolve the dependency
0:30:45
fiddlerwoaroof
schoppenhauer: the second link is the builder, the first is a shell-script that actually does things
0:31:12
Fare
jasom: does your script deal with executables made with e.g. cl-launch or xach's equivalent?
0:31:21
fiddlerwoaroof
I just read a bunch of stuff about nix and this was the shortest path to victory.
0:31:23
jasom
here's an autogenerated list of packages that failed to load: https://paste.pound-python.org/show/YqxSEXWKVP0rRoRD6XAw/
0:32:10
Fare
jasom, cool I don't see workout-timer there -- does that mean you succeeded at loading it?
0:32:55
fiddlerwoaroof
fiddlerwoaroof: if you have a shell script that does what you want named "builder.sh" that nix expression might do the right thing :)
0:37:15
fiddlerwoaroof
If I have a macro that creates a generic function object, will that cause problems at load time?
0:38:37
Fare
jasom, schoppenhauer does either of you know how to make nix-copy-closure work between two machines?
0:40:41
jasom
cl-sat.glucose.build #Invokes curl during build <-- here's a line from the blacklist that is fun...
0:49:25
jasom
https://paste.pound-python.org/show/WvGieEO57Ptr3qFHi6aN/ <-- here's my builder.sh; haven't looked at it since September, so I'd have to read it myself to remember how it works
0:49:46
fiddlerwoaroof
My impression was that a conforming program requires that all the literals be externalizable
0:51:07
jasom
but each lisp dependency has .conf file that adds its input/output rules, so you include those as part of any system that will depend on that one
0:52:03
fiddlerwoaroof
Boke: my chain of thought was that my macro is producing a generic function object rather than a literal
0:52:03
jasom
I had something working that didn't cache the build outputs, but that seemed not nixy enough, so now there are system-wide caches, though IIRC it fallsback to using your home directory if the system-wide caceh fails
0:52:39
fiddlerwoaroof
This means that the gf object is a "literal" .: it needs to be externalizable
0:52:41
Boke
fiddlerwoaroof: i would assume the macro is expanding to a form that will produce a generic function when evaluated
0:54:31
fiddlerwoaroof
I've fixed that on my version, I just removed the l-t-v call and quasiquote the call to make-anonymous-generic-function
0:56:02
fiddlerwoaroof
http://metamodular.com/CLOS-MOP/initialization-of-generic-function-and-method-metaobjects.html
0:59:38
fiddlerwoaroof
It's a bit like using class-prototype to get the value of a :class allocated slot
1:00:02
pillton
Couldn't you do (defmethod make-method-lambda ((gf standard-generic-function) (m standard-method-class) form))?
1:00:40
fiddlerwoaroof
I have one generic function that maps over a tree of objects and applies a callback to each
1:01:10
fiddlerwoaroof
The anonymous gf provides a nice-ish syntax for dispatching on the class of each object in the tree
1:08:01
pillton
Sure. That is why I like common lisp i.e. there is no god group to stop you from blowing your feet off.
1:42:13
fiddlerwoaroof
e.g. something like (with-imported-symbols (packag:symbol1 package:symbol2) (+ symbol1 symbol2))
1:42:44
Boke
macros affecting how forms in them are read doesn't make sense with the reader separation that exists
1:45:23
pillton
There are package local nicknames: http://www.sbcl.org/manual/index.html#Package_002dLocal-Nicknames
1:47:18
aeth
What about CCL? If something is supported by SBCL, CCL, and ECL it's practically a standard.
1:54:17
vtomole
How strict is clhs on what counts as a standard? What I'm trying to ask: when is a implementation not considered to be common lisp?
2:03:24
vtomole
So if *theoretically* There was a set of procedures that CL programmers used a lot. Now if these programmer were tired of doing (load "utilities.lisp") on all their programs; if this utilities.lisp was added to SBCL. Will SBCL still be conforming?
2:04:39
aeth
A lot of de facto standards already exist, generally handled by portability libraries like cffi, bordeaux-threads, closer-mop, etc.
2:05:23
Boke
the point of the standard is to let programs run across implementations. an implementation having extra stuff doesn't mess w/that.
2:05:31
aeth
That's what i mean by 'practically a standard". Things that are supported by most if not all of the popular implementations are de facto standards.
2:19:34
PuercoPop
in sb-int: there are also some utility functions that you can find elsewhere, like with-unique-names and binding*, which is in the spirit of metabang-bind
2:25:48
PuercoPop
Fare: uiop:nest was about reducing the nesting so the code only right? TBH I just use vanilla constructs, never bothered me enough to load something like metabang-bind