libera/#commonlisp - IRC Chatlog
Search
1:26:53
hobo
so, I wrote a chat program to learn CL, and I currently connect to the server via telnet. One thing I noticed is that if the user is in the middle of typing, and they receive a message, then the input gets broken up.
1:27:43
hobo
ideally, the incoming message appears above the prompt and their input remains untouched
1:30:03
semz
alternatively you could use something like curses on the Lisp side or output the necessary control codes yourself, but that might go beyond the scope of a beginner project
1:54:02
phantomics
The concept of curses is pretty simple: you can get the dimensions of the screen, move the cursor to a given point and enter characters. What you want to do is keep track of where the user's cursor is, and then when a new message comes in, you rewrite all the text in the chat area above the entry area, then when finished, move it back to where the user had the cursor before the message came in
1:59:26
hobo
to be clear, would i need to write a separate curses client, or can I just send the telnet client the screen buffer?
2:03:07
phantomics
curses has a method to get the screen size, croatoan exposes it, see: https://github.com/McParen/croatoan/blob/master/test/evolution.lisp
3:50:24
hayley
I just got SIMD scanning working in my regex engine. It is now about three times as fast as Hyperscan at finding resolutions in my Xorg.0.log apparently.
3:52:24
White_Flame
hobo: are you sure you used raw telnet for muds, and not something like tinyfugue?
4:09:36
phantomics
Interesting thing I just discovered in LispWorks: (expt 10.0d0 10) gives 1.000000000000004D10, the 4 is not there in other CLs. Causes problems when taking the ceiling of the result
4:11:35
Nilby
hayley: just don't sell out to intel, or if you do make sure to get a big ask like qpx
4:13:47
hayley
Not quite as "feature"ful, given that I have to generate a DFA from everything, but it's pretty fast in return, even without SIMD.
4:14:41
phantomics
Cool, I'll have tackle SIMD at some point for April, I take it the SIMD is using define-vop and only works with SBCL?
4:16:46
semz
phantomics: A program that relies on this exact behavior sounds misdesigned to me, the same way a program using exact FP comparisons would.
4:18:11
phantomics
It also has a tendency to lock up a lot during intensive April computations, maybe it's a problem with the multithreading
4:22:12
phantomics
ECL sometimes locks up once or twice when doing the intensive demo test suite, but LW locks up a dozen times or so needing manual restarts. SBCL, CCL, and ABCL get through it fine.
4:23:24
beach
I think you should report it to LispWorks. I am sure they will appreciate the feedback.
4:27:15
beach
I don't think so. Martin Simmons seems like a very reasonable person. At least when we have diner together at ELS. :)
6:31:36
White_Flame
phantomics: CLHS says that "a floating point approximation might result" for anything but (expt <rational> <integer>)
7:49:56
jackdaniel
n.b I'm not "a fan of stable things" - most notably I'm not that cool (a pun towards the word "fan"), but changing stable apis breaks existing code - mind that no common lisp implementation changed nth argument order to match elt, even if someone could have thought that it is a good idea :)
7:51:03
jackdaniel
or that changing the interface of with-output-to-presentation in a non-backward compatible way would break many preexisting clim applications
8:06:03
beach
jackdaniel: It would be much easier to parse what you wrote if you would capitalize NTH, ELT, API, and CLIM.
11:25:08
pjb
jackdaniel: beach: would I suggest to use instead 𝐧𝐭𝐡, 𝐞𝐥𝐭, 𝐀𝐏𝐈, 𝐂𝐋𝐈𝐌, given the flame you can get when using upper case?