<< 09-11-2017 >>

00:04:55skrylari must have missed when we got this table type
00:06:05GitDisc<awr> oh it looks like you're supposed to set "i386" if you're using emscripten
00:08:21*couven92 quit (Quit: Client Disconnecting)
00:12:01*bkerin quit (Ping timeout: 240 seconds)
00:25:01*yglukhov quit (Remote host closed the connection)
00:25:37*yglukhov joined #nim
00:29:41*yglukhov quit (Ping timeout: 240 seconds)
00:29:50*Jesin quit (Quit: Leaving)
00:38:03*ipjk quit (Quit: Leaving)
01:09:01*gokr quit (Ping timeout: 240 seconds)
01:12:02*rauss quit (Read error: Connection reset by peer)
01:13:55*rauss joined #nim
01:17:21*vlad1777d quit (Ping timeout: 240 seconds)
01:17:44*rauss quit (Read error: Connection reset by peer)
01:20:14*rauss joined #nim
01:39:38*jinshil joined #nim
01:40:30*jinshil quit (Client Quit)
01:40:44*jinshil joined #nim
01:45:01FromGitter<Varriount> @Araq Hm. I'm looking at destructors - would it be possible to have a `=destroyMany` as an optimization for elements that must be destroyed during sequence/array destruction?
01:50:25*sz0 joined #nim
01:51:09*kalkin--- joined #nim
01:54:27*kalkin-- quit (Ping timeout: 240 seconds)
02:21:46*jinshil_ joined #nim
02:25:05*jinshil quit (Ping timeout: 250 seconds)
02:27:27*marenz_ quit (Ping timeout: 240 seconds)
02:36:11*dddddd quit (Quit: Hasta otra..)
02:37:41skrylarVarriount: i don't know that there IS an efficient way to destroy many things
02:38:12skrylarisn't conventional wisdom for that to either use free lists, or in extreme cases, mark-sweep zones?
02:41:33*chemist69 quit (Ping timeout: 250 seconds)
02:53:30*NimBot joined #nim
02:55:11*jinshil_ quit (Quit: Good-bye!)
02:55:29*chemist69 joined #nim
02:56:07*kier joined #nim
02:57:08*redlegion joined #nim
02:57:08*redlegion quit (Changing host)
02:57:08*redlegion joined #nim
03:04:38*yaiyan joined #nim
03:05:40*arnetheduck joined #nim
03:06:29*tefter joined #nim
03:10:09*joshbaptiste joined #nim
03:14:03*FromGitter quit (Ping timeout: 250 seconds)
03:14:15*FromGitter joined #nim
03:14:29*hohlerde quit (Ping timeout: 250 seconds)
03:14:55*xet7 quit (Ping timeout: 250 seconds)
03:15:52*ehmry quit (Ping timeout: 240 seconds)
03:16:12*mindB quit (Ping timeout: 240 seconds)
03:16:12*planetis[m] quit (Ping timeout: 240 seconds)
03:16:15*shashlick quit (Ping timeout: 248 seconds)
03:16:15*dyce[m] quit (Ping timeout: 248 seconds)
03:16:17*byteflame quit (Ping timeout: 252 seconds)
03:16:17*MrAxilus[m] quit (Ping timeout: 252 seconds)
03:16:21*Jipok[m] quit (Ping timeout: 255 seconds)
03:16:21*Demos[m] quit (Ping timeout: 255 seconds)
03:16:28*notdekka[m] quit (Ping timeout: 240 seconds)
03:16:32*jivank[m] quit (Ping timeout: 240 seconds)
03:16:38*unclechu quit (Ping timeout: 276 seconds)
03:16:47*watzon quit (Ping timeout: 248 seconds)
03:16:47*TheManiac quit (Ping timeout: 255 seconds)
03:24:45*endragor joined #nim
03:29:54*xet7 joined #nim
03:46:59skrylarVarriount: how would it work any better than that?
03:47:20skrylarthe best case is each item is in sequential memory and you just either memset it all to zero or unmark the region and throw it away
03:47:40skrylarif there is some complex destructor logic other than "its all zero now" it would have to run regardless
03:47:47skrylarso i dunno what 'destroymany' could do different
03:47:49FromGitter<Varriount> Well, if the destructor for an object needed to do something (say, serialize the object to disc), then doing a batch operation might be faser
03:48:20skrylarthat sounds case specific
03:49:03FromGitter<Varriount> Well, a more specific variant: memsetting the memory to zero, for security reasons. It's faster to memset an entire region, rather than many multple regions
03:51:28skrylari think that would become a secureDelete or such
03:52:39skrylaralthough such a securedelete is just going to be a memset to the raw pointer to the seq's cap after normal delete, so template
03:56:38*abeaumont quit (Ping timeout: 240 seconds)
04:03:59skrylarreading the stuff for texinfo
04:04:18skrylarit doesn't seem that bad really. info might be arse, but texinfo seems about the same as rst/sphinx/etc
04:06:53FromGitter<Varriount> skrylar: Making a language parser, or a renderer?
04:07:24skrylarVarriount: no, i need to write docs someday
04:07:57skrylarsomeone was complaining in another community that "emacs isn't documented" and i was like ". . . . . ."
04:08:21FromGitter<Varriount> skrylar: *gasp* you mean people actually write documentation?
04:08:38skrylari write comments and stuff :(
04:08:54*FromGitter * Varriount looks at the compiler source code
04:09:31skrylaralthoguh some open source stuff is well documented. GNU stuff seems to be, Debian is. Anki is as well
04:09:53skrylarSuperMemo (not open source)'s manual is fun to read.
04:10:03skrylarIt's this like, huge brain dump from the author on memory research and learning
04:11:27skrylarmanaged to implement most of SM-17 in nim
04:11:55skrylarhttp://help.supermemo.org/wiki/SuperMemo_Algorithm
04:13:02FromGitter<Varriount> skrylar: I don't know about Anki. I could never figure out how to set it up to display my flash cards to me, then let me type corrections
04:13:56skrylarVarriount: theres some {{type:stuff}} tag you have to use in the stylesheet editor. I havent used it in some time :(
04:14:21skrylararch maintainers goofed and pushed anki beta as a "stable" and it broke my stuff, so i moved over to mnemosyne for now
04:14:28skrylaralso anki insists on using a 20 year old algorithm
04:14:49FromGitter<Varriount> I've been using Quizlet
04:15:01skrylarmeh
04:15:14FromGitter<Varriount> skrylar: I never appreciated how convoluted the English language was until I started learning German
04:15:33skrylarVarriount: most of the benefit to those systems is making the cards yourself.
04:15:56skrylarSM has a lot of text on his 'incremental reading' thing. Which is fancy talk for "read something, use a highlighter on sentences, and make flash cards of those"
04:16:11skrylaran SM clone in nim would be nifty
04:16:12FromGitter<Varriount> Oh, I make the cards myself, I just use Quizlet for storage and learning.
04:16:33skrylaryou can also amusingly, use anki for learning anki
04:16:42skrylarIf you do the cards for it :)
04:16:48FromGitter<Varriount> It's also handy because I can have the flashcard portion of the phone app read the flashcards to me while I'm in the shower
04:17:02skrylardoes quizlet have any spatial separation logic
04:17:09FromGitter<Varriount> No idea.
04:17:34FromGitter<Varriount> I'd have to know what spatial separation logic is first.
04:18:11skrylarits based on the idea that you don't actually need to study every day and you learn more by remembering things you're about to forget than studying things you already know
04:18:38skrylarthe most basic is ex. the Leitner system, where you have a couple boxes for notes and you study the first box daily, and move stuff you know to the next box, where each box is less frequent and failed cards go to box one
04:19:04FromGitter<Varriount> I think so. It has a "long-term-learning" function for sets of cards.
04:19:07skrylarso german words you know well take up less review time
04:19:28skrylarLeitner is pretty simple. SuperMemo's is based on this guys obsession with remembering things
04:19:38skrylarhalf the program is like, statistics dumps and charts
04:21:35skrylarAnki uses SM-2 which is from 1980something. Later versions of SM-* started tracking curves and predictions.
04:22:17skrylarLatest version (17) has some dual-value thing where it does logistic regression on grades and then has some bayesian shit somewhere that tries to learn how accurate you are at grading yourself O_o
04:22:40FromGitter<Varriount> So... which one is best?
04:22:49*Guest49345 quit (Quit: My iMac has gone to sleep. ZZZzzz�)
04:22:55FromGitter<Varriount> O rather, which real-world implementation is most effective?
04:23:07skrylarhard to say
04:23:15skrylarSM is the only one doing anything more than leitner
04:23:40skrylarMnemosyne, I'm not sure what they're using. Anki uses the oldest SM. Org-mode has an addon which does SM-5 i think?
04:24:17skrylarpeople don't seem to care about these systems outside of languag elearning apparently
04:24:30*yglukhov joined #nim
04:25:23skrylarthree more functions and nfltk goes on github, whee
04:25:28*yglukhov quit (Remote host closed the connection)
04:26:04*yglukhov joined #nim
04:26:08FromGitter<Varriount> As critical as I am of memory usage, I prefer my GUI libraries to have a native look.
04:26:23FromGitter<Varriount> Admittedly, that really only means anything on Mac or Windows, but w/e
04:26:47skrylarI used to. But since I'm more or less forbidden by the universe to use apple products, i stopped caring
04:27:43skrylarGiven how apt people are to use web browser apps that have no business being browser apps, it seems to further hold that usability>"nativeness"
04:28:02FromGitter<Varriount> Ugh, don't remind me. *looks at slack*
04:28:13skrylarmattermost is quite pleasant
04:28:22skrylarAlthough, Google Wave predicted slack basically.
04:28:43skrylarIf they hadn't horridly mismanaged the beta, we would have desktop clients for an interoperable slack equivalent
04:28:45FromGitter<Varriount> You mean predated?
04:29:08skrylarI think Matrix is trying to revive it, but in the most.. hopeless way
04:30:13skrylarI wish i still had the talk link. Diaspora had a talk on youtube, and they mentioned how hard it is to do anything once someone 'big' enters the market
04:30:33skrylarBecause the cost for Google/Facebook to ape your feature with a bigger branding budget is less than it costs you to get people on to your product
04:30:58*yglukhov quit (Ping timeout: 264 seconds)
04:31:16skrylari start turning more in to RMS as time goes by ._.
04:33:00FromGitter<Varriount> Meh. The GPL may be nobel, but using it in anything but an application means that your library will never be used.
04:33:28skrylarIt's more that RMS et all put their own blood in to the circus
04:33:33FromGitter<Varriount> Er, noble
04:33:38FromGitter<Varriount> How so?
04:34:29skrylarwell if you look at what gets GPLd these days
04:34:38skrylarIt's mostly used as a weapon to say "F U" to people who don't buy enterprise licenses
04:34:50skrylarIt's not actually used to *protect humanity*
04:35:17skrylarAnd people are actually getting *mad* at Stallman, because he was patching holes in the GPL
04:35:25skrylarLike the Tivoization problem
04:36:02*skrylar shrug
04:37:51skrylarIt's just strange to me that he made all these claims in the late 80s and everyone said that's extreme. Then in the 90s it started happening, but he was still extreme. And in the 2000's, same story. In 2010s we have AIs policing youtube videos for cabals interests, and its like "... Maybe we shoulda listened :B"
04:38:42skrylarApproaching 2020 its like, people are just embracing the bullshit
04:38:44skrylarbut thats enough of that
04:39:21*skrylar quit (Quit: Leaving)
04:39:51FromGitter<Varriount> Switching to a different topic.
04:40:26FromGitter<Varriount> Regarding the "new memory runtime", I wonder if we could keep the GC, and just have the memory optimizations.
04:40:57FromGitter<Varriount> I mean, it doesn't seem like the outlined changes actually break existing memory semantics, just enhance them with moves.
04:59:47*sz0 quit (Quit: Connection closed for inactivity)
05:38:46*Jipok[m] joined #nim
05:49:49*unclechu joined #nim
05:49:49*dyce[m] joined #nim
05:49:49*Demos[m] joined #nim
05:49:49*ehmry joined #nim
05:49:50*watzon joined #nim
05:49:55*TheManiac joined #nim
05:49:55*MrAxilus[m] joined #nim
05:49:56*jivank[m] joined #nim
05:49:56*byteflame joined #nim
05:49:56*hohlerde joined #nim
05:49:56*planetis[m] joined #nim
05:49:56*shashlick joined #nim
05:49:56*mindB joined #nim
05:49:56*notdekka[m] joined #nim
05:53:06*skrylar joined #nim
05:53:12skrylari return bearing gifts https://github.com/Skrylar/nfltk
05:54:13*abeaumont joined #nim
06:08:23*rauss quit (Quit: WeeChat 1.9.1)
06:15:02*gmpreussner quit (Ping timeout: 248 seconds)
06:15:02*GaveUp quit (Ping timeout: 248 seconds)
06:15:03*dom96 quit (Ping timeout: 248 seconds)
06:15:45*GaveUp joined #nim
06:16:09*gmpreussner joined #nim
06:16:27*subsetpark_ joined #nim
06:16:36*dom96 joined #nim
06:16:36*dom96 quit (Changing host)
06:16:36*dom96 joined #nim
06:18:58*SenasOzys joined #nim
06:22:50*xet7 quit (*.net *.split)
06:22:50*Elronnd quit (*.net *.split)
06:22:50*subsetpark quit (*.net *.split)
06:22:51*koppeh quit (Ping timeout: 246 seconds)
06:22:53*subsetpark_ is now known as subsetpark
06:30:03*xet7 joined #nim
06:35:14*nsf joined #nim
06:39:45*endragor quit (Remote host closed the connection)
06:45:20skrylaroh dear. firebird has a ton of intptrt and size_t everywhere
06:45:23skrylarisn't intptr_t === size_t
06:46:43skrylaroh. apparently "yes but not 20 years ago"
06:50:31skrylarAraq, oi. whats the nim version of intptr
06:50:35skrylari don't see it in the system module
07:09:19*flyx quit (Ping timeout: 258 seconds)
07:10:28*jivank_ quit (Ping timeout: 258 seconds)
07:12:38*couven92 joined #nim
07:15:09*endragor joined #nim
07:17:09*yglukhov joined #nim
07:20:11*endragor quit (Ping timeout: 250 seconds)
07:26:25Araqskrylar: "int"
07:28:44Araqvarriount: the problem is that you can't "move" memory that stems from a thread local allocator
07:29:41Araqmaybe we can make the allocator shared and have some logic in the GC to know about moves
07:31:15Araqbut as I said, a GC lures you into the wrong architectural choices
07:34:43FromGitter<Varriount> Araq: Such as?
07:35:03Araqread what I wrote about the "--symbolfiles fiasco"
07:35:16FromGitter<Varriount> Ah, serialization
07:36:36FromGitter<Varriount> Araq: It seems that the plan is to make ref-less design more attractive
07:37:38Araqyes
07:38:52*yglukhov quit (Remote host closed the connection)
07:43:24*jinshil joined #nim
07:52:37*Vladar joined #nim
07:54:11*ftsf joined #nim
07:56:18*endragor joined #nim
08:08:28*yglukhov joined #nim
08:09:18*gokr joined #nim
08:12:44couven92Araq, I need editDistance in a private C# project of mine, can I just take the Nim editDistance implementation I have been working with and port it to C#?
08:13:17*yglukhov quit (Ping timeout: 268 seconds)
08:13:55Araqyup, the license allows these things
08:14:07couven92:)
08:14:11couven92Horray for MIT!
08:14:42*PMunch joined #nim
08:19:57skrylari think i wrote one of those for skylihts years ago before learning nim already had one
08:25:37FromGitter<data-man> @couven92: Try this https://forum.nim-lang.org/t/1730/4
08:27:13couven92@data-man interesting... what does it do differently? Even though I ported the strutils implementation to unicode, I still cannot claim that I understand what the original version actually does :P
08:29:47*claudiuinberlin joined #nim
08:32:43FromGitter<data-man> Dynamic programming is so...dynamically incomprehensible. :)
08:37:07*Kingsquee joined #nim
08:41:36PMunchHmm, why do I get a SIGSEGV when I try to do "cstr[0] = 'a'" on a cstring?
08:42:55PMunchAs in: http://ix.io/C6K/
08:43:34PMunchDoing "echo cstr[0]" works just fine
08:45:34PMunchSeems like def- has also had this issue: https://gist.github.com/def-/15feb9775721a13a851e
08:46:15AraqPMunch: you're writing into constant static data, not supported
08:47:07PMunchWhat
08:47:16PMunchAll cstrings are contstant static?
08:47:28Araqthe literals
08:47:44Araqthere is a difference between
08:47:50Araqvar x: string = "x"
08:48:00Araqcstring(x)[0] = 'a'
08:48:02Araqand
08:48:07Araqvar x: cstring = "x"
08:48:25*vlad1777d joined #nim
08:48:27couven92PMunch, think about it: we have the same in C, right?
08:48:52PMunchAh, so first defining it as a string and then defining a new variable which is the .cstring of that works
08:49:12PMunchhttp://ix.io/C6L/
08:49:14PMunchLike so
08:49:55PMunchIs this something that could be checked at compile time to give a more sensible error message?
08:52:20PMunchHmm, so is there a way I can make a cstring from only the last part of the string?
08:54:07PMunchThe reason I'm doing this is that nimAES uses cstrings and my application requires me to run 100_000 rounds of ECB encryption. However since ECB is block based the encryptECB function found here: https://github.com/jangko/nimAES/blob/master/nimAES.nim#L285 would only encrypt the first half of my buffer
08:54:39*floppydh joined #nim
08:54:52Araqcstrings are declared as "dangerous" and not much checking happens :-)
09:00:54PMunchYeah I'm not sure why nimAES uses them..
09:01:25PMunchMy best guess is that it has been ported directly
09:01:50*yglukhov joined #nim
09:03:03PMunchI'm actually having some performance issues with it, so I might rewrite the thing to use arrays and sequences of uint8s instead
09:04:30*yglukhov_ joined #nim
09:05:01*yglukhov quit (Read error: Connection reset by peer)
09:13:41*jinshil quit (Read error: Connection reset by peer)
09:20:01*marenz_ joined #nim
09:20:55*endragor quit (Remote host closed the connection)
09:23:48*endragor joined #nim
09:28:33*jjido joined #nim
09:28:39*kalkin-- joined #nim
09:30:59*Amrykid quit (Ping timeout: 268 seconds)
09:31:03*vlad1777d quit (Ping timeout: 250 seconds)
09:31:09*flyx joined #nim
09:31:36*kalkin--- quit (Ping timeout: 268 seconds)
09:31:44*Amrykid joined #nim
09:47:24*endragor quit (Remote host closed the connection)
09:49:19*endragor joined #nim
09:50:21*endragor_ joined #nim
09:50:40*endragor_ quit (Remote host closed the connection)
09:53:35*endragor quit (Ping timeout: 240 seconds)
09:57:37*endragor joined #nim
10:02:35*endragor quit (Remote host closed the connection)
10:09:55*Arrrr joined #nim
10:13:53*endragor joined #nim
10:17:11*jjido quit (Ping timeout: 240 seconds)
10:27:52*arnetheduck quit (Ping timeout: 260 seconds)
10:42:50*claudiuinberlin quit (Read error: Connection reset by peer)
10:56:56*SenasOzys quit (Remote host closed the connection)
10:58:06FromGitter<alehander42> why if I write ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a0434bef257ad910972697a]
10:58:35FromGitter<alehander42> createTester still gets NimNode
10:58:40FromGitter<alehander42> (and cant compile)
11:04:11Araqthat's how the macro system works, inside the macro's body everything is of type NimNode
11:04:27Araqexceptions are 'typedesc' and 'static[T]'
11:05:42*pwntus quit (Remote host closed the connection)
11:06:05FromGitter<alehander42> ok that's what I meant
11:06:17FromGitter<alehander42> so static[Lang] is what I want
11:06:18FromGitter<alehander42> thanks
11:07:22*skrylar quit (Remote host closed the connection)
11:09:45*xkapastel quit (Quit: Connection closed for inactivity)
11:10:57*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
11:14:14FromGitter<mratsim> Is there a very simple Nim key-multivalue/single-table database package? I want to write an object pool for Cuda/GPU allocation and keep track of (address: ByteAdress, alloc_size: Natural, in_use: book, last_use_epoch: Natural). Usage will be 1. Is there not(in_use) and alloc_size == requested_size ==> return ByteAddress and in_use = true 2. Table[atAddress].in_use = false when return memory to cache. 3. When
11:14:14FromGitter... last_use_epoch pass a certain threshold free the GPU Memory for good.
11:15:38*SenasOzys joined #nim
11:17:52Araqmy goto solution is sqlite and db_sqlite.nim
11:18:04Araqcan be slow though
11:20:30PMunchmratsim, isn't a DB a bit overkill for this?
11:20:39PMunchOr am I misunderstanding you
11:20:45FromGitter<alehander42> I used sqlite and db_sqlite.nim for something like that a week ago, and eventually I wrote manually a faster format specifically optimized for my data
11:22:24*zolk3ri joined #nim
11:22:49FromGitter<mratsim> @pmunch DB is overkill yes, I will have about 8-12GB to track with 200MB to 6Gb objects to track so 1 to 60 entries to track at most.
11:23:12PMunchWhy not just a table?
11:24:27FromGitter<mratsim> I though about it like Key: ByteAdress, Value(size: Natural, in_use: bool, epoch: Natural)
11:25:28FromGitter<mratsim> But searching for epoch > threshold looks slow and searching for in_use == false and size == request_size seems ineeficient too
11:26:35*elrood joined #nim
11:26:42FromGitter<mratsim> Alternative would be to have 3 tables (ByteAddress, in_use) (ByteAddress, alloc_size) (ByteAddress, epoch)
11:28:47FromGitter<mratsim> @Araq sqlite also seems like overkill
11:31:04*jjido joined #nim
11:34:40avsejI wonder why nim has MIT license, but nimble is BSD
11:36:59FromGitter<data-man> @mratsim: lmdb & sophia can store multivalue. Bindings are in packages
11:37:36*yglukhov_ quit (Remote host closed the connection)
11:38:07FromGitter<mratsim> @data-man I'll check those out thanks
11:38:10FromGitter<alehander42> @mratsim how often do you have to do those searches? searching in ~70 entries seems fast if you're not doing it all the time
11:38:15*yglukhov joined #nim
11:39:39FromGitter<mratsim> Very often, the idea is to avoid the cost of allocating/deallocating GPU memory in tight loops, and GPU memory allocation/deallocation is at least 5x more expensive than on CPU
11:40:38FromGitter<mratsim> So I expect to search quite often if there is a free memory chunk of the proper size
11:40:53*PMunch_ joined #nim
11:42:55Araqavsej: not sure
11:43:11*PMunch quit (Ping timeout: 240 seconds)
11:43:43FromGitter<Yardanico> let's ask @dom96 :)
11:44:08FromGitter<alehander42> so, you do size == request_size, and not size >= request_size
11:44:30FromGitter<alehander42> does this mean the chunks you'll need are of only several possible sizes ?
11:44:35FromGitter<alehander42> e.g. 200 400 600 mb etc
11:45:00couven92Araq, dom96 should be happy now, merge https://github.com/nim-lang/Nim/pull/6640 ?
11:45:19couven92ah, no, wait, I forgot there is this ominous nimscript issue...
11:45:24*PMunch__ joined #nim
11:46:27FromGitter<alehander42> if that's true, can't you search from an array of the not-used indexed by size div base_size
11:47:45*PMunch_ quit (Ping timeout: 248 seconds)
11:51:45*PMunch__ quit (Quit: Leaving)
11:51:54*PMunch joined #nim
11:53:59*dddddd joined #nim
12:00:36FromGitter<mratsim> Yes 90% of the time I expect in a loop that allocations are of the same size. Mmmh that's an idea, seems a bit magical though
12:02:25*Snircle joined #nim
12:02:37FromGitter<mratsim> Reading this tuto about implementing a sqlite clone in C https://cstack.github.io/db_tutorial/parts/part3.html
12:03:10FromGitter<alehander42> I often found I can transform some of my "keys" to 0..n while adding little limitations and use this trick ⏎ if the others 10% the sizes are unpredictable you can fallback to different search scheme and benchmark if that's good enough
12:07:45*kobi7 joined #nim
12:08:12FromGitter<data-man> @mratsim: you need a in-memory database?
12:09:19*JappleAck joined #nim
12:16:36FromGitter<data-man> @mratsim: then try https://github.com/OpenSystemsLab/unqlite.nim with updated C sources from https://github.com/symisc/unqlite
12:24:19PMunchmratsim, multiple tables with object references
12:25:37PMunchFor your epoch stuff you can have a sorted list, booleans can just be two lists for true and false. And then you just need to set some addresses
12:56:40*nsf quit (Quit: WeeChat 1.9.1)
13:01:18dom96Why is Nimble BSD? No particular reason. Just the license I chose. Why is it BSD when Nim is MIT? Pretty sure Nim was GPL back when I created Nimble, so maybe you should be asking why Nim is MIT licensed :)
13:06:21elroodMIT and 3-clause BSD are pretty much equivalent anyways
13:08:53elroodif you care about unpermitted use of your name choose BSD, if not go MIT, it doesn't really matter
13:27:20FromGitter<alehander42> can I force an ident
13:27:24FromGitter<alehander42> nvm
13:44:59FromGitter<lawgsy> It says in the official tutorial part 1, that when using slices, b[0..^1] is shorthand for b[0..b.len-1], however when I dynamically create such a sequence b, b[0..b.len-1] works while b[0..^1] yields "Error: no surrounding array access context for '^'"
13:48:09Araqlawgsy: the rewrite didn't work in every case :-) In Nim devel it does.
13:49:35FromGitter<lawgsy> @Araq okay :) figured it would have already been caught or even resolved, just couldn't find if it had.
13:50:10*Guest27009 quit (Quit: Leaving)
13:50:12Araqbut I'm curious, what's the snippet that triggers it?
13:50:29*RPG joined #nim
13:50:53*RPG is now known as Guest42015
13:55:55FromGitter<lawgsy> let's see, what's the easiest way to drop the snippet in here? pastebin or something?
13:56:18Araqhttps://play.nim-lang.org/
13:56:23Araq:D
13:58:25FromGitter<lawgsy> Even better. https://play.nim-lang.org/?gist=3447ad7bbd315fba05c04ffa432dfde5
14:02:53Araqok works with devel
14:03:04FromGitter<lawgsy> \o/
14:03:12avsejpower pc LE for some reason detected as big endian. https://github.com/nim-lang/Nim/pull/6713
14:03:15Araqif you want it working with 0.17.2, use a 'let'
14:04:47*gokr quit (Ping timeout: 268 seconds)
14:05:20avsejAraq, do I need to open PR in csources after the fixing templates, or you will regenerate them later?
14:05:48Araqit's all generated but you have to wait until we release 0.18.0
14:05:48FromGitter<lawgsy> A let statement? But the sequence is altered in the for-loop... so that would yield another type of error
14:06:13Araqlawgys: you're indexing into the result of a 'reserved' proc call
14:06:30Araqthat can always be put into a let
14:07:45avsejno problem, I can patch csources until then
14:09:05FromGitter<lawgsy> I'm not sure if I quite follow, could you give me a brief example or otherwise point me into the right direction?
14:10:19avsejalso could you take a look at this one? https://github.com/nim-lang/Nim/pull/6703, currently tests will fail if example.com is not available or internet disabled
14:13:28*SenasOzys quit (Remote host closed the connection)
14:13:41*SenasOzys joined #nim
14:25:22*TjYoco joined #nim
14:38:18FromGitter<lawgsy> The problem also occurs in 0.17.2 when the array is passed as a parameter it seems, so even a 'let' statement probably would not solve this
14:38:25FromGitter<lawgsy> or sequence*
14:45:15FromGitter<mratsim> @data-man thanks for unqlite as well, actually I think that 3 hash tables (ByteAddress, size), (ByteAddress, in_use) and (ByteAddress, epoch) will have less overhead than any of the sofia, lmdb or unqlite in-memory database.
14:45:21*jjido quit (Ping timeout: 248 seconds)
14:45:46*couven92 quit (Read error: Connection reset by peer)
14:50:14*jjido joined #nim
14:52:10*koppeh joined #nim
14:53:03Araqlawgsy: https://play.nim-lang.org/?gist=04ee0b885b1301f6b065798d5457ea55
14:54:21FromGitter<lawgsy> oh I see what you mean. alright, thanks :)
14:56:36Araqdon't ask why the spaces around .. ^ are required for 0.17.2 :-)
14:57:04Araqthat's not required in devel, devel rocks...
14:57:48FromGitter<lawgsy> the spaces around it actually solve the entire issue without adding a let statement :D
14:59:14Araqit's inefficient then though
14:59:21Araqreverse is called twice
15:00:07FromGitter<lawgsy> is it? well I could always slice first, reverse afterwards
15:01:24FromGitter<lawgsy> not sure why reverse would be called twice though, but reduced[0 .. ^2].reversed should resolve that issue
15:05:41kobi7hi guys, is seq a value type? (not ref type?)
15:10:35kobi7what does it mean illegal storage access?
15:10:49kobi7SIGSEGV: Illegal storage access. (Attempt to read from nil?)
15:11:16TjYocokobi7 did you initialize your seq with @[]
15:11:30kobi7https://gist.github.com/kobi2187/6839b5867034519546f79a4d61c43d6f
15:12:28kobi7'ourlist' is modified in-place. then added to a sequence. (not sure if i need to clone or if it's a value type) but anyway i get this err
15:13:29kobi7oh, result has to be initialized?
15:13:49TjYocokobi7 yeah, try result = @[] on top of the proc
15:14:02TjYocoor first line I mean
15:14:11kobi7I see. let me try
15:14:48kobi7yay! success
15:15:34kobi7wouldn't it be better to initialize by default?
15:16:02Araqyes, it would. turned out to be hard to do internally
15:16:32kobi7but some types are initialized, right?
15:16:57TjYocoresult is automatically created as the type the proc returns
15:17:14TjYocojust seq results aren't initialized
15:17:17kobi7I thought it was just a decision, like string is nil instead of "" (empty string)
15:17:58TjYocoI think he got rid of nil string being default too
15:19:55*endragor quit (Remote host closed the connection)
15:20:12kobi7does anybody know of a permutation algorithm, for example, if the args are: [1,2,3] , 2 the result would be [[1,2], [1,3], [2,3]]
15:21:01kobi7maybe it's called combinations? I don't have much math background
15:22:46TjYocokobi7 you could probably make it pretty easily, check out sequtils in nim statndard library
15:22:50*gokr joined #nim
15:23:52*endragor joined #nim
15:25:19FromGitter<lawgsy> try looking for a k-subset algorithm
15:26:30kobi7thanks. i guess i should browse stack overflow instead of asking here.
15:27:54FromGitter<lawgsy> I'm sure I've written one in the past, but I'm sure folks on SO have much better solutions if I were even able to find mine
15:28:33*endragor quit (Ping timeout: 248 seconds)
15:29:27*jjido quit (Ping timeout: 240 seconds)
15:29:54kobi7:)
15:30:10*PMunch quit (Quit: Leaving)
15:30:11TjYocokobi7, this and the nim forums is probably the best place to ask questions. If you want someone to write you an algorithm for that then ask that instead
15:31:40kobi7ok
15:34:34FromGitter<data-man> @kobi7: https://forum.nim-lang.org/t/2812
15:34:35kobi7how do you usually sort in nim?
15:34:51Araqimport algorithm
15:34:57Araqalgorithm.sort(...)
15:34:59kobi7stdlib has algorithm.sorted
15:35:26kobi7so I need to provide the custom cmp ?
15:35:57FromGitter<lawgsy> you can use system.cmp for basic comparison such as numbers I believe
15:36:33AraqI don't think I've ever used system.cmp, always need a custom comparator
15:38:30TjYocoVSCode has the blue icon back, thank god. That orange one was ugly
15:39:28FromGitter<mratsim> @kobi7 that's called a Cartesian product
15:40:31FromGitter<lawgsy> @mratsim I don't think so
15:40:44TjYocomratsim idk, I think he wants all the combonations of 1,2,3 that are only 2 long
15:43:10FromGitter<mratsim> Mmm right
15:44:10FromGitter<lawgsy> k-subset or k-length subset algorithm should give him all the algorithms from set theory he could wish for
15:46:21Arrrrwe need a template to make cmps https://play.nim-lang.org/?gist=8a1c7c30fbb9f6f33ca44885b15e4efc
15:46:57FromGitter<mratsim> https://en.wikipedia.org/wiki/Combination#Enumerating_k-combinations @kobi7 maybe it will give you some keywords for your search
15:47:11*SenasOzys quit (Ping timeout: 248 seconds)
15:52:38*PMunch joined #nim
15:53:23ArrrrThis is probably more useful https://play.nim-lang.org/?gist=c93424ad398cbe4ba3711bab79f3cfb8
15:57:12*SenasOzys joined #nim
16:00:16*rauss joined #nim
16:01:33GitDisc<awr> i'm having trouble getting the nim compiler to use emscripten
16:01:46GitDisc<awr> using `nim c --cc=clang --clang.exe=emcc --clang.linkerexe=emcc --cpu=i386 --o=test.html test.nim`
16:02:40GitDisc<awr> nim attempts to copmile but gives me Additional info: Requested command not found
16:02:47GitDisc<awr> even though emcc is on the PATH
16:03:31GitDisc<awr> (also this is on windows)
16:06:15*sz0 joined #nim
16:11:13shashlickAraq: I propose making c2nim a part of koch tools and included in Nim
16:11:52shashlickhaving it separate makes it hard to get it compiled and working, especially since it is very useful for pulling in external libraries
16:12:12*coolp_jim joined #nim
16:12:26*mindB left #nim ("User left")
16:15:51GitDisc<awr> oh i think i found the problem
16:16:15GitDisc<awr> nim attempts to invoke "emcc.exe" when emcc is a batch file on windows
16:17:40GitDisc<awr> is there a way to stop nim from suffixing the cc with ".exe"?
16:21:10elroodsome wise man quite recently said filenames without extension are barbaric like dynamic typing ;) you could write an .exe which calls the batch file as a workaround ;P
16:21:43FromGitter<data-man> @Arrrr: Thanks for cmp template! D's stdlib has a similar template (multiSort) for sorting by any number of conditions.
16:22:05FromGitter<lawgsy> from what I read in extccomp.nim needsExeExt() returns true for windows by default, so I don't think so
16:22:39*yglukhov quit (Remote host closed the connection)
16:23:25*yglukhov joined #nim
16:25:27*yglukhov quit (Read error: Connection reset by peer)
16:25:56*yglukhov joined #nim
16:30:42*yglukhov quit (Ping timeout: 260 seconds)
16:39:02*PMunch quit (Quit: leaving)
16:39:57*coolp_jim left #nim ("WeeChat 1.9.1")
16:41:13*PMunch joined #nim
16:44:09*Jesin joined #nim
16:45:45*guest5081 joined #nim
17:06:38*floppydh quit (Quit: WeeChat 1.9.1)
17:08:40*xkapastel joined #nim
17:11:51*gokr quit (Ping timeout: 240 seconds)
17:17:15FromGitter<Varriount> PMunch: You can't pass it an index?
17:17:32PMunchHuh?
17:19:23*endragor joined #nim
17:20:07*Trustable joined #nim
17:21:04*compt joined #nim
17:21:54comptHi i was wondering how good is nim for competitive programming, i.e. does the stdlib contain all the common data structures and algorithms?
17:23:57*endragor quit (Ping timeout: 240 seconds)
17:26:43FromGitter<Varriount> PMunch: to the encryption routine
17:27:32FromGitter<Varriount> compt: Depends. What do you consider "common data structures and algorithms"?
17:28:01*nsf joined #nim
17:29:22PMunchcompt, yeah most of the stuff should be there
17:29:36PMunchIf not in the stdlib only a `nimble install` away :)
17:30:29PMunchVarriount, no it didn't take an index. I'm rewriting the thing now. It was using strings internally which I assume would be another thing that's bad for it's performance
17:30:43*yglukhov joined #nim
17:31:46comptPMunch: websites like hackerrank do not support nimble install unfortunately :P
17:31:48FromGitter<Varriount> Well, only if its making string copies
17:32:36PMunchHmm, I guess it isn't really
17:32:50PMunchBut it's making uint32s from uint8s
17:32:54PMunchSo copying those..
17:33:13PMunchI guess the better idea would be to convert it into taking an array of uint32
17:33:44PMunchAnd rather provide it with a seq[uint8] -> seq[uint32] converter
17:34:53PMunchAnd a string -> seq[uint32]
17:35:41*yglukhov quit (Ping timeout: 268 seconds)
17:35:42comptVarriount: common data structures - stack queue linked list atleast...
17:36:53*yglukhov joined #nim
17:37:05comptalso bigint data type
17:37:11*TjYoco quit (Ping timeout: 240 seconds)
17:38:08comptor anything comparable to the STL in c++
17:39:28*yglukhov quit (Read error: Connection reset by peer)
17:39:53*nsf quit (Quit: WeeChat 1.9.1)
17:40:03*yglukhov joined #nim
17:42:18dom96big int is available as a separate Nimble package
17:42:21dom96the rest is in the stdlib
17:43:52compthttps://nim-lang.org/docs/lib.html doesnt list stack and queue but i can see queue.nim on github. and i can't see stack anywhere
17:44:20dom96you can use seq as a stack
17:44:29dom96there is a pop function
17:44:57comptOkay
17:45:00comptthanks
17:45:21comptbtw any plans to have bigints as official data type?
17:50:42dom96Nope. Not for v1 at least
17:51:12*TjYoco joined #nim
17:51:50comptOkay, i found https://github.com/nim-lang/Nim/issues/2725 Has been open for a while.. and probably is going to stay so for a while..m
17:52:07*claudiuinberlin joined #nim
17:52:44comptIs the destructors work going to remove the GC? and how much significant change will it have on the language and the stdlib? (i know it is for v2)
17:53:30TjYocoyou can turn off the GC right now if you want to
17:54:51*miran joined #nim
17:55:23comptI have nothing against the gc yet. Just wanted to know if it would lead to any significant changes to the user facing stdlib api and their working.
17:55:51compt*it = destructors
18:02:27FromGitter<mratsim> no before many years
18:02:30FromGitter<mratsim> not*
18:02:39*compt quit (Ping timeout: 260 seconds)
18:05:37FromGitter<mratsim> After serious thinking, instead of an in-memory database, Nim tables are pretty good since you can have multiple equal key, so I can use a Table of [memory_size, ByteAddress] and only track the free cuda object pool. Now I need to find a way to add “Decay” to the Nim tables. I guess DecayingTable that would be interesting to add to the library? (especially for game devs). I’m not too sure how to do it but well.
18:07:52*Nikky quit (Quit: WeeChat 1.9)
18:08:03*Nikky joined #nim
18:11:46*Nikky quit (Client Quit)
18:11:56*Nikky joined #nim
18:12:27*Nikky quit (Client Quit)
18:12:38*Nikky joined #nim
18:23:29*jsgrant_ joined #nim
18:52:33*Sembei joined #nim
18:53:50FromGitter<Varriount> @mratsim You posted those links on epoch-based and QSBR-based memory reclamation. Do you know any more about it?
18:54:00FromGitter<Varriount> I have some questions, but I'm not sure who I can ask.
18:54:01*Pisuke quit (Ping timeout: 240 seconds)
18:55:52*jjido joined #nim
18:55:54FromGitter<Varriount> compt: Linked lists are in the 'lists' module, although sequences are usually a better choice.
18:56:17*aerx joined #nim
18:58:34Araqvarriount: ask me ;-)
18:58:39*claudiuinberlin quit (Ping timeout: 248 seconds)
18:59:21FromGitter<mratsim> I just know that it's interesting :P and I need to review that in depth :p
18:59:34*salewski joined #nim
19:01:14salewskiDo we already have a proc like min_by as in Ruby? https://ruby-doc.org/core-2.4.2/Enumerable.html#method-i-min_by
19:03:38AraqI doubt it
19:04:21salewskiOK, then I will create one. Bye.
19:07:41*salewski quit (Quit: WeeChat 1.9.1)
19:19:54*TjYoco quit (Quit: Leaving)
19:22:51*Vladar quit (Quit: Leaving)
19:25:00FromGitter<Varriount> Araq: Ok. Looking at that QSBR-based library, it seems like there is only one "pool"of memory - during those quiescent states, all memory tracked will be released. Isn't this a downside - usually bits of memory need to be freed at different times.
19:25:39Araqwell it's not a GC, as I said, it's a queue or similar to it
19:35:06*vivus joined #nim
19:42:06*tefter quit (Remote host closed the connection)
19:46:58GitDisc<awr> @salewski is this what you want?
19:47:03GitDisc<awr> import sequtils, algorithm
19:47:04GitDisc<awr> type Fruit* = enum orange, pear, blueberry, strawberry, apple
19:47:05GitDisc<awr> echo Fruit.mapIt(it).foldl(if ($a).len() < ($b).len(): a else: b)
19:47:06GitDisc<awr> echo Fruit.mapIt(it).sortedByIt(($it).len())[0 ..< 3]
19:51:43vivusanybody used this before: https://networkos.net/nim/reactor.nim/ ?
20:10:40*yglukhov quit (Remote host closed the connection)
20:17:55*Arrrr quit (Quit: Leaving.)
20:20:39*salewski joined #nim
20:21:51salewskiGitDisc, the desired minBy() is in no way related to Nim's enums.
20:22:27salewskiRuby uses the term enumeration in a different way.
20:23:39salewskiWhat I need: I have objects with a member field like temerature in a seq, and I want to select coldest.
20:24:55salewskiTrivial to code, I start with one of Nim's sort() procs. I just asked because I was not sure if it already exists.
20:24:59salewskiBye.
20:27:17salewski(Of course I could do a sort and use el[0], but plain select is faster.)
20:27:51*kobi7 quit (Ping timeout: 240 seconds)
20:30:38*yglukhov joined #nim
20:30:51*yglukhov quit (Remote host closed the connection)
20:31:06*yglukhov joined #nim
20:39:27*gokr joined #nim
20:40:50*Snircle quit (Ping timeout: 258 seconds)
20:41:18*ipjk joined #nim
20:42:15*salewski quit (Quit: WeeChat 1.9.1)
20:52:04*nsf joined #nim
21:01:47*couven92 joined #nim
21:02:38*fredrik92 joined #nim
21:05:37*couven92 quit (Disconnected by services)
21:05:40*fredrik92 is now known as couven92
21:08:24FromGitter<Varriount> vivus: It's nice, however reactor.nim seems primarily connection oriented. I don't see any procedures for reading/writing to/from files
21:10:37*SusWombat quit (Quit: Leaving)
21:18:17*Trustable quit (Remote host closed the connection)
21:19:46vivus@Varriount so its more suited for network applications?
21:20:14FromGitter<Varriount> vivus: Yes. I don't know how it compares with the async stuff in the stdlib though.
21:20:55vivusit claims it is better than the stdlib performance-wise
21:21:55dom96You shouldn't be worried about performance when it comes to stdlib's async
21:25:51*SenasOzys quit (Ping timeout: 248 seconds)
21:35:33Araqit claims that but there is no benchmark to backup that claim
21:35:53Araqit seems mostly based on "it wraps C, so it's faster"
21:36:41Araqas if a never ending cascade of "if err goto error;" couldn't be beat performance-wise
21:40:04*vlad1777d joined #nim
21:41:56GitDisc<treeform> What are your thoughts on futures/callback based concurrency vs green threads? Do you have your thoughts in a blog post some place?
21:49:22*miran quit (Quit: Konversation terminated!)
21:52:58*Jesin quit (Quit: Leaving)
21:52:59*guelosk joined #nim
21:54:53*Snircle joined #nim
21:56:32*Jesin joined #nim
21:57:56*SenasOzys joined #nim
22:03:21*jjido quit (Remote host closed the connection)
22:06:52*jjido joined #nim
22:07:08*FromGitter quit (Remote host closed the connection)
22:07:20*FromGitter joined #nim
22:14:08Araqtreeform: could do some live demo about it
22:18:56*SenasOzys_ joined #nim
22:19:43*SenasOzys quit (Ping timeout: 248 seconds)
22:26:09*jjido quit (Ping timeout: 248 seconds)
22:40:43*jsgrant_ quit (Remote host closed the connection)
22:41:24*yglukhov quit (Read error: Connection reset by peer)
22:41:59*yglukhov joined #nim
22:42:39*aerx quit (Ping timeout: 248 seconds)
22:46:45*yglukhov quit (Read error: Connection reset by peer)
22:47:19*yglukhov joined #nim
22:47:36*PMunch quit (Quit: leaving)
22:51:56*zolk3ri quit (Remote host closed the connection)
22:53:05*nsf quit (Quit: WeeChat 1.9.1)
23:00:29*elrood quit (Quit: Leaving)
23:06:28GitDisc<treeform> I would prefer a blog post. But I would take a live demo. I really want high level thoughts. I really like green threads (specifically python's gevent), they feel comfortable when I used them, they look just like normal threads we are all used too. Having programmed in JavaScripts promises callback hell, I don't want to do it.
23:06:58GitDisc<treeform> But wheat probably what makes gevent work is python's stupid GIL and is not at all performant.
23:07:44*guelosk quit (Ping timeout: 260 seconds)
23:07:46GitDisc<treeform> With futures you know exactly what is going on. If you know what await macro does etc... and probably can be a ton more performant.
23:08:46GitDisc<treeform> But I still just kind of want that simple world of global vars and mutable state with a bunch of threads. That probably just can't happen due to limitations of the universe or some thing.
23:09:08GitDisc<treeform> Gevent does it but probably really slow and all locking which is not a reason to use nim in the first place.
23:09:38GitDisc<treeform> But then Future style code looks very different from normal looking code and normal libs don't work and with it and block it when they block.
23:09:42dom96you won't have to worry about callback hell with async await
23:10:34GitDisc<treeform> I think I still do? I rewrote my code to use async and now it all not in the style I would write it.
23:11:12GitDisc<treeform> mainly because you can't use var think.
23:11:51GitDisc<treeform> So you have to collect all your changes and cart them about like you would in a functional language and return them to apply them.
23:15:22GitDisc<treeform> It might be better that way. In a concurrent system functional style probably wins.
23:15:36GitDisc<treeform> it still takes your head to wrap around it.
23:17:36GitDisc<treeform> Another problem is is the system mainly IO bound or CPU bound?
23:18:00GitDisc<treeform> concurrency is not parallelism etc...
23:18:09ipjkAre green threads affected by GIL? I thought that was just native threads.
23:18:11GitDisc<treeform> (min is IO bound)
23:18:30GitDisc<treeform> ipjk in python everything is effected by the GIL
23:19:06*couven92 quit (Quit: Client Disconnecting)
23:20:22GitDisc<treeform> but maybe you are right they seem to have tons written about it gevent and GIL. I am not an expert on this.
23:20:52ipjkNeither am I, and I haven't used much python either
23:23:56GitDisc<treeform> I used gevent a ton it just felt magical. I think the main problem is that async/await just does not feel magical. Just this extra crap you need to put around in your code to make it run. Oh and you can't use any normal features.
23:24:21GitDisc<treeform> But it does work. And is probably 1000x faster then python.
23:24:33GitDisc<treeform> So maybe I should not complain.
23:32:04*yglukhov quit (Read error: Connection reset by peer)
23:32:37*yglukhov joined #nim
23:34:29FromGitter<Varriount> treeform: Doesn't gevent just move the async/await to the standard library calls?
23:40:27*yglukhov quit (Read error: Connection reset by peer)
23:40:59*yglukhov joined #nim