libera/#commonlisp - IRC Chatlog
Search
20:33:52
_death
pjb: when you write O(...) it means worst-case, iirc.. for average/amortized cases you don't use big-O but phi or somesuch
20:35:19
pjb
That said, nothing prevents you to implement your own hash-table variants with the right properties for your case.
20:35:27
_death
pjb: it's important when you have deadlines (real-time).. so you would then prefer, say, merge sort O(n*lg(n)) over quicksort O(n)
20:35:58
White_Flame
but there are tons of options that emerge with this sort of combined API, that just having the basics suffices better
20:36:15
White_Flame
for instance, if there is no existing key, maybe you want to have different behavior than if one does exist
20:36:29
White_Flame
or have the option to remove the key within your read-modify-write operation, etc
20:36:51
pjb
_death: note that bubble sort on a sorted array is O(n), so it could even be better if our array is usually sorted.
20:37:03
q3cpma
Yeah, another thing that I don't like, is that SBCL's with-locked-hash-table seem to lock the whole table, and not just the bucket
20:40:01
_death
q3cpma: basically for this problem I'd say you want a priority queue (which can be implemented, say, as a heap of some kind)
20:41:38
q3cpma
_death: hmmmm, how would that work with strings? Doing log(N) string comparisons sounds dreadful.
20:43:20
pjb
q3cpma: that said, usually you have to have a lock outside of the hash-table, hash-table locks are quite useless IMO.
20:43:39
White_Flame
you could intern string themselves, or if they don't have very many shared prefixes, failure comparisons will be quick
20:44:18
pjb
hash-table locks are ridicuous: (progn (decf (gethash src-account accounts) transfer-amount) (incf (gethash dst-account accounts) transfer-amount))
20:45:10
White_Flame
and the (incf (gethash ...) ...) doesn't hold a lock between the read & the write
20:45:46
_death
q3cpma: of course CL already gives you hash-tables and sort.. and it'll likely be fast enough (even if a hash-function gets called twice...)
20:45:50
pjb
The point is that if you have multiple threads, there will be other data to include in the mutex, not only the hash-table entry.
20:49:15
Alfr
_death, I doesn't matter whether your analysis is armortized or not. O(f) means there exists A for all sufficiently large X we have g(x) < A*f(X).
20:51:42
Alfr
_death, in contrast big theta means that's g is also bounded below by f, i.e. additionally there's B f.a. large enough X s.t. B*f(X) < g(X).
21:22:36
White_Flame
~/quicklisp/local-projects/ can have symlinks or subdirs that will be quickloaded
21:23:11
White_Flame
or there's asdf:*central-registry* but you need to have init code that feeds it on every launch
21:38:23
White_Flame
seok: no, there's a ql: call to update/refresh the registry, if you've changed the local-projects during runtime
21:43:15
pjb
seok: and not asking the same question in multiple channels. See the answer in #clschool
0:19:29
Guest17
found https://common-lisp.net/project/asdf/asdf.html#Controlling-where-ASDF-searches-for-systems this. looks like I can just define an environment variable for it at build time
0:46:53
phantomics
Hey everyone, is there a preferred library/macro to write paths for getting contents of nested plists? Like (get-lpath list :a :b :c) instead of (getf (getf (getf list :a) :b) :c)?
0:53:27
mfiano
Can someone remind me of the extended keyword parameter syntax or point me to the relevant section?
0:53:54
mfiano
I would like to write a method for #'shared-initialize that accepts non-keyword-interned &key arguments
0:54:13
phantomics
But they mention that performance isn't their priority, in my case I know I'll always be using a plist so I could just write a macro for that case myself
0:57:05
mfiano
So reading this, am I correct in that in order to supply a non-keyword keyword-name, I must explicitly specify the initial value form?
1:00:50
lotuseater
but (&key (a '())) would be helpful, so one knows from reading that there should go a list
1:02:40
lotuseater
mfiano: and maybe you remember also that you can give a specific keyword predicate too as a third component
1:02:42
mfiano
In this case I have several methods defined on #'shared-initialize specializing on classes that are intended to be abstract mixin classes.
1:03:40
mfiano
To define these classes, a defclass-writing macro is used (instead of defclass), which canonicalizes some things. For example, specifying keyword-interned initargs has a high liklihood of clobbering sibling mixins
1:04:16
mfiano
So I must also be sure to do so in shared-initialize/reinitialize-instance/initialize-instance/etc
1:07:28
mfiano
This is a complicated project I've been writing the design down for like 2 months now. Maybe one of these days said design will be solid enough to implement :)
1:13:12
lotuseater
_death: hm just a minor, wouldn't it be: (defun foo (&key (a b)) (list b)) (foo :a 42) => (42) ?
1:14:08
mfiano
I read AMOP recently, and the authors made a seemingly bold claim that the MOP solves the problem in that no longer do you have to choose flexibility over performance. Anyone that knows the MOP knows that is not _all_ that bold :)
1:14:45
_death
lotuseater: your form has a different meaning.. it defines a FOO function with a keyword parameter named :A, a corresponding variable named A, and a default value form B
1:18:19
mfiano
&key ((a b)) means that the argument will be 'A and the parameter will be B, and bound to NIL if the argument is not supplied.
1:18:30
_death
lotuseater: in the sub-section for keyword parameters, an example is given that shows the corresponding long syntax for the short syntax you used
1:19:11
lotuseater
ACTION is very happy to be allowed being around so many very capable people, honestly
1:26:08
lotuseater
hah from our discussion i tried a simple class slot with ":initarg name" so an instance value for this is given by "'name \"foo\""
1:30:40
mfiano
More like trying to piece pages of my thoughts together on paper before I write the next module
1:33:46
lotuseater
mfiano: your "[ab]using to the limit" gets me to the song "Push it to the limit" ^^
1:35:49
mfiano
Naming things is hard, especially when the minimum description that conveys meaning is overly verbose.
1:36:48
mfiano
overly verbose wouldn't be a problem if it weren't for a high-frequency client interface
1:42:47
mfiano
Designing and coding is usually easy in comparison with nomenclature. I would probably be a good mathematician if I gave it as much attention.
1:45:49
lotuseater
so before (define-symbol-macro thing (gensym "THING")). this would be a line in the book "How to screw things up with elegance"
5:05:34
lotuseater
beach: If you don't mind, I wanted to ask you about the status and your plans with Gsharp. I recommended OpusModus (maybe you heard of it) to a very music-affine friend of mine who also works in that topic and he's already on Mac. I remembered your Gsharp project when he mentioned he used MuseScore.
5:06:34
lotuseater
I wonder how much effort would be needed to port OpusModus for other implementations and Linux.
5:08:15
lotuseater
When someone hears `gsharp` it could be thought of a maybe new programming language by Microsoft accidently.
5:09:40
lotuseater
I saw when skimming through your repo files that you also implement things from Metafont. :) very interesting
5:10:22
beach
When I started Gsharp, there was no good Music font. Now there is a free font and a good standard.
5:10:47
beach
Or, rather, there were music fonts, but they looked like crap on low-resolution displays.
5:11:59
beach
So the idea for Clovetree is to use McCLIM, the new open font standard, and the new open font. I forget the names of the standard and the font.
5:12:48
beach
Otherwise, I will simplify the concepts of Gsharp. It was a mistake to introduce the concept of a "segment" to the user. I did it because I thought I needed it for performance.
5:14:34
lotuseater
Is music one of your other special interests? Writing such applications requires also much domain specific knowledge.
5:15:57
beach
And I took an interest in music engraving. First I read the book by Ted Ross, and that was interesting but very brief.
5:16:02
lotuseater
I remember reading about Knuth, when visiting him at home you have to make a organ pipe session playing with him. :)
5:20:02
beach
A composer is someone who knows about things like harmony and counterpoint. I have studied those a little bit, but not enough to be a composer.
5:20:35
beach
Music engraving, however, is something you can read up on and then implement the rules in software.
5:27:01
beach
To someone who is unfamiliar with music engraving as a domain (like for those composers who think they know everything) it is a very surprising read.
5:28:18
beach
So the main features of a program like this is to implement all these rules, with all the possible variations, while still allowing the user to tweak the result (because it is impossible to totally automate).
5:29:22
beach
I can't imagine what prompted the MuseScore developers to use C++. It seems like a masochistic choice.
5:30:41
beach
So what information are you looking for, and what are your plans? Maybe I already answered all your questions?
5:33:25
beach
I mean, why were you interested in the status of Gsharp in the first place? Do you plan to re-implement OpusModus?
5:34:09
lotuseater
And maybe if you know the geometry "GeoGebra" I would like to have this in McCLIM too, so featuring 100% less Java.
5:35:44
beach
Maybe so. Clovetree is stalled at the moment because I am too busy with Gsharp, but maybe later.
5:40:32
beach
Once I finish bootstrapping, there will be tons of smaller, independent projects like a type of compiler optimization, or some other modules.
5:47:15
beach
Bah, Mandarin has only 4 tones as I recall. Vietnamese has 6 or 8 depending on how you see it.
5:48:14
lotuseater
oh sounds interesting, but maybe if I would learn an Asian human language it would be Japanese I think
5:52:37
beach
I lived in Aotearoa for a year, and tried to organize a Kiwi Common Lisp meetup, but there are only around 5 Lispers within a 3 hour flight radius from Auckland. Very different from Europe.
5:54:06
lotuseater
I never lived in another country yet, but I would want to, if some interesting opportunity opens up and someone would need me.
5:57:42
lotuseater
gilberth said jokingly to me organizing some CL meetup somewhere here central and invite some people, now that the situation gets hopefully better with time. but I would also travel for that to France if other costs are not out of my current financial range
6:50:33
pjb
lotuseater: I also worked a little with gsharp, if you have questions. I have some patches here: https://gitlab.com/abnotation/gsharp I have apending pull request on gsharp to prepare for more PR with my patches… https://github.com/robert-strandh/Gsharp/pulls
6:55:35
pjb
beach: that's nice, all PR merged. I will make new PR with my patches soon (I hope over the week-end). Thanks.
6:55:59
lotuseater
I forked the repo this night and skimmed trough, for example changed some (when foo ...) to (unless (null foo) ...) and such