freenode/#lisp - IRC Chatlog
Search
13:54:43
phoe
I know you're pretty disenchanted when it comes to the industry and I kinda share the feeling, but IMO it doesn't make these lispy attempts futile or unworthy in general
13:55:18
beach
iarebatman: Also, if it *does* work, you will have a huge responsibility to make sure Common Lisp is a success where you work.
13:56:10
beach
phoe: I didn't say that. Just that there are strong forces against changes like that, so iarebatman should not be disappointed if it doesn't work.
13:57:41
beach
iarebatman: When I worked in industry (briefly), the way I did it was to show real results even before even mentioning the word "Lisp".
13:58:41
iarebatman
beach: Yeah no worries, I'm not expecting him to fall over himself to let me use lisp or anything.
13:59:40
iarebatman
We just went through a rather large and painful project where we used the wrong tool for the job - so I think I have an opening to at least have him hear me out though.
14:01:08
Xach
I had some success when I was able to prototype a working solution in the time allocated to simply do some research into options.
14:02:32
beach
iarebatman: Good luck. Like they say, it is easier to get forgiveness afterwards than permission beforehand.
14:02:38
Xach
If there is a library to do it already in npm or pip or something, it's a harder sell.
14:03:00
iarebatman
Yeah - there's a decent chance I'll be able to get some time for experimentation.
14:07:19
beach
iarebatman: The other advantage of not asking beforehand is that, since you never were refused permission, it is OK to actually use it, but if you ask and permission is refused, using it anyway would be to disobey.
14:25:16
iarebatman
eh, I understand the concept - but that's not what I'm going to do. It's not my intention to put the company in a bad spot just because I want to do something. I like my job and am friends with my boss (have been for 10+ years) - so I won't try to go behind his back like that.
14:26:16
iarebatman
I've got a good pitch and a decent demo - hopefully that'll sell it enough for an experiment
14:34:57
beach
iarebatman: Can we assume that you know that Common Lisp is not an "interpreted language" and that automatic memory management is not slower than manual memory management. And of course that automatic memory management is a prerequisite for modularity?
14:37:07
iarebatman
beach: Thanks for checking. We're mainly a SQL Server and C# shop at the moment, so pitching that aspect wouldn't really come across as an 'improvement' if you know what I mean.
14:38:55
beach
Then, instead, you might talk about the confusion between representation and encapsulation in languages like C#. With CLOS, encapsulation is handled an orthogonal mechanism called "packages", which makes the entire thing more flexible.
14:39:48
iarebatman
A couple of questions that I would like to have ready answers for are: How hard is it to deploy and keep a CL app up-to-date on internal employee computers? As well as: How can we take advantage of the fact that we can hot-patch systems in production to reduce down-time during updates?
14:42:54
iarebatman
To be honest, CLOS is something I need to obtain more experience with myself - so I can't talk about it with confidence yet. My demo consists of showing me bring in the same dataset with json, csv, xml, excel, and from a database - all to demonstrate they all are lists. Then at the end, I show that these lists of data can be evaluated as code as well. During that whole talk, I plan to go into detail how in c# I'd have to
14:44:09
phoe
re employee computers: you can piggyback on top of Quicklisp and compile-and-load your applications from source on employee machines
14:44:51
phoe
if you create your own internal quicklisp dist, then people can do (ql:update-all-dists) to fetch the newest sources
14:45:16
phoe
or you can distribute ready executable binaries just like you would do for many other languages
14:47:21
pve
iarebatman: I also think CL for quick prototyping and exploring data and databases in the REPL is the way to go.
14:47:21
phoe
as for hotpatching, if you know which forms to send to your live images to evaluate then you send them and they're in the image, working - zero downtime in the happiest case, minimal downtime when you pause the application for the duration of patching
14:47:28
phoe
I'll also do a shameless plug - see https://github.com/Apress/common-lisp-condition-system/raw/master/Appendix%20E/Appendix%20E.pdf for some examples that involve the CL condition system and live debugging
14:53:58
pve
iarebatman: it is probably an easier sell if you present CL as an interactive data exploration tool to be used alongside whatever else you're using, as opposed to saying "let's replace C# with CL"
14:57:48
daphnis
what's the best way to avoid having to confirm the redefinition of every single constant when reevaluating something in sbcl/slime?
15:05:07
jackdaniel
daphnis: if you want parameters, then replace all defconstant operators with defparameter
15:08:56
daphnis
well, the values don't normally need to change, but it's impossible to reevaluate the buffer without reevaluating the defconstants too. but i've just been assuming that values that normally don't change should be defined as constants, maybe that's wrong.
15:10:22
jackdaniel
daphnis: constants may be inlined in functions, that's why redefining them may /not/ achieve what you want
15:10:37
beach
daphnis: If you use DEFCONSTANT with (say) the value of (LIST...) then the value will be different each time you evaluate the DEFCONSTANT form, so it is not really constant.
15:15:45
daphnis
thanks. i'll just use defparameter then until the need for defconstant becomes apparent.
15:33:53
phoe
you can (alexandria:define-constant +foo+ "bar" :test #'string=) multiple times and it won't trigger warnings or errors
15:36:37
jackdaniel
phoe: the reason why defconstant does not allow reevaluating constants that are not eql is to preserve identity between fasls and the image
15:37:09
Bike
the concept of define-constant in my view is for when you want to define a constant but don't care about identity, just some looser measure
15:38:23
phoe
jackdaniel: yes, and A:DEFINE-CONSTANT does not try to work around this; it simply makes it possible to compile-and-load a file multiple times without invoking UB and/or redefinition errors
16:50:02
lotuseater
Hi there :) Has anyone of you already read the new book "Programming Algorithms" written by Vsevolod Domkin? I ordered it from him directly last week but it takes a few weeks to be shipped to Germany.
17:06:19
lotuseater
Just to hear opinions. :) Could be a good completion to the content of the ~15 other main CL books.
17:08:21
beach
I had several problems with the draft, but I think those were addressed before it got published.
17:10:39
lotuseater
okay, I would read and work with it over the holidays, so can give my opinion to you
17:15:14
mfiano
I skimmed the first version, before it was picked up by Apress and was available for free, and I thought that it was very lacking and full of misinformation in regard to the actual algorithms discussed. But, maybe that has changed.
17:18:17
lotuseater
Yes in October there came "CL Condition System", also some aspect which is needed to known more.
17:19:59
mfiano
phoe did an excellent service to the community with that book. The condition system is incredibly powerful, and far under-used, probably due to the lack of good resources on the topic. I'm glad the book is giving it some deserved recognition.
17:20:34
edgar-rft
lotuseater: I do net even get a date *when* it will be available, to me it smells as if they first want enough orders before even start printing
17:21:57
lotuseater
mfiano you're right. just looking at the special operator unwind-protect, awesome
18:59:27
iarebatman
Sorry for the delay - the pitch went pretty well. I have a tentative OK to go ahead and explore using CL where I see fit. His one concern was that he didn't want us to end up with 18 technology stacks, so he said if we go this route that I better not want to change languages again 6 months later.
19:02:39
phoe
apress cannot commit to a release date before the text of the book is finalized - and I have to admit and apologize, I am still doing the last bits of technical review upon it
19:19:45
edgar-rft
phoe: yes, but I'm not in hurry. There are some folks running a book store here who are nearly broke, I want them to make some money.
19:58:35
no-defun-allowed
IT'S JUST NOT THAT BROKEN, ALSO #FREENODE MIGHT BE MORE HELPFUL IN THIS SITUATION
21:15:20
jasom
Just because it's been a while since I used defclass in anger; init-forms cannot depend on initializer arguments directly, correct? So the only way to get fancy with initializing some slots based upon parameters from other slots is an :around method for one of the initialization generic functions, right?
21:22:41
no-defun-allowed
Most code I've read does the opposite. Do you find yourself replacing initargs frequently?
21:23:22
jasom
no-defun-allowed: it's one of the main reason I might use defclass rather than defstruct
21:25:21
lotuseater
jasom could you give a simple example so I can fully understand your question? but sounds interesting
21:25:57
lotuseater
I use defstruct the most if no inheritance (or just simple) is needed, makes objects and everything lightweight
21:26:40
no-defun-allowed
Well, you can always (defmethod initialize-instance ((object <class-name>) &key some-initarg) ...) to get at the initarg, or use the relevant accessor as the primary method for initialize-instance puts initargs and initforms in their slots.
21:27:15
jasom
no-defun-allowed: right, that's what I am doing. Just wanted to make sure there wasn't a better way
21:30:18
jasom
It would be less code and more declarative if I could specify initialization forms as functions of initialization arguments inside the defclass itself.
21:55:37
Bike
if a parameter used by an initform wasn't provided, would you expect an unbound variable error, or for it to default to nil?
21:57:56
jasom
Bike: I would expect it to be like an initarg, and if I needed it to always be bound, I could use :default-initarg
21:58:45
Bike
i don't know what "like an initarg" means. if an initarg isn't provided, a slot's value is unbound, but it doesn't signal an error. what does that mean for a variable?
22:00:25
Bike
what would the slot initfunction be? would it take parameters or would it somehow be a closure? or would there just be no initfunction?
22:00:56
Bike
i'm not asking these as gotchas or anything. people talk about wanting this a fair bit and i'm wondering how the machinery could be set up.
22:06:57
jmercouris
Bike: what is a slot initfunction? a function that initializes the value of a slot?
22:07:51
Bike
when CLOS gets a slot with an initform, it saves the form, but also saves an initfunction, which is just (lambda () ...form...)
22:08:45
Bike
it's faster, and also it allows (let (...) (defclass ...)) to work like you'd expect it to
22:08:59
jmercouris
what I always have done in the past is provide an initform that is a lambda, should I have been providing initfunctions?
22:09:46
Bike
well, it's part of MOP, but you don't really provide initfunctions directly, no. I'm not sure what you mean by providing an initform that's a function. that just means the slot is bound to a function, not that the function is called to produce the slot's initial value.
22:10:49
Bike
oh, i see. in that case i guess :initfunction #'some-function-call would hypothetically make sense
22:11:31
_death
the defmodel macro in cells defines accessors with the instance name "self" and ^reader macros that expand to (reader self) and can be used in initforms.. but I don't think something like this is necessary
22:12:44
phoe
(defun make-foo () (list 1 2 3)) (defclass bar () ((slot :initform (make-foo)))) (slot-value (make-instance 'bar) 'slot) ;=> (1 2 3)
22:13:39
jmercouris
there is something about the name "Mr Bicycle" that just makes me smile, it is funny :-)
22:16:11
phoe
whenever I remember that nickname I get reminded that he's working with drmeister, and that's the kind of drug that he synthesizes with cando in order to produce chemical lisp bikes for proteins to ride on
22:23:13
jasom
Bike: right not an around intiialize-instance that bound the initargs to a special would probably be sufficient for my needs, then I could getf or destructuring bind to get the arguments I want
22:24:25
Bike
the way you can have multiple initargs for the same slot makes destructuring-bind difficult
22:43:03
lotuseater
I hope some day I will understand how clasp and cando or the qvm by rigetti really work. but there is so much more great stuff out in the wilds or waits to be crafted
22:58:27
Bike
clasp is just a lisp implementation, so the hard to understand things are just normal stuff like CLOS initialization
23:02:49
lotuseater
but those are the kinds of stuff I tell about if blub people ask me what you can even do with those s-expressions
23:05:59
jmercouris
my experience with mathematica was quite slow... maybe it was the hardware I was on
23:07:11
jasom
jmercouris: but of course mathematica has a lot baked in, like the famous goat code-golf
23:07:31
lotuseater
once upon a time (a few years ago before I got fully into lisp and haskell) i thought the symbolic math is so powerful. but now i see it kind of low
23:09:23
jasom
I don't know what the mathematica extension is, but if it's e.g. ".m" then one might get a lot of falsely identified mathematica files.
23:14:33
no-defun-allowed
If you have a file with enough define-conditions, it'll decide your Lisp code is NewLisp code.
23:15:37
jasom
phoe: oh that's nice. I last checked this almost 10 years ago, so it's probably much improved