freenode/#lisp - IRC Chatlog
Search
12:02:06
AeroNotix
no-defun-allowed: distributed consensus protocols aren't inherently required to be "blockchains"
12:02:26
AeroNotix
beach: I think there's a huge difference in academic programming and industry programming
12:02:54
no-defun-allowed
I'm only tying the developers to one assumption, that there is a definite "latest" state in their environment.
12:03:21
AeroNotix
beach: academics think their work is a superset of all of industry work, it's just not the case at all. I find a lot of elitism stems from the belief it is a superset and therefore where all of industry programming is heading and techniques learned in academia MUST eventually be used in industry
12:03:23
no-defun-allowed
The protocol is symmetrical, so you can have two REPLs connected to each other, with hooks to announce new information too.
12:03:45
jackdaniel
beach: as I said, I don't consider "elitism" a bad thing, I'm just saying that the quoted claim is elitist *and* that being "elitism" is not a drawback. also noted, that such status-based elitism may hurt people, who could be perceived as an elite from "skill" perspective. but I'm getting into offtopic, sorry :)
12:04:14
no-defun-allowed
I'll release it tomorrow, I just have to make a synchronous-ish API for clients and do some final testing.
12:04:35
no-defun-allowed
The whole thing was 240loc last time I checked, and it hopefully will stay under 400.
12:04:54
AeroNotix
beach: no, you didn't. I just brought it up because I find a lot of grating conversations appear at that boundary
12:05:04
no-defun-allowed
I also have a <20LOC example which uses two hash tables for data and versions.
12:06:06
AeroNotix
no-defun-allowed: I'm a huge fan of using jepsen/knossos for testing distributed consensus
12:06:34
no-defun-allowed
It's all textual for example, and the line `--EOF--` is reserved to denote end-of-files.
12:07:02
no-defun-allowed
It only checks the version number is being incremented and you make the logic, blah blah.
12:08:01
AeroNotix
lets say you have a mesh of 4 servers running this protocol. You end up with two partitions. They each keep accepting writes on either side. What is the true version of the write after the partition heals?
12:09:04
no-defun-allowed
I have a line commented "we don't care" in the upload logic. It's literally (t nil).
12:09:57
no-defun-allowed
Unix timestamps fit naturally to the problem but I still prefer revision numbers.
12:10:03
AeroNotix
if you have a (2)-(2) netsplit with 4 servers. During a split there are an equal number of writes on both sides.
12:10:53
no-defun-allowed
No, but the versioning number is and that's how the latest version is decided.
12:11:29
no-defun-allowed
If both sides hold revision #3, neither will listen to the other even if they verify. Someone must come along and write #4 or greater.
12:12:17
no-defun-allowed
If you want those, use a linked list of some form and make everything immutable.
12:12:57
no-defun-allowed
Alright, goodnight. I have fucking guitar ensemble in the morning. God vce music sucks
12:16:33
Shinmera
Bleh, only need to write some thousand lines of documentation more and I'll finally be rid of this damned library
12:21:20
Shinmera
Ah balls I forgot funcall doesn't take a function name. -- needs to be (funcall (fdefinition `(setf ,foo)) ..)
15:13:19
Shinmera
ACTION 's ghost leaves him https://github.com/Shinmera/iclendar/blob/master/documentation.lisp
16:26:11
dim
Shinmera: I like the RDD approach (http://tom.preston-werner.com/2010/08/23/readme-driven-development.html), do you know about it?
16:27:23
Shinmera
I don't follow it however because my design changes too much during development. Maintaining separate documentation would be too much overhead.
16:28:00
dim
that's what I like about the README first approach, you don't detail the design, but the end result: how to use what you're building as a user
16:28:20
Shinmera
I do brainstorming first on paper or in my mind to figure out a basic architecture, and then I implement it. Iterate on that a few times until it fits. Then I write documentation on it to shake out the last remaining problems.
16:29:07
Shinmera
I just don't write it down in a README because again, it might change quite a bit while I face the harsh reality :)
16:29:11
dim
yeah, so that's what you put in the README right? what problem you're solving and how, as a user, what you're doing make sense
16:29:50
Shinmera
Mh, in my readmes I describe what the library is, how to use it briefly, and if needed what the internal organisation is.
16:30:02
dim
my main problem with RDD is that I tend to not re-read the README often enough, unfortunately
16:30:39
dim
I think the README should be a conversation with the potential user, why would they be interested into what you did in the first place?
17:08:49
krwq
Hello, has anyone used cl-who? I'm having some issues with the simplest examples: https://pastebin.com/u0Zq1Cm5
17:17:09
krwq
drmeister: I think you can just use the pointer with cffi's aref equivalent (forgot the name)
17:20:14
_death
https://edicl.github.io/cl-who/#syntax .. personally I prefer yaclml (<:a :href foo (<:ah bar))
17:22:50
krwq
_death: to ensure they are link and not something like "\"><script>alert(...)</script>\""
17:26:45
mood
krwq: There is also spinneret, which has cl-who-like syntax but is, imo, a little more convenient
17:28:54
krwq
thanks guys, the non-escaping attributes seem to have worked correctly, I'll leave cl-who for now as I like that it writes to stream directly, if I have more issues and become too annoyed I'll try yaclml and spinnernet
17:29:56
_death
yaclml needs html5 upgrades.. fortunately I've not really dealt with web stuff for years
17:31:02
krwq
_death: I just need that to generate simple e-mail - I've started with just cl-template which works ok but when I added some html this started to look really ugly
17:32:31
mood
krwq: spinneret can also write to a stream (though always *standard-output*), but cl-who is certainly a fine choice
17:33:31
krwq
mood: stdout is fine considering it's a non-issue in common lisp :) I don't want to spend too much time on learning it since I've already got it working and already spent like and hour or cl-who
17:34:37
krwq
it has it's things that it sometimes generates not what i mean but I think I can live with that as long as it is fixable
17:35:11
krwq
+ in most of the cases I'll likely wrap the codegen anyway and can add a simple testcase/assert
17:40:52
krwq
pjb: I wanted to add just <ul><li><a href="foo">bar</a></li>...</ul> - I did text gen first but it started getting ugly and I'm planning to add more complex html later
18:17:11
HighMemoryDaemon
I have a pathnames package defined in another file. When I use Slime and try to compile, I get the error "The name "PATHNAMES" does not designate any package." However, when if I compile that load line separately and then compile the file, it works fine. My basic code: https://hastebin.com/duzaxajimi.lisp
18:18:21
Xach
HighMemoryDaemon: better: define a system file and let asdf load things in the right order for hou
18:24:33
Xach
like, you could have something like myproject.asd containing: (defsystem #:myproject :serial t :components ((:file "pathname") (:file "spam-filter"))) and then use (asdf:load-system "myproject") will compile and load them in order of appearance
18:26:26
HighMemoryDaemon
That is pretty easy. Was just checking out this guide: https://common-lisp.net/~mmommer/asdf-howto.shtml
18:28:19
Xach
HighMemoryDaemon: oh, here's something i made to help get started with stuff that requires other libraries: https://www.xach.com/tmp/quickstart.html
21:15:09
dim
Xach: BTW there's now https://github.com/slyrus/abcl/tree/master/contrib/asdf-jar (which I'm yet to try), so that might be something for you to have a look at in the context of quicklisp bundles when using ABCL?
21:39:54
mood
The most confusing thing when writing macros must be double backquotes. I just don't have any intuition for them
21:41:59
mood
pjb: I'm writing a macro-defining macro, and using list, append and friends would obscure just how simple what's happening actually is. Except for the fact that double backquotes are even more confusing, so I guess I'll just do that.
21:42:37
pjb
macros are functions like any other, don't forget to use abstractions and factorization.
21:42:41
mood
AeroNotix: Sure, but when you're two levels deep, how do you get back to the outer level? ,, produces all kinds of weird effects
21:49:48
mood
Shinmera: That does work, but I don't *understand* it. My brain wants to just write ,,(when has-thing '(print "bar"))
21:50:23
Shinmera
Well first you need the ,@ in order to splice in a list that won't leave a NIL if your test is false
21:50:48
Shinmera
Then, since you don't want the code to be evaluated when the inner macro is called, you need the quote
21:51:50
Shinmera
Basically since each level of unquoting is going to try to evaluate the thing, you need to stop that from happening by intermittently adding quotes.
21:51:52
AeroNotix
But pjb is right, probably could turn the inner-macro into a function that returns that form
21:56:40
mood
AeroNotix: I could generate the body of the inner macro using a function, yes. I'll see if that makes things clearer
22:03:01
equwal
Paul Graham has an interesting take on double quoted macros in On Lisp. He compares them to integrating (something you do in calculus). Essentially the reason it is difficult isn't because of the notation, it is because it is just a really complex problem. Just like integration though, there are tricks you can learn to make it easier. For example, when writing a macro-writing macro, you can write the inner macro separately, then write
22:03:01
equwal
the outer macro into it. You can then substitute in the code for the inner macro. The analogy is strong: substitution is one method of integration. There are other tricks you learn as you go along.
22:11:17
mood
Shinmera: It looks quite alright in the logs: https://irclog.tymoon.eu/freenode/%23lisp?around=1534111681#1534111681
22:15:57
no-defun-allowed
should i still put #' before my lambda expressions? sbcl doesn't seem to care and it feels old
22:16:47
mood
no-defun-allowed: There is a macro named LAMBDA that expands to #'(lambda ...), so you don't have to, except in some circumstances
22:18:21
Shinmera
mood: Funnily enough #'(lambda ..) also doesn't work in some situations, like the :report of a condition.
22:18:47
Shinmera
In fact, in which situation do you think you have to add #', because I can't think of one
22:19:54
mood
Hmm, good question. I seem to remember finding something in the past, but I'm drawing a blank
22:20:12
Shinmera
Anyway, the short is: save yourself the two characters and the visual noise, and just use lambda.
23:05:27
pjb
aeth: #+genera (defmacro lambda ((&rest bindings) &body body) `(cl:function (cl:lambda ,bindings ,@body)))
23:15:34
aeth
pjb: I think it was Genera. I'm not sure because it has been a few years. I think the proper way of doing it, though, is pushing it to *features* iirc.