freenode/#lisp - IRC Chatlog
Search
3:03:39
gendl
Thanks. I should read more before I ask here. I'm just playing with this old code which supposedly converts to iterate code so I was believing what it was outputting.
3:04:42
gendl
I think i might not be using the converter right. I probably have to do some package-fu to get the old let-streams operators to be recognized by the converters.
5:08:47
beizhia
Here's a question I may as well ask here: I've finally figured out why developing with Slime and the REPL is so awesome (making a little website with hunchentoot). How do I bridge the gap between that and C/Java/Ruby, where I'm used to deploying a project as a whole?
5:17:56
fiddlerwoaroof
beizhia: you write an asdf system definition and then start a fresh repl, load your system + all its dependencies and dump an image
5:20:32
fiddlerwoaroof
You can get pretty fancy with how you do it, but I often just write a little build script and run it with sbcl --load
5:20:33
fiddlerwoaroof
https://github.com/fiddlerwoaroof/dotfiles/blob/master/stumpwm.d/build/build.lisp
5:21:03
fiddlerwoaroof
Here's another example: https://github.com/fiddlerwoaroof/objc-lisp-bridge/blob/master/Makefile#L9-L11
5:22:54
beizhia
aha nice. I'll give those a deeper dive in the morning. Thanks for the example code!
5:23:40
beizhia
I still cant figure out if I'm just having a tough time with this, or if it's really quite different from everything else out there
5:24:39
fiddlerwoaroof
The only similar systems still around, as far as I know, are smalltalk systems
5:25:38
fiddlerwoaroof
You "build" an application by dumping the current state of your lisp implementation and then loading that back into the lisp implementation next time you run your app.
5:26:26
fiddlerwoaroof
It's more like the way docker containers work than the way something like Makefiles, mvn, cargo, etc. work
5:30:44
beizhia
I kinda prefer that. Feels a little more grounded in reality. I totally still feel more at home reading source files in a static typed compiled language.
5:31:50
fiddlerwoaroof
Yeah, if you really get into desigining stuff for exploration at the repl, you start missing the types less
5:32:01
beizhia
Just moved over to doing a lot of Javascript at work and honestly Lisp is helping me understand JS a lot.
5:32:30
fiddlerwoaroof
I've noticed that a lot of the practices $work promotes for designing testable code also lend themselves nicely to designing repl-friendly code
5:32:38
beizhia
I've been seeing that. Read a great article contrasting unit testing with REPL programming.
5:32:55
fiddlerwoaroof
i.e. writing small pure functions wherever possible so that you don't have to worry about io/etc.
5:33:01
beizhia
Basically, both are just the simplest way of calling a function, is what they mentioned.
5:33:26
beizhia
Ya, trying to emphasize that point with my team... We have a lot of several-hundred-liners in our code.....
5:33:41
fiddlerwoaroof
Also, don't be afraid of CLOS, I found it entirely changed my perception of what OOP means
5:34:17
beizhia
Heh, that's what this little tutorial is walking me though actually. I'm getting it. CLOS is rad.
5:34:31
fiddlerwoaroof
beizhia: if this were #js, I'd strongly recommend using ramda as the standard library of JS
5:37:04
minion
beizhia: direct your attention towards pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
5:37:29
beizhia
I have before, a couple times. I should probably hit it again though, now that I know more.
5:38:03
beizhia
This is maybe my 3rd earnest go at getting into LISP, and I think it's starting to stick.
6:04:37
aeth
In general the differences are: Scheme is (1) minimalist (and breaks compatibility so the names are often cleaner), (2) has hygienic macros, (3) has call/cc, (4) guarantees tail call optimization so tail recursion is idiomatic
6:05:13
aeth
Scheme implementations are incompatible with each other in key areas (although portable Scheme is possible to write).
6:05:50
aeth
Common Lisp culturally values portability, is more of a practical language instead of an academic one (at least traditionally), and has a huge immutable standard.
6:07:38
aeth
I think that the main practical use in modern programming style would be trivial coroutines? https://en.wikipedia.org/wiki/Coroutine#Implementations_for_Scheme
6:09:35
aeth
But I think a good distinction that hints at the early 1990s era cultural divide (practical vs. academic) is that if you're working with arrays of numbers, CL is imo much nicer than Scheme.
6:14:17
aeth
(And I wouldn't be entirely surprised if some Scheme implementation eventually extended the numeric tower to include all division algebras, not just real and complex)
6:23:32
beizhia
I can see why a scheme-type language would be nice for something like Guile, where you only want to embed as little as possible. For something on its own though, common lisp just feels much more usable.
6:24:44
fiddlerwoaroof
ACTION likes how CL feels like it could be an OS if people were willing to give it a chance
6:26:44
fiddlerwoaroof
Anyways, I put together a little demo that uses custom method combinations to define groups of HTTP server routs: https://gist.github.com/fiddlerwoaroof/2def4b081bb9ba179efcce48a204646c
6:27:31
fiddlerwoaroof
It works in Lispworks and ECL, but sbcl and ccl seem to have a bug in their implementations of define-method-combination's long form that prevents it from working there.
6:31:43
fiddlerwoaroof
And, there's also a question of whether or not my method-combination is conforming
6:47:11
beach
I just thought of a way, and it is so obvious that I am convinced that SBCL already does it in a similar way.
6:48:21
fiddlerwoaroof
I have a hazy recollection of reading a comment about this last night, but I was focusing on other things
6:50:26
aeth
fiddlerwoaroof: If beach doesn't know something about the implementation of CLOS, there's a good chance no one knows.
6:55:08
jackdaniel
I believe you don't give enough credit some prominent figures in the community (which I won't call by name to not embarass them with such praise :)
6:57:26
jackdaniel
that's not the point. there are many people who worked on existing implementations or compared them. for instance at last ELS the very topic of method combinations has popped up
6:57:55
fiddlerwoaroof
And, this isn't a question of implementation but of the interpretation of the standard
6:58:18
fiddlerwoaroof
The standard is vague about what happens when all the specifiers match but the qualifiers differ
8:39:15
heisig
mrblack: But it is not a function, it is just a symbol that is treated specially in certain macros.
8:39:43
mrblack
jackdaniel, heisig: cool, thanks... it was used in Land of Lisp but I don't think the author explains it, couldn't find. It's hard to find info about it because that's a common word. Do you have any links for it?
8:40:35
jackdaniel
use l1sp.org (the second character is "one", not small "L"), very handy for such lookups
8:40:38
mrblack
thank you, jackdaniel. this seems like a good site to bookmark. Google wasn't of much help ;)
8:41:19
jackdaniel
also I believe that duckduckgo redirects to this site when used with a special bang
8:41:48
aeth
If you make DuckDuckGo your default search engine you can just !l1sp in the URL bar in e.g. Firefox
8:42:03
mrblack
jackdaniel, aeth, great. I used Vimium, though, it lets me create commands for any search I want.
8:45:13
mrblack
is it possible to access this documentation offline like man pages, from Emacs or the command line?
8:46:52
mrblack
I see that "slime-documentation-lookup" will open the term under cursor on the web browser... it's good enough, I guess. But offline would be better
9:24:31
Xof
fiddlerwoaroof: I think you've found the two relevant paragraphs about method combinations and matching specializers / differing qualifiers
9:25:25
Xof
sbcl generally (at least historically) tends to go for outward portability -- if it uses only standard functionality and runs on sbcl, it runs on other CLs
9:25:42
Xof
so it chooses to obey the paragraph that says that what you're trying to do isn't allowed
9:26:07
Xof
however: there is an escape hole -- sbcl doesn't enforce that restriction if there is a single, wild-card method group
9:30:33
Xof
beach: sbcl optimizes make-instance in a bundle of different ways. the main way is when the initarg symbols are constant, we construct a CTOR (see src/pcl/ctor.lisp) which maps the initargs to slot locations (per-class if the class-name argument to make-instance is variable, otherwise just once), receives values for all the initarg forms that weren't compile-time constants, and allocates and initializes the instanc
9:30:52
Xof
actually I'm less sure about the "bundle of different ways"; I think I've managed to get them all into one sentence :-)
9:31:45
beach
Xof: Thanks. What if there are :AROUND methods on INITIALIZE-INSTANCE and/or on SHARED-INITIALIZE?
9:35:36
Xof
we refuse to optimize if there's a non-standard allocate-instance method, or an :around method on shared-initialize. we can cope with :around methods on initialize-instance if it calls (call-next-method) appropriately
9:38:11
Xof
welcome. This was largely Gerd Moellmann's work, when he was (I presume) bored between jobs around *gulp* 2002
10:07:48
flip214_
Can I get the current input position (in bytes) from CXML? I'd really like to create an index (tag => position, length) into a large XML file, and then do "random" IO on it.
10:35:33
beach
You say that ASLR is irrelevant to my address-space argument. I don't understand why.
10:39:29
flip214_
beach: ASLR is irrelevant for the "historical reasons", and also " does not take great care to prevent a temporary buer from overowing,
10:43:15
flip214_
so yeah, ASLR helps _a_small_bit_ re security -- but as soon as you can overwrite a buffer or cause other misbehaviour, you more or less have lost. even if the program "only" crashes, it's a very easy DOS.
10:43:54
beach
I still think it is relevant. ASLR attempts to prevent some code from sticking a different return address on the stack by making that return address randomly different.
10:44:26
beach
And putting a different return address on the stack is possible because the process has full access to its address space, including the stack.
10:44:59
beach
So if the process did not have access to its stack, this kind of attack would not be possible and ASLR would not be necessary.
10:45:25
flip214_
beach: I thought that your main point in 1.2.4 is that full-address-space access is because of historical reasons, and has quite some security implications - some of which might get better with ASLR.
10:45:57
flip214_
but then you propose an architecture where _all_ things run in the same address space, and could potentially read each others secrets.
10:46:43
flip214_
beach: in your architecture, they won't, but that's not a feat of ASLR. _that's_ why I think ASLR is irrelevant for CLOSOS.
10:47:44
beach
It was not meant to be an argument for my architecture. It was meant to be a description of a kludge that was invented to improve security in a system where the process has full access to its address space.
10:49:47
flip214_
beach: I suggested to shorten the ASLR paragraph (and not remove it), so that it's not forgotten.
11:44:46
pillton
mrblack: You can download the CLHS from http://www.lispworks.com/documentation/common-lisp.html .
11:45:56
pillton
mrblack: In can set where emacs looks up pages by changing common-lisp-hyperspec-root i.e. (setq common-lisp-hyperspec-root "file:///my-fancy-nick/contrib/hyper-spec-7.0/HyperSpec/")
11:48:19
flip214_
when using FORMAT iteration ~:{ ~a ~a ~}, can I make the second element optional, eg. for an input '((1 2) (2 3) (4)) ?
12:04:23
mrblack
Does anyone know why I'm getting an error here? "(equal '(1 2 3) (cons 1 (cons 2 (cons 3))))". I'm using sbcl, and this is a direct copy from the book Land of Lisp (I usually type, but I copy pasted just to check after getting the error). Here are the environment and errors: https://hastebin.com/yimevowome.php
12:09:20
jackdaniel
mrblack: I'm certain that 40 people there will be more interested in basics than 316 people here
12:10:11
jackdaniel
as of cons, it is a two-argument function. lists defined recursively as NIL or cons
12:13:08
mrblack
jackdaniel, I understand that "nil" is the empty list, but what I really wanted to know is why it's necessary in the example...