freenode/#lisp - IRC Chatlog
Search
21:26:20
phoe
All conditions signaled inside FOO are going to be printed, but execution will keep on going.
21:52:31
no-defun-allowed
If they can't read it, they can't crack it -- I mean I haven't heard of it used like that.
21:56:16
pjb
drduck: security by obscurity is no security. There are AI-based malware. You could implement that in lisp. There are AI-based countermeasures. You could implement that in lisp.
21:56:36
pjb
drduck: Please don’t assume Lisp is only useful for Animation and Graphics, AI, Bioinformatics, B2B and E-Commerce, Data Mining, EDA/Semiconductor applications, Expert Systems, Finance, Intelligent Agents, Knowledge Management, Mechanical CAD, Modeling and Simulation, Natural Language, Optimization, Research, Risk Analysis, Scheduling, Telecom, and Web Authoring just because these are the only things they happened to list.
22:01:44
no-defun-allowed
Please don't assume Lisp is only useful for malware since we infected your computer with it.
22:27:48
jcowan
https://web.archive.org/web/20120128001349/http://philosecurity.org/2009/01/12/interview-with-an-adware-author
1:00:14
White_Flame
discussed this pretty recently, but in old code that I've seen, consider a normal hashtable scenario holding a symbol->value mapping. If you have no hash tables but only symbol plists, then the usage is symbol-plist ->(table-name value)
1:01:22
White_Flame
so there is no central object holding the table. The symbol keys are just annotated with the table named entries in the plist. It's a pretty good way of avoiding plist key clashes
1:02:39
anamorphic
So I was playing with this: (defun magic-keyword (keyword) (setf (fdefinition keyword) #'(lambda (hash-table) (gethash keyword hash-table)))), which lets you use (:foo hash-table) like in Clojure... Is that kind of thing likely to cause a mess in subtle ways?
1:05:25
White_Flame
I can't see anything at simple glance of the spec that would clash with that use
1:06:40
White_Flame
it does go against common style in terms of what keywords are for, but I don't think there'd be a technical problem with it
4:36:15
leo_song
Speaking about network, is there portable way of avoiding the read hanging on the unfinished line other than READ-CHAR-NO-HANG?
5:09:07
leo_song
Better to write a new one over the system calls when dealing with GBs of data other than the READ-CHAR-NO-HANG
5:19:13
beizhia
Anyone got some good resources for introducing other coders to Lisp? Going to be giving a little talk to a bunch of php and JS coders. I
5:22:37
aeth
beizhia: you could try doing something fun and visual with a library like https://github.com/vydd/sketch or https://borodust.org/projects/trivial-gamekit/ or https://github.com/cbaggers/cepl
5:22:39
beizhia
I was thinking of giving a good showing of REPL/Slime development, macros, asdf/quicklisp, etc
5:23:08
beizhia
maybe a bit of interactive web-dev with hunchentoot, since thats what I've been doing lately myself
5:24:17
aeth
beizhia: I think CEPL would be a good choice to show off what SLIME can do. e.g. https://www.youtube.com/playlist?list=PL2VAYZE_4wRKKr5pJzfYD1w4tKCXARs5y
5:24:54
aeth
Only do graphics if you have control over the hardware, of course. Who knows what drivers a random machine has.
5:25:29
beizhia
Oh ya, those would be pretty rad. I'd be showing it from my machine, so that's all cool
5:25:40
leo_song
beizhia: I think build a "cl-php" over hunchentoot should cost less than 1000 lines of code, and much faster than real PHP
5:26:59
beizhia
I do want to keep it around 30 mins of demo time, so its probably more of a core concepts of the language sort of thing
5:28:39
aeth
leo_song: if you mean implementing PHP in CL, it's probably not 1000 lines. cloc says I have 763 lines of .lisp and .scm code in my Scheme implementation in CL and it's only about 40% complete. And Scheme's one of the closest languages to CL (and one of the smallest specified languages)
5:32:22
leo_song
aeth: yes, one of my freind did a similar thing in Node.js during the internship, he said it's very handy
5:44:46
leo_song
beizhia: I think a very important point is telling people Common Lisp is actually simpler than their languages
5:51:21
beizhia
leo_song: Agreed. I do also have to make them comfortable with the syntax (or lack thereof)
6:05:39
aeth
I mean, left-pad was accidentally quadratic but not really. https://accidentallyquadratic.tumblr.com/post/142387131042/nodejs-left-pad
8:57:51
beach
A Gray stream is a stream. It is named after David Gray, so it has nothing to do with the color.
8:58:51
jmercouris
so it is a protocol based on the implementation of some defmethods required to be considered "gray"
8:59:15
beach
Then the programmer defines methods on that class like trivial-gray-stream:read-char etc.
8:59:24
jmercouris
so it is one programmers specification of what functionality a stream object should support
8:59:52
jmercouris
and why might I want to conform to this protocol? are there supporting libraries that expect gray stream conforming objects?
8:59:53
beach
Yes, for example, you can write a stream that returns random characters and never reaches EOF.
9:00:33
beach
SBCL and probably most other Common Lisp implementations accept Gray streams as arguments for stream functions, like READ.
9:03:43
jmercouris
and I assume again it was probably a time/money issue that prevented its integration into the specification?
9:04:43
jmercouris
so what happens if you only implement part of the protocol, let's say you only implement the byte reading methods
9:05:26
jmercouris
for example, in places where SBCL allows gray streams, will it cause issues, or would it just try to work, and if a method doesn't exist- then raise a signal
9:06:46
jmercouris
I'm hoping that when I get to it in a Gentle introduction that I'll finally understand
9:07:11
beach
There are no signals in Common Lisp. The only "signal" in the Common Lisp HyperSpec is a verb.
9:09:18
jmercouris
by that same logic couldn't you say "this signal in this function produced a condition"?
9:09:39
beach
Here is an example of use of Gray streams: In Second Climacs, I nead to READ the contents of an editor buffer. But the buffer is not a stream. It has a complex structure. So I create a Gray stream that is acceptable as a stream to the Common Lisp implementation, and that knows about the structure of the buffer, so that it keeps the current line and column in its instance.
9:11:09
jmercouris
so when you say "the buffer is not a stream", you basically mean the buffer is not a contiguous block of data that can be easily read from?
9:11:49
jmercouris
and so you hide that complexity behind a stream object that knows from where to fetch the various parts that compose the buffer to make it appear as if it is one contiguous block, or a file or something, something that a normal stream could read
9:11:52
beach
Furthermore, in Second Climacs, I keep a cache of expressions already read, indexed by position. If a call to READ is made with such a position, I return the cached object, and advance the position beyond the characters of the object.
9:12:23
beach
jmercouris: I mean, it is not a stream in that it is not (typep <buffer> 'stream) so it can't be used to READ from.
9:12:52
jmercouris
okay, I see, it is some other, unsupported type, so you had to implement a gray stream to treat it as a stream
9:13:25
jmercouris
and why exactly might you want to do this? where did you need to read the buffer contents as a stream?
9:13:48
beach
jmercouris: The buffer contains Common Lisp code, and I need to read it in order to analyze it as such.