Fernando-Basso has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 258 seconds]
iclon_ has joined #racket
iclon has quit [Ping timeout: 245 seconds]
iyzsong has joined #racket
soegaard has quit [Quit: soegaard]
iyzsong has quit [Read error: Connection reset by peer]
iyzsong has joined #racket
jao has quit [Ping timeout: 245 seconds]
lockywolf_ has joined #racket
iyzsong has quit [Read error: Connection reset by peer]
englishm has quit [Excess Flood]
englishm has joined #racket
lockywolf_ has quit [Ping timeout: 272 seconds]
lispmacs has joined #racket
efm has quit [Ping timeout: 272 seconds]
<lispmacs>
could a racket program accessed shared memory from another program?
<lispmacs>
*access
dddddd has quit [Remote host closed the connection]
FreeFull has quit []
endformationage has quit [Quit: WeeChat 2.5]
_whitelogger has joined #racket
_whitelogger has joined #racket
_whitelogger has joined #racket
vraid has quit [Ping timeout: 252 seconds]
<lispmacs>
hi, does Racket have an interface for accessing shared memory objects?
<winny>
lispmacs: you may want to ask on racket-users mailing list, the slack bridge is not currently working, and it appears most users are using slack :(
<lispmacs>
winny: I just did a little Internet searching, and it looks like the answer is no
<lispmacs>
it seems that Racket only has "places", but there doesn't seem to be a way to simply access a shared memory object from any other program, near as I can tell
sauvin has joined #racket
<lispmacs>
unless, I guess, maybe I could just read the /dev/shm/* file
<winny>
is this to communicate between racket and a non-racket program?
<lispmacs>
winny: correct
<winny>
maybe it might be better to use something a bit more structured than shared memory
<lispmacs>
I tried the fifo pipe approach, but I'm not able to get quite enough data across the pipe fast enough, it seems
<winny>
why not a unix domain socket
<lispmacs>
i.e., a named OS pipe
<winny>
iirc FIFOs are actually pretty lame for real world use
<lispmacs>
winny: I'm open minded, if domain socket will be able to do it. I've got to move like 160000000 bytes per second
<lispmacs>
winny: I'm concerned I'll wast a lot of time reimplemented to get something not any faster. the fine print of the link says domain sock and pipe basically the same under the hood
<winny>
does the data change a lot?
<lispmacs>
winny: not sure exactly what you mean, but data is live feed from an SDR, almost never repeating unless antenna disconnected
<winny>
maybe you should ask the question, can my code handles 160,000,000 bytes already read into racket within the allotted timeframe
<lispmacs>
winny: well, the Racket program might not necessarily use all the data, but I need to be able to feed it all in for sure. Test case was simply just feeding the data in and dumping it to a file, but I could only pull in about 90% of the samples
<winny>
hmmm :/ that 90% sounds not very ideal
<lispmacs>
timing test shows, with Fifo approach, nearly all CPU time is in system calls, so I'm thinking bottleneck is the FIFO pipe
<winny>
this sounds like a good discussion on the mailing list, there are likely techniques i'm not familiar with to handle data far more quickly in realtime within racket
<winny>
even just the basic question of how to process large amounts of data quickly in racket would be very beneficial to your usecase
<lispmacs>
winny: well, question is more bringing it in, in the first place. FIFO not seeming to work, but chose FIFO because you can read the pipe with just simple I/O operations. Internet says that shared memory access is the fastest, but I don't see a Racket interface to straight-up shared memory access
<winny>
you could live in the edge, write some racket FFI and see what terrible things happen (or maybe it'll work perfectly if one doesn't do anything bad)
<winny>
your use case seems a bit extraordinary so it might be worthwhile to explore that
<lispmacs>
well, I was a bit more interested in getting past this point quickly to the more interesting aspects of processing SDR data. Perhaps Guile would be better suited for this application
<winny>
It would be worth exploring
<winny>
maybe also throw in chicken scheme if that doesn't workout
<lispmacs>
buc buc buck-aw!
<lispmacs>
sorry, couldn't resist
<winny>
haha, i totally missed the reference =)
<lispmacs>
I haven't played around with Chicken. Wrote a big application once in Guile, and I'm a fledging Guix fanatic
<lispmacs>
*fledgling
<lispmacs>
but I got give racket a few points for all the great documentation
<lispmacs>
well, I think I have to go bed now
<winny>
hope you get a PoC working in whichever scheme you please :)
manualcrank has quit [Quit: WeeChat 1.9.1]
Arcaelyx has quit [Ping timeout: 248 seconds]
zipper has joined #racket
enderby has quit [Ping timeout: 245 seconds]
zipper has quit [Ping timeout: 244 seconds]
Trieste has quit [Ping timeout: 272 seconds]
zipper has joined #racket
Trieste has joined #racket
{AS} has joined #racket
{AS} has left #racket [#racket]
zipper has quit [Ping timeout: 245 seconds]
zipper has joined #racket
orivej has joined #racket
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sudden has quit [Ping timeout: 246 seconds]
zipper has quit [Quit: WeeChat 2.5]
trafaret1 has joined #racket
Diagon has joined #racket
trafaret1 has quit [Remote host closed the connection]
ng0 has joined #racket
Diagon has quit [Quit: Leaving]
soegaard has joined #racket
_whitelogger has joined #racket
ZombieChicken has quit [Remote host closed the connection]
iyzsong has joined #racket
lexi-lambda has quit [Ping timeout: 252 seconds]
rodlogic has quit [Ping timeout: 252 seconds]
lexi-lambda has joined #racket
rodlogic has joined #racket
Fernando-Basso has joined #racket
Fernando-Basso has quit [Max SendQ exceeded]
Fernando-Basso has joined #racket
Fernando-Basso has quit [Remote host closed the connection]
Fernando-Basso has joined #racket
soegaard has quit [Quit: soegaard]
orivej has quit [Ping timeout: 246 seconds]
asymptotically has joined #racket
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
teardown has quit [Ping timeout: 245 seconds]
lockywolf_ has joined #racket
soegaard has joined #racket
lockywolf__ has joined #racket
sagax has quit [Quit: Konversation terminated!]
FreeFull has joined #racket
lockywolf_ has quit [Ping timeout: 245 seconds]
dddddd has joined #racket
Fernando-Basso has quit [Remote host closed the connection]
zipper has quit [Read error: Connection reset by peer]
englishm has quit [Excess Flood]
englishm has joined #racket
zipper has joined #racket
`micro has quit [Remote host closed the connection]
soegaard has joined #racket
zipper has quit [Read error: Connection reset by peer]
`micro has joined #racket
zipper has joined #racket
bremner has quit [Ping timeout: 264 seconds]
technomancy has quit [Ping timeout: 248 seconds]
cantstanya has quit [Ping timeout: 260 seconds]
cantstanya has joined #racket
ZombieChicken has joined #racket
cartwright has joined #racket
Sgeo has quit [Ping timeout: 245 seconds]
cantstanya has quit [Ping timeout: 260 seconds]
ubLIX has joined #racket
ZombieChicken has quit [Quit: WeeChat 2.5]
ZombieChicken has joined #racket
ZombieChicken has quit [Client Quit]
ZombieChicken has joined #racket
casaca has quit [Ping timeout: 272 seconds]
casaca has joined #racket
casaca has quit [Ping timeout: 246 seconds]
casaca has joined #racket
ziyourenxiang has quit [Ping timeout: 244 seconds]
ng0 has quit [Quit: Alexa, when is the end of world?]
Arcaelyx has quit [Ping timeout: 244 seconds]
davidl has joined #racket
davidl_ has joined #racket
ubLIX has quit [Quit: ubLIX]
davidl has quit [Ping timeout: 244 seconds]
bremner has joined #racket
Arcaelyx has joined #racket
casaca has quit [Ping timeout: 245 seconds]
casaca has joined #racket
aeth has quit [Read error: Connection reset by peer]
aeth has joined #racket
casaca has quit [Ping timeout: 248 seconds]
casaca has joined #racket
casaca has quit [Ping timeout: 248 seconds]
casaca has joined #racket
casaca has quit [Ping timeout: 272 seconds]
casaca has joined #racket
selimcan has joined #racket
dedbox has joined #racket
Sgeo has joined #racket
Sgeo_ has joined #racket
Sgeo has quit [Ping timeout: 246 seconds]
zipper has quit [Ping timeout: 248 seconds]
Sgeo_ has quit [Ping timeout: 245 seconds]
Sgeo has joined #racket
zipper has joined #racket
zipper has quit [Client Quit]
notzmv has joined #racket
teardown has joined #racket
<dzoe>
What are the memory limits of futures?
<dzoe>
I am trying to generate 2^27 combinations of numbers and sort them by their sum ...
<soegaard>
Time to think about improving the algorithm ... :-)
selimcan has quit [Ping timeout: 248 seconds]
<dzoe>
It boils down to a list of 27 numbers bitwise-bit-set? and for/sum to get each combination of those 2^27
<dzoe>
Nope
<dzoe>
I just proved only brute-force is possible :(
<soegaard>
Small numbers?
<dzoe>
"Random" numbers.
<soegaard>
So fixnums is out of the question?
<dzoe>
Actually amounts from real-world invoices.
<dzoe>
Well, fixnums are ok that is one of optimizations I am going to implement.
<dzoe>
This is 64bit platform, so I assume fixnums with eurocents would work.
<dzoe>
My plan is to generate a huge list/vector of pairs where car would be the combination number 0..2^27-1 and cdr would be the sum
<dzoe>
Then I can sort it by the sum using merge-sort pretty quickly (about 3G operations actually)
<soegaard>
How fast/slow is in-combinations?
<dzoe>
Now that is an interesting question
<dzoe>
I used (combinations) for smaller instance of the problem and didn't consider it now.
<dzoe>
Lemme check.
<dzoe>
Ok, in-combinations looks faster
<dzoe>
But does not allow me to store the "combination number"
<soegaard>
The sum?
<dzoe>
No, the sum is easy
<dzoe>
(foldl unsafe-fx+ 0 combination)
<dzoe>
Hmmm Killed after 90s and 8G RAM consumed
selimcan has joined #racket
<soegaard>
What do you mean by "combination number"?
<dzoe>
I need to know which numbers created the sum.
<dzoe>
My idea is to use a single number to represent each combination where the bits in the number would represent the summands.
<dzoe>
Because storing something like (cons the-sum the-combination-list) eats memory immediately
<dzoe>
Storing (cons number number) should be easier
<dzoe>
Yet it is a list and therefore the (cons (cons number number) (cons (cons number number) (cons (cons number number) ... eats some memory up as well.
<soegaard>
It is a tough problem, when you have so many combinations
<soegaard>
FWIW the implementation of in-combinations is here. Perhaps you can modify to keep track of the extra information you need?
<soegaard>
You can save some memory by storing the numbers in (huge) vectors.
<soegaard>
That will save you a pair for each combination.
<dzoe>
The implementation looks basically like what I used
<dzoe>
Yes, I am already thinking about cramming the sum and the bitfield into a single number.
<dzoe>
But that seems to be rather preliminary optimization right now.
<soegaard>
True.
<dzoe>
Now we are talking.
<dzoe>
Computes all 134M combinations with their sums and then gets killed after consuming 10G of RAM
<dzoe>
And it takes only about 2m20 to finish
<soegaard>
!
<dzoe>
But I still don't get why it consumes so much memory.
selimcan has quit [Ping timeout: 245 seconds]
<dzoe>
Maybe I should pre-allocate a huge vector and use it for storing averything.
ubLIX has joined #racket
selimcan has joined #racket
soegaard has quit [Quit: soegaard]
soegaard has joined #racket
<gluon>
i'm scratching my head trying to find a way to have a "cumulative" string-replace
<gluon>
suppose i have a hash, with different key value pairs for each string replace i want to make on a string
<gluon>
if i traverse it with a simple for and a string-replace in its body, then nothing is returned at the end
<gluon>
similarly if i use something like for/first or for/last only the first replacement is returned in the final string
<gluon>
is recursion the only way to solve this?
<soegaard>
Do you have all the indices where replacements needs to take place?
<gluon>
no, but i guess i can get them
<gluon>
like using some string find function?
<soegaard>
Then I suggest using a frew passes.
<soegaard>
First split the string into substrings (list "foo" "a" "bar" "c" baz") where the strings is split before and after each string to be replaced.
<soegaard>
The use map to with a function replace-one that looks up the string in the replacement hash table and maps to the replacement (and if not in the hash returns the original).
<gluon>
ahh
<soegaard>
Then use string-append* to append the new list of strings.
<gluon>
i thought about using map before, but i didn't think about splitting the string first
<gluon>
ofc
<gluon>
thanks
<soegaard>
It's easier than doing in-place replacement.
<gluon>
yes
<gluon>
it's really simple and elegant, just feed map with a split string in the form of a list
<gluon>
and do one by one
<soegaard>
gluon: Ooh. I just found regexp-replaces in the docs. It has the form (regexp-replaces input replacements)
selimcan has quit [Ping timeout: 248 seconds]
srandon111 has joined #racket
<srandon111>
hello all guys, can somebody explain to me why when i install racket i should also install drracket /?
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]