freenode/lisp - IRC Chatlog
Search
18:18:28
verisimilitude
If people misuse the language and that's allowed without complaint, such cretins destroy the language over time.
18:19:11
grewal
p] lionrouge: Is there any particular reason you want to use lisp for scientific work?
18:20:16
verisimilitude
Tying this to Common Lisp, I expect every implementation to follow the standard, and if it doesn't, then it's broken and I won't ``correct'' my program to work on it, even if it were a trivial change.
18:21:48
grewal
Sure, but natural language is more like pseudocode than code. It adheres to a "metalanguage" rather than to a formal spec.
18:22:19
grewal
And what about if you had a working lisp program in Lisp 1.5 or Interlisp or something, you wouldn't ``correct'' it to work on Common Lisp?
18:23:40
verisimilitude
Still, Common Lisp was designed to be the common dialect and so contains many things those others had to ease this.
18:28:07
grewal
At what point do we say no more change? Should we go back to Old English or Latin? Should we drop modern languages and program everything in assembly? (N.B. I not making an analogy between Latin and assembly)
18:29:37
verisimilitude
I'd certainly prefer to use a singular ``they'' and also ``thou'' instead of the ambiguous ``you''.
18:30:08
verisimilitude
If the machine is high-level, why not program in its native language, grewal?
18:35:15
lionrouge
grewal: I'm an FPGA designer and my father is a physicist with some bright ideas on simulating physical processes which he implemented in Fortran in late 80s in his thesis. He wants to continue this work and I want to help. However I don't want to use C for it (I know it well, I do highload programs for PC and embedded and I know how easy it is to mess up and how hard it is to change program architecture once it's even a bit mature)
18:35:49
lionrouge
Also I know Python and Go, trying to study Clojure as I got interested in FP in recent couple of years.
18:37:03
lionrouge
Reading some papers by Sussman just makes me feel LISPs are superior for this kind of work
18:37:52
verisimilitude
Lisp is a particularly good language if you only have a vague idea of what you're doing, lionrouge.
18:41:03
MichaelRaskin
Another case is when you are willing to invest into making language constructs to express the computation
18:47:20
grewal
And a nice thing with Common Lisp (and possibly other dialects) is that you can optimize only what needs to be optimized
18:48:41
grewal
And don't forget that you can use ffi to communicate with any existing fortran and C libraries that you don't want to reimplement
22:36:17
sjl
It has a :use-thread key arg that defaults to t if threads are supported, so my guess would be "yes"
23:30:14
seok
Well, after a day of fiddling with various server and web libraries, I think I am ready to build a simple webgame app
23:49:32
pjb
:components ((:file "source1" :depends-on ("package")) (:file "source2" :depends-on ("package")) …)
23:50:56
pjb
:components ((:file "source1" :depends-on ("package")) (:file "source2" :depends-on ("package" "source1")) …) <- add it!
23:54:58
seok
It would save me days of coding trying to figures out puppeteer + chrome api for scraping
23:56:24
pjb
*f is not used often, you could use it, but for special variable the convention is *foo*.
23:56:57
lerax
seok: seems that the main developer uses macOS too, initially didn't even work on Linux
23:56:59
seok
lerax: Its one of the dependencies on NeXT that is hard to install, if not impossible on windows
23:58:55
lerax
I don't use Windows currently... actually it past some years since the last time I used
23:59:29
seok
Well, the options for scraping JS based content atm is Selenium (outdated library on CL), PhantomJS (discontinued) or puppeteer
23:59:53
lerax
Good to see your feedback, seok. Sorry to hear that you cannot tried in Windows. NeXT it's really a nice browser.
0:01:26
pjb
Of course, if it had its own name, I could be more inclined to try to use it. NeXT is Steve Jobs baby!
0:46:04
Bike
if you look at the definition for sb-impl::%defun, you can see it does a bunch of things, and one of them is the setf fdefinition
0:59:53
mfiano
I remember one of the reasons why my team doesn't use defmethods for inner loop stuff is because you said it was slow. We had a discussion about it where I thought SBCL cached the right applicable method after it computed it the first time. But you said it doesn't do that and that's why it is slow. Do you remember anything about this conversation, or have any relevant references? My log searching is coming up
1:01:18
Bike
i vaguely remember something like that, but you might be putting too much stock in my words.
1:04:14
Bike
http://www.sbcl.org/sbcl-internals/Discriminating-Functions.html#Discriminating-Functions
1:06:16
mfiano
So the right applicable method is or is not cached? I guess I'll have to read all of that
1:43:43
pjb
mfiano: anyways, if you use CLOS objects, accessing the slots will use generic functions, and this will be at the core of the most inner loops!
1:50:29
pjb
Using a structure is 3 times slower, only using a direct counter is faster: https://pastebin.com/Egma3LV1
2:00:15
asarch
Any tool to convert hours, minutes and even seconds to seconds (e.g. 02:00 -> 120 seg)?
2:04:47
pjb
cf. com.informatimago.common-lisp.cesarum.date.utility:hms60-from-secondes and com.informatimago.common-lisp.cesarum.date.utility:hms60-to-secondes
2:07:05
Josh_2
How do I tell the compiler to not make annoying noises about variables that are "unused"
2:07:16
pjb
asarch: notice that (decode-universal-time 7200 0) #| --> 0 ; 0 ; 2 ; 1 ; 1 ; 1900 ; 0 ; nil ; 0 |# and (encode-universal-time 0 0 2 1 1 1900 0) #| --> 7200 |#
2:07:49
asarch
Yeah, I need it because I've downloaded a big video with the full OST soundtrack from YouTube and I need the seconds in order to set the bookmarks for the track
2:08:06
psilord
Hello, I have a question about generic functions. When I defgeneric something, and then defmethod a pile of methods, when I invoke them later, are there are requirements about caching the applicable method so the next time I call it in that same code location, the call is faster? Does this concept even exist?
2:09:48
Josh_2
I'm trying to use scope to my advantage, but the compiler is giving me warnings I want to ignore :O
2:09:55
psilord
pjb: [hello!] I'm mostly wondering if when I call a method it MUST perform a lot of work to compute the applicable method.
2:10:33
pjb
psilord: there's an algorithm to find the right method. You call a generic function, not a method. Methods are not funcallable.
2:10:34
psilord
I have a 'memory' of method invocations being slow, and unsuitable for things like math libraries. And, finding that I don't remember the evidence why, or if I just hallucinated it, I'm asking around. :)
2:11:08
pjb
psilord: as you can see from by benchmark above, it's only 10% slower than a normal function call.
2:15:57
pjb
(defun f () (declare (special *tcp-in-socket*)) *tcp-in-socket*) (defun g () (let ((*tcp-in-socket* 42)) (declare (special *tcp-in-socket*)) (f))) (g) #| --> 42 |#
2:20:15
psilord
pjb: But, it is implementation dependent for how much work is done when the generic function is invoked, correct? It COULD compute the applicable method each time, or possibly cache it, or anything in between.
2:21:11
pjb
Yes. But I don't know how to call the method outside of the scope of the generic function. There are constraints on call-method and call-next-method. They're not available in general.
2:23:05
pjb
Josh_2: they don't need the earmuff. You could consider avoiding it, since there's always a clear declarations of their specialness.
2:23:37
pjb
Josh_2: without earmuff, they could pose a problem if you call eval or compile in a function called by a function declaring them special.
2:23:48
psilord
pjb: thanks. It seems then, for my purposes (inner loops running billion or trillions of times) I should prolly use functions and inlining when appropriate as opposed to generic functions.