freenode/#lisp - IRC Chatlog
Search
10:35:15
makomo
yup, purely aesthetic. you can use whatever symbol you want, as LOOP only checks the symbol's name when looking for "loop keywords"
10:44:08
loke
moldybits: LOOP also supports various other variations, like so (LOOP WHILE X UNTIL Y DO (something) UNTIL Z DO (something-else) WHILE ZZ)
10:47:12
jackdaniel
that comes from the fact, that DO (among other things) is a syntactic sugar for a tail recursion
10:47:39
jackdaniel
(I won't elaborate on that because I need to take care of something else, but it is nicely explained in peter norvig style guides)
10:47:40
pjb
moldybits: try: (defpackage "MY-LOOPS" (:use "CL") (:export "WHILE")) (loop do (print 'hi) while nil) (use-package "MY-LOOPS")
10:49:46
moldybits
pjb: you mean just to see it in action? how does defininig a package for it help, though?
10:50:35
moldybits
it is a bit verbose. i think i'll use the loop version as i feel i need to fully embrace it.
10:52:58
moldybits
the last expression causes a name-conflict between my-loops:while and common-lisp-user::while
10:54:33
pjb
Notice that some lisp have macros named WHILE, UNTIL, etc. (eg. emacs lisp) and some package may also export operators such as COLLECT, SUM, MAXIMIZE, etc. So those collisions are not academic.
10:55:22
pjb
(in-package "MY-LOOPS") (defmacro while (condition &rest body) `(do () ((not ,condition)) ,@body))
10:57:01
_death
so the issue usually manifests itself in interactive development, if you're using a package that exports these symbols
10:58:35
moldybits
when i misspell a symbol in slime, it starts showing up as a completion, which is annoying. is the way symbol interning works (or whatever it's called) ... good/sensible?
10:59:11
loke
moldybits: You should be able to filter out symbols in the completion list that are not bound to a variable or function.
10:59:35
loke
moldybits: However, you may still want to complete on it (it may be a CLIM presentation type, for example)
11:00:07
White_Flame
in theory, this could be done in the repl by detecting an abort, and containing what it had interned up in the meantime, undoing it after the fact
11:01:20
jackdaniel
actually you'd need to trace function intern (so in practice, you'd need to hack the reader, and reader as is isn't very comprehensible)
11:01:26
loke
White_Flame: That would be very bad... What about this: (setf (gethash h 'foo) n bar (error "foo"))
11:02:44
moldybits
i just remember finding symbols and packages unexpectedly confusing last time i tried understanding them. would you people consider it to have been properly designed?
11:03:28
White_Flame
and only if that symbol was interned newly on that attempt, and only if used for hat
11:07:26
White_Flame
of course, if you botch a short name that you don't use completion for, none of that helps
11:08:08
no-defun-allowed
Then, I wonder how it'd fare with cl-arrows and other syntax-moving macros. It probably should not be enforced on the user, only just the default action, or maybe double-tab would bring up all suggestions or something clever.
11:11:51
no-defun-allowed
Better yet, write a program to step out exactly what the inputted program would do.
11:17:40
moldybits
hm. i combined all files into one (just 200 lines for now), with headings and ^L. i wonder if i'll feel inclined to split it up as it grows.
11:57:35
p_l
not sure if there's one such book. You'd probably have to cobble it together from multiple ones?
11:59:49
heisig
vms14: Just hack something in Lisp, and I promise you will find out why so many programmers love it.
12:00:24
p_l
SICP teaches you computing science with definitive lisp bent. PAIP will show you a bunch of techniques that will do a lot of good (including writing an optimizing compiler!)
12:00:48
vms14
but I wanted to see if you knew a book that shows the essence, because lisp is not only a language
12:01:00
p_l
Gentle Introduction to Symbolic Computation will open to you various alternative uses of Lists (though, iirc, it didn't do much about symbol-plist, which is kinda forgotten thing in CL)
12:01:31
vms14
and that they dissect it different, like every function is a little step that takes a previous function and is taken for another function
12:02:53
vms14
I mean learn to think as a lisper, even if that's matter of time. Sure there are books that show this fact, more than the others
12:17:05
vms14
what things of lisp you guess are part of this "enligthenment" that changes your way of think about programming?
12:18:21
schweers
But also Common Lisp in particular gets a lot of things right which are not limited to lisp like languages. CLOS is one thing, conditions and restarts is another.
12:19:04
schweers
Having the whole language available at all times is also something I had to get used to and cannot do without anymore.
12:19:09
vms14
and that you don't write programs, but write a new language which adapts to your needs
12:20:23
jackdaniel
I think you've read some of pg essays. there is some truth in them, but part of it is just a salesperson speech
12:21:11
vms14
but the "lisp fans" are talking so high about lisp in a way I've never seen before with other languages
12:21:13
Demosthenex
i'd say there's a bit of the epiphany still. i came from a procedural algol style background, and when i worked with lisp for a while and it clicked, it was quite a feeling ;]
12:22:04
Demosthenex
i had been skeptical about the epiphany claim myself, and it's not like the heavens part and light shines down, but it changes the way you think
12:22:26
jackdaniel
well, I'm working with CL almost exclusively and I can tell with certainity that it is no silver bullet - a very good language with well-thought qualities and some flaws
12:22:32
Demosthenex
vms14: no, i don't mean learning functional. i mean lisp, and programming with lisp.
12:23:22
vms14
also what I see is that most of modern languages are "modern" and have "modern features" that lisp had forever
12:23:30
jackdaniel
(some of the flaws I talk about are not inherent to the language itself, but to the ecosystem and such)
12:23:33
Demosthenex
frankly i've said to many friends that i wish i'd learned lisp first in highschool. i feel like it made me a better programmer in every langauge as a result of learning it.
12:23:52
vms14
and it's strange to know that an ancient language like lisp is more modern that most of languages we know
12:24:35
schweers
vms14: Don’t confuse lisp the idea with Common Lisp the language. The latter was standardized in ... 1994?
12:24:43
vms14
also I guess learning lisp is a bit like start again to learn programming, due to the fact lisp is different to most languages
12:24:58
vms14
and that most languages are very similar, sharing the same syntax, the same loops, etc
12:25:01
Demosthenex
vms14: if you spent a few weeks learning lisp with a pet project, i think you won't be disappointed.
12:26:04
vms14
also the goal is to learn lisp in order to understand what is that "enligthenment" and to steal concepts from lisp the day I'll make a toy language
12:26:32
vms14
Demosthenex, I don't want to learn emacs, but it seems is the only way to program in lisp
12:27:00
vms14
also that if you invest time with emacs, and learn how to configure it, you'll be happy and start to think why you didn't come before
12:28:07
schweers
vms14: I don’t know anything about Sam, but you can use bare evil-mode in emacs or spacemacs (which is what I use)
12:29:26
Demosthenex
schweers: i just can't stand those who get wrapped up in font effects and cute gui tweaks instead of the power of the thing in front of them. :P
12:29:57
heisig
vms14: There is also Portacle (https://portacle.github.io/), which is easier for getting started than standard Emacs.
12:36:16
moldybits
vms14: for me it's that it has little tools to make incremental development easier, which makes it fun. i don't know if or care how useful it is or is not in the real world.
12:51:46
schweers
I wonder how (in)efficent jumping around a file and writing is on sbcl (or ccl for that matter)
13:58:52
schweers
I get an error claiming that the defmethod form has an invalid qualifier and that only append and :around are valid.
14:00:30
pjb
schweers: no, I'm not sure how append is implemented, but if it uses append, returning a literal list may be a problem for the last argument to append, since it won't be copied.
14:01:32
pjb
schweers: setting the file position with file-position should be as efficient as fseek, ie. very on usual file systems. Only if your file is stored on tape, should it be slow.
14:02:13
schweers
pjb: no, I am worried about issuing a syscall on every jump. Not sure that would happen, though.
14:03:08
pjb
syscalls are fast. But granted, on small files, it might be faster to just load the whole file in the userspace, mutate it in RAM, and save the whole file back.
14:04:13
schweers
Currently I mmap the whole thing and operate on it as foreign memory, so I have no syscalls for the actual operation.
14:05:25
jmercouris
I want to do (format nil "~{~a~^ ~}" list) but insert a newline instead of a space
14:06:21
jmercouris
I am looking at the page and I was just going down a rabbit hole trying to find it
14:09:31
makomo
jmercouris: SLIME has a hyperspec.el module which you can use to look up stuff from CLHS. it even has a special function just for FORMAT directives: common-lisp-hyperspec-format
14:09:52
makomo
very very useful. i also find myself always digging through the CLHS just to find that list of FORMAT's directives. quite annoying :-)
14:12:12
makomo
it's a great timesaver once you start consciously stopping yourself from using the web browser to access CLHS
14:13:23
makomo
jmercouris: yeah, i use that too (thought it was part of hyperspec.el, but it seems it isn't)
14:14:53
jmercouris
(slime-setup '(slime-fancy slime-company slime-asdf slime-indentation hyperspec))
14:15:13
jmercouris
but it doesn't seem to be working when I type "," I don't see common-lisp lookup or anything
14:15:37
makomo
my list of contribs is (slime-company slime-asdf slime-fancy slime-indentation slime-sbcl-exts slime-scratch)
14:15:55
makomo
but i didn't even have to set up hyperspec.el manually. trying to dig up where it's coming from
14:16:38
makomo
oh, nothing in the SLIME repl itself. an actual emacs command: common-lisp-hyperspec-format
14:18:54
makomo
yeah, it seems hyperspec.el is included with a default SLIME installation, no contribs are required
15:38:46
schweers
is there a function which works similar to INTERN but won’t intern new symbols? I.e. only look up and return existing symbols?
15:49:33
drmeister
Well, the actual rendering is with Javascript and there is some Python between the Common Lisp kernel and the browser.
15:57:11
koenig
I sort of view that aspect of molecular dynamics as being the big scale "set up a batch job and run it on a supercomputer" side of things.
15:58:04
koenig
And view your work with Clasp and interactive molecular dynamics in a notebook as being on the smaller scale "develop an interactive shell that you can use to poke at molecular dynamics problems interactively" side of things.
16:00:27
drmeister
Well one sec for that - but it programatically generates AMBER input scripts and a makefile that will run the AMBER jobs with as much parallelism as possible. It will use your local machine, a cluster of GPU accelerated machines - or the Amazon Web Services GPU instances.
16:02:20
koenig
I have to admit that I don't know how big AMBER scales. We used to run some pretty big NAMD runs and NAMD was one of the qualification applications used to certify Summit at ORNL.
16:04:59
koenig
I guess the neatest thing about your work in my opinion is that you're driving toward what is essentially an interactive shell and an associated domain specific language for doing molecular dynamics.
16:06:39
drmeister
Thanks. There's more though - we are going to be running parallel AMBER jobs at a very large scale.
16:07:52
drmeister
That's a small job - one free energy perturbation calculation that calculates the ddG of benzene going to phenol in lysozyme.
16:08:37
drmeister
The ellipses are jobs. The rectangles are files that are generated and consumed by the jobs.
16:10:48
drmeister
What we are doing here is automating large numbers of free energy perturbation calculations.
16:11:52
drmeister
The Common Lisp code sets up the input for a distributed build system that can be run on different target machines.
16:13:26
dim
drmeister: wow nice! are you doing the jobs orchestration in the CL layer too? if that's the case, are you using lparallel/lfarm for that?
16:13:37
pfdietz
While I don't do chemistry, I do read Derek Lowe's blog. That has to count for something, right?
16:14:14
drmeister
dim: No - we are generating makefiles and input scripts within a directory hierarchy.
16:14:50
drmeister
The jobs orchestration is developed by my partner Martin Cracauer - formerly of Google and ITA
16:15:39
drmeister
It uses standard unix tools to distribute the jobs so that everything follows a well defined and reviewable security model.
16:16:09
dim
well if you're looking for ways to have CL “listeners” on the remote GPU servers and talk lisp to them directly for orchestration and off-loading, have a look at lfarm, I think you'll like it!
16:17:08
drmeister
Thank you. Some of the jobs in that graph I just dumped are lisp jobs running in Cando.
16:18:25
drmeister
The jobs basically run as shell scripts - launched using ssh - so that we can use ssh key management as the security model.
16:20:39
dim
instead of bash you have say clasp running on a port where it expects lisp commands, same model as slime/swank if I understand correctly
16:20:42
drmeister
We are building security into everything because if pharmaceutical companies are going to use this - they can review the security and feel as good about it as they can anything else.
16:21:10
dim
so that the code you run remotely is still lisp, you basically have remote funcall over it, a quite classic RPC mechanism
16:22:50
drmeister
Understood. We opted for an approach where the workers can do different things like run AMBER jobs, run Cando scripts, run cpptraj (part of AMBER) run a python script (bleh - gotta rewrite that in Cando CL)
16:24:25
dim
well the most important and difficult thing to do in a production environment is error handling, reacting to things not doing what's expected
16:25:33
dim
so I would use even Python rather than shell scripts, or if I have Common Lisp and its condition system and restarts... well... that looks more like it
16:26:30
drmeister
Martin and I talked about this. Cando can launch other programs using unix calls. But this is more his domain - so we are doing things with the shell rather than using Cando as the shell.
16:28:34
drmeister
IIRC the argument was that if we use standard tools like ssh, bash, rsync for this layer that the security would be reviewable.
16:29:33
drmeister
Also, we run things in tmux - so we can connect into any machine and figure out what has been going wrong.
16:30:30
dim
imagine that layer being written in CL, you would then be able to review it... and contribute to it... ;-)
16:33:39
koenig
Admittedly, NAMD runs on Charm++ which is oriented toward the supercomputing community. But for example it was one of the acceptance codes for Summit at Oak Ridge National Laboratory where it'd run across the entire machine with ~4,096 nodes each with something like 4 or 8 GPUs per node.
16:33:46
drmeister
Within Cando I can write code with loops that can generate any number of parallel AMBER jobs with a single function call. At what point would the calculation become impressive to the computational chemistry community?
16:34:26
drmeister
I could take the ZINC database and solvate every molecule and set up a minimization, heating, pressurization and replica-exchange molecular dynamics run.
16:34:53
koenig
The machine itself is somewhere around 200 petaflops, although I wouldn't know anymore what to expect NAMD would do on a machine like that.
16:35:59
drmeister
Now - that's running different molecular dynamics simulations or one large simulation? With 4,096 nodes you won't be anywhere near a linear speedup of one job - right?
16:37:20
drmeister
You are talking something like simulating 10,000,000 atoms of chromatin or a big chunk of membrane - right?
16:37:57
koenig
If you look at Klaus Schulten's (RIP) group's work, those are the kinds of molecular systems they seemed to focus on.
16:38:28
drmeister
Right - no - that's not what we want to do. We have lots of simulations with lots of automation to handle the messy problems of setup and analysis of those simulations.
16:39:33
koenig
So Clasp's contribution is as a rich way of configuring and orchestrating your computations?
16:40:24
koenig
Do you have any publications outlining the benefits that Common Lisp brings to your work vs. using something like Python?
16:40:55
koenig
Because, having worked most of my life in supercomputing centers, I could envision that as the big pushback I'd get if I were to say I was going to use Common Lisp as my glue language.
16:41:13
koenig
And this isn't a criticism of your fine work, by the way. I'm genuinely interested in the answer.
16:41:17
drmeister
The entire molecular mechanics toolchain of loading structures, building structures, solvating structures, adding ions, assigning force-field parameters, saving topology files, generating input scripts for the MD engine, loading dynamics trajectories, analyzing dynamics trajectories - it's all under control of Common Lisp.
16:42:46
drmeister
I think we are about to demonstrate the benefits of Common Lisp over the mess that Python has made in the computational chemistry community.
16:43:49
koenig
At one point when I worked at ORNL, I ported ECL to the Cray (Titan) and tried to develop some domain specific languages to do work on a couple of systems-related domains, similar to what you're describing.
16:44:06
drmeister
We are talking to pharmaceutical companies right now. I'll be demonstrating all of this at the AMBER developers meeting.
16:44:48
drmeister
We could always bring up and run cl-python inside of Cando for those that really, really want python.
16:44:51
koenig
You'd have to appeal to the business case, of course. That's all the pharma companies will care about.
16:45:14
koenig
Like, their margins are so small these days that they're trying to wrestle out as much productivity as possible.
16:46:22
drmeister
Right now they pay a lot of annual licensing fees for closed source, black box software.
18:13:24
trafaret1
discardedes: can you in a few word explain me what means this -> : in common lisp?
18:20:14
trafaret1
if I get it right it's like classes with variables and methods but initialized under some name
18:20:55
verisimilitude
Using package:symbol references SYMBOL in package PACKAGE; using :symbol references SYMBOL in package KEYWORD; related but not quite the same is #:symbol, which references SYMBOL in no package.
18:21:36
verisimilitude
That is, (CONS #:SYMBOL #:SYMBOL) creates a CONS with two distinct symbols in it.
18:24:45
verisimilitude
Alright; my point is that it's not so tricky once you learn more. Which languages do you already know?
18:25:44
verisimilitude
Oh, a one-pass language; Lisp doesn't require you declare things before using them in every case, as one difference.
18:26:43
verisimilitude
English is the language of programming; your English is decent already; what's your first language?
20:28:54
ioa
hi, does anyone know, whether there will be an ELS-banquet during the ELS days, or just the Programming banquet on Wednesday?
20:48:33
no-defun-allowed
hopefully there'll be, else I have to socialise with non-Lisp programmers, eugh
20:49:06
no-defun-allowed
[wait! no-defun-allowed! you're not going, so you don't have to socialise with anyone!] well, you hopefully won't have to either
20:52:38
moldybits
not sure if this is the place for slime questions? say i've modified bits and pieces all across a buffer and want to re-evaluate everything, how can i do that without excepting on defconstants?
20:53:47
asarch
One stupid question: In this Emacs GNU Emacs 26.1 (build 1, x86_64-unknown-openbsd, GTK+ Version 3.22.30) M-x package-refresh-contents works perfectly. However, in this one GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21) from Xubuntu, it doesn't
20:55:20
asarch
Contacting host: elpa.gnu.org:80, Failed to download ‘gnu’ archive., 5Contacting host: melpa.org:443 [2 times]
21:47:21
jgkamat
I don't think there's a mirror, but you can build the packages from source pretty trivially
21:49:29
asarch
Since Xubuntu is based on Ubuntu which is based on Debian, I think the Linux kernel from Debian has a serious problem