freenode/#lisp - IRC Chatlog
Search
18:31:08
sukaeto
my company has a handful of them, we get payed more than we would if we were professors
18:32:02
sukaeto
that being said, there are people on my team whom I know make more than I do because they've been in industry for longer than I have and also only have undergrad degrees
18:33:34
jasom
sukaeto: on the other hand, after my Dad got his PhD, he had more than one job interview end with "We don't hire people with PhDs"
18:36:44
sukaeto
jasom: I've gotten that too. I was even told by one company that they were looking for someone with more experience for an entry level position! As if being from academia meant you had negative work experience!
18:39:32
sukaeto
I know another guy with a PhD who works for a company that generally has a disdain for people from academia (he only got in there because of another guy who knew him and lobbied hard for him)
18:39:50
sukaeto
from what I know about that company and their engineering practices, I wouldn't want to work there.
18:40:01
jasom
I think that "PhDs can't code" probably stems from the fact that many places use general CS knowledge as the gateway to hiring, and obviosly, if two people have equally bad coding skills, the one with the PhD will have better general CS knowledge
18:40:28
sukaeto
it's probably not fair to extrapolate from that one example to every company that refuses to higher people with terminal degrees, but it does make me wonder.
19:10:45
TMA
there was a joke told before the fall of the eastern bloc: a professor learned that factory workers have higher wages than professors. He dressed down and applied. After several months there was an annoucement that those that will attend evening high school will get a raise. He went there, math exam question: compute the area of a circle. He did not remember the formula, so he derived it using integrals, but the result was -pi*r^2. He looked at it baffled when there c
19:12:02
TMA
... there came a hint from another student: "you have swapped the limits of the integration."
19:13:55
TMA
the sad part is that the wage disparity was real then -- the educated were not the "preferred" [[in a sense it is still the case, because of the model of financing universities here]]
19:21:06
dTal
A mathematics professor and their student are eating lunch in a cafe. The professor laments that regular folk just aren't educated or interested in mathematics. While he's in the toilet, the student gets an idea. He calls over the waitress, slips her $5, and says "In a minute, I'm going to ask you a question. I want you to answer 'one third ex cubed'." The waitress agrees.
19:22:58
dTal
The professor returns from the toilet and the student says, "You know, you're wrong about people. I bet you $20 that our waitress can do at least basic calculus." The professor scoffs and readily agrees to the bet. So they call the waitress over.
19:23:53
dTal
The student says to the waitress, "We were wondering if you could settle a question for us. Could you by any chance tell us the integral of ex squared?"
19:26:18
Bike
that was my fingers being misaligned with the contacts of my electromechanical data input device
19:28:19
jackdaniel
beach: phoe: guess what I found today in clim-inspector sources? (one of the top lines)... "(define-modify-macro togglef () not)" ^_^
20:20:24
__rumbler31
when I need to quote something that would otherwise make escaping natural quoting rules insane, I used it once
20:21:06
__rumbler31
it made integration a little tricky, because the package has to be loaded before code that depends on it can be loaded and at the time I didn't know how to automate that without opening up the repl and doing them one at a time
20:21:53
__rumbler31
I used it to house an xml document representing an android framework on a string, without having to escape all the "
20:56:25
razzy
hi, is there a way to crawl in functional program and display a topology of nested functions??
20:59:20
jmercouris
razzy: if you can generate an AST you can also generate a tree showing the nested functions
21:05:27
jmercouris
abstract syntax tree, it is an intermediate representation of a piece of code that has been parsed
21:06:45
jmercouris
anyways, the wiki page is pretty good for this concept actually: https://en.wikipedia.org/wiki/Abstract_syntax_tree
21:08:01
jackdaniel
if yes, could you name three special operators and why they are not ordinary macros?
21:08:48
jackdaniel
no, it is designed to make you realise something (and prevent you from wasting time, or at least to estimate effort more accurately)
21:09:11
jmercouris
don't worry, I won't venture to build one for Lisp, I've spent enough wasted time trying to implement languages :D
21:10:15
jmercouris
jackdaniel: it feels more like a challenge due to a manner of phrasing than a friendly suggestion at introspection is all, there seems to be some communicaiton barrier between us. I'll henceforth always assume your intent is positive
21:10:22
jmercouris
because it turns out to be so more often than not, and I am just misunderstanding
21:12:54
razzy
yop, AST is what i mean :]. it shine when you do have purely functional code. you could notice bad behaviour from one look at topology :].
21:13:41
Bike
implementations can provide information about what functions are called by a given function
21:13:59
Bike
they sort of have to know, for linking reasons, and you can sometimes get the information from like slime-list-callers
21:17:33
jackdaniel
(because you never know if it has some sneaky special operator in ext package and which is used in expansion of standard macros)
21:17:35
dim
razzy: have a look at https://www.informatimago.com/develop/lisp/ I think it contains helpful bits you might need here
21:20:43
Bike
well, you can use swank/backend:who-calls and such and put that information together into whatever graph you like
21:25:16
Bike
do you need to do it from source, or is having the actual functions in the image okay? because if it's the latter i'd really rely on the introspection tools
21:39:14
jmercouris
I seem to remember sometime ago there was a discussion about the origin of the mach kernel in apple, I found a handy diagram here: https://en.wikipedia.org/wiki/Darwin_(operating_system)#/media/File:Unix_timeline.en.svg
22:14:05
jasom
jmercouris: walking the AST is hard in lisp primarily because of two reasons; firstly there are macros; e.g. you can guess that this binds x, but can't know it: (with-foo (x :y z) (bar x))
22:15:40
jasom
jmercouris: so you say "just expand all the macros before walking" which brings us to the second problem; the CL standard permits standard special forms and macros to be expanded into forms that do not exist in the standard, so you can end up with code that could do anything.
22:16:57
jasom
if you were to reimplement all of the evaluation rules for all standard macros and special forms, then you could selectively expand macros not in CL, and possibly end up with something sane.
22:18:26
jasom
but even then you have things like backtick, which can expand to non-standard forms at read-time :(
22:21:11
jasom
not sure what that expands to in ccl, but I'd bet a large sum of money that it's not SB-INT:QUASIQUTE
22:23:37
Bike
i think the only sbcl code walker problem, i.e. the only special operator that's messed up implementation specifically, is the extra function names FUNCTION allows
22:24:21
Bike
there's an sb-ext:truly-the special operator, but it has a macroexpansion into the as it ought to
22:25:29
Bike
hmm, i might be wrong, there's another half dozen special operators i've never seen before...
22:28:19
Bike
though i don't think %primitive is going to show up even in macroexpansions, it's just for inline expansions at worst
22:45:14
__rumbler31
yea I don't understand this thread, but i'm intrigued, and have to go. Happy V day y'all
23:15:36
otwieracz
https://gist.github.com/otwieracz/db012be5e986dde28d518aeb8ff593dd I've got some lparallel magic here - it breaks read-write lock implementation.
23:16:13
otwieracz
Regular BT threads work just fine, but when I try to use it inside lparallel channel - magic happens and stuff breaks.
0:14:51
dto
i'm curious to know if you have any thoughts or recommendations on day planning? https://i.imgur.com/mym4DKo.jpg i'm working on some lisp to make nice cards
0:18:37
jasom
otwieracz: it looks like you are exiting your lambda without releaseing the lock; did you try a test where your thread performs the lambda many times?
0:23:12
jasom
hmm, I wrote a test that does it and it completes, but the mutex was still being held by an exited anonymous thread
0:24:37
jasom
otwieracz: try running test2 two times in a row, it will deadlock waiting on the mutex the second time
0:33:19
jasom
otwieracz: sorry that was wrong; if you run test2 rwlock-resource is still owned by an exited thread despite the rcount being zero
0:41:27
jasom
otwieracz: adding a (print (rwlock-resource rwlock)) immediately after the release-lock line in read-lock-end shows the lock as still being owned. This is bad
0:43:39
jasom
otwieracz: aha sbcl's mutex release silently returns if the current thread is not the owner. You want a semaphore, not a mutex for rwlock-resource
0:50:36
jasom
otwieracz: I have to go, if you still haven't figured it out in a couple hours I'll comment on the gist with a fix
0:58:48
emaczen
how can I force ASDF to force load all systems or is that what the :force keyword does specify?
3:27:34
White_Flame
but yeah, it probably doesn't know defpackage, so it's trying to evaluate the arguments
5:07:53
whoman
class definitions especially, i think method/generic is quite nicely clean. maybe i will make a macro for myself for defclass, i find it is unnecessary to (slotname :initarg :slotname :initform nil ..) rather than just (slotname) but perhaps it is my reading comprehension that is not verbose enough
5:11:22
whoman
hmm true about java.. i am also overly accustomed to class definitions being in one place/block with the associated methods/interface
5:15:12
pillton
It is wrong to think that generic functions are equivalent to methods/interfaces in C++, Java and Python.
5:23:28
beach
whoman: The reason for the slot options is so that you can apply fundamental principles of software engineering, such as access control, abstraction, data hiding, etc. If you remove those options, those aspects can't be controlled. But perhaps you are not used to programming in large projects where several people need to collaborate and where long-term maintenance is a real concern.
5:27:02
beach
This is also why most people here reject any attempts at "simplifying" class definition by defining a custom macro with fewer slot options. Usually, such attempts boil down to not caring about the difference between interface and implementation.
5:29:04
whoman
i can fully understand these things =) but, to type the same slot name twice i feel could be optional
5:33:47
rme
Lots of people try writing a defclass wrapper macro. Many ultimately decide it was a bad idea.
5:34:13
beach
Because then, when you reload the class, the slot will get a different name, and you will have huge classes in the end with lots of gensymed slot names.
5:34:57
beach
whoman: Furthermore, CLOS needs to know to merge slots with the same name in subclsses.
5:35:26
whoman
hmmm. what do people use as convention for slot/accessor name differences? i've seen '%'
5:36:32
beach
whoman: That's what I use. Some people put a suffix -of on the accessor. Not many people like that convention though.
5:37:11
beach
whoman: You may want to have an exported reader and a private writer, so you need two different names.
5:38:16
pjb
On the other hand, often (99.99%) slots are not sophisticated: their accessors don't do anything but setting or reading the slot.
5:38:51
pjb
And if they do something, often (0.009999%), they do something that is systematical, so you do want to generate them with your own macro.
5:38:55
beach
whoman: Also part of the verbosity you see is that in Common Lisp, you can write :ACCESSOR BLA wheras in Java, you have to write separate get_bla and set_bla functions which is even more verbose.
5:40:48
whoman
pjb, i agree there, but maybe then one should be using structs for the simple objects
5:41:16
pjb
If only you could redefine structs easily, and if only their accessors were generic functions…
5:41:39
beach
whoman: There is just so much variation between :initform or not, between a single :initarg or several, between :reader or :accessor, that it is usually not worth the effort to try to simplify.
5:42:41
pjb
When I say write your own macro, it should not be purely syntactic. It should be motivated by semantic reasons. For example, you can write a define-entity macro.
5:43:24
pjb
At the application level, you don't care about slot names vs. accessors, and what mechanism you have to put into accessors automatically. This should be abstracted in an application-level define-entity macro.
5:44:40
pierpa
defclass being verbose, means one has a few seconds more to think about what they are doing :)
5:45:42
pjb
That said, using a define-class macro with the same syntax as defstruct is a nice way to upgrade your structures to classes.
5:48:07
whoman
all of it agree! thanks guys =) the most i will do for syntax is to split up single slot defs on different lines, for my requirements of visualising my datatypes. then, doing the right thing at the application level.
5:49:07
whoman
i see a lot of lisp code that is too 'bare knuckle' , directly using low level system ops in application level. i definately feel the same, that building up higher level DSL to the application itself is the right way
5:49:44
whoman
i think the gap between "bad" lisp code and "good" lisp code is not as wide as with say, C or Java =)
5:59:37
beach
Well, C is a strange thing. Because of lack of capabilities for abstraction, it is unfit for application programming. And in order to use it for system programming, you often have to rely on behavior that is undefined in the language definition and therefore specific to a particular compiler.
6:13:21
stylewarning
But C is easy to write in the sense you can vomit something into your text editor and it will compile and behave approximately correctly
6:23:17
stylewarning
Yeah, “approximately correctly” should have been “remotely correctly but good enough for managerial sign off”