freenode/#lisp - IRC Chatlog
Search
7:15:01
phoe
I just committed a very short summary of the condition system over at https://www.reddit.com/r/lisp/comments/7xg61l/can_anyone_explain_conditions_to_me/du82y9p/ - I'd like a review of that comment in case I'm speaking garbage somewhere.
7:18:42
jackdaniel
phoe: handler-case unwinds the stack, so claim "Every condition handler is a function, and that function is executed right where the condition was signaled." is bogus
7:19:24
phoe
"That function may decide to unwind the stack which allows for behaviour like C++ exceptions (see HANDLER-CASE)"
7:20:02
jackdaniel
condition handlers *are not always* executed right where the condition was signalled
7:20:38
beach
I think technically it is the function that gets called, and that function may do a non-local exit.
7:21:16
beach
But, phoe also says that execution may continue after a call to a signaling function. I don't think that is the case for ERROR.
7:21:58
phoe
jackdaniel: HANDLER-CASE establishes two functions - a very short handler that just calls THROW #:G123 and performs a non-local exit, and a matching CATCH that contains the main body of the function.
7:22:07
jackdaniel
beach: in case of handler-bind function is called without unwinding the stack (so you can examine it) and in case of handler-case first stack is unwound and then function is called (that's why the first sentence is erronous)
7:22:26
phoe
but that body of the function is *not* a handler itself in the strict meaning - it is not the function that gets dynamically bound.
7:22:38
beach
phoe: That's is kind of misleading in the context though. You give the impression that in (progn (error ...) (fn ...)), FN can actually be called.
7:24:56
phoe
beach: I'm sure that with handler-bind the stack is not unwound and with handler-case the first thing that happens is unwinding of the stack.
7:24:58
jackdaniel
beach: yes, we had to switch to handler-case* in some project to be able to print backtrace of error (not of the handler)
7:25:37
jackdaniel
and handler-case* was a disguised handler-bind which did non-local exit from body
7:26:31
phoe
"Every condition handler is a function, and that function may be executed right where the condition was signaled or it may may decide to unwind the stack."
7:26:55
beach
I am looking at the expansion of handler-case in SBCL, and it looks to me like the handler function is called when the stack is still not unwound.
7:30:49
phoe
The actual handlers in HANDLER-BIND only perform non-local exit to the forms that contain the actual handler bodies.
7:32:14
phoe
Handler as in the function that gets bound by HANDLER-BIND or handler as in the function that actually executes the body.
7:32:50
jackdaniel
most intuitive (for a programmer and from the abstraction perspective) is the function which handles the condition (that is - function written by the programmar who is responsible for higher-level logic)
7:33:23
beach
jackdaniel: But in the case of HANDLER-CASE the programmer does not write any function.
7:34:44
jackdaniel
"Each error-clause specifies how to handle a condition matching the indicated typespec." ← specification how to handle a condition is arguably a handler, and the way it is invoked is implementation detail
7:36:12
jackdaniel
http://hellsgate.pl/files/c4b578f0 regarding backtraces, this snippet illustrates the practical difference ←
7:39:38
phoe
I assume that it first executes the forms it is given and only *afterwards* performs a non-local exit. Which is useful.
7:39:59
jackdaniel
beach: spec also agrees with you "(so that the handlers established around the expression are no longer active)"
7:41:36
jackdaniel
but implementation is not super-compilcated. It looks exactly like handler-case*, but it does evaluate the expression before stack is unwound
7:44:43
jackdaniel
[yet I still think, that saying that handler is invoked before unwinding a stack, while technically in-par with spec is confusing, because expression is what the programmer cares about]
7:45:01
phoe
Because I see that it's correct to name the handler as the part that is bound to the condition but it's useful to name the handler as the "useful" part that calls the forms.
8:18:18
flip214
Hmm, the CDRs on cdr.eurolisp.org/final.html have vanished - this is only a 404 now. Does somebody know the new location?
9:51:01
beach
Hmm, indentation is made much more complicated because of the presence of comments and other elements that are part of the text, but not part of the expression being read.
9:55:17
beach
ACTION instantly regrets suggesting that example; fearing that it will now be debated.
9:56:08
Shinmera
jackdaniel: Not if you expect the indentation to be as much as the comment (like I, and probably beach, do)
10:06:02
beach
And there is of course my favorite example where Emacs indents a LET binding as if it were a form.
10:40:14
dim
so your quarrels about how to properly indent Lisp code... I wish I could still find that funny ;-)
10:43:23
dim
more seriously I tend not to care much and am ok/happy with Emacs defaults most of the time, the SLIME navigation, debug, and tracing facilities are way more important to me than the indenting of the code
10:44:17
dim
that said I have some expressions in the vein (put 'bind 'common-lisp-indent-function (get 'let 'common-lisp-indent-function)) in my cl config for Emacs
10:54:02
beach
dim: What is that you like about SLIME's debugging facilities that you don't have for other languages?
10:55:23
dim
beach: you'll laught at me for that being really the basics, but I love the fact that you can interactively try any function in the REPL and have the “advanced” tracing UI too
10:55:58
dim
the REPL isn't specific to slime, it's quite more powerful in lisp than any other language I've been playing with in the past, apart from Erlang maybe
10:57:16
dim
doing Python, when you have e.g. a small parser to read query timings from a subprocess stdout, and want to just try that function, it's cumbersome, in lisp you just play at the REPL, and if you wonder about what happens when you run the whole program, just trace it!
10:57:32
beach
I definitely won't laugh at you. I am just interested, because I have seen several times in this channel people saying that SLIME is the best IDE, all languages included.
10:59:38
beach
So for instance, I still don't know how to use SBCL to set a breakpoint at any place in the code, run the program until it stops, and then step by expression.
11:00:28
dim
breakpoints... I don't know, I just edit the code with a (break) at the right place, then C-M-x and run my test again in the REPL
11:03:55
dim
basically, half of the people in there use advanced debugging facilities, the other half are like “just add a printf here and there, and think hard”
12:43:32
ludston_
Which implementation of common lisp has a stepping debugger that works intuitively? I haven't gotten sbcls to work either.
13:04:59
Xach
ludston_: I don't know from personal experience, but I've heard the debugger experience on allegro is very good.
13:05:56
Xach
I have used allegro a bit, but never delved deeply into the debugger; I mostly used slime's interface instead.
13:24:40
flip214
Shinmera: when regenerating the ELS webpages you might want to clean up the "../static/proceedings/2017.pdf" and similar links
14:11:10
jmercouris
a way to print up to column x filling with characater? e.g. I want to print "fish" and then however many spaces necessary to make it equal to 10 columns or something
14:12:53
jmercouris
Xach: Cool, thank you, can you also tell me where I may find the other control strings in the CLHS?
14:21:50
phoe
jmercouris: https://www.hexstreamsoft.com/articles/common-lisp-format-reference/clhs-summary/#subsections-summary-table is a summary of it
14:22:56
jmercouris
I spent like 10 minutes leafing through clhs sections to find the ~T operator, I completely understand why you are working on the ultraspec
14:45:12
jmercouris
dlowe: so you wrote another search backend? why don't you publish it to the extensions wiki
14:46:33
jmercouris
Ah, must be nice to be browse the utopianet where all websites accept simple arguments :D
14:48:01
jmercouris
dlowe: I'm just messing with you, I have to shamelessly promote whenever possibe is all :D
14:49:33
Xach
Let me be clear: if you promote the project by berating people for using a "plebian browser", you should not stay here.
14:52:27
jackdaniel
I think it is enough to note, that sarcasm is not welcome here (nor aggressive advertising) and let's move to lisp topic ;-)
14:53:53
dim
jmercouris: I think a proper answer here would be “sorry, I didn't realize it could be taken as offensive and that was not my intention”
14:55:18
jmercouris
dim: I would say that if I could imagine a scenario in which it could be construed offensive, I didn't say something completely unknown, it even has a knowyourmeme page
15:01:43
foom
BTW, next time, if you leave out the "if anyone at all was offended" in the middle of your apology, it would seem more sincere. It's clear that someone was offended, as per discussion above.
15:03:29
dlowe
I'll even start - I think the CLIM backend using cl-charms is brilliant and could really work for climacs or some other CL editor.
15:05:03
jackdaniel
and half of the things will be of course broken (font-size, rendering non-rectangular regions etc)
15:14:06
pjb
dlowe: won't happen, for the same reason as a CL clone of linux won't: the device drivers!
15:14:42
pjb
dlowe: nah, I'm just being pessimistic. It could be written easily since it's just a userland library, and the data files are available and with a public format.
15:14:46
flip214
Shinmera: I meant that you might want to change the link now visible as "../static/proceedings/2017.pdf" to be called like "Proceedings 2017" instead. (The text between <A> and </a>.)
15:19:58
p_l
node.js people put together a termcap/terminfo parser as part of blessed library and use that
15:36:09
beach
dim: How it reassuring that half of the developers don't use good tools? To me, it is very disturbing.
15:37:04
beach
flip214: I don't think that will work, because I want to be able to edit code even though the package has not been created yet.
15:52:08
pjb
beach: remember, every 5 years, the programmer population doubles. Which means that there are basically 50% of -5 year newbies.
15:52:43
shrdlu68
The biggest challenge with writing a curses library in CL is controlling the terminal mode.
15:52:53
dim
beach: paraphrasing the book (which is real good, you would enjoy it), or rather what I recall about it, the more important tool you need is good thinking, the rest just helps with that
15:53:18
pjb
shrdlu68: of course, some CFFI will have to be involved (unless you use clisp of course).
15:54:31
beach
dim: Yes, but the corollary is that if your thinking is already good, it would be foolish to decline the use of tools that may save a lot of time and energy.
15:56:00
beach
pjb: CS teachers are almost 100% newbies. And I can explain that some day if you like. It has to do with the career path of a typical CS teacher.
15:57:25
dim
beach: of course there's something to what you're saying, then there's also the learning curve and investment and triaging the good tools in the myriad of available ones, etc
15:57:52
beach
pjb: In fact, ironically, the typical CS teacher is unfit to teach undergraduate classes (because those classes are general, and they don't have any experience with the general stuff), but they are qualified to teach the masters courses, because they are supposed to be about their research specialty.
15:58:10
dim
CS education is about culture and how to think, in my view, not about how to become a good worker who knows a given toolset
15:58:43
beach
dim: Yeah, tell that to the software industry, and see where they would turn instead to get qualified employees.
16:00:11
beach
dim: Also, tell that to my colleagues worldwide, who are convinced that what industry wants is what industry needs.
16:00:18
TMA
dim: it depends on the school -- some CS uni programmes are more trade school than science
16:01:10
beach
TMA: He is right though. They really shouldn't be called CS. And of course they aren't in most countries.
16:04:36
dim
industry is also famous for wanting to hire juniors, fresh out of school, with low salary because they don't have any experience, but with the same skills as professionals with 2 to 5 years of exeprience
16:05:20
dim
IOW I think the industry perfectly realises that you don't know how to do your job when you're just out of school, and learning that takes a good 2 to 5 years, and that's normal and expected; it's just that nobody wants to be paying for that
16:05:44
dim
but to go from there and say that the public schools should be paying for that is not good thinking in my book
16:08:00
beach
That's a political decision similar to other decisions about industry subsidies. I don't have a problem with that.
16:08:01
beach
What I have a problem with is that my colleagues worldwide truly believe that industry is so good that they actually know what they need, so when the express some desires, these colleagues rush to satisfy them, rather than doing the research to figure out what industry actually needs, and teach that instead.
16:09:47
dim
what about training people to be smart and capable of learning new technologies by themselves thanks to a very solid theoretical background, and then letting them figure out what their employer/customer need?
16:10:34
beach
That is a possibility. It requires a PhD, which industry then won't hire because it is too expensive, and it won't give them what they want (and think they need).
16:11:19
beach
And this is on topic, because in my opinion, industry needs people who know Common Lisp. But industry doesn't know that, because the decision makers in industry don't have sufficient education, experience, and knowledge to know that.
16:11:22
dim
I'm not too sure about that requiring a PhD as opposed to the years of PhD training currently being almost the only ones where we are used to treat students as being smart and capable young adults
16:13:20
beach
In my opinion, most masters students are incapable of reading and understanding research papers, make a literature search, and such. And that is something that is required to determine what a particular employer needs, simple because it is rare that the employer work smack in the specialty of the employee.
16:15:22
jmercouris
beach: are most of the things an employee needs to learn for a job available in the scientific literature?
16:15:43
jmercouris
It is my opinion that most of the things people spend learning are internal processes, programs, culture, things like that
16:17:57
beach
jmercouris: You are right. But I am not discussing what is needed for a job. I am saying the exact opposite, that many employers focus on their internal culture, which is usually very primitive, and they don't know that they could make way more money by doing things differently.
16:19:12
jmercouris
there are sometimes unions of companies that share knowledge with each other, these focus on a "community" of knowledge
16:19:25
jmercouris
I'm trying to remember the term for it, I think it is something like "open innovation network"
16:19:59
jmercouris
I wouldn't know as I've never participated in such a network, but I beleive that they are supposed to serve a different purpose
16:20:20
jmercouris
something about amortizing the cost of developing expensive new technologies, and combining different technologies and patents to produce new products
16:20:33
beach
So we currently have this vicious cycle, where decision makers in industry are using primitive techniques and tools, so they want employees who master those, so they go to the university and require those tools. And my colleagues believe them and teach those tools, thereby maintaining the industry at a very primitive level.
16:20:48
TMA
I think that learning common lisp made me a better programmer even though I never use it in any employment-related work
16:22:25
jmercouris
possibly a very influential book or some "successful company" pitching it, so there can be many copycat companies
16:22:25
beach
If current CEOs make decisions that could be made by a spreadsheet program, they should be replaced by one.
16:23:08
jmercouris
if they make a decision based on some difficult to measure criteria, the shareholders will be at their neck when it goes belly up, regardless of the reason
16:26:42
jmercouris
that's why I also mentioned "copycat" companies, who just kind of steal ideas and attempt to apply them to their company
16:30:23
beach
While there are startup companies and small companies that can make lots of money without being technically very advanced, and instead have good ideas about the market, I am convinced that most developers work for biggish established companies where innovation is not the most important.
16:30:25
beach
Instead, what they need is to improve productivity to keep up with competition. That is where it is important to evolve with new tools, better developer knowledge and experience, etc. And this is failing miserably in most companies. I say that because I have not seen a single such company with a good strategy for improving productivity.
16:32:37
jmercouris
beach: innovation is very important in big companies, at least any with any staing power. when we see an incumbent corporation not innovating it is usually because they are working on commodity product, or there is not replacement technology in the pipeline
16:32:52
jmercouris
the reality is that the market will change, always, for every product, it is not enough to simply improve throughput overtime
16:33:19
jmercouris
even something as simple as "salt" has a market that has changed dramatically in terms of distribution throughout time
16:33:19
flip214
beach: ah, right. well, if the package isn't even defined yet, you won't need any special-case handling, anyway!
16:35:02
TMA
innovation is dangeorous in biggish companies -- it is not predictable; yet it is vital; the solution is to have a specialized department where there are smart people herded with the hope that they will produce something of value every now and then
16:35:38
jmercouris
TMA: That is just one of many strategies, another I talked about is an open innovation network which can reduce the risk, allow for patent sharing among companies etc
16:36:14
Xach
I was thining idly today about how implementations could extend CL in ways that would not be used by existing programs, and the triple colon sprung to mind...
16:36:20
jmercouris
additionally, since technology follows the S-shaped curve, a company need not invest in a technology right away, it's not a bunch of people sitting in labcoats hoping that stuff happens, usually they shoot off some piece of existing research with an expected goal
16:36:31
TMA
except that the innovation shall never touch processes running outside the innovation pen (at least not too substantially)
16:37:05
jmercouris
TMA: Beach: If any of you are interested in innovation practcies, with respect to operational efficiency, I have a good reccomendation