freenode/lisp - IRC Chatlog
Search
11:38:54
beach
I don't know any by heart. And there are several. Do you mean the one written by Fare et all when he worked for Google?
11:42:41
beach
It is not a very detailed style guide. It is more about understanding what style is for and why it is important.
11:44:22
beach
Like it says, it is about memory. You want the person reading your code to have to remember as little as possible in order to understand the code. And that goal has several consequences...
11:45:22
beach
You want to get rid of special cases first, so that the reader does not have to remember to look for them over a long chunk. Example: recursion should start with the base case.
11:48:04
beach
The WHEN/IF thing is an example of both. When you use IF, you make the reader remember that there is an `else' part coming up when he or she is reading the `then' part.
11:48:30
beach
So if there is no `else' part, then you have unnecessarily wasted the memory of the reader.
11:49:00
beach
By using WHEN instead, you immediately tell the reader that there is no need to remember to look for any `else'.
11:51:15
flip214
yeah.... but when I switch windows, the first thing I see is the last line written.
11:51:42
beach
Memory is also the reason for the rule about using the most specific construct that will accomplish the task at hand.
11:52:55
beach
when the ... are all lists, then mapcar is more specific, so it should be used in that case.
11:54:36
beach
ldbeth: Also, everything "can be figured out". That's not the point. Again, the point is how long it takes the person reading your code to figure it out.
11:55:45
beach
Yes, but again, this is not about personal preference, unless of course, you keep your code to yourself.
11:57:02
beach
It seems whenever style is discussed here, it always ends with people stating their personal preference, as if that is the important thing here.
12:14:37
Posterdati
please I need to write a small lisp interpreter on a microcontroller, shall I use scheme?
12:20:06
Posterdati
well I need the bnf coded grammar for a small subset of lip, I thought about scheme, from this project instead https://github.com/hmgle/yascm
12:20:46
jackdaniel
Posterdati: I think that this is offtopic on this channel, so prolonging the discussion is not a good idea
16:05:26
beach
My latest invention for call-site optimization is going to require some more work, but it will be great in the end.
16:06:38
beach
This paper I am working on, and that I want to submit to ELS this year: http://metamodular.com/SICL/call-site-optimization.pdf
16:29:01
beach
Josh_2: Don't feel you have to read the draft paper. Essentially, it's a general technique to optimize functions calls so as to avoid overhead in the form of indirections, call-protocol costs, and argument parsing.
16:36:05
Josh_2
cant say I really understand it but I am not more curious about how CL functions are implemented
19:10:26
dbotton
Xach when does the build of the next quickslip tar up my repo? Is it when the can build label is applied or does it happen closer to the new release?
19:31:53
Xach
but! if you want strong predictability in what will be in quicklisp, a branch or release is the way to go
20:29:27
gendl
Hi, is it normal to run a CL in WSL and connect with slime from an emacs running natively in Windows?
20:31:25
gendl
and will give up supporting pre-built (signed/notarized etc) prebuilt gendl for Mac. Just do not have the time budget for that. I'm hoping most folks wanting to use it on mac can build it from quicklisp.
20:31:54
gendl
pity that it's just at a time when these shiny new M1 processors are coming out but oh well.
21:05:37
Xach
i know someone who uses docker to run their lisp in a linux environment with some linux foreign libraries, but connect mac emacs to it through container port forwarding. docker shared filesystem helps keep things in sync.
22:04:18
anticrisis
gendl: I use WSL2, build emacs from source, and run it all on WSL, using a cheap X server for Windows. It was too complicated to get all the emacs bits and pieces working under Windows.
22:07:51
gendl
anticrisis: Thanks. The X server is not too much hassle? I've been doing ok with emacs on windows, except I haven't managed to get magit going (which admitedly is kind of a big deal)
22:08:03
anticrisis
Oh I should also say accessing the Windows filesystem is through /mnt/c/... etc and works fine, though there is a bit of a performance hit
22:08:30
anticrisis
No the X server was entirely turnkey - no config required - it's on the Microsoft Store - X410
22:09:13
gendl
anticrisis: but if you're running the whole thing under WSL then you shouldn't need the /mnt/c/ for much, right?
22:09:24
anticrisis
Re magit, yeah, that's what I meant by all the bits and pieces - emacs needs all these external things to work well together, and sometimes they don't
22:09:44
anticrisis
That's right, keep everything on the wsl filesystem, and it works great - for instance, build sbcl etc
22:10:15
anticrisis
but for anything you want to actually access from windows, you of course need to access via the mount points
22:11:53
anticrisis
If you do try to run magit over a mount point, or treemacs, it can take several seconds to load
22:13:20
anticrisis
The one thing about X410 is you need to select the "Allow Public Access" option - which in practice shouldn't matter because you've got windows firewall, but take note
22:13:46
gendl
noted. And why did you build emacs from source rather than `sudo apt-get install emacs` ?
22:14:31
anticrisis
Ah - I wanted to try the native compilation branch, which was pretty neat - eventually just went back to the bleeding edge - release version would be just fine