freenode/lisp - IRC Chatlog
Search
7:36:41
krwq
https://www.codeproject.com/Articles/340797/Number-crunching-Why-you-should-never-ever-EVER-us - the only case where linked list is better is when you have fragmented memory
7:39:29
jdz
It should have been "Why you should never, ever, EVER use linked-list in your code again if you program in C++".
7:40:29
hajovonta
the article actually states: "The number crunching prefix is key to this whole article. If the "Number crunching:" part of the title is ignored it might be understood as a general advice to always stay away from linked-list, that is not the purpose of this article. "
7:41:29
jdz
The choice of programming language and libraries constrains (or at least heavily influences) the data structure, algorithm and general problem solving choice.
7:43:38
jdz
krwq: For instance the section(s) about locality of reference completely disregard garbage collection and GC'd language implementations.
7:47:54
krwq
jdz: considering that in almost every benchmark linked list loses I'd rather have linked list as a separate data structure - it's true that we can't tell for sure which one is better without implementing reasonable size lisp program and checking how it performs on both implementations
7:50:22
hajovonta
but then there is versatility and maintainability and linked list may be advantageous when these are more important than number crunching performance
7:51:23
jdz
hajovonta: if linked list is not the right data structure, use the one that _is_ right. Where's the problem?
7:52:11
hajovonta
I often use a linked list when first attacking the problem and then later switch if it becomes a performance problem
7:54:05
jdz
Again, I think the original question was about implementing single-linked lists with vectors, and people in this channel argue that that is the wrong thing to do.
9:02:17
miatomi_
anyone know if there's a "newbie friendly" distribution of common lisp? the thing I'm looking at is this: between learning asdf, learning about quickproject, quicklisp, slime, etc. on top of just learning common lisp, there was a lot of friction that I had to go through that might throw some other newbies off. if there was a distribution of sbcl, lets say, that came bundled with quicklisp and automatically installed quickproject with
9:02:17
miatomi_
a short tutorial, that would probably take down the TTL (time to learn) for new people a ton, and give them an almost clojure/leiningen like experience
9:04:39
pjb
clisp has a number of features that are newbie friendly: it includes readline, and has a usable debugger, so you can use it in the terminal without slime.
9:05:27
pjb
Some care is given to return unsurprising results for newbies. Eg. sort will keep the first and last cons cells in place.
9:05:55
pjb
Of course, it is not a good idea to rely on it, but while learning how to program, it is a question that may stay delayed.
9:06:57
pjb
clisp also has a number of modules included, so that you can write interesting programs without having to load any quicklisp libraries.
9:07:34
pjb
So you can spend a couple of years in clisp, without having to learn slime, asdf, quicklisp, quicklproject, etc. Just pure Common Lisp.
9:08:00
pjb
Once you know Common Lisp you can learn emacs and then include slime. And later you can include libraries with asdf and quicklisp.
9:16:39
jdz
I dropped clisp back when I found the debugger was actually useless for me, and never looked back. I don't even remember what my problem with clisp was.
9:17:55
jdz
Also using lisp without proper environment will only waste time that could be used learning the environment from the start.
9:25:18
shka
miatomi_: portacle is easy to setup (not sure if "set up" term does apply here), i think CCL is quite good and explains things that happen better then SBCL, i did not use clisp so i don't have opinion on it
9:28:35
miatomi_
portacle looks interesting! thanks all for that. I wonder if "learn emacs" might even be too high of an entry, but this looks like it abstracts away the emacs part of it which is nice.
9:29:27
Shinmera
it doesn't remove emacs as a learning component, but it at least includes a reference guide that teaches the concepts and important bindings.
9:33:34
pjb
miatomi_: emacs has a 1/2 hour tutorial. If that's too high of an entry, what are you doing here?
9:37:44
miatomi_
pjb: to be clear, I've passed all of these barriers already. but asking a newbie to learn a bespoke text editor to get up and running in their new language is a lot. other lisps have recognized this, take racket for example
9:39:49
miatomi_
beach: what do you mean? originally I was asking in order to learn if this is a worthwhile project to take on myself. just wanted to get a sense if there was anything newbie friendly out there. I think portacle qualifies
9:44:04
beach
What does the situation look like in industry? Suppose for instance that someone wants to learn C# for Windows. Can they get away with using the editor they are already familiar with? It is not a rhetorical question and it is not meant for miatomi_. I am asking in general because I just don't know. If the answer is "yes", do they then miss out on some features that they could have had if they converted to whatever Microsoft
9:44:52
Shinmera
VS is free nowadays, and it uses the same kinds of keybindings people already know from other software.
9:45:58
Shinmera
I haven't checked, but I wouldn't be surprised if IntelliJ and Eclipse also support C#. Those are, I believe, the other two "top" IDEs.
9:47:13
beach
OK. Thanks. So when people complain about having to learn Emacs, they basically already know one of those, and they all have the same key bindings?
9:47:18
Shinmera
Generally if the language in question has enough industry pull most major IDEs are going to include support for it.
9:47:56
Shinmera
beach: They diverge in details, but most people complain about copy, cut, paste, undo, redo, open file, save.
9:48:36
Shinmera
And you can't really change them in Emacs because the defaults would clash with too many other keybindings. (C-c prefix, for instance)
9:49:31
Shinmera
I've considered the idea of including more standard keybindings in Portacle, but rejected it because it would make getting help harder since I'd have to change too much.
9:49:52
beach
That really sucks. I mean, Emacs predates all those, and I think the Emacs bindings are quite well thought out. Frequent operations are short, infrequent ones are long. And it is rare that two key sequences are similar if one is "dangerous".
9:50:13
basket
Shinmera: Emacs ships with cua-mode that does that; it's not too much of an issue for clashes because C-x and C-c are only cut and copy when the region is active
9:50:46
Shinmera
basket: I'm aware of cua mode, I still don't consider it a good idea, especially because C-c etc are still useful when regions are active.
9:52:58
scymtym
people's wish to keep working within their respective environments has been recognized in a certain way, though. many IDEs are now basing their support for programming environments on the "language server protocol" which is like a JSON-based, language-agnostic, specified version of the swank protocol
9:53:41
basket
Shinmera: Yes, but it does make it much more viable for newbies who just want a Lisp editor with familiar keybindings and see learning Emacs as a hurdle, I think
9:54:19
Shinmera
basket: I consider the potential for confusion in the bindings clash too high a risk
9:55:36
beach
We have had system administrators who found it a good idea to provide a "standard" startup file for (say) students. The result was that nobody knew exactly what key sequences to use, or what happened when the wrong one was accidentally issued.
9:59:13
pjb
At least Xcode implements the basic emacs control keys, and integrates good enough with an emacs editing workflow…
9:59:29
miatomi_
pjb: haha, fair. I love emacs too, I had the advantage of learning it before taking on clisp weirdly.
10:03:17
jdz
pjb: not sure it's Xcode specifically, because emacs keybindings work in all text fields on OSX.
10:10:32
d4ryus
readline, which is pretty wide spread among shell utilities, also uses Emacs Keybindings (as default, at least)
10:11:09
jdz
Yes, and Emacs users usually use them, other people even don't know their command line has undo.
11:47:10
hajovonta
when my program starts to grow, how do I keep the functions in order so that when loading the file, I don't get warnings like "undefined function" when the function definition comes later in the file?
11:47:43
hajovonta
or, maybe a better question can be that how can I easily reorder or at least analyze my file ?
11:51:20
hajovonta
this is because I need it to run in a screen, and then I connect to it via swank server
11:51:46
hajovonta
so things are further complicated by running screen -S 'sbcl --load whatever' ...
11:53:24
Shinmera
Unless of course you do stuff at load time that causes warnings. Function order won't matter, though.
12:49:55
Xach
If you put uiop-3.3.0 in ~/quicklisp/local-projects/ and (ql:quickload "circular-streams"), you can see it loads cffi and babel twice.
14:24:45
Xach
commit 4ed76c32050753c8a4450c342a1592881e11d63d seems to reference constant recompilation
14:39:07
Xach
Fade: good! though I did not spend as much time writing code with it as i wanted, so i'm going to stick with it more.
15:39:07
Bike
Let me help you out then, it's Bike 4283, Shinmeta 59821. Soon I will overtake you to take my rightful place
15:40:59
Shinmera
And the lord said: you shalt no longer mistype other's names, for I give you the power of tab completion
16:05:18
jmercouris
you won't believe it, but someone actually got really upset on #python like a year ago when I randomly brought it up
16:05:33
jmercouris
they went on a huge rant about how noobies will randomly type it into the terminal and see what happenes
16:06:12
jmercouris
When I first installed linux in seventh grade I did something similar, I actually deleted my mounting point
16:09:17
jmercouris
Xach: I never suggested anyone try the command, I don't ever give wrong advice (to the best of my knowledge)
16:12:00
jmercouris
shka: I think we'll be okay, pretty sure most people aren't running root nonstop
16:19:07
Bike
Shinmera: if you remember the mirai worm, the dev named themselves after that show. that's the Real World Connection
16:23:44
aeth
It is no longer a functional command because it was a meme so it should warn, at least with the GNU version. There are more dangerous variants, though.
16:28:37
Shinmera
Hmm yes, punishing curiosity is definitely a good thing and posting something malicious to trick people makes me a good, likeable person.
16:28:38
_death
will someone fall for (format t "~{,2F~^ ~}" (loop repeat 5 collect (random 1.0))) ?
16:29:31
jmercouris
It's definitely not trolling, I didn't have the intent to rile anybody up or trick anyone, I was just making a joke
16:30:03
jmercouris
The joke was that I was running the command somewhere on my system, or on one of my machines
16:31:03
jmercouris
I think we can let this one go now, I apologize, for anyone reading this conversation in the future, please do not run the command as it will recursively delete all of your directories given enough permissions to do so
16:51:02
pjb
jmercouris: can you imagine that some people actually drilled into their iPhone 7 to add an audio plug!
16:54:10
pjb
beach: For now, I have no idea. I'm looking for a new job (to pay taxes). I probably will be busy for the next one…
17:01:56
beach
Though, I understand that they are still looking for a program chair. If anyone knows anybody that might accept this important task, please contact a member of the steering committee.
17:41:57
sjl
Shinmera: I didn't have time to do much of anything last night, but maybe I can ask you some stuff today to clarify things in my brain
17:42:23
sjl
Shinmera: so, the general idea of Harmony is that you have a Mixer that plugs together a bunch of segments
17:43:24
Shinmera
A "mixer" is basically just a collection of segments that are run in order when the mixer is run.
17:45:44
sjl
one thing I wasn't clear on: are there actual separate buffers between each, or is it just a single buffer that gets operated on by each one in turn?
17:46:38
Shinmera
buffers are basically just float arrays. you can re-use them or not, but obviously if you have two channels you can't use the same buffer for both.
17:46:59
Shinmera
Harmony obscures that detail because it includes a system to automatically handle buffer allocation for you.
17:48:03
Shinmera
That stuff happens in pipeline.lisp. The actual allocation algorithm is in the Flow library, though.
17:49:19
sjl
what I'd probably want to do is use the vanilla mp3 source's (decode ...) to fill a buffer in memory in the initialize-instance :after method on my preloaded source
17:49:46
Shinmera
What I think you should do is look at https://github.com/Shirakumo/harmony/blob/master/sources/buffer.lisp and try to make it work with a data array that's initialised with a complete buffer read by cl-mpg123.
17:51:37
sjl
so instead of (play "foo.mp3" :sfx :type 'mp3-source), it would end up being (defparameter *foo* (read-mp3-file-into-buffer "foo.mp3")) ... (play *foo* :sfx :type 'buffer-source)
17:54:42
Shinmera
Maybe something like making play accept a CFFI pointer or some struct that encapsulates a raw audio array
17:54:58
Shinmera
And then change the source interface to include generic versions to decode stuff into such arrays.
17:55:10
sjl
What's the deal with https://github.com/Shirakumo/harmony/blob/master/sources/mp3.lisp#L70-L96 then?
17:55:51
Shinmera
That was a hasty attempt at making things work as I was pressed for time before a jam.
17:56:10
Shinmera
It's not because it ties logic that's part of the decoding and logic that's just part of the buffer together.
17:57:11
Shinmera
We'll probably want some class that contains a data array, size, encoding, channels, structure, and sample rate, from which actual sources can then be spawned.
17:58:51
Shinmera
The idea would be that you'd keep this structure around and allocate it ahead of time, whereas sources are used to actually play it back at run time.
17:59:39
sjl
well, I guess if you wanted multiple concurrent copies of some audio effect, you'd need to have multiple sources
17:59:46
Shinmera
You can, but especially with sfx where you might need to play multiple instances of the same thing simultaneously, that doesn't really work.
18:00:09
Shinmera
And just logic-wise it's easier to simply say "hey, play this back" and not have to worry about reusing it if you don't have to.
18:43:21
sjl
Shinmera: I guess the thing that still feels weird would be the filling of that preloaded buffer, because it would use an mp3-source to fill a buffer which would then be used by sources
18:43:36
sjl
or are you thinking there would be some really basic (read-mp3-file-into-buffer ) function
18:50:44
Shinmera
The high-level interface would probably then also get a LOAD function analogous to PLAY that loads to this buffer struct thingy based on the source implementation.
18:52:47
Shinmera
While I'm on that, more source types is another obvious improvement area. Especially supporting WAV, OGG, and FLAC would be good.
18:56:55
Shinmera
More filter segments on libmixed would also be nice, particularly high/low-pass filtering, reverb, and distorion.
19:05:49
jmercouris
beach: seems like people are always conflating language with implementation, now that you've made me aware of the difference, I see it everywhere: https://getstream.io/blog/switched-python-go/?a=b
19:22:48
bigos
https://github.com/bigos/qtools-testdrive/blob/hello-notepad/src/qtools-testdrive.lisp
19:32:09
bigos
i guess i will try another time, i found few c++ examples but i have no clue how to translate them to qtools, i guess it's time to have a break