freenode/#lisp - IRC Chatlog
Search
19:07:51
verisimilitude
I don't like it, in any case, but it's certainly easier to argue for using GTK or Qt, since GUIs under UNIX are always going to be awful for no good reason.
19:08:30
djeis[m]
I agree, except for the hating on Python lol. Python was neither poorly designed nor poorly implemented, it intentionally chose representations and dispatch systems that can't be implemented in a highly performant manner in favor of other design choices. Also, there is a 3rd party McClim backend that uses SDL2, it's just really slow and kinda a mess.
19:08:47
verisimilitude
I'm still surprised that I'm apparently the first to try to write something comprehensive, instead of just using an Ncurses linking.
19:09:22
verisimilitude
I've seen I believe one library that didn't link to Ncurses, but it was unfinished and, in my view, rather poorly written.
19:10:34
verisimilitude
The first time I read about Python's one-line limit on lambdas, I thought it was a joke, djeis[m]. There's also no TCO for poor reasons. I've also read an entire article about how Python's halfway equivalent to UNWIND-PROTECT doesn't actually work.
19:11:51
djeis[m]
The one-line lambdas was dumb, fair. The TCO is intentional tho, TCO can make understanding stack traces harder. And, how is python's finally broken? I'm not aware of that one.
19:14:27
drmeister
What do folks think about what is going on in the Java world with Oracle? https://www.reddit.com/r/programming/comments/alvviz/oracles_newest_audit_tactic_focusing_on_java_or/
19:14:58
verisimilitude
Here's the link: https://vorpus.org/blog/control-c-handling-in-python-and-trio/
19:15:26
phoe
drmeister: to put it bluntly and somewhat incorrect, only if they use Oracle-licensed code.
19:17:27
drmeister
I've checked out minecraft clones in the past. The sheep keep getting stuck in streams.
19:19:07
copec
With all these get kids hacking things tying into minecraft, that seems like that would be great
19:19:22
dlowe
you can replicate the code, but it would be very, very hard to replicate the culture that sprang up around the original
19:21:15
drmeister
Oh dear lord - there goes an hour this weekend checking out https://github.com/pupcraft/sucle
19:21:17
easye
One can use ABCL to "script" Minecraft, which is almost as good as a "Minecraft clone in CL".
19:23:32
easye
drmeister: Encouragement definitely came out of conversations with you and Xach, amongst others.
19:23:39
phoe
"Now let's evaluate this Lisp form to give ourselves diamonds. Diamonds. DIAMONDS!!!1"
19:24:28
phoe
easye: if you need any playtesters, I'll gladly spend some time trying to test your stuff on my machine
19:25:10
easye
phoe: Sure. Lemme get my proverbial bits in a line. Probably have something ready on Monday or so.
19:25:29
phoe
some further yak shaving^W^W^W^Wnext step: interface with the ComputerCraft mod to get a Common Lisp REPL in your minecraft game
19:25:53
drmeister
ACTION just started playing minecraft again - he's (slowly) working up the minecraft technology stack to explore underwater.
19:27:02
phoe
watch out guys, drmeister is going to build an underworld lab to create new crafting recipes in
19:27:04
drmeister
Minecraft is less depressing than snarfing up political blogs - but it takes so many cycles away from clang compilation.
19:27:38
easye
But I was working on getting the ABCL REPL in the same process space by including it on the classpath.
19:28:32
easye
So, one can dynamically introspect and manipulate the Minecraft code via immediate reference, rather than having to bridge some sort of RPC.
19:29:30
djeis[m]
That'd be interesting and terrifying, from a minecraft server owner's perspective.
19:30:05
drmeister
easye: I try to keep things ultraportable so I can work anywhere - I am compiling on my macbook Pro all the time. I walk around with it open because it's compiling so much.
19:30:32
djeis[m]
ACTION is considering remote server administration via connecting to a running minecraft server
19:31:54
drmeister
phoe: I use AWS a lot - but too often I find myself with no internet connection while I'm working on something. I find that maddening.
19:32:19
easye
drmeister: re: obfuscation: by following known hacks that others have done. Recently (last six months) part of the API stabilized by committing a sort of "RPC" interface in one of the Minecraft jars.
19:33:52
drmeister
Jeeeze - I've thought about Common Lisp and minecraft to teach programming so many times over the last decade.
19:34:29
drmeister
I'm not planning on going to ELS this year (crazy, wonderful things are going on here). But ... minecraft... Common Lisp...?!
19:35:16
dlowe
It's an impressive community effort, given the complete lack of interest by its creators.
19:35:21
drmeister
shka_: Well, I thought, hoped, dreamed I could get my daughter interested in programming.
19:36:55
MichaelRaskin
shka_: not being able to program doesn't release you from dealing with IT being horrible, though
19:39:30
easye
drmeister: Good. Honestly I didn't end up getting my daughter interested in programming either with this, but it was still cool to do.
19:40:12
drmeister
ACTION grumbles - dammit - well - somebody's daughter better get interested in programming.
19:41:38
sukaeto
I'm hoping she'll be willing to learn to program just to be able to automate basic tasks/make her own computer more useful
19:42:23
easye
Honestly learning how to type is a big impediment. When I was her age, I spent a lot of time puring over DECWriter printouts, correcting programs ~.
19:43:26
verisimilitude
If you're going to teach any of your children to type, teach them with a decent layout, such as Dvorak.
19:43:59
sukaeto
I honestly believe that it's impossible to communicate as quickly using an onscreen keyboard on a smart phone as it is with a keyboard
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