freenode/#lisp - IRC Chatlog
Search
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
5:56:56
beach
Do you mean "why is it theoretically impossible?", or "why is the world currently set up so that it can't?"
5:57:46
beach
As I understand it, it can. But I am not very good with web stuff, so I'll let someone else answer that.
5:58:22
Usersda
theoretically a server could be set up to parse a lisp convention/dialect the way it interprets html, no ?
6:06:34
no-defun-allowed
I think Tymoon uses a HTML-lookalike templater, which you can put embedded Lisp forms in. At least the plaster tool did when I modified it.
6:08:15
no-defun-allowed
You can generate HTML, CSS and JavaScript from Lisp macros, and I've used some libraries for those a few times before.
6:17:35
Usersda
what i mean is, why does firefox for example interpret html, but any number of browsers can't read a lisp file. can't lisp be written in a hyper text markup way ?
6:18:26
beach
Usersda: You are basically asking why current technologies have made crappy choices. That's a very tough question.
6:20:45
phadthai
(:html (:head (:title ...)) (:body ...)) ? If so some systems provide macros for such
6:21:09
beach
Usersda: Yes, it's all habit. Like I often put it, people spend a lot of time and energy to avoid having to learn Common Lisp.
6:23:01
Usersda
more complex reltionships like DOM in javascript, frames ect could all be expressed in the same language. Instead of having employers for instance asking you if you are proficient in spanish, arabic and chinese, they would be like, how experienced are you with english applied to dynamic web design.
6:24:35
no-defun-allowed
If I redid the web, I would make it a distributed object system, and ask objects to draw themselves on the screen and handle events, instead of emitting a markup language no one knows how to reimplement.
6:25:30
no-defun-allowed
But, yes, you can make an Uber clone using Lisp libraries. (Except that it won't handle the legal actions to not consider your drivers employees.)
6:25:34
Usersda
Like i was recently getting a quote from linode, and their estimate wizard was intense. I still don't know if I were to rent some server space, would i be able to implement lisp in a large production that can scale.
6:25:58
fiddlerwoaroof
If you want to generate HTML for a website, you can use something like spinneret
6:28:34
no-defun-allowed
Usersda: We have run projects on OVH with a small budget. There is also Heroku (with <https://github.com/jsmpereira/heroku-buildpack-cl>) which is free, if you can handle the "serverless" management stuff they do.
6:29:50
Usersda
fifflerwoaroof: i'm not so much exploring ways to translate. I'm wondering what the actual advantage of html is. Like the chinese counting system is said to be easier or faster to sum totals. to
6:30:24
no-defun-allowed
A web browser is the most portable virtual machine ever made. Even Java doesn't have nothing on its usage.
6:30:27
fiddlerwoaroof
Most things are the way they are because of relatively arbitrary decisions made sometime in the past
6:30:57
fiddlerwoaroof
Now, we're stuck with HTML/CSS/JS just because people already know them, so it's easy to find people to work for you
6:31:47
fiddlerwoaroof
It's an annoying cycle, and it's nearly impossible to break because unusual technologies generally get scapegoated
6:32:55
fiddlerwoaroof
The fact is, when it comes to things like picking programming languages, companies look for the languages that are easiest/cheapest to hire for
6:34:21
Usersda
well python is only easy/cheap to hire for because it blew up in the 2010's for some reason.
6:34:26
no-defun-allowed
Efficiency is not well defined. "The cheapest to hire for" may be the most efficient to an accountant.
6:35:00
fiddlerwoaroof
Something like Java is popular because Sun and other companies spent billions of dollars marketing it
6:35:18
fiddlerwoaroof
And then universities all decided it was the future and started teaching it to everyone in CS
6:35:23
Usersda
i can define it as such : if i have to hire someone who has to be experienced in chinese, spanish and arabic to write an ping pong slideshow in english....like wtf ?
6:35:45
fiddlerwoaroof
The thing is, programming languages aren't as hard to learn as natural languages
6:36:12
fiddlerwoaroof
I can, and have, gotten a job writing mainly a language I didn't know and learned enough to do good work over a couple weeks
6:36:35
Usersda
even before i came accross lisp i would look at python and c++ and be like...there must be a better way.
6:37:40
Usersda
it's really affecting me, because i feel like lisp was hidden from me *insert zoolander crazy person meme*
6:39:21
fiddlerwoaroof
I learned it a long time ago, and I never really noticed marketing the way Java was
6:39:39
fiddlerwoaroof
But, I think libraries like numpy and it's relatively readable syntax made a huge difference
6:40:04
no-defun-allowed
(I really dislike most pseudocodes, so that's not a very high standard. But they do say that.)
6:40:33
fiddlerwoaroof
And, it's standard library has enough to cover most of the utility scripts I write
6:41:02
fiddlerwoaroof
There are some things that are really annoying to do in CL: like, there's no high-quality library for dealing with IMAP
6:42:28
Usersda
technically we could have different formalization of lisp for web service and a different one for locally executed scripts. The way you don't use the same terms and structures or tones at church as you do with friends.
6:44:45
Usersda
"The original Interim Mail Access Protocol was implemented as a Xerox Lisp machine client and a TOPS-20 server. " wtf
6:47:27
Usersda
even reddit was originally written in lisp. then all of sudden somebody decided we needed 50 languages and 3 years of comp sci to work on a underwear renting website.
7:04:07
Usersda
"Our point of view is that most data bases are accessed by programs written in several differentlanguages, and we do not see any programming language Esperanto on the horizon." lol
7:16:07
Usersda
which in light of the constant cature of lisp projects by other languages once they start scalling , is like illuminaty territory
7:18:38
Usersda
anyways , thank for your input friends, i get mad sometimes so sorry about the rants , i just feel like so much time has been wasted
8:54:13
jeosol
I recently dabbled with it again, and someone here ( i forgot who), I think Luis, showed me some lisp interface libs
8:55:08
beach
My (admittedly small) family was in charge of the documentation for CPLEX for a long time.
8:57:02
jeosol
btw, been trying to do remote calls to scale my applications. I recently started using docker and learned about swank-client.
8:59:04
jeosol
I am doing some benchmark now running async jobs, seeing how may connections I can make to a docker running lisp (one container).
9:07:49
beach
Actually, Bike and karlosz are the ones working on the compiler these days. I am doing bootstrapping.
9:10:29
beach
jeosol: We have also forked off a few projects. Eclector is quite good these days. Trucler (lexical environments) seems to work. So does Clostrum (first-class global environments). Incless (Common Lisp printer) is being worked on.
9:12:07
beach
And of course there are several tools that are independent from the SICL project, like Clouseau, McCLIM, CLIM flamegraph, etc.