freenode/#lisp - IRC Chatlog
Search
14:28:05
pfdietz
The interesting (to me) question: what are the things that are done to programs? Compiling and running them, for sure, but what else? These would affect language design.
14:33:27
jackdaniel
(hm, I hope it wasn't rethorical question, that would be silly of me to answer it)
14:34:27
pfdietz
I think listing use cases for programs as things to be manipulated would be very interesting.
14:34:35
jackdaniel
in less narrow sense: sharing runtime (we could look for instance at irc as a single program shared between peers)
14:39:22
pfdietz
Off the top of my head: verification and other kinds of static analysis, diffing, refactoring, test generation, documentation extraction, generation of human-readable explanations of program behaviors, instrumentation (and other aspect-like changes).
14:41:12
jackdaniel
maintaining development-related information (i.e program could host its own source code, issues, wiki, documentaiton), so if it hosts its own code – merging two program forks
14:43:47
pfdietz
Anyway, the program manipulation API affects language design, and I think it would make sense to make it more explicitly defined.
15:20:49
zigpaw
jackdaniel: have you looked at Elixir doc tests? I think that is also quite a neat idea that could add to your great list above.
15:25:21
jackdaniel
I'm familiar with the concept nad I find it really messy to mix: function body, documentation and unit tests in the same block with a weird syntax
15:31:42
jackdaniel
having it all accessible from one place (with help of the editor) makes more sense, but they shouldn't be lumped together in text
17:30:38
dim
thanx Xach... I have this project in mind that seems quite simple to begin with, and I'm wondering if Heroku and then Python would make it so much easier for me, because the goal is not the write the code but to host a user available service…
17:31:33
dim
or, if I don't find an existing platform that implements my ideas, I could also subcontract this part, but I'd rather than something that is known to be worry free and scaling easily
17:32:08
dim
I want to have to deal with as few moving parts as possible myself, that's not where the added value is in that project
17:47:54
fiddlerwoaroof
dim: my impression of Heroku is that it gets really expensive once you move past the "hobby project" stage
17:49:07
fiddlerwoaroof
Anyways, if hosting options are flexible, deploying docker containers to some managed kubernetes provider or to AWS ECS/Fargate might be good option
17:49:25
fiddlerwoaroof
Also, if the language choice is flexible, there's Clojure things like Datomic Cloud.
18:06:30
dim
fiddlerwoaroof: yeah agreed Heroku can get quite expensive when you get lots of traffic, I'm not sure I will get that though
18:07:12
dim
fiddlerwoaroof: Clojure looks like a decent lisp from what I've seen before, but this project isn't a good opportunity to discover a new language from scratch
18:38:13
aeth
What I'd do is set up a private gitlab repo and deploy from that. Maybe sftp in a build of the recent SBCL
18:47:55
fiddlerwoaroof
So, I'm not really a fan of containers, but the nice thing about containers is that they standardize your execution environment
19:09:15
fiddlerwoaroof
I've managed to make redistributable images using CFFI's static linking features
19:09:53
fiddlerwoaroof
e.g. this _should_ work on any linux that supports the relevant GLIBC symbol versions: https://github.com/fiddlerwoaroof/daydreamer/releases
19:10:39
fiddlerwoaroof
To dump the image, you do this: https://github.com/fiddlerwoaroof/daydreamer/blob/master/build.lisp#L39
19:10:53
fiddlerwoaroof
My environment setup is all here: https://github.com/fiddlerwoaroof/daydreamer/blob/master/clone-all-the-things.sh
19:22:38
dim
fiddlerwoaroof: would you be interested in contributing a build process for static pgloader images?
19:36:22
fiddlerwoaroof
Maybe, if I can find some time. The complicated thing is that, as far as I know, it only works on sbcl and you need to build sbcl specially
21:27:25
elderK
I've defined a new type, with deftype, that specifies which symbols are valid for that "type."
21:27:43
elderK
(I read that like, enumeration values C-style - you know, symbolic names for integers, aren't the way to do things in CL?)
21:29:15
elderK
I was hoping that if I created an array of my type, the system would prevent me from say, setting an element of that array to some symbol outside of those specified by deftype. I've since learned about element type upgrading. So, the array accepts things of T.
21:30:45
sjl_
I've used integers before for things like emulator opcodes, to be able to easily look up things about them (e.g. their functions) in an array later.
21:30:45
elderK
Right, so you'd have functions that are used to mess with the array, and have the appropriate check-type in them, correct?
21:32:02
sjl_
Depending on your implementation you may get more or less help with the type checking. SBCL on (safety 3) is pretty helpful
21:33:32
sjl_
e.g. in SBCL if I do (deftype http-method () '(member get put post delete ...)) and then later (declaim (ftype (function (http-method string) t) query)) (defun query (method url) ...)
21:33:57
sjl_
and then later do (query nil "http://foo.com") later, SBCL will warn me that nil isn't an http-method
21:34:56
elderK
Just starting out you see. Finals are coming to an end, and I thought as a "learning project", I'd implement a (tough) assignment I did earlier in the year, but in CL.
21:35:53
sjl_
Yeah. If you want code review you can post it here and people are generally happy to critique things to varying degrees of nitpickiness
21:36:40
elderK
I imagine what I write at first will be pretty terrible. I hope to learn the better ways :)
21:37:20
elderK
It's like, there's a lot of "shortcuts' I'm used to using in C. None of those will work here.
21:38:39
elderK
This seems like a good little project. It's a solver for a cellular automata kind of thing. It's simple in that it doesn't need a lot of libraries and stuff. But not trivial. Seemed like a good fit :)
21:41:20
sjl_
Yeah, something nontrivial but not super involved is a good starting place. Especially something you've done before, so you're not trying to understand both the problem itself and a new language at the same time.
21:49:42
sjl_
One thing to keep in mind about shortcuts, is that a lot of CL people (e.g. me) care a lot about brevity of *ideas*, and don't care much about brevity of *characters*.
21:50:07
sjl_
e.g. to concatenate two bytes, a C programmer might do (a<<8)|b whenever they want to do that.
21:50:50
sjl_
someone like me would (declaim (inline concatenate-bytes)) (defun concatenate-bytes (high-order low-order) (logior (ash high-order 8) low-order))
21:52:02
sjl_
It's more characters to type "(concatenate-bytes ... ...)" than "...<<8|...", but instead of saying two things every time (shift, or) I'm saying exactly what I mean
21:53:36
sjl_
actually I did use dpb instead of the logior and shift when I implemented my cat-bytes :) https://github.com/sjl/cl-chip8/blob/master/src/emulator.lisp#L28
21:54:53
pfdietz
The cool thing about lisp here is not what the particular operators are, but that integers act more like integers. No 32/64/etc. limits.
21:55:31
sjl_
Yeah. Having actual numbers that act like numbers in my programming language is so refreshing.
22:13:56
elderK
Guys, when it is okay to do say `(,something ,something-else) vs. (list something something-else)?
22:14:14
elderK
I'm creating an array, and the dimensions are well, you know, part of the parameters.
22:15:34
sjl_
backquote is fine for that, yeah. It's good to keep in mind that backquote doesn't necessarily produce a fresh list every time
22:15:52
sjl_
So if you're going to be mutating the result, don't use backquote (or make sure to copy the whole tree first)
23:33:08
fiddlerwoaroof
iirc, one of the implementations switched to using structs as part of quasiquoting and broke some people's code walkers
0:05:19
luis
fiddlerwoaroof: you said you had to patch CFFI and Osicat to get static linking working. Will you be sending pull requests?
0:09:27
nyingen_
Do we have any particular libs or idioms for spawning external processes and doing I/O with them?
0:11:00
aeth
In particular, uiop:run-program or uiop:launch-program (the latter is newer and is capable of being async)
0:12:24
aeth
You probably want (uiop:launch-program name :input :stream :output :stream) and then you call uiop:process-info-input and uiop:process-info-output to get the two streams
0:18:56
nyingen_
I am writing some glue code. Last time I did this I switched to perl because CL's MySQL libs did not work for me. But this database is in sqlite, which I have used CL with before, so it should be all good
0:25:58
fiddlerwoaroof
If you're expecting something like (swap (atom 0) '1+) => (atom 1), that doesn't exist
0:40:00
elderK
Another dumb question: If I have a structure instance, and I copy it is, is the copy deep?