freenode/#lisp - IRC Chatlog
Search
4:33:01
beach
Wouldn't it be great if there were video clips with the same quality of that by Kiczales, describing Common Lisp?
4:39:18
beach
I can't figure out how the authors of this paper: https://chrisseaton.com/rubytruffle/pldi17-truffle/pldi17-truffle.pdf could write the second paragraph of the introduction.
4:41:38
beach
But I am surprised that those VMs were written that way, and I am surprised that the authors seem to take it for granted that things have to be written that way.
4:50:11
asarch
(CLIM-DEMO:DEMODEMO) is complaining about "There is no thread support in this instance.", however, in the compilation of the SBCL binary: "Enabling threads due to --fancy."
4:52:30
aeth
I think this means it is :SB-THREAD in *FEATURES* "Users of a Lisp built with the :sb-thread feature should also read the section about threads, Threading." http://www.sbcl.org/manual/index.html#Threading-basics
4:53:01
no-defun-allowed
apparently (defmethod closer-mop:slot-value-using-class (class (instance netfarm-instance) slot-definition))
4:53:16
aeth
I'm surprised the mention of :sb-thread is just that sentence in "9.7 Foreign Function Calls" and not in the threading section, though.
4:55:27
aeth
no-defun-allowed: Here is a simple but functional use of the MOP in my game engine to guarantee type checking in certain places (since :type can be ignored, and is ignored in SBCL by default). https://gitlab.com/zombie-raptor/zombie-raptor/blob/48a75d6b543950c3581e5f413be8bd5c4cf3a357/util/metaobject.lisp
4:55:34
beach
no-defun-allowed: There is a very general rule in CLOS programming: you are not allowed to write methods that are applicable when given only standardized objects.
4:55:43
aeth
no-defun-allowed: It's very close to the minimal, and it was an all day trial-and-error process, so maybe you can learn from that and skip a day
4:59:27
aeth
no-defun-allowed: https://gitlab.com/zombie-raptor/zombie-raptor/blob/48a75d6b543950c3581e5f413be8bd5c4cf3a357/data/shader.lisp#L42-80
4:59:55
aeth
only additions were (:metaclass checked-types) and the line ":checked-type foo" for most of the slots
5:00:10
aeth
The deletion was a lot of the docstrings that said how to use it correctly, since now it can be enforced with an assert
5:00:32
aeth
(You can't use check-type because check-type takes unquoted types... Well, you probably could with some kind of eval or a macro or whatever, but that's messier)
5:02:22
beach
no-defun-allowed: SBCL will check the types of slots if you have a sufficiently high value of the DEBUG optimize quality.
5:04:08
aeth
Yes, my solution isn't the only solution. I could have written a defclass* macro that wrapped defclass to enforce a higher debug when SBCL was being used. That could have other unintended consequences, though.
5:05:25
aeth
I was using it as an example of something that's very close to the minimal MOP usage, though.
5:36:54
beach
So two very disturbing pieces of information in the past 24 hours: 1. There are researchers out there who assume that a high-level language has to be implemented using an interpreter plus a compiler plus a runtime written in C or C++. 2. The video by Gregor Kiczales shows that there are very knowledgeable out there, and most of this essential knowledge seems to have been lost.
5:38:43
beach
p_l: The first two paragraphs of the introduction in this paper: https://chrisseaton.com/rubytruffle/pldi17-truffle/pldi17-truffle.pdf
5:38:56
no-defun-allowed
so i have some key->value mappings which represent an object loosely, and i don't want to intern those
5:39:53
no-defun-allowed
so i use a hashtable which stores those mappings, and i'd like SLOT-VALUE to look up the names of symbols in that table
5:40:49
beach
no-defun-allowed: It sounds like you need a new metaclass. That can be very tricky because there is a lot of functionality you then must provide.
5:41:36
no-defun-allowed
i do have a metaclass which i can create classes with but i think i'm missing some components
5:42:14
beach
no-defun-allowed: I don't think you can get away with a "cookbook" technique for that. You need to understand a large part of the MOP.
5:42:29
no-defun-allowed
afaik that method never gets called, trace prints out nothing, and inspecting the class creates a stack overflow
5:46:33
p_l
beach: while I generally agree with what you said on #1, I'm not sure I see it in this paper, other than description of typical VM built in style of Self HotSpot compiler
5:46:34
no-defun-allowed
maybe something lingered from testing, so a new environment would be better
5:47:16
beach
p_l: You are right of course. They don't explicitly say that it has to be done this way, only that the examples they use are written that way.
5:48:08
p_l
interestingly enough, an example they call in later (PyPy) is also at least somewhat self-hosted
5:48:11
beach
p_l: Nevertheless, it is depressing to me, because I was expecting something like "This is of course not the only way to implement a programming language..."
5:49:08
p_l
in my charitable reading of it, it still looks like there's assumption of "runtime" written in C
5:49:31
beach
no-defun-allowed: There might be methods on other generic functions that you have to supply as well.
5:54:37
p_l
skimmed the paper, need to pack to visit a rather unwelcoming country, but I think the techniques could be implemented in CL to implement the same languages with greater success
5:55:50
beach
no-defun-allowed: Since your metaclass is a subclass of standard-class, the rest of the machinery still does what it always does. There are very likely other generic functions that need to be specialized as well.
5:57:02
beach
no-defun-allowed: You might want to check Pascal Costanza's implementation of LETF (this is from memory) where the slots are represented as special variable to make it thread safe.
6:02:47
no-defun-allowed
okay now setting a value in the hashtable works and the method is called, but (slot-value instance 'foo) still doesn't pick up the "slot"
6:03:06
p_l
beach: well, yeah, the atmosphere in some places can be bad from what I hear, but so far a weekend visit to London or my alma mater does not involve forms rivalling NATO SECRET access forms
6:11:43
no-defun-allowed
beach: would it be a bad idea to write methods on SLOT-MISSING then? that actually gets called consistently on testing
6:21:06
p_l
beach: I was wondering about dropping at MIT for a moment, but I don't think I'd get to see much of the stuff that interests me
6:23:30
beach
no-defun-allowed: Sure, but I doubt that the lack of such methods is the origin of your problem.
6:24:02
beach
p_l: I don't think there is anything to see. But you might catch some people, I guess.
6:25:09
beach
p_l: I know what you mean. I will again refuse to go with my (admittedly small) family to the USA for the holidays.
8:05:59
splittist
ACTION has been enjoying a holiday from all news. It would be a pity to have to avoid #lisp, too
8:10:40
equwal
https://retractionwatch.com/2017/02/20/placed-much-faith-underpowered-studies-nobel-prize-winner-admits-mistakes/
8:34:55
no-defun-allowed
some CL book called missing features a euphemism for a bug, does anyone know which one that is?
8:39:10
beach
equwal: I think it should be part of the job description of software developers and computer scientists to systematically mistrust the fast module, and to systematically combat the closed mindset ("performance oriented" in my essay).
8:40:44
equwal
I think so too. The "fast module" is what it feels like to work at McDonalds. We can't do that.
8:41:54
beach
You would be surprised how many times I have observed software developers believe the fast module, thereby creating huge amounts of work for themselves as a result of a "hunch" that is just wrong by orders of magnitude.
8:53:32
jackdaniel
since programmers (and computer sciencists) work with programs on regular basis, their "fast module" may be actually great (I think it was also stated in Kahneman's book, that "fast module" proofs to be very solid when we talk about experts)
9:52:43
makomo
speaking of talks, another nice lisp-related video, from the guy who made cl-6502 https://vimeo.com/47364930
9:59:16
elderK
Unless it's for stories - I have a real problem of starting technical books, reading half way, then moving on. It's different for references like say the Intel manuals or CLtL2 - as I refer to them over and over and over, random access almost.
10:25:28
elderK
You know, the more I read, the more I realize the same concepts seem to be discovered again and again but each time with different names.
10:25:45
elderK
As I read this stuff about "meta-level architecture", I find myself constantly thinking of "policy-based design" in C++ template metaprogramming.
10:26:43
elderK
I wonder how much is just a simple case of being influenced by say, Lisp or Smalltalk.
10:27:34
fiddlerwoaroof
And the similarities aren't entirely accidental: for example, Guy Steele was part of the group that made Java
10:32:52
elderK
Still - and maybe I'm just getting jaded - I wonder how much of it is NIH and people kind of build their own version of hte SAME thing and give it a new name
10:33:25
elderK
But often time these days, at least in the web sphere - there seems to be a lot of churn.
10:33:46
elderK
Granted, I am not exactly knowledgable when it comes to the "web sphere" so what I say could be absolute, total foobar.
10:37:42
elderK
Out of curiosity - and this is aimed at many in the room: How did you like, come up to speed with CL? How long did it take you? What was your learning path? Did you spend a lot of time reading the usual texts, doing exercizes? Did you simply create some small projects and hack away, slowly getting more and more complex and more comfortable?
10:59:26
pjb
beach: we've seen nothing yet. The first generation of programmers is retired and dying, but they were just a few. Soon, a lot more will disappear, and this will be felt direly. Given that half of the programmers are newbies with less than 5 years of experience…
11:02:36
pjb
elderK: it's independent rediscovery, given that the number of programmers double every 5 years, and not all of them have been "formally educated" far from it.
11:18:09
elderK
Like, I have met people without formal educations, who independently research and read into things heavily, say.
11:18:21
elderK
And then I've met those with formal educations who have stuck only to what they were taught, never exploring further.
11:22:05
jackdaniel
formal education is not a necessity, but lack of thereof spins a considerable amount of ignorant people (and it is very easy to spot an ignorant). so even if 90% of uneducated people are not ignorants, 10% is very much visible hence the availability bias leads to a simplistic correlation: uneducated -> ignorant
11:24:07
elderK
I guess as always, it depends on the person in particular. Some people, whether they have been formally educated or not, are compelled to learn more, to dig. Driven to refine their abilities.
11:24:22
elderK
And then there are some, who seem happy to rest on what they've learned, whether it's enough or not.
11:24:25
jackdaniel
another thing is that "modern" univeristy purpose is to meet market demands. market demands now high volume of programmers who will follow directions and many universities just align lowering education standards (to have more students, and money follows a student)
13:33:57
dim
AdventOfCode is very fun to do in CL! (https://adventofcode.com/) — the funniest part is when you read how much effort is spent in other languages to write code that runs in an acceptable time & space where in CL usually the first crappy idea you have is good enough
13:34:33
dim
I just wrote a stupid quadratic algorithm just in case it would be ok, took 16,059 microseconds (0.016059 seconds) to run, 38,608 bytes of memory allocated, with CCL
13:49:18
tumdum
it depends on value of "other languages" - as much as I like CL, my Go and Rust solutions are as easy to write yet always faster. If you compare CL to Ruby you might be right, but that's not surprising
13:50:39
jackdaniel
ACTION would be interested in seeing dim's code and tumdum's code solving the same problem (with similar amount of work)
13:53:35
shka_
wouldn't be a good idea for open for write to provide restart for superseeding or overwriting existing file? I supposed there is a reason why this wasn't done, but this reason eludes me.
13:57:46
pjb
shka_: also, between the time you test and the time you get the answer, the situation may have changed. This is why it wouldn't work.
13:59:34
shka_
_death: no, but it would be silly to offer such restart always as it would probably create more bugs
13:59:35
pjb
Well, the fact is indeed, that no CL function has any internal restart point specified, apart from a few such as check-type, assert, or the various C-something.
14:00:36
pjb
For example (ASIN 42) could provide a restart to give a valid argument (all functions could have it).
14:01:06
pjb
(said otherwise, no CL function is specified to use check-type, at most, to signal a type-error, that's all).
14:01:52
_death
shka: the restart would be supplied when there's an error.. so if :if-exists :error errors a restart taking a new :if-exist value could be provided
14:04:37
shka_
_death: yes, but my point is that restarts such like this we would leak control of internals to the user which may be harmful
14:05:56
_death
shka: the point of restarts is to allow making a decision somewhere else, not to hide things from the user.. for that you can just not provide the option
14:07:34
_death
the error could include more information that gives context about the OPEN.. but yes, it may be too little context to be useful except when developing
14:10:37
_death
there could be a ROBUST-CL that specifies much more comprehensive behavior with regards to errors
14:12:27
tumdum
jackdaniel: e.g. http://tilde.cat/~t/tmp/day2.go vs https://git.sr.ht/%7Ettt/aoc18/tree/fe45caaf00bb487dde683cee552d19611fa0de37/day2.lisp
14:13:40
jackdaniel
tumdum: important point was to see code produced by two different people (who seem to favour other languages)
14:14:21
jackdaniel
what may be a hint, that you have more experience with these languages (than with cl)
14:14:28
tumdum
sure, I'm just sharing *my* solutions. You can compare them with whatever you want :)
14:17:21
dim
well it's the same approach in tumdum Go's implementation and my CL one, so I would guess it takes about the same time
14:18:31
dim
my puzzle takes about 8ms to solve in CL; then again we might have large differences in the number of iterations required to find a solution in our respective puzzles, so…
14:20:43
tumdum
'cat day2.input | time -v ./day2 2>&1 | grep "User time"' results in "User time (seconds): 0.00" ;)
14:20:55
_death
anyway, here is mine https://gist.github.com/death/df37a5f5218eaef229f9358412b54f33 .. I just spend a few minutes after brushing my teeth in the morning :d
14:21:55
jackdaniel
I had a benchmarking game today (against myself though): https://files.mastodon.social/media_attachments/files/008/350/509/original/09baa41f5212cffd.png
14:23:16
jackdaniel
(here is some more information: https://mastodon.social/@jackdaniel/101171161106313135)
14:24:21
dim
_death: I kind of like the simplicity of (some (lambda (letter) (= (count letter str) n)) str), even though it's O(n²)
14:28:28
dim
that's what I like with CL in those puzzle, you can be pretty stupid and have no issues out of it
14:41:01
_death
I think every year there's one day with a problem that's not so trivial, around the 20th day
14:56:03
tumdum
_death: for me the hardest problem last year was day3: https://adventofcode.com/2017/day/3 :D
14:59:49
tumdum
afair I constructed actual 'grid', you can check it here: https://github.com/tumdum/aoc2017/blob/master/03/main.rs
15:03:30
makomo
after it wasn't going quite according to plan, i went on to do something else and forgot about aoc
16:09:44
dim
well from reading the article about Taxicab geometry on Wikipedia, it seems that a solution for AOC/2017/d3 would be to generate the coordinates of the number on thr grid and then take the sum of the absolute values of them, that's it (with e.g. 3 being at (1,1) and 21 being at (-2,-2))