freenode/lisp - IRC Chatlog
Search
13:50:09
jackdaniel
if anyone have some spare time in their hands I'd appreciate critical remarks on this mailbox implementation: https://gist.github.com/dkochmanski/4de37d4e7432d8d59afa7d2a64a4bb41
14:06:11
gilberth
As a matter of taste: I do not like the business on lines 81 and 82. Why not (min (mailbox-%count mailbox) (or n (mailbox-%count mailbox)))?
14:06:57
gilberth
And then the ZEROP test could be skipped. When 'n' is zero the LOOP would return NIL as well.
14:07:28
phoe
I'd also abstain from modifying the function argument and introduce a new binding instead - again, matter of taste and a little bit of debuggability
14:17:51
hjudt_
what is the best way to concatenate pathnames, or better a pathname and a string? e.g. i want to concat "~/my/path/" "to/this/file"?
15:03:44
verisimilitude
You can also use MAKE-PATHNAME with the :DEFAULTS argument being set as necessary.
15:45:21
catchme
They require that I know the function symol, but I want to pass the pointer and args type without the symbol name
15:47:01
_death
https://common-lisp.net/project/cffi/manual/cffi-manual.html#foreign_002dfuncall_002dpointer
15:48:55
catchme
As I understood from the example `(foreign-funcall-pointer (foreign-symbol-pointer "abs") () :int -42 :int)` the pointer doesn't mean the function pointer!
17:21:50
verisimilitude
Perhaps they wanted to fix this bug, but couldn't, because some programs have grown to depend on this useful behavior?
17:30:30
grewal
At my last job, csh (or rather tcsh) was still the "official" shell according to all the documentation. Of course, all actual shell scripts started with #!/usr/bin/bash
17:55:29
lionrouge
what is the fastest LISP dialect now? I mean suitable to write a scientific calculation program
17:56:13
lionrouge
maybe there are libraries to do the task like NumPy/SciPy/etc. in Python which itself is pretty slow
17:56:15
phoe
but, if you want Common Lisp, SBCL is pretty damn fast when it comes to optimizing numeric computation
17:57:42
verisimilitude
Unlike Python, it's common to write Common Lisp libraries in Common Lisp, or at least that's the ideal.
17:58:15
lionrouge
When I heard it's name for the first time I thought there was some Steel Bank and it created a LISP dialect for it's own internal purposes and only recently I discovered true history of the name :)
17:59:13
phoe
at that university, Carnegie was a professor of steelworking and Mellon was a professor of banking
18:01:34
verisimilitude
Rust, however poor, is an example of a language with a rather standard package manager.
18:07:01
grewal
phoe: Carnegie and Mellon weren't professors. They made their money in steel and banking, and then founded the university
18:09:05
verisimilitude
Well, I'd thought ``professor'' could be used to show support of something, making phoe roughly right despite the phrasing, but that meaning only applies when concerning religion, after checking my dictionary.
18:11:30
TMA
universities are rarely named after academics -- there are exceptions, but then the named academic was already dead by the time the university was founded
18:13:58
Bike
because carnegie mellon university as an entity didn't exist until both the actual people died, i think
18:13:59
verisimilitude
My Oxford dictionary only uses that meaning for religion, but it does make sense that it would apply to the other meanings, I thought. Which dictionary is that, dlowe?
18:14:54
Bike
wiktionary has it, and has a quote about professors of magic, which is sort of not a religion
18:15:59
dlowe
As an educated native speaker, I would never ever abscribe that meaning unless I was reading something old.
18:17:31
Bike
using cognates like that is a pretty common thing for speaking a learned language, there's no especial problem
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