freenode/#lisp - IRC Chatlog
Search
19:45:23
aeth
Typing is still a necessary skill for getting real work done, it's just harder to pick it up in leisure activities than in the 1990s. Even on the PC the keyboard is less used. Everywhere. e.g. Back in my day, when I was playing an online FPS, all we had was text chat and if you typed too slowly you got fragged. Kids these days have voice chat in their FPSes, which they often play on consoles without keyboards.
19:45:25
MichaelRaskin
I think even two-thumb physical keyboard might beat on-screen after a minimal learning curve
19:45:49
MichaelRaskin
(not sure if still true for natural-language input with swipe-a-word interface)
19:47:30
aeth
Oh, and cheat codes in single player PC games (remember cheat codes?) were normally typed, so if you quickly needed resources in Age of Empires II you better get good at quickly writing those four magical words.
19:48:17
sukaeto
aeth: yeah, that's what I mean. If you were a teenager in the 90s, you talked to all of your friends over AOL instant messenger or ICQ.
19:48:31
sukaeto
there was the brief window where typing was just something you needed to be able to do in every day life
19:49:15
aeth
sukaeto: You're probably a few years older than me. I had Gaim (now Pidgin) and I had AOL, ICQ, MSNM, and Yahoo and both Yahoo Messenger and ICQ were basically dead, at least in my circles. All of the Americans used AOL IM and all of the international people used MSN Messenger.
19:49:35
copec
drmeister: I dig seeing you talk about your work in a "non-chemistry colleague" fashion
19:51:29
sukaeto
aeth: FWIW, all of my international friends used either MSN or ICQ. But the MSN users seemed to be a strict subset of the ICQ users.
19:53:53
aeth
What I really miss, though, is being able to use one program (Gaim/Pidgin) for all IM. I don't think I've touched that program since Google Talk went with a proprietary protocol. (Instead, I simply just don't use IM.)
19:56:19
drmeister
aeth: We ported jupyter widgets and nglview (a molecular visualization jupyter widget) to Cando Common Lisp.
19:57:55
drmeister
We are using cl-jupyter. Everything is reimplemented in Common Lisp. There is still the jupyter notebook Python middle-ware and everything on the browser is Javascript (of course and yuck).
20:00:41
aeth
drmeister: JSCL exists but it doesn't have any interesting (to me) parts of the languages last time I tried the online demo
20:01:05
MichaelRaskin
I guess the bright future is where Clasp would be able to use LLVM to produce WebAssembly…
20:01:48
drmeister
ACTION is waiting for webassembly exception handling and GC - and/or some volunteers to step up.
20:05:03
phoe
Well, for the good news, package-local nicknames seem not to incur a big runtime penalty on CCL.
20:05:33
phoe
(For the different-kind-of-good ones, I think I've found other issues in CCL 1.12 while testing.)
20:14:53
phoe
handlers are actually functions that are stored on a stack of sorts. each HANDLER-BIND or HANDLER-CASE actually is equivalent to (let ((*handlers* (append new-handlers *handlers*))) ...)
20:15:51
phoe
SIGNAL searches *HANDLERS* for a list of all handlers that match the type of the signaled condition.
20:17:44
phoe
And that's the way it was done to bootstrap a condition system off a conditionless Lisp.
20:20:11
makomo
how can i print a single-float of value 1.99999988079071044921875 properly, with all of its digits?
20:20:12
djeis[m]
block lets you handle the nonlocal return, cus you can return-from a block from inside of a nested lambda, and unwind-protect lets you write cleanup code.
20:20:39
makomo
note that this number is exactly representable within IEEE 754's single-precision floating-point
20:23:18
makomo
the funny thing is, INTEGER-DECODE-FLOAT gives back the proper significand and exponent
20:25:35
makomo
but even if i do something like (format nil "~,50f~%" <value>), it still doesn't print them
20:27:00
nirved
makomo: single-floats are equivalent after certain precision, no need to print more digits
20:29:22
djeis[m]
Right, but the point is that there's a special case of single-floats where the exact decimal representation does actually have that many digits.
20:30:45
djeis[m]
Although, integer-decode-float gives the same result for 1.99999988079071044921875f0 and 1.9999999f0
20:31:24
makomo
right, but along with the number that maps exactly to that floating point number, there are many other values which map to the same floating point number (infinitely many of course)
20:32:57
makomo
so it can print any of the infinitely many possible values that map into that particular floating pointer number
20:34:13
makomo
i guess i would need to implement my own printer if i wanted the described behavior (i.e. always printing the value that maps exactly into the given floating point number, without any error)
20:34:18
verisimilitude
My figuring was that it's not actually required to adhere perfectly to any standard and so behavior such as this would still be technically correct.
20:35:19
djeis[m]
Yea, CL doesn't require IEEE floating point, that's why it provides functions for querying the kind of floats you have. It does, however, encourage implementations use IEEE floating point and has a standard feature for supporting it.
20:36:55
djeis[m]
The issue is that you've lost those extra decimals once you've stored the value in a single float.
20:37:24
makomo
hm well, actually, the rationale for the number i picked was IEEE's single-float, but even if SBCL didn't use IEEE 754 to encode the numbers, it still gives back the correct significand and exponent
20:38:45
djeis[m]
But IEEE single float uses the same bits to represent 1.99999988079071044921875f0 and 1.9999999f0, doesn't it?
20:39:33
makomo
it's a many to one mapping. the issue is that i was expecting the reader to give me the value which maps into my floating-point number *exactly* (without any error)
20:54:42
aeth
Well, they can be exact, but they're mostly used to inexactly approximate the real numbers the very important characteristic that they're finite. If they were actually infinite (like bignums) you'd very quickly run out of memory in a lot of problems and things would be much slower. (Technically, even then, there are uncomputable numbers.)
20:56:59
aeth
You can actually see this sort of issue in CL when you use rationals for some things. You start with 3/5 and you very quickly wind up with 8792569327849/19765971324829478974811436 in your calculations.
20:58:06
aeth
(Although in practice you'll probably wind up with it automatically coerced to a float at some point.)
21:28:36
djeis[m]
Long as you never use a float in your calcs it never will, but that's a tricky restriction sometimes.
21:31:04
aeth
The problem is that there is no rational-approximation version of EXP, EXPT, SIN, COS, TAN, LOG, etc. So not only will those automatically coerce, they'll coerce to single-float, probably not what you want if you're not caring about performance. (And you couldn't have that without some kind of additional argument or global variable to say how to truncate the rational.)
21:33:42
aeth
LOG will galdly return single-float if given any number other than a non-single-float float. So (log 64 2) will give you 6.0 even when you might want 6, and that's a bit of a counterintuitive part of the language becuase you'd probably actually want (round (log (coerce 64 'double-float) 2)) if you're passing in an integer (although LOG is a bit of a special case there).
22:11:05
paule32
what i don't understand by lisp is: in the documentation stand's - the eval is from inner to outer box
22:13:14
verisimilitude
Macros and special operators don't necessarily have the normal evaluation rules, paule32.
22:17:11
djeis[m]
Evaluation of just function applications is, at each level, left to right. It's just also inner to outer, because all of the arguments need to be evaluated before the function call happens.
22:26:06
no-defun-allowed
Don't do that, it's dangerous and odds are asdf and quicklisp won't work right.
22:31:55
verisimilitude
If not, it would probably be easiest to just download it manually, if one doesn't already have Quicklisp.
22:32:16
no-defun-allowed
Nope, but if it did you wouldn't have to bother with finding them, as quicklisp would load those too.
22:32:44
no-defun-allowed
But, my advice is to install quicklisp anyway, learning CL without it is a bit lonely.
22:36:10
paule32
when starting clisp in console with loading flags, no change to start the application
22:36:23
aeth
UIOP is weird. You (probably) already have an ancient version of UIOP loaded, as a dependency for ASDF, and Quicklisp just "upgrades" UIOP to the newer version with more features. If you look at the verbose output it's recompiling functions when you quickload it, at least in SBCL.
22:36:37
pjb
paule32: now, the problem is that X servers nowadays are configured to not listen to TCP ports.
22:37:06
pjb
paule32: on linux you can use netstat -tnpl|grep 6000 to see if there's a X server listening on port 6000. If not, you won't be able to connect.
22:38:14
paule32
i realize that, but don't remember it, bud good to know, a had a project under the table, which use Xephier
22:38:52
pjb
Adding &key (display 0), I can run (paule-hw::hello-world "127.0.0.1" :display 1) and successfully display this hello world window. ps ax | grep -e 'X.*listen' --> 38628 ?? S 0:00.01 /opt/local/bin/X :1 -listen tcp -iglx
22:39:53
pjb
paule32: notice also that DISPLAY can point to a socket; eg. on macOS, it's DISPLAY=/private/tmp/com.apple.launchd.K3QVcZANEn/org.macports:0
23:26:31
lowryder
sjl: I read your "Path to Common Lisp" post some time ago, prompting me to begin a path towards common lisp. I went quite far without worrying about my editor. But now it's maybe time.
23:27:12
sjl
cool. yeah, if you've gotten comfortable with the language, the next step is the editor
23:27:29
lowryder
sjl: I'm also a vimmer, and I use vlime. I read on HN that you use a terminal in vim as a direct REPL instead of the read-only bit in vlime
23:28:22
lowryder
sjl: I was wondering: if you're modifying a lisp file and you add a function, how do you load just that new function into your running lisp without reloading the whole file?
23:30:05
sjl
Vlime has a function that will compile the current buffer's file, I have it bound to a keystroke https://hg.sr.ht/~sjl/dotfiles/browse/default/vim/vimrc#L2644
23:33:06
sjl
So I end up with my files in splits, with a terminal split and the Vlime repl output split also visible, e.g.: https://i.imgur.com/DuBD6WD.png
23:37:21
sjl
I generally use \e more than \f though, to just "compile current top-level expression" rather than the entire file at once
23:39:34
sjl
Oh, sorry, you said "without loading the whole file". Yeah that's the <localleader>e mapping there.
0:47:27
lowryder
sjl: It took me a moment, but everything became clear when I tracked down your sbcl-vlime command
1:02:06
Xach
margaritamike: there are probably a lot more libraries to save you work in other environments.
1:02:48
Xach
There are libraries to parse html and libraries to fetch web pages in lisp, but not as many choices
1:04:47
no-defun-allowed
writing a scraper in CL would be less time for everyone in the future though
1:04:48
pjb
Once upon a time, web crawling involved a lot of ad-hoc coding. For that, lisp was rather good. Nowadays, we may assume that web pages are more correctly following standard, but that's not entirely the case. So depending on the pages and their age, you may find that lisp is preferable than using other libraries that may be harder to patch.
1:05:42
pjb
On the other hand, nowadays, you would definitely want a complete javascript implementation to be able to crawl random sites correctly.
1:30:53
pjb
But the advantages of lisp can be its inconvenients; it doesn't have all batteries included. When you need to understand and modify the code, it doesn't matter. But if you just to do something predetermined fast, a canned library might be better.
1:31:29
pjb
On the other hand, IME, most of the time when you start with a canned solution, you find that it's defective in a way or another, and you end losing more time trying to make it work to your case than if you had started from scratch with lisp…
1:39:03
no-defun-allowed
you can trust pjb to be a saddist, i hope other people here are more optimistic
1:46:41
pjb
For example, once I had to write a simple program for OpenWRT. Instead of using ecl as I would have, I had to do it in python. But on that processor, python didn't support threads, so the core functionality of this program couldn't be implemented. Alternative python compilers were of no use. Eventually, I wrote it in C, but it would have been done in a fraction of the time in CL with ecl.
4:34:05
aeth
margaritamike: It's not defeatist. The main drawback of CL is that if 95% of your work is already done in a library, it's probably not a CL one
4:38:06
aeth
this is the realistic drawback of any non-top-10 language without a corporate sponser that can pay for replacement libraries