freenode/#lisp - IRC Chatlog
Search
7:56:42
ggole
Mmm. There are advantages beyond just removing indirect branches, though, since you can inline the now direct calls and get the usual benefits.
7:57:26
ggole
The usual disadvantage is that defunctionalisation is a whole program transformation, but dynamic compilers don't really suffer from that.
7:58:12
aeth
This article talks about some advanced branch prediction. And it points out that it's not even the best known methodology! https://fuse.wikichip.org/news/2458/a-look-at-the-amd-zen-2-core/
7:59:43
ggole
If you compile strictly AOT, then yes. However a JIT compiler can record which classes/values actually arrive during execution, avoiding that problem.
8:05:20
dialectic
ggole: What do you mean "defunctionalization is a WPO, but dynamic compilers don't really suffer from that"?
8:06:18
ggole
A dynamic compiler is presented with all of the code at runtime (although not necessarily all at once). Thus there's no issue of separate compilation.
8:07:48
dialectic
seok: I haven't used it but isn't this what you're asking for? https://github.com/fukamachi/caveman/blob/master/README.markdown#structured-querypost-parameters
8:09:13
dialectic
In other frameworks the body isn't always parsed until you ask it to be parsed. I wonder if there's a way to do trigger that in caveman2.
8:13:44
dialectic
seok: No, you're supposed to use (defroute ("/login" :method :POST) (&key _parsed) and then get the values out of _parsed.
8:14:18
no-defun-allowed
dialectic: The predictor isn't that dense, just one perceptron per register. I think Zen 1 had something like that too.
8:16:03
dialectic
seok: You can tell from the rest of the documentation that the macro uses specific symbols to bind specific features. _splat is another example in the docs.
8:17:01
aeth
dialectic: I guess the next step in advanced compiler writing is reverse engineering exactly how Zen 2's branch prediction works and optimizing for it. (Or deoptimizing it with pathalogical cases if you're writing Intel C's compiler.)
8:17:29
no-defun-allowed
dialectic: Seems this paper was presented to the IEEE in 2001 if it matters. I wouldn't be scared.
8:17:30
dialectic
You're welcome. I remember you asking that question yesterday (or the day before) and felt bad when you asked it again
8:17:59
no-defun-allowed
And well, there's only so much you can do by increasing clock rate. I think CPU manufacturers learnt that at the end of the 00's.
8:18:28
aeth
no-defun-allowed: A lot of Intel marketing right now is just a giant "5" and then a smaller ".0 GHz"
8:19:31
no-defun-allowed
aeth: Don't forget the 1HP portable air conditioner used to get the processor to that speed.
8:21:05
no-defun-allowed
Apparently perceptrons were used for prediction as early as Piledriver (in 2012).
8:21:33
shka__
no-defun-allowed: 5GHz on silicon translates to 120W of TDP which is a practical limit of air cooling
8:22:50
no-defun-allowed
shka__: I was referring to a demonstration Intel did where they literally used an air conditioner to cool their processor.
8:24:20
no-defun-allowed
https://i.redd.it/hqlqm3jkfn211.png is the last I'll say about perceptrons and processor cooling, though I want to write a perceptron now.
8:26:18
shka__
it is probabbly the simplest ML algorithm possible, but i wonder how they put it on the silicon
8:30:44
aeth
an impractical gimmick is exactly the sort of thing we might see in parts that are stereotyped toward impractical gamers, though
8:31:09
seok
no-defun-allowed: you are right the docs say "it should not be used in code where performance is important"
8:32:37
seok
shka__: haha, for at least early stages of development I will try this out. I don't imagine accessing slot values will ever be a bottleneck in my web application
8:32:46
no-defun-allowed
Also I can't tell if it handles multi-dimensional arrays, which is a shame because you don't see them in many languages and I like to brag.
8:33:44
aeth
shka__: Fortunately, even though the important computers are cloud servers, they're not too different from desktop CPUs with lower clock speeds, especially these days with the core wars going on.
9:35:18
jackdaniel
there is also #clschool if you have numerous basic questions due to learning the language
9:35:32
Filystyn
ok. I have this first question. defvar *db* nil <--- I have this example but the clisp complained and I had to remove nil
9:36:09
Filystyn
I do not knwo which questions are basic in my opinion #languageNOOBS channels are useless and have little support
9:37:18
jackdaniel
#languageNOOBS channels are for populated by people who are interested in giving advise. some people hang on irc to spend time with fellow lispers
9:37:30
jackdaniel
that said it is unlikely that clisp responded to (defvar *db* nil) with a warning
9:41:02
minion
Filystyn: direct your attention towards pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
10:07:19
no-defun-allowed
You can write that into file.lisp, then any references to +var+ will be replaced with that "something".
10:16:54
no-defun-allowed
If you want that symbol to alias *winedb*, you should use define-symbol-macro then.
10:23:17
_death
(defun evil-load (file &optional alist) (with-open-file (stream file :direction :input) (loop for form = (read stream nil stream) until (eq form stream) do (eval (sublis alist form)))))
10:25:17
no-defun-allowed
_death: didn't know about sublis and always wrote it myself, thanks for pointing it out
10:57:39
jackdaniel
there is another question, is the thing you want really the thing you want, or these are just misdirected means to an end we do not know about
10:58:50
jackdaniel
I'm saying that only because I was scolded once in the past for verbatim answering the question instead of hinting the solution, justfully so ,)
12:36:47
ochkep
There is now a way for foreigners to donate to MoveOn PAC without being detected and to help defeat Donald Trump in 2020. We have set up accounts that will take your donation and peg it to the name of someone who hasn't donated the maximum yet. Best of all, this is 100% legal! Help preserve human rights and global governance; donate to MoveOn. “When a community starts to listen to each other, pull together, and work towards
12:36:47
ochkep
URI: bitcoin:bc1qyv7kug65090hq8yhzp76q2kvujt69p9pdxrjd7?amount=0.03000000&label=MoveOn&message=MoveOn%202020
13:04:16
jackdaniel
oh, I've banned him? I totally tried to click "donate on this shady link" button
13:14:15
ck_
I'll add the phrase about legality to my dictionary, next to "... in concordance with the prophecy"
13:14:36
p_l
(unless you work on missile guidance and post on #lisp, but that's a bit different case)
13:17:33
no-defun-allowed
Not a good one though. Good reason to make sure you always optimize for safety ≥ 1.
13:19:41
no-defun-allowed
MAKE-INSTANCE, not -WAR, or something. Night, don't let the spambots bite.
13:27:17
p_l
ck_: how about "for majority of human population, it might be perfectly legal to shoot to kill many of NSA employees and contractors" ;)
14:09:51
ck_
It will also come up when printing circular data structures (and *print-circle* is not nil)
14:17:25
pfdietz
Or, more generally, when printing structures that have sharing of things that are not normalized to EQL objects on reading (like lists or uninterned symbols).
14:30:32
Xach
this has been a sore spot for me but I recently I can do it all in lisp (like i do everything else). for the longest time i thought i had to use somebody's shell script.
14:32:35
Xach
of course, it's lisp that does a lot of shell-command running, but running commands with control in lisp is nicer to me than running shell commands with control in shell
14:35:33
Xach
it's not the most streamlined but it seems to work for me -- https://pastebin.com/BfJptuCU
15:37:50
mfiano
Are there any libraries containing a list of country names, perhaps with a mapping of 2-letter country codes to full names? My use case is a drop-down list for a client's web site I am maintaining.
16:06:35
sjl_
mfiano: echo '('; curl 'https://pkgstore.datahub.io/core/country-list/data_csv/data/d7c9d7cfb42cb69f4422dec222dbbaa8/data_csv.csv' | tail -n +1 | sed -E 's/"?(.*)"?,(\w\w)/("\2" . "\1")/'; echo ')'
16:10:33
sjl_
might want to look for the official source and transform that -- I have no idea how reliable "data hub dot i o" is.
16:16:19
sjl_
but really that was just a silly way of saying "just find the official list and transform it into sexps somehow"
16:18:44
mfiano
This is as official as I'm going to get I think: https://download.geonames.org/export/dump/countryInfo.txt
16:21:23
sjl_
curl 'https://raw.githubusercontent.com/MarcoPolo/iso-country-codes/master/src/iso_country_codes/countries.clj' | tail -n +2 | tr '{}[]' '()()' | sed -E 's/\(def countries/\(defparameter \*countries\*/' is almost there, except for the silly commas
16:23:48
isoraqathedh
Otherwise I guess you can wrap the whole expression with a ` and just let the commas sort themselves out.
16:25:17
ck_
just leaving this here for the log: https://www.cia.gov/library/publications/the-world-factbook/appendix/appendix-d.html
16:27:55
sjl_
incredible: curl 'https://raw.githubusercontent.com/MarcoPolo/iso-country-codes/master/src/iso_country_codes/countries.clj' | tail -n +2 | tr '{}[]' '()()' | sed -E 's/\(def countries/\(pprint `/' | sbcl --script
16:33:46
mfiano
this works for the official geonames list I linked above. I can't get it to work without a temporary file though: echo '(defparamter *countries* ('; cat file.txt | awk '{ print "(\""$1"\" . \""$5"\")" }'; echo ')';
16:38:02
sjl_
something like curl https://download.geonames.org/export/dump/countryInfo.txt | awk -F\t 'BEGIN { print "(defparameter *countries* \'(" } /^[^#]/ {print "(\"" $1 "\" . \"" $5 "\")" } END { print "))" }'
16:41:08
LdBeth
I find some limitation of the implementation of META on quicklisp which makes it less powerful & flexible compare to the original one presented in that paper
16:53:50
trafaret1
need help want to know how to get package info from slime which I can obtain via quicklisp
16:56:43
pjb
ck_: it would be an error to assume that all applications are always working on data describing the present.
16:58:37
pjb
now, granted having a package such as com.informatimago.common-lisp.cesarum.iso3166 is not good, since the data is apparently fixed, and if a new version of standard appears, it won't rack it (automatically). It would be better if it downloaded the standard at compilation-time or at load-time, and updated its database accordingly.
17:00:52
sjl_
mfiano: works for me. I use fish as my shell though, you might need to adjust for bash or whatever
17:01:10
mfiano
sjl_: I fixed it with: curl -s https://download.geonames.org/export/dump/countryInfo.txt | awk -F$'\t' 'BEGIN {print "(defvar *countries* ("} /^[^#]/ { print "(\""$1"\" . \""$5"\")" } END {print ")"}';
17:02:49
ck_
but continuing on this increasingly off-topic branch of conversation, what's the latest country that changed names? Congo comes to mind, but that was a while ago already
17:04:52
stacksmith
https://en.wikipedia.org/wiki/Geographical_renaming - although #lispcafe is probably a better place for this
17:13:23
jackdaniel
stacksmith: you've mentioned CLIM In the morning (probably yours yesterday), in case you didn't see the log I've provided some explanation which you may find useful
17:16:00
jackdaniel
CLIM specification is complicated because it describes at least three things: window manager abstraction, barebones I/O toolkit and CLIM itself ← this
17:52:25
stacksmith
jackdaniel: I think I was trying to say that a system that is too complicated to fit into the CLOS dispatch mechanism and requires a layer of predicate logic is probably too much for my tiny brain...
17:56:08
jackdaniel
presentation-types have more to do with CL types than CL classes per se, that may be the reason
18:04:35
stacksmith
I understand the need to fine-tune dispatch and even create a protocol layer separate from the general dispatch mechanism, including a meta layers for discovery and versioning negotiation, etc. It just gets tedious after a while to be on the user end of it. If unchecked, it turns coding into something akin to accounting or filling out government forms. At least we have SEXPs, which avoids 'the obvious solution' of usng XML.
18:16:28
stacksmith
I am just bitching about complexity of frameworks in general, and my annoyance at having to learn quirky large frameworks that impose large amounts of quirky rules. CLIM is certainly no worse than anything else, and probably better than most. In the ideal world, a framework would remain transparent, allowing you to use as little or as much as you want, without a massive commitment. Kind of the way CLOS lets you pick and choose.
18:17:30
jackdaniel
CLIM kind of does, the issue is that the lower parts are not properly documented and separated (btw, please see query message)
18:25:21
stacksmith
jackdaniel: I will take a look - I am due for another round of McCLIMming soon. What I would love to see is a non-emacs text environment, in which maybe you can pop up a menu or a dialog box. Or if you wish, open a window and output some stuff into it. And maybe have some presentations bind some keys. So it's a smooth transition from text to a full-blown GUI if needed. I think McCLIM is kind of like that.
18:27:35
jackdaniel
n.b: https://files.mastodon.social/media_attachments/files/016/413/077/original/6de35a0d65c75548.png log4cl appender (all source code may be seen on the screenshot)
18:42:12
stacksmith
Huh. Reminds me of https://github.com/stacksmith/subtext , my attempt to wrangle GTK into a Lisp UI... I would just love to get rid of Emacs in the middle screwing everything up.
18:48:06
stacksmith
Does CLX work well with antialiased fonts? I think last time I tried McCLIM jackdaniel talked me through installing an antialiased font that looked good...
18:48:57
jackdaniel
Andy Hefner implemented antialiased fonts over a decade ago, and I've added kerning and transformations this year
18:49:22
jackdaniel
shka_: it may look good or bad, but what's more important it is much faster than logging to emacs
19:18:36
vsync
Jachy: perhaps you know, what is the reason for requiring both inherit from protocol class and satisfy protocol predicate?
19:23:39
vsync
wait, but "However, simply implementing a method for the predicate that returns true is not necessarily enough to assert that a class supports that protocol; the class must include the protocol class as a superclass."
19:25:33
jackdaniel
protocol classes are for specializing "default" methods on said protocol classes. predicates are just a syntactic sugar (you could use typep for that for instance where type would be the protocol class name)
19:26:19
jackdaniel
stacksmith: no subpixel antialiasing. loke has ressurected freetype engine which do support that, but it is disabled by default (we prefer native lisp over ffi). instructions on how to enable it are on the wiki in github
19:26:51
vsync
ohhhh wait... this describes two approaches one can take in designing a protocol, not a choice of how to implement