freenode/#lisp - IRC Chatlog
Search
2:36:22
jeosol_
is anyone running a web application and could show me their setup. Essentially, settings behind nginx, etc. My eventual is plan is to move to AWS where I have an instance with SBCL but I have not done much.
2:37:58
jeosol_
I have a bias for production web application and I want to start understanding what is involved so set this up.
2:39:03
jeosol_
but my question is around configuration and deployment, e.g., on AWS. I am able to run simple problems on my machine but want to start looking in the area of deployment.
2:39:06
onion
parenscript is also nice. i have only looked at erlang and haskell for servers before cl
2:39:28
onion
if its an sbcl image, you can connect emacs or other dev ide to it and develop while its up
2:39:49
rme
learningtouch.com is a CL-backed web site. It's hunchentoot running behind an Apache reverse proxy.
2:41:05
rme
If I was setting it up today, I might use ngnix, but there were already other Apache-hosted sites on the same machine.
2:41:54
jeosol_
why nginx? that would be better because I use that for my simple example, but have problems adding hunchentoot as proxy. I have only been able to get hunchentoot to work with apache2 in the past.
2:42:28
jeosol_
if you recommend, nginx, better then. I will just find a setup with hunchentoot as reverse proxy.
2:44:18
rme
Apache was easy for me to set up. Ensure mod_proxy is loaded, and then two lines in the config: "ProxyPass / http://127.0.0.1:9999/" and "ProxyPassReverse / http://127.0.0.1:9999/" and I was all set.
2:46:19
rme
Then there's a startup script (run from rc.local or something) that runs the ccl in a tmux session and then loads a little lisp file that configures and starts hunchentoot.
4:06:49
sukaeto
jeosol_: unfortunately, I can't show any of the code, but I maintain a Caveman2 application running behind nginx: https://github.com/fukamachi/caveman
4:07:38
sukaeto
in production, we spawn of some number (dependent on the number of CPUs on the host) of FastCGI workers, each in its own docker container
5:12:42
jeosol_
those running CL web applications, what do you framework do you use? Hunchentoot (raw), Weblocks, Caveman, ...?
5:17:31
jeosol_
Thanks @onion, I am assuming these are battle tested and can be used for serious production app?
5:18:27
jeosol_
I have a back end application and want to develop the front end part, also using React (recommended by some frontend guy, not an expert in this space)
5:18:30
onion
i think woo might be, i will be choosing that myself, ive seen it mentioned today or yesterday in some project
5:19:08
jeosol_
I did give a try in the past and it's the one I invested the most time when I was trying things out.
5:19:11
onion
for front end i will be using Parenscript myself. dont need react or anything, just canvas or GL here.
5:19:21
beach
No, I mean, check with Shinmera whether your potential choices are "battle tested, etc".
5:20:33
jeosol_
michaeljforter says he runs CL apps in production but I sent him a message on Reddit a while ago to see his setup but got nothing. I assume he was busy and forgot
6:31:40
didi
Hehe. I'm reading CLTL2 and this came to mind: (my-post-defined-fn (progn (defun my-post-defined-fn (x) x) 42)) => 42
6:55:08
beach
It can't evaluate the argument before looking for the function, because then it would not know whether it IS a function, and hence not know whether the argument should be evaluated.
6:56:10
didi
beach: IIUC, it can, because if it is not a special form nor a macro, it assumes it is a function.
6:57:13
didi
beach: I think it just assumes it is, evaluates the arguments, then try to find the function. CLTL2 says this is unspecified.
6:57:40
beach
didi: To find out that it is not a macro, it must query the environment with the function name. Which is what I mean by "look for the function".
6:59:48
didi
beach: I think I'm not understanding you. What I'm think of is (cond ((special-form-p x) ...) ((macro-p x) ...) (t ;assumes it is a function ...))
7:03:09
didi
If it's not a special form nor a macro, it assumes it names a function. It doesn't know yet there is no function named by the symbol.
7:05:09
beach
That's the function that the compiler calls to figure out whether it is a macro or a function or a special form.
7:06:05
didi
beach: It might call it /after/ it assumes it names a function and /after/ it has evaluated the arguments.
7:06:39
beach
Because it would not know then whether it has the right to evaluate the argument, because it would not know whether it might be a macro.
7:06:48
didi
Oh well. The program (my-post-defined-fn (defun my-post-defined-fn (x) x)) evaluated to MY-POST-DEFINED-FN, so I don't know what is happening then.
7:07:55
didi
beach: Sorry, I don't know how to convince you. The program runs and CLTL2 says it is possible.
7:08:43
beach
I am just saying that it has to "look for the function" first, in order to determine whether it has the right to evaluate the argument.
7:09:52
beach
There is only one mapping from function names to function-like things in the environment. That mapping could show that the name is a function, a macro, a special form, or that it is not defined as any of those.
7:10:19
beach
So that mapping has to be queried in order to determine whether it has the right to evaluate the argument.
7:10:48
beach
Querying that mapping is "looking for the function". There is no other way to figure that out.
7:49:57
didi
Hum. Apparently the macro `defvar' has a special way of dealing with its parameter `initial-value'. Something about only evaluating `initial-value' on use? I don't understand it.
7:50:46
didi
beach: No no. I mean "The initial-value form is not evaluated unless it is used; this fact is useful if evaluation of the initial-value form does something expensive like creating a large data structure. "
7:52:25
beach
The Common Lisp HyperSpec says: initial-value---a form; for defparameter, it is always evaluated, but for defvar it is evaluated only if name is not already bound.
7:53:06
beach
So DEFVAR first checks whether the name is bound. If it is, then the form is not evaluated.
7:53:55
beach
So if the form has side effects when evaluated, then those side effects will not happen if the name is already bound (with DEFVAR).
8:02:05
loke
beach: OK, I now have a very basic Maxima interaction session working. However... I have a problem that you might be able to explain.
8:04:45
loke
beach: I'm not sure I want. But I discovered that behaviour and I wanted to understand why.
8:06:20
beach
And those streams are selected automatically as one of the interactors panes (if one exists) unless you tell it otherwise.
8:06:29
loke
OK, Maxima is strange... If I input “x/y”, maxima will return a symbolc equation that looks like this (simplified): ((MTIMES) $X ((MEXPT) $Y -1))
8:07:19
loke
that is mathematically correct, for not what the user expects to see... How, Maxima's default renderer to text will actually render that as “x/y”, so there is some kind of simplification phase happeneing. I can't for the life of me figure out where that is done though.
8:08:36
didi
Uh, so AFAICT the definition of "lambda-expression" changed from CLTL2 to the standard. CLTL2 says a lambda-expression can't be meaningfully evaluated, but the standard says there is a macro `lambda', which by being a macro, can be meaningfully evaluated.
8:13:48
didi
I assume (function lambda-expression) works because we can use lambda-expressions in the place of function names.
8:19:26
pierpa
No, I misremembered. It is ok. http://www.lispworks.com/documentation/lw70/CLHS/Body/03_ababd.htm
8:20:24
didi
Oh, it even calls "a lambda form", where CLTL2 says it isn't a form, because it can't be evaluated.
8:41:59
beach
didi: Since you are reading CLtL2 and since we discussed when functions are "looked for", check section 8.5, page 209. There is a function FUNCTION-INFORMATION that is not in the Common Lisp HyperSpec, but basically the compiler of every implementation must use something similar to find out what a name in a function position means.
8:49:48
schweers
do I read the hyperspec on aref and bit correctly, that the standard does not specify what happens when I attempt an out ouf bounds access? sbcl seems to throw an sb-int:invalid-array-index-error. I guess it depends on the debug optimizations?
8:52:18
beach
schweers: It also doesn't specify what happens if you give something other than an array to AREF.
8:54:43
beach
The fact that there are so many undefined situations in the Common Lisp HyperSpec is the reason I started the WSCL (pronounced "whistle") project.
8:56:27
beach
I am repeating it for the benefit of those #lisp participants who didn't see it that time. :)
8:59:44
pierpa
Duh. Thanks for the reminder. I was already watching the project but I had forgot about it :(
9:18:55
beach
flip214: For WSCL? My current thinking is to avoid new functionality. A good existing Common Lisp implementation should already be a WSCL implementation, or at least nearly so.
9:21:39
beach
schweers: At the moment, I haven't done anything. But I don't intend to add new functionality. I only plan to specify many of the things that the Common Lisp HyperSpec leaves unspecified. And it should be such that the most common implementations already specify those things in a reasonable way.
9:22:33
schweers
maybe I didn’t make clear what I meant. The standard doesn’t specify what happens when aref is given an out of bounds index. You specified what should happen in WSCL?
9:23:39
schweers
And you only specify behaviour, which at leas one existing implementation already does? For instance, as sbcl throws an error, you might specify that an error should be thrown?
9:24:40
beach
[errors are "signaled" in Common Lisp. Not thrown.] Sort of. I do not plan to check whether at least one implementation does what I want. So it might be the case that for a few cases, no implementation does the right thing.
10:24:44
beach
In fact, if someone could help me set up the dpANS files so that I could do a single `pdflatex' to compile it, then that would help immensely.
10:25:19
beach
Also, someone pointed out that I am not using the most recent version of dpANS, which I didn't know. I would like to do that of course.
10:34:08
pierpa
Perhaps it would be easier to start from the CLHS? It should be way easier to reverse engineer
10:52:21
beach
pierpa: TMA is right. The Common Lisp HyperSpec is copyright by LispWorks and they do not allow derived work.
10:53:26
beach
shka: Doesn't matter much. I mean, phoe has already removed that problem essentially, by creating CLUS.