tonyg changed the topic of #racket to: The Racket Programming Language -- https://racket-lang.org/ -- https://gather.town/app/wH1EDG3McffLjrs0/racket-users -- http://pasterack.org -- logged at https://libera.irclog.whitequark.org/racket/ -- This is the right place to ask for help with (Dr)Racket. Remember to wait around for an answer!
sudden has joined #racket
Tuplanolla has quit [Quit: Leaving.]
shawnw has quit [Quit: Konversation terminated!]
bubblegum has quit [Ping timeout: 252 seconds]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 255 seconds]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 256 seconds]
bubblegum has joined #racket
Origin has quit [Ping timeout: 268 seconds]
livoreno has quit [Ping timeout: 256 seconds]
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
thegeekinside has joined #racket
thegeekinside has quit [Read error: Connection reset by peer]
thegeekinside has joined #racket
thegeekinside has quit [Read error: Connection reset by peer]
thegeekinside has joined #racket
thegeekinside has quit [Read error: Connection reset by peer]
runrin has joined #racket
GreaseMonkey has quit [Remote host closed the connection]
chiselfu1e is now known as chiselfuse
skapata has quit [Remote host closed the connection]
<polarian> interesting... also the heap has more overhead at least in C, the stack has a set size (which is also why it overflows if you recurse too much, which is why I assume racket/scheme uses the heap, seen as the languge(s) are built around recursion), but this set size also means no allocating or freeing of memory is needed which does take time. With the heap it must find a free block of allocated memory, and chop that up, otherwise ask the kernel for more
<polarian> memory, and then there is reclaiming this and returning it to the kernel, while stack? it just pops the frame once out of scope. Unless I'm missing something stack is far more performant, but it has limitations of course.
<polarian> and a lot of languages tend to be better than bad C
<polarian> C you don't just simply pick up the language, you must understand the ins and outs of everything... optimisation? that's mostly up to you
<polarian> I remember discussing it with a Java software developer, its far easier to write performant Java code which the JIT compiler can calculate hotspots and optimise them further, than pick up C and instantly expect it to perform better.
<polarian> Racket also has a AOT compiler... so I assume you can get decent performance if you were to use racket in a production codebase?
shawnw has joined #racket
<polarian> also, vectors are still iterated, or is that also recursive under the hood?
<bremner> polarian: "under the hood" it is machine language. The implementation of loop (e.g. the for macro) in racket is (probably) tail recursion, but that doesn't really make an important difference; it is still iteration from a user and performance point of view.
danse-nr3 has joined #racket
<polarian> I assume its highly optimised though, right?
<bremner> yes, you might look up "tail call optimization"; it turns tail recursion into goto
<polarian> oh so its not "true" recursion then, it follows the structure of recursion but it hops instructions like in iteration...
<polarian> so on a programming level it is recursion, but its then optimised out to act like iteration?
<bremner> right, that's what tail-call-optimization is
<bremner> scheme and racket guarantee that particular optimization, which means that tail-recursion is safe to use, performance wise
<polarian> thats cool...
<polarian> so racket traversals and path finding must be much more convinient
danse-nr3 has quit [Ping timeout: 264 seconds]
<polarian> and performant than the C counterpart
danse-nr3 has joined #racket
<bremner> note that "tail-recursion" is not all recursion. It's a special kind of recursion.
lagash has quit [Ping timeout: 268 seconds]
a51 has joined #racket
thegeekinside has joined #racket
Origin has joined #racket
danse-nr3 has quit [Ping timeout: 268 seconds]
macabro has joined #racket
mzan has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mzan has joined #racket
Tuplanolla has joined #racket
lagash has joined #racket
notzmv has joined #racket
notzmv has quit [Remote host closed the connection]
notzmv has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 255 seconds]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 246 seconds]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 255 seconds]
bubblegum has joined #racket
skapata has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 252 seconds]
bubblegum has joined #racket
macabro has quit [Remote host closed the connection]
mdhughes_ has joined #racket
mdhughes has quit [Ping timeout: 246 seconds]
GreaseMonkey has joined #racket
thegeekinside has quit [Read error: Connection reset by peer]
bubblegum has quit [Read error: Connection reset by peer]
thegeekinside has joined #racket
thegeekinside has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
thegeekinside has joined #racket
thegeekinside has quit [Read error: Connection reset by peer]
thegeekinside has joined #racket
<shawnw> I think one of the important things to really getting Scheme (And Racket) is realizing that there's no fundamental difference between iteration and recursion (Especially tail recursion). They're just two sides of the same coin.
bubblegum has quit [Ping timeout: 268 seconds]
bubblegum has joined #racket
thegeekinside has quit [Remote host closed the connection]
notzmv has quit [Ping timeout: 256 seconds]
notzmv has joined #racket
<bremner> well. I think there is a big difference between tail recursion and general recursion as far as performance.
<polarian> so in other words, don't go out of your way to use for, because unless it is more practical in the situation, it should perform similarly to recursive?
<polarian> aka use whatever is syntaxically easily?
<polarian> easier*
<polarian> for the situation?
<bremner> you should use for in racket because it makes the code easier to read, and because it guarantees tail recursion. the for macro in racket is just a wrapper for tail recursion.
<polarian> so overall, vectors are still faster, for is still worth using over recursion (unless its a recursive algorithm)
notzmv has quit [Ping timeout: 264 seconds]
<bremner> vectors are clearly faster _for random access_. For other things, I'd need to benchmark to know if it is significant
<bremner> vectors vs recursion isn't really a comparison that makes sense to me
bubblegum has quit [Ping timeout: 260 seconds]
<polarian> vectors vs lists is the argument here
<polarian> if iterating each is negligable in difference... why use a vector?
<polarian> I have been told by a few people who write racket code that "racket is orientated around lists, you use lists for everything"
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 264 seconds]
morte has joined #racket
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 240 seconds]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 255 seconds]
bubblegum has joined #racket
<shawnw> Lots of things don't involve doing something with every element of a data structure, just specific ones. Or need fast random access to preform well.
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #racket
bubblegum has quit [Ping timeout: 268 seconds]
bubblegum has joined #racket