freenode/#lisp - IRC Chatlog
Search
9:28:51
frodef
no-defun-allowed: thanks! I thought I'd tried that, but I guess my brain just bottomed out.
9:44:25
beach
Like I told the #sicl participants, if I were smarter than I am, I would have been able to simplify bootstrapping from the start, but I am what I am, so it is taking me several iterations. But I think it (i.e. the essence of what I need to do for bootstrapping to be understandable) finally makes sense to me.
10:07:43
flip214
luis: please provide some feedback. I'm adding JSON support to swank (instead of S-expressions).
10:08:53
flip214
First I send an S-expr to switch to JSON; but while that changes a slot in *emacs-connection*, the read loop (in another thread) already restarts DECODE-MESSAGE, so passing the "current" slot of *E-C* in doesn't work.
10:09:30
flip214
I can work around that by doing autodetection in READ-MESSAGE - #\( vs. #\[ use the right function.
10:17:35
flip214
Or I could define the decoder slot to be a list of decoders that's tried from the end... then I could append the json decoder, and the already-passed in list would become extended in READ-MESSAGE as well
10:22:34
Posterdati
phoe: I did a looping task tha occasionally could exit from loop and thus get executed
10:23:08
phoe
I don't know if lparallel provides an API for this kind of introspection; AFAIK usually you'd do that by trying to receive-result
10:24:00
Posterdati
phoe: if the task is still executing, does receive-result blocks the waiting task?
11:17:53
frodef
With CL-WHO, how can I emit HTML from a generated sexpr? Like (defun make-input (attributes) (w-h-o (s) (:input ,@attributes) ...)) ?
11:21:55
flip214
frodef: EVAL might help.... but yes, it's a compiler basically, so you'll need to build an (anonymous) function and call it to get the text
11:25:35
no-defun-allowed
The equation looks more like m times slower than n using your server concurrently, where m is your number of threads and n is your number of concurrent users.
12:12:24
frodef
just outputting some "standalone" html is easy, but like my example defun something that "slots in" with cl-who is perhaps less obvious.
12:59:22
jmercouris
I'm trying to understand some pseudocode on Wikipedia and having a bit of trouble with a particular operator
13:01:29
jmercouris
ah damn, I posted the whole file, sorry about that here is what I meant to post: http://dpaste.com/93B9DWF5A
13:17:36
jmercouris
so I guess the assumption is the Neighbors would typically include the node itself
13:48:25
pve
frodef: wasn't there some combination of htm, esc and str that made it work cleanly? Maybe I'm remembering it wrong..
13:59:13
frodef
the cl-who syntax even prevents evaluation where it expects a html keyword. The one reasonable solution i can see (in terms of extending cl-who) would be a magic attribute keyword that evaluates its argument form and inserts it into html.
14:34:10
frodef
jmercouris: how so? Seems to me FOR ... is a variable-clause, while WHILE ... is a main-clause ?
14:37:47
splittist
for-as includes for =. This may be one of the LOOP forms the MIT-derived LOOP's accept, but shouldn't. (And therefore may not in future.) (Do I mean MIT?)
14:39:14
_death
I messed up.. frodef is right.. at first it seemed fine to me, now it's obviously doesn't (looking at the grammar helped, but I doubt I wrote code like it)
14:40:33
jackdaniel
since frodef probably implemented loop from scratch for movitz things like that are very noticeable for him
14:42:16
jackdaniel
why perverse? it is a pita to remember the syntax, but when you have it memorized it is easy to use
14:43:12
phoe
(loop for loop being the source of everything that is wrong and horrible with common lisp do ...)
14:43:45
jackdaniel
someone very accurately pointed out, that lisp is a wonderful for writing dsls and this is a dsl
14:44:45
jackdaniel
loop has some flaws (i.e not extensible per standard specification, its syntax could be more grokkable etc)
14:45:20
jackdaniel
and it is complex enough to take thousands of line of code to implement (unlike do, which is fairly trivial)
15:07:46
Kabriel
frodef, _death is it a syntax error because of clause order, so (loop for item = (pop x) until (null x) do (print item))?
15:09:05
jackdaniel
say x = (1) , first you pop, so x = (), x is null now, so you do not get to the print clause
15:11:38
Kabriel
So is it non-conforming to have a variable-clause after a main-clause in any circumstance?
15:13:38
jackdaniel
it seems to me that way (mind, that your friendly neighborhood lisp implementation will most likely accept that though)
15:14:24
nij
Hello :) I'm reading Graham's /On lisp/. In section 3.4 he talks about functional programming, and some good practice. One of them is the following.
15:14:38
nij
"If a function must perform side-effects, try at least to give it a functional interface."
15:15:17
jackdaniel
it is described later in the book afair - he talks about making it referentially transparent
15:17:47
nij
It all sounds perfectly neat and natural. Haven't had development experience yet. Dunno what real obstacle I will run into in practice.
15:19:55
jackdaniel
pg's preference for functional-like programming seems to be more scheme-like than common-lisp-like
15:23:23
phoe
I like this kind of mostly-functional code style myself; it provides lots of benefits coming from the functional style and some benefits coming from imperativity
15:24:28
beach
nij: On Lisp has a lot about macros, and macro expanders are a good place for functional programming since 1. They are executed at compile time, so not a performance problem at run time and 2. Macro expanders should not have any side effects on the external environment (usually).
15:25:14
phoe
beach: I found point 2 to be more like "macroexpanders should be idempotent with their side effects"
15:26:32
phoe
beach: it's okay for macros to perform side effects as long as these effects are idempotent; interning symbols is the most obvious example
15:26:59
phoe
while doing stuff like creating files or sending network traffic is usually a big no-no because then you have no control over how many times those are performed
15:27:21
jackdaniel
nij: if onlisp is your first programming book (or even common lisp book), I'd rather recommend ansi common lisp, pcl or paip
15:27:27
phoe
due to the fact that macros can essentially be expanded at any time any number of times.
15:27:28
minion
nij: paip: Paradigms of Artificial Intelligence Programming. More about Common Lisp than Artificial Intelligence. Now freely available at https://github.com/norvig/paip-lisp
15:27:32
minion
nij: 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).
15:27:59
jackdaniel
by acl I mean paul graham book ansi common lisp (it has an excellent set of excercises after each chapter)
15:28:34
phoe
I enjoyed PG's ANSI CL book and I can recommend it as long as you disbelieve everything he says about CLOS
15:29:13
curiouscain
Make sure to have a go at writing some macros, not just reading about them. There's a step between reading and writing, where the understanding becomes clearer.
15:37:54
cl-arthur
structs are quicker in terms of access etc. because they're simpler and have very little expressive power and introspection
15:37:57
tychoish
you get different autogetnerated assessors by default and a more compact in memory layout for simple cases (?)
15:39:08
jmercouris
well, I can think of some very performant things in which I've chosen structs, but that is because of the way traversing them is handled
15:39:09
nij
I don't think I'd have problem understanding what macros are.. just have to go there slowly.
15:40:08
curiouscain
Do you have things you want to make, but can't be bothered? Or do you have no ideas?
15:40:25
tychoish
having a small enough project that's like "tractable for a single human," is often the hard part for me.
15:41:54
tychoish
I disagree with team tic tac toe because it feels like an interview question and it never feels worth the time.
15:43:50
jackdaniel
clos is not only defclass vs defstruct kind of excercise, it brings much more - most notably generic functions
15:44:06
phoe
nij: gemini is a network protocol that has gained some fame as of late due to being a better Gopher with SSL and such
15:46:09
curiouscain
nij: Also checkout gemini.circumlunar.space all the documentation is there. The spec is quite simple, relatively speaking.
15:46:16
jackdaniel
defstruct accessors may generally be inlined, because you can't change a structure layout conformingly
15:46:58
nij
I do hope there to be a vim/emacs- like browser that can use all those goodies from the normie world.
15:47:33
beach
So then, it's a completely different issue. Contributing to qutebrowser won't be a Common Lisp project for you.
15:48:12
beach
nij: If you contribute to a project, you can make it better than what you are currently using.
15:50:16
nij
If Nyxt is based on some huge platform that's hard to control.. then it's going to be hard to alter then.
15:54:49
_death
wrt loop what's worse is that I have lots of (loop repeat ... for ...) .. very annoying
15:56:13
Kabriel
_death: I frequently use a pattern for reading text files that puts a termination clause in-between variable initialization clauses.
16:00:05
nij
Maybe which one is going to help me the most if some day I degenerate myself to work in huge companies..?
16:00:27
beach
nij: Since there is no widely agreed-upon definition of "Lisp", some people might include languages that some others think don't belong.
16:01:01
phoe
I find CL really insightful in my daily job even though I do C/C++/Erlang for a living
16:01:30
phoe
the language is an eye-opener due to its inherent multiparadigm nature and the fact that it does its best to get out of the way and let the programmer figure out how they want to approach a given problem
16:01:46
phoe
and then approach it from that point of view without fighting the constraints of the language
16:03:23
phoe
companies are definitely capable of pushing even shitty languages down people's throats when they throw enough money at the problem
16:04:01
nij
I can definitely understand the power and the ease of abstractions, once one masters it.
16:04:36
byallahyourpfpgi
<nij "Maybe it's because it's too easy"> i would lisp really started declining in the 90s due to hype of other langs in the corporate sphere
16:05:09
nij
This is why higher category theory, while on one hand is nice, does not have large community yet.
16:05:37
nij
It's too easy to make itself easier, thus also too easy to make people think they are easier.
16:05:45
hhdave
Apple's Cambridge research lab used to do a lot of things with Lisp, though I think they reckoned the parens would scare away many programmers, so they created Dylan.
16:05:45
tfb
Also there is this myth that lisp is 'declining'. I'm pretty sure there is more work being done in and around CL today than there was twenty years ago. And I was there then (and before).
16:08:15
nij
Sure, the fact that lisp eases the process of abstraction does make life easier. But does it really make your programs easier to read, if you haven't looked at it for ten years?
16:09:08
_death
Kabriel: because I mostly try to keep my loops simple.. https://adeht.org/usenet-gems/one-function.txt
16:09:16
tfb
nij: If the abstractions are good, then they're still easy to read. If they're bad, not so much.
16:09:29
hhdave
nij: that /can/ be a problem with lisp programs. The language is so mutible and the tempation great. Discretion is advised.
16:09:32
nij
Versus in python say, developers are doomed to use low-level functions.. but that makes life easier cuz one does not have to learn all those new functions.
16:09:49
save-lisp-or-die
I've read some cogent opinions about the mystery of CL's underuse in industry that cite "developer fungibility" as the reason large companies prefer not to use lisp. The reasoning goes something like: it is too easy for a single lisper to invent their own conventions & therefore that lisper is harder to replace.
16:10:03
phoe
that makes life hell because you have lots of code that is required to be repeated in many places without the ability to abstract syntax away
16:10:30
curiouscain
That happens in enterprise-type languages anyway though. Applications with things like n-tier architectures are notoriously awful to go back to after a period of time.
16:10:51
phoe
this argumentation is like "we can't use lisp because a single programmer can destroy our codebase"
16:11:12
save-lisp-or-die
I agree - the issue is addressed by codified conventions within a single organization.
16:11:30
phoe
this doesn't talk poorly about lisp, this talks poorly about your corporate development processes
16:12:32
phoe
managers who are fearful enough are already having their fears corporately tended to by Oracle
16:14:51
hhdave
nij: I think programming language popularity is a complex thing, often involving much history and culture as well as technical considerations.
16:16:22
tfb
The argument that all lisp projects end up in their own language built on Lisp is very weak: *all* large projects end up with their own language, it's just usually a shitty language built on strings
16:16:35
nij
I want to share the nicety of lisp to my IT friends. But all of them are working and are "practical".
16:17:08
phoe
you can only pretend that your large project is not its own language because "it's written in Java, look, we use maven to build it"
16:17:46
phoe
lisp just makes this much more explicit because you no longer perform new ContextManagerInstantiationManager(...) and instead you (defmanager ...)
16:24:23
tfb
phoe: except, you don't use maven. You use some configuration management tool you wrote which uses Jinja2 and three other home-made templating systems to write maven configurations
16:25:17
tfb
phoe: and the Java code is also preprocessed by Jinja2 (except you need to use another version of it).
16:26:16
ck_
... but no problem you just open Eclipse and use this dialog to build the configuration and then click here and here and 'ok' -- and then just do it again because the first time always crashes
16:32:14
tfb
(And just to finish my rant, there are lots of configurations you use. They are all slightly different copies of each other. when you find a bug you have to fix it in 248 different places. OK, finished.)
17:26:27
jmercouris
1000 one line functions can be far more difficult to reason about than 5 200 line functions
17:54:15
hhdave
Xach: I think you may have over egged it with circulating the job ad. Ron Garret just emailed me enquiring! (thanks!)
18:12:08
jeosol
had rain this morning, computer tripped off and my runs died. Was able to find the gnuplot issues though, so no entering debugger
18:40:12
jeosol
josh_2: I am running meta-optimization (optimizing and optimizer) and the F(X) for the sub-optimization is very expensive, so it can take weeks. I do a test with a table-look (in the sub)
18:41:15
jeosol
afterwards, I run the more expensive problem. My last UPS powerpack is dead, so I was taking risk to run the jobs. Unfortunately, rain today caused the power to trip.
19:19:21
phoe
minion: memo for pfdietz: I have some people who are interested in your work on random-testing the SBCL compiler and the techniques you used and the effects that it had and the bugs that it uncovered; is there any published code/research that I should link them to?
19:20:09
phoe
minion: memo for pfdietz: also, if you ever have the time to prepare and speak about it, I would love to listen to this on an Online Lisp Meeting someday (and so would these people).
20:25:19
jeosol
josh_2: Now for the meta-optimization part, some people call it meta-learning (in the machine learning community). I have an optimizer (hereafter sub-optimizer) that I want to use to optimize a problem but this optimizer takes some (tuning) parameters, e.g., a, b, c, d, and the setting can make it performance better or worse
20:26:33
jeosol
So now, I push a second optimizer on top of the sub-optimizer (to determine the best parameters for a, b, c,d) while solving the underlying process. It's a very expensive computation
20:27:06
jeosol
It's very specific, perhaps, sometime, I will try to see if I can share results/process. But yes, I use CL for everything.
20:29:18
jeosol
apart from proprietary third-party (FORTRAN) executable does the more expensive forward F(X) calculations
20:29:44
Josh_2
but I assumed (wrongfully) you were talking about code optimization but now I see you mean machine learning it makes a lot more sense
20:29:53
jeosol
josh_2: in my case, I had control for the whole workflow, I just used what was best. The first version from grad school used matlab though, then C++,
20:30:53
jeosol
josh_2: yeah, it is the sense of machine learning. I wish I can make my builds faster though. Fare did tell me to look at poiu but haven't been able to make it work
20:48:02
jeosol
josh_2: sorry i am a bit tired ... hence explanation. But overall experience with CL has been good but I got a lot of help here and comp.lang.lisp (earlier)
21:06:31
Josh_2
Is anyone updating the list at https://lisp-lang.org/wiki/article/recommended-libraries ?