<< 15-12-2017 >>

00:05:48*gmpreussner quit (Ping timeout: 240 seconds)
00:07:02*gmpreussner joined #nim
00:16:40FromGitter<nitely> Araq: docs for things exported with `export thing` are not generated. May be it's intended?
00:18:20*endragor joined #nim
00:21:25Araqvarriount: It's not ugly, 'random' is deprecated, 'rand' is the new thing
00:22:53*endragor quit (Ping timeout: 256 seconds)
00:25:05FromGitter<zacharycarter> @raydf I'd love to do more web dev in karax, unfortunately at work I'm stuck using react :/ and I'm currently not involved in building any mobile apps
00:25:59FromGitter<zacharycarter> I need to build a more complex app with karax - I think it's really a great library and I think there could be an ecosystem built around it, assuming enough people were to use it
00:27:06dom96radagast: further to zacharycarter's message: ...and if PRs are too much, issues would be great too :)
00:29:15FromGitter<nitely> awr: if docs for `export some` were generated, then you could have a main module that exports the public API, but that's not the case
00:30:11radagastI'm thinking of creating an unofficial gitbook/wikibook about basic Nim. I have spare time of a few months. This might be a good learning experience for me.
00:33:10FromGitter<zacharycarter> could you elaborate on where you're finding friction in learning the language?
00:33:17FromGitter<zacharycarter> or certain features?
00:34:11FromGitter<zacharycarter> if anything needs more documentation in Nim - I think it's advanced, low level / unsafe features as well as multi-threading, parallelism, async, etc...
00:34:45FromGitter<zacharycarter> and some advanced examples of the above mentioned features would be wonderful as well
00:37:38GitDisc<awr> nitely: The `export x` appears to do what I want
00:38:33GitDisc<awr> but, as you said its not certain if this is how `export` is meant to work
00:40:16radagast@zachary, regarding advanced topics like low level/unsafe --best place to contribute is to the manual itself. There are a few non-stable constructs like concepts that need a bit more explaining. However, what I want to achieve is a different approach to introduce Nim to beginners.
00:41:45radagastThe presentation of the manual is a little bit.... complicated. I want to take a different approach, that's all.
00:43:05GitDisc<awr> I recall seeing a few months back that someone wanted to make a video tutorial series for Nim.
00:43:34FromGitter<zacharycarter> I wish there were less video tutorials for programming and more text based tutorials
00:43:36GitDisc<awr> I know videos are not everyone's preferred educational medium, but I like them
00:43:44FromGitter<zacharycarter> :P
00:45:41radagastTo be honest, visual method of teaching can be more effective. But alas, it requires more effort.
00:47:03FromGitter<nitely> awr: yeah, using export to avoid the doc generation is certainly a hack
00:47:42FromGitter<nitely> plus, it's unclear to me if the no docs for exports are intended behaviour
00:50:01*SenasOzys quit (Read error: Connection reset by peer)
00:50:35*SenasOzys joined #nim
01:25:47*vlad1777d quit (Ping timeout: 256 seconds)
01:32:37FromGitter<zetashift> @radagast there is also http://nim-cookbook.btbytes.com/ where you can add some code samples
01:46:14FromGitter<mratsim> The manual is not a tutorial, more of a reference book.
01:47:30FromGitter<mratsim> Personally I find video tutorials really cumbersome, it's too slow, and you can't control + F.
01:50:39FromGitter<mratsim> Targeted tutorials/recipes (Nim for frontend web, Nim for IO, Nim for networking, Nim for games, Nim for science) might be helpful.
01:59:16FromGitter<zacharycarter> +1
02:11:31*endragor joined #nim
02:32:28*chemist69 quit (Ping timeout: 240 seconds)
02:40:04*skrylar joined #nim
02:46:27*chemist69 joined #nim
02:55:04*dddddd quit (Remote host closed the connection)
03:44:51*marenz__ joined #nim
03:47:58*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:49:10*marenz_ quit (Ping timeout: 272 seconds)
03:52:38*astronavt joined #nim
04:26:24FromGitter<Varriount> @mratsim My project this month is going to be compiling how-to articles on Nim, for the website.
04:26:56FromGitter<mratsim>
04:37:33*marenz__ quit (Ping timeout: 264 seconds)
04:39:01*astronavt quit (Remote host closed the connection)
04:47:56skrylardo any nimmers actually use stuff like Dash and Zeal
04:52:35FromGitter<mratsim> I dowloaded Dash since someone put nim docs in a compatible format, it was a dropbox link though
04:53:14FromGitter<mratsim> @dom96 @Araq, Nim readme still mentions Gratipay even though it closed down. https://gratipay.com/
04:54:18*nitely joined #nim
04:54:29skrylarmratsim, varriount: https://github.com/Skrylar/sksbox woot
04:56:14*nitely quit (Client Quit)
04:58:24FromGitter<mratsim> have to play with it vs msg pack, protobuf et al
04:59:00skrylarits not a replacement for those things
04:59:16FromGitter<mratsim> the apartment besides mine, took full fire 2 hours ago, and I can’t sleep :/
04:59:24skrylar'_'
04:59:59skrylarin a non impending fire danger sense, sbox is more a solution to glTF's problem of "We used json but have this inconvenient buffer of floats lying around"
05:00:20skrylarit's sort of zip-esque in that it just deals with key/values and you shove blobs there
05:00:33FromGitter<mratsim> it has been extinguished, but it smells.
05:01:01skrylarmsgpack is quite nice though
05:01:16skrylari haven't tested the module someone wrote. i did write a bson module, but never did the final polishes on it
05:01:49skrylaron the fence about trying to have msgpack with an optional pre-schema, or just biting it and writing an avros adapter
05:02:38skrylaravros is already 50% json, so that would just sit back on the json code we already have. the binary version would take a little work, but it 1) hooks in to Apache Spark and al ltheir big data shit and 2) also solves the problem of "i need to do a lot of rpc and already know the schema"
05:06:50skrylarbleh nimble is still giving protocol errors
06:01:52FromGitter<mratsim> Avro seems quite nice, I didn’t check it out until now (though I’ve looked into Thrift, Bson, etc). I like Cap’n Proto cerealization homepage too: https://capnproto.org/language.html
06:02:33FromGitter<mratsim> Seems like Avro can use either no compression, zlib or Snappy too
06:02:39FromGitter<mratsim> huhu maybe I have a winner
06:05:47FromGitter<mratsim> https://github.com/thekvs/cpp-serializers
06:06:54FromGitter<mratsim> and: https://eng.uber.com/trip-data-squeeze/
06:31:48*yglukhov joined #nim
06:35:25*nsf joined #nim
07:33:33*solitudesf joined #nim
07:37:44*Vladar joined #nim
07:41:29skrylardoesn't any serialization method "support" compression
07:46:08*gmpreussner quit (Ping timeout: 240 seconds)
07:46:45skrylarmratsim: sounds like that page is saying capnproto is the best ever
07:49:21*gmpreussner joined #nim
07:49:47FromGitter<alehander42> "infinitely faster" and I thought light speed travel was just a dream
07:49:50skrylarserializers are awkward to compare, imho. it really depends on your goals
07:51:04skrylarschemaless is great for throwaway scripts and prototypes, schema compiled is great for real-time wire stuff, schema-stored is apparently best for long-term document life (ex. "can i open this ten year old blender file?")
07:54:11skrylarwill take a look at capnproto's spec tho
08:04:26skrylarsome of the optimizations these things make don't work super well in nim
08:04:55skrylarafaik we don't really have a common-use slice mechanic, so you can't just hand out slices to the giant buffer instead of copying out strings
08:11:23*Lord_Nightmare2 joined #nim
08:14:53*Lord_Nightmare quit (Ping timeout: 255 seconds)
08:14:53*Lord_Nightmare2 is now known as Lord_Nightmare
08:16:42*vlad1777d joined #nim
08:19:20skrylarblegh. capnproto's official spec doesn't say what the offset allocations are
08:24:32*claudiuinberlin joined #nim
08:28:50skrylarhttps://github.com/zielmicha/capnp.nim hm
08:56:36*floppydh joined #nim
08:57:17skrylarhoboy. interesting blog post on someone saying the way capnproto allocates space apparently also works for livecoding
09:03:59*gmpreussner quit (Ping timeout: 248 seconds)
09:05:24*gmpreussner joined #nim
09:19:42skrylarhttp://cbor.io/ neat.
09:21:56*xkapastel quit (Quit: Connection closed for inactivity)
09:24:12*chemist69 quit (Ping timeout: 272 seconds)
09:25:16*solitudesf quit (Ping timeout: 265 seconds)
09:36:54FromGitter<raydf> @zacharycarter. Look in this gist: https://gist.github.com/raydf/5e428c8e275cde6a01905b7dd9a26840. I tried to translate: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ The problem is for my little understanding of the transpilation/compilation process of nim to js i couldn't find a way to pass the parameters to the nim method that is a callback on success or on error of the barcode scanner. This is the normal behaviour of
09:36:54FromGitter... all cordova plugins (to use callbacks). What i'm doing right now is using proxy functions without parameters that call the javascript code for the plugin, using global objects for exchanging the messages/properties. ... [https://gitter.im/nim-lang/Nim?at=5a3397b61a4e6c8223107555]
09:37:52*chemist69 joined #nim
09:41:47*arnetheduck joined #nim
09:43:36*Arrrr joined #nim
09:43:36*Arrrr quit (Changing host)
09:43:36*Arrrr joined #nim
09:44:47*Ven` joined #nim
09:48:49*PMunch joined #nim
09:49:41ArrrrGood improvements to random. I think a rand(Enum) would be useful too, i use this a lot.
09:52:48Araqrand(ValueA..ValueB) should work
09:52:58Araqbut probably I got the generic wrong :P
09:54:16ArrrrIt should create a const array to take into consideration enums with holes
09:58:49AraqI'll remove enums with holes instead ;-)
09:58:54Araqhate that feature, it's stupid
09:59:23Araqenums should be simply, enums with holes are not "enumerable" at all
09:59:27Araq*simple
10:02:35*gokr joined #nim
10:03:19ArrrrYes, you can always use a custom array to give enums custom int values
10:10:19AraqI introduced this feature for easier C interop but 'distinct' didn't exist back then
10:10:49AraqI wonder if we really should deprecate it
10:11:12Araqmakes Nim's core more complex and v0.18 is the big breaking release
10:17:44skrylarforcing people to jump through hoops sounds like the opposite of double plus good
10:18:41PMunchI like enums with holes :(
10:20:32*NimBot joined #nim
10:20:57AraqPMunch, you could use a distinct int instead
10:21:12PMunchYeah, but then I don't get automatic enumeration
10:21:21skrylaror prefixed names
10:21:27skrylarErrorCode.ItBroke
10:21:31PMunchI could also use separate enums, but then the compiler won't warn me of overlapping series
10:22:15Araqskrylar, for prefixed names you can move it to its own module
10:22:28skrylari'm confused here as to whether there is a legitimate problem with enums and holes or if araq is just having an anneurism over entropy
10:22:36PMunchTake this for example: https://github.com/Tomas-M/xlunch/blob/master/xlunch.c#L104 It's C code but the idea is the same
10:23:00skrylaralso fun with "import fooberrors"
10:23:11ArrrrSo why do you need holes for that
10:23:35AraqPMunch, all I see is an C enum with pointless arbitrary values in between them for coolness
10:23:58PMunchSo that people can do retval & mask to determine which kind of return value it is
10:24:30Arrrrburn it with fire
10:24:36PMunchHaha :P
10:24:49PMunchI guess I could create a macro for it in Nim..
10:25:58Araqwhat is an "anneurism over entropy"?
10:26:41*vlad1777d quit (Ping timeout: 248 seconds)
10:27:38PMunchArrrr, what don't you like about it? Makes sure that I can add more exit codes and old code can still work as the masks doesn't change :)
10:29:31skrylarAraq, shannon entropy increases when more probabilities exist
10:29:44ArrrrI think you can use procs for that behavior instead of casting enum to int
10:30:01skrylarif the sole reason to get rid of something is "because it takes code that already exists" == just pissing around with entropy at that point
10:30:08skrylarif its like, some crushing maintenence burden... maybe
10:30:13AraqI learn from the languages I don't like too.
10:30:58Araqin this case it's Golang's "a feature we lack cannot break"
10:31:03PMunchArrrr, of course there are different ways of doing it. But this one is nice and simple, provides me some compiler protection, and is pretty clear when looking at the source
10:31:28Araqskrylar, wanna bet how many bugs are open wrt enums with holes?
10:31:47ArrrrWell, is clear if you have C experience. I think a specific proc for that behavior is more clear.
10:32:17Araqit's ok, I won't touch enums with holes. for now.
10:32:24skrylarAraq, seven multiplied by the inverse root of splorb.
10:32:42*PMunch rejoices!
10:33:42PMunchArrrr, a simple table of return codes. Maybe throw in a small comment about the masking stuff. How much clearer can it get?
10:35:23ArrrrA real table called "ExitMask"
10:40:49*dddddd joined #nim
11:02:11FromGitter<mratsim> The enum are OK as is, some libs would be much harder to wrap otherwise like this one which uses negative values: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/blis_api.nim. I'm pretty sure the Neverwinter Nights code also uses heavily enum with holes. And we already had questions about enum having to have 0 in reddit and in the issue tracker.
11:03:04Araqof course now that the feature exists people appreciate it and like to keep it
11:03:25Araqthat's why it's so important to not introduce features in the first place... :P
11:06:59Araqnimble install gtk2
11:06:59AraqDownloading https://github.com/nim-lang/gtk2 using git
11:06:59Araq Warning: Package 'gtk2' has an incorrect structure. The top level of the package source directory should contain at most one module, named 'gtk2.nim', but a file named 'atk.nim' was found. This will be an error in the future.
11:07:12Araqis there a single package that DOES NOT produce this warning?
11:07:51Araqif nothing adheres to the scheme we came up, maybe the scheme is wrong...
11:07:53euantorI think my packages don't show it, but they're pretty simple
11:09:06Araqmaybe Nimble needs to get smarter, 'tests' and 'example' directories don't have to be listed as excluded dirs
11:12:53Araqeuantor, now that I understand the problem my own new packages are free of these warnings too
11:13:20Araqbut package managers need to get out of my way :P
11:13:40dom96It is getting out of your way, that's why it's a warning
11:14:02euantorThe problem is introducing it as an afterthought when there are already many packages and conventions
11:15:01*Ven` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:16:39dom96I guess we need to get back to discussing this in https://github.com/nim-lang/Nim/issues/6700
11:17:10dom96We're discussing two things there now :\
11:20:44euantoryep, that discussion kind of fell into another discussion
11:23:48FromGitter<mratsim> The zip package (or untar?) also has an incorrect structure.
11:27:41*Ven` joined #nim
11:29:01*Ven` quit (Client Quit)
11:40:06PMunchArrrr, that wouldn't give you the compile-time check though..
11:40:47PMunchAnd yeah the nimble package structure is a bit weird..
11:44:14skrylari keep having issues with nimble publish crapping out
11:54:18ArrrrWhy do you need the compile-time check? to avoid repeating values? You can do this: https://play.nim-lang.org/?gist=f25c547a50842ab1867f610fe152ae8c
11:58:41PMunchBut then I have to write out each of the values..
12:00:18PMunchIt's not a huge thing, just a minor convenience :)
12:01:06skrylarprobably a good time to learn jenkins if stuff is going to break again
12:01:09ArrrrYes, but i think is better for many procs to avoid caring about holes in enums
12:06:29FromGitter<Yardanico> https://pineapplefund.org :P
12:07:29Araqdom96, the problem with the warning is the "this will be an error in the future" part
12:12:47AraqError: ambiguous identifier: 'on' --use system.on or events.on :-/
12:13:46Araqambiguous identifier: 'any' --use system.any or pegs.any
12:18:45*nc-x joined #nim
12:22:28nc-xAraq: Why does https://github.com/nim-lang/Nim/blob/02ff5f596c330b68927f843814ecb9b86c2eee67/compiler/nimblecmd.nim#L60 simply parse the path and take whatever is after a `-` as the version number? Shouldn't it read the version from the *.nimble file? I am asking this because I just downloaded the nimx repo as zip. Running nake fails with `Error: unhandled exception: len(ver) == 0 or contains({0, 35, 48..57}, ver[0]) Wrong version: master
12:22:37nc-xbecause it reads the wrong version number
12:23:20Araqthe compiler doesn't process .nimble files
12:23:25nc-xChanging the folder name to have a number after the `-` works though.
12:23:47nc-xAraq: I mean why not just parse the *.nimble file to read the version info?
12:23:52*skrylar quit (Quit: Leaving)
12:24:03Araqbecause the compiler is not nimble?
12:25:08nc-xBut nimble or not nimble, the version number of the project would remain same, no? But currently the compiler uses the path of the folder to detect the version number (atleast when `--nimblepath` is used)
12:25:46Araqthat's how nimble works ... it installs packages into foo-$version
12:26:05dom96if you want to add nimx to your path then uust use --path
12:26:07dom96*just
12:26:18Araqwhy do we need to support invalid package names?
12:26:21dom96or use nimble to install like everyone else :)
12:26:43*Snircle joined #nim
12:26:54Araqdom96, can you confirm that 'nimble develop foo' git clones foo?
12:27:03dom96yes
12:27:14nc-xBut what if i have downloaded a local package from github, maybe for changing the source code and using `nimble develop`? I should not be manually required to change the folder name to include the version number
12:27:27Araqcan we get an alias for this? 'nimble clone' would make it more obvious
12:27:59Araqa local package wouldn't have the name foo-master.
12:28:12Araqas that it is not a valid pacakage name
12:28:34Araqok, if it is no package ... but then why add it to your $nimbledir?
12:28:39dom96nc-x: if you 'cd' into that directory and run 'nimble develop' then it shouldn't be a problem.
12:28:55dom96Araq: I guess...
12:29:38dom96but then ``nimble clone`` in a package's directory will be odd
12:29:47dom96as it won't actually clone
12:30:06Araqalright, fair enough
12:30:27nc-x@nc-x "if you 'cd' into that directory and run 'nimble develop' then it shouldn't be a problem." -> Thats what i did.
12:30:33dom96`nimble develop` mirrors `nimble install` pretty well.
12:31:16*Trustable joined #nim
12:31:19dom96nc-x: I see. I would consider that a bug then.
12:31:30dom96Report it on Nimble's repo though
12:32:12nc-xAraq: What if the "VALID" package name is in a folder name which has a `-`? say "C:/abc-def/package". Now it reads the version as `def/package`
12:32:26dom96hrm, I see the issue now
12:32:37dom96Nim uses the same logic for 'develop' linked packages
12:32:54dom96maybe this is a Nim bug after all
12:32:58nc-xIMHO, the version should be parsed from the *.nimble files even if the nim compiler is used.
12:33:45nc-xor maybe some other logic, where nim and nimble find the same and correct version number.
12:33:56dom96This would tie Nimble to the compiler too much
12:34:44nc-xWell, after seeing the effectiveness of rust and cargo, I would love if nimble and the compiler are tied together.
12:34:45*marenz__ joined #nim
12:35:00dom96Does Rust read cargo files?
12:36:04dom96It doesn't seem like it
12:36:05dom96http://doc.crates.io/environment-variables.html
12:36:12nc-xMost probably not, but in the Rust community, use of rustc is discouraged and usage of cargo is encouraged everywhere.
12:36:17dom96It seems that cargo passes this information via environment variables.
12:36:40dom96Yeah, so perhaps we should move in that direction instead?
12:36:55AraqI don't want Cargo, thanks.
12:37:15nc-xWell, *most* people would love to.
12:38:10nc-xAnyway, is this a bug? If yes, in which repo should i open the Issue?
12:38:33Araqlast time I checked Cargo it didn't solve any of my problems, Nimble gets a decent 8/10 score
12:38:34dom96Open it in the Nimble repo. I'll figure out whether I should touch Nim code or not so as to not trigger Araq :)
12:39:02dom96I must be going now
12:39:08dom96bbl
12:39:52nc-xIMHO, one place where nimble shines is `tasks`. But using cargo for every project does make simple things even more simpler.
12:40:17nc-xdom96: Okay, will open the issue in the nimble repo.
12:40:46FromGitter<dom96> Oh and btw. Using nimble instead of Nim is a workaround for your issue here.
12:41:02FromGitter<dom96> So do try it and let me know what the pain points are with that.
12:47:56nc-xdom96: using `nimble develop nimx` or manually downloading nimx and doing `nimble develop` works fine. But only if the path does not contain any `-`. Or if `-` is followed by a number. So this is in fact a nim bug when `--NimblePath` is used.
12:48:08nc-xStill i will create the issue in nimble repo with an example
12:50:07Araqprobably there is a simple bug in the compiler when it comes to dash handling
12:54:20Araqbut that doesn't mean 'nimx-master' is a valid package name. and when the package name is invalid, how could I read its .nimble file to figure out the version?
12:55:33nc-xdom96: https://github.com/nim-lang/nimble/issues/439
12:56:02nc-xAraq: See the above issue. The package name is valid, the folder in which the package is stored is not.
12:56:37nc-xMaybe this could be fixed atleast. Have to agree about the invalid package name though.
12:57:20Araqyeah, that is just a bug
12:57:30Araqdoesn't seem to be hard to fix
12:58:17nc-xand for the invalid package name case also, I would love to have an error that says that the package name is invalid, rather than an assertion failure which says the version is incorrect.
12:58:35Araqpfff details :P
13:01:07nc-xShould i add the `invalid package name` case to the *same issue* so that I could get a lovely error in that case? Or should I open a new Issue (this time in the Nim repo)
13:01:33*PMunch quit (Quit: Leaving)
13:01:44*PMunch joined #nim
13:09:10nc-xUpdated the same issue for now.
13:09:14*nc-x quit (Quit: Page closed)
13:14:00*Ven` joined #nim
13:23:22*sleepyqt joined #nim
13:24:20radagastDo all objecs inherit from RootObj?
13:27:41Araqno, only the ones which are declared to inherit from it
13:35:52*natrys joined #nim
13:42:54fvspointer parameters in procs - these are mutable by their nature, right? So no need to declare with "var"?
13:43:22*gokr quit (Ping timeout: 265 seconds)
13:45:39*solitudesf joined #nim
13:46:03fvsproc(lyr: pointer) = lyr.reset
13:46:11FromGitter<mratsim> var is needed if you want to modify the pointer
13:46:39FromGitter<mratsim> Var is not needed to modify the object pointed to (it's shallow immutability)
13:47:33FromGitter<mratsim> Still several people (including me) prefer that as long as there is a modification, var is used because it conveys intent.
13:48:58fvsgotcha, thanks
13:49:10FromGitter<mratsim> Well for pure pointer I don't follow that rule though, only for ref object.
13:53:45Araqthat breaks subtyping :P
13:55:53*Arrrr quit (Read error: Connection reset by peer)
14:00:16*Jesin quit (Quit: Leaving)
14:14:03*Ven` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:19:53*drs left #nim (#nim)
14:20:01*Ven` joined #nim
14:33:50*floppydh quit (Quit: WeeChat 1.9.1)
14:36:10*foo_ joined #nim
14:36:38foo_hello?
14:37:16PMunchHi?
14:38:00foo_oh cool, I was just seeing how active the channel is since sometimes I get on irc and there are 100+ nicks and nobody actually there
14:38:16PMunchOh right
14:38:35PMunchThis channel is pretty active, at least if someone asks a question or suggests something :)
14:38:46foo_I'm about to jump into learning nim so I wanted to see if this would be a viable resource
14:38:49foo_awesome
14:39:21PMunchMost definitely, when I was learning Nim this channel was incredibly valuable
14:39:45PMunchWe of course prefer if you at least Google things first though :P
14:40:29foo_yeah I will, I usually spend far too long trying to figure things out before asking anybody(often to my own detriment) but I wanted to be sure I had somewhere to turn if I need it
14:41:27foo_anyway, that's all for now really, I have to go but I wanted to check on this before I leave for the day
14:41:40foo_nice meeting you
14:43:04PMunchHope to see you around :)
14:43:27Araqhey, foo_ you're welcome
14:47:37*foo_ quit (Ping timeout: 256 seconds)
14:48:08*gokr joined #nim
14:49:38FromGitter<zacharycarter> Does anyone have any good resources for learning multi threading programming using low level primitives like Nim features? Even like a C resource or something would probably be useful to me.
14:51:06radagastI'm very pleased with the nice sugar for generic type constraints. However, how does a Nim programmer emulate template specialization of C++?
14:51:11PMunchdom96's book talks a bit about it I think
14:51:17radagastOh wait, I can just overload
14:51:21radagastnvm
14:51:35flyxthe slides from my professor's Real-Time Programming lecture give a good overview, but unfortunately I cannot hand them out :/
14:52:06FromGitter<mratsim> @zacharycarter Dom book? :P
14:52:46FromGitter<zacharycarter> I didn't think dom's book went into too much detail on it but I'll have to go through my copy again tonight
14:53:04FromGitter<mratsim> There is the channel part.
14:54:53FromGitter<mratsim> Otherwise you can look at Intel TBB (threads building blocks) the doc is not bad, it's for task based parallelism. (Or OpenMP for data parallelism)
14:55:41FromGitter<mratsim> Start a threadpool, and assign stuff to threads basically.
14:57:14FromGitter<mratsim> Maybe check C++11 native threads/threadpool tutorials
14:58:11FromGitter<zacharycarter> thanks @mratsim I'll give those resources a look over as well
15:00:09*endragor quit (Remote host closed the connection)
15:00:29*Ven` quit (Ping timeout: 272 seconds)
15:14:45*yglukhov quit (Remote host closed the connection)
15:23:26*BitPuffin|osx joined #nim
15:30:27*yglukhov joined #nim
15:30:49fvswrapping some c that includes: char** src
15:31:04fvsin nim, is this: ptr cstring?
15:31:20fvshowto get the string in src: src[]?
15:32:12*Sentreen quit (Remote host closed the connection)
15:32:36flyxfvs: no, just use cstring
15:32:37flyxah wait
15:32:38flyxdouble ptr
15:33:02flyxsrc[] with ptr cstring should work
15:33:44*Sentreen joined #nim
15:34:36flyxdepending on the use-case, I think a `var cstring` param could be used instead
15:35:28AraqcstringArray
15:36:01*Sentreen quit (Client Quit)
15:37:10*yglukhov quit (Remote host closed the connection)
15:39:33*yglukhov joined #nim
15:41:00*yglukhov quit (Remote host closed the connection)
15:41:56*SenasOzys quit (Remote host closed the connection)
15:43:56*arecaceae quit (Remote host closed the connection)
15:44:15*arecaceae joined #nim
15:45:48*Jesin joined #nim
15:45:50*yglukhov joined #nim
15:49:00dom96The parallelism chapter of my book, I dare say, is one of the best :)
15:50:10*yglukhov quit (Remote host closed the connection)
15:51:27FromGitter<Yardanico> Always happy when I see something like this
15:51:36FromGitter<Yardanico> (https://files.gitter.im/nim-lang/Nim/QF5I/image.png)
15:56:18*d10n-work joined #nim
16:00:09*BitPuffin|osx quit (Ping timeout: 265 seconds)
16:01:43Araqstalker :P
16:01:58FromGitter<Yardanico> and I read almost every github notification I get
16:02:04Araqany experts on data flow analysis around?
16:09:28*sz0 joined #nim
16:15:00FromGitter<zacharycarter> This article series is interesting - https://blog.molecular-matters.com/2015/08/24/job-system-2-0-lock-free-work-stealing-part-1-basics/
16:15:31FromGitter<zacharycarter> I haven't read through it all the way, trying to make sure I understand everything I'm reading
16:17:51*yglukhov joined #nim
16:17:54dom96Yay, just got one assignment left to finish and semester 1 is done!
16:19:56FromGitter<zacharycarter> :D
16:23:21*dddddd quit (Ping timeout: 265 seconds)
16:25:46*natrys quit (Ping timeout: 265 seconds)
16:26:35*dddddd joined #nim
16:27:10PMunchzacharycarter, yeah work-stealing is pretty interesting
16:27:41*BitPuffin|osx joined #nim
16:30:58*yglukhov quit (Remote host closed the connection)
16:32:04dom96I wish I had time for more livestreams :\
16:34:04FromGitter<zacharycarter> PMunch: I'm trying to think about job scheduling in Nim
16:37:33*gokr quit (Ping timeout: 256 seconds)
16:44:22FromGitter<tim-st> When I override a proc to return 1) bool 2) int and use the proc name in another proc that compares the proc to int, it can't find out that 2) has to be taken? Isn't this the only possibility?
16:49:09FromGitter<zacharycarter> @tim-st please share some code
16:49:20FromGitter<alehander42> huh I didn't know that was possible in nim
16:50:01dom96Not sure if this is what you mean but Nim does not support return type overloading
16:50:39FromGitter<tim-st> @dom96 yes, I meant that. ok thanks
16:50:57FromGitter<alehander42> I see how somebody can be confused
16:51:25FromGitter<tim-st> I coded too long in python, it works there
16:51:26FromGitter<alehander42> if you just compile the overloads without calling them, there is no error (because no cgen for them obvsly)
16:51:36FromGitter<tim-st> yes, exactly
16:51:44*natrys joined #nim
16:52:00dom96it works in Python? really?
16:52:39FromGitter<tim-st> I mean I can return any type within the function
16:52:45dom96oh
16:52:56dom96Maybe what you want is an object variant?
16:53:05dom96you can also abuse JSON for this
16:53:40*natrys quit (Client Quit)
16:53:42FromGitter<tim-st> I don't know, I just expected it to work, as I said, there wasn't another possibility for the compiler
16:59:58FromGitter<alehander42> do you have any particular function/task in mind? probably there is a good way to achieve what you want without return type overloading
17:01:26*yglukhov joined #nim
17:01:35FromGitter<tim-st> @alehander42 I now had a look at my code again and it's probably better to rename the proc to a name that fits better, maybe this is mostly interesting for the return type openarray.
17:01:56FromGitter<alehander42> (and actually Python doesn't really suport exactly that: you might be able to return either bool or int from the same function, but Python will always call the same def for a `name`)
17:03:02FromGitter<tim-st> Yes, that's true but the same func can yield different return types in Python, in Nim it's not possible I learnt now
17:03:58FromGitter<alehander42> you can use variants to wrap different types
17:04:14*nsf quit (Quit: WeeChat 1.9.1)
17:04:19FromGitter<alehander42> also it *can* in a lot of cases: if it depends on a different set of args
17:04:30FromGitter<alehander42> which is usually when this is useful
17:05:03FromGitter<tim-st> Ok that's good to know, thanks!
17:06:22*yglukhov quit (Ping timeout: 265 seconds)
17:13:43*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
17:16:57*Jesin quit (Remote host closed the connection)
17:18:07*SenasOzys joined #nim
17:19:38*Jesin joined #nim
17:26:17*Jesin quit (Ping timeout: 256 seconds)
17:29:31*miran joined #nim
17:30:44*yglukhov joined #nim
17:39:18*Jesin joined #nim
17:42:28*PMunch quit (Quit: Leaving)
17:42:33*gokr joined #nim
17:42:59FromGitter<zacharycarter> The godot community is a show :/
17:45:36*dddddd quit (Ping timeout: 260 seconds)
17:50:02*dddddd joined #nim
17:51:12FromGitter<mratsim> Actually you can use auto for multi return types, but last time I tried I got caught by Araq :P (flatten proc/iterator).
17:52:32FromGitter<mratsim> I manage to have proc that could return Tensor or CudaTensor depending on a static[enum] with `when` conditions
17:56:41miranhi all! HashSet doesn't have .pop()? how to get some random value out?
17:57:58subsetparkYou might need to get a seq version, randomly pick an element, and then remove from the set
17:59:07miranbleh....
18:00:01miranhopefully there's some way without conversion
18:06:49FromGitter<tim-st> @mratsim good idea, thanks!
18:10:45*claudiuinberlin joined #nim
18:12:25miransubsetpark: i did it with: for element in set: doThings(element); break
18:13:14subsetparkwhat do you do, randomly pick an i in the cardinality of the set and then doTHings when j == i?
18:13:21miranand manually excluding that element
18:14:42Araqpatch the stdlib and add this feature
18:15:13*Trustable quit (Remote host closed the connection)
18:15:19mirani start iterating through the elements, and then stop (break) after the first iteration
18:16:23miranAraq: should it be random, or is fine like i did it above?
18:16:28Araqyeah I doubt the stdlib implementation would do something else
18:16:55Araqno random. debuggability is king
18:24:42*sz0 quit (Quit: Connection closed for inactivity)
18:44:26*Arrrr joined #nim
18:47:10*yglukhov quit (Remote host closed the connection)
18:58:30*BitPuffin|osx quit (Ping timeout: 265 seconds)
19:00:25*sz0 joined #nim
19:02:07miranAraq: ok, i'll look into that tomorrow, now i'm too tired. if i manage to do something useful, i'll make a PR
19:04:46*yglukhov joined #nim
19:10:18*yglukhov quit (Remote host closed the connection)
19:10:33*yglukhov joined #nim
19:11:05*yglukhov quit (Remote host closed the connection)
19:11:26*yglukhov joined #nim
19:11:55*yglukhov quit (Remote host closed the connection)
19:13:28*sz0 quit (Ping timeout: 240 seconds)
19:16:39*sz0 joined #nim
19:22:59*solitudesf quit (Quit: solitudesf)
19:26:16*yglukhov joined #nim
19:26:19*yglukhov quit (Remote host closed the connection)
19:26:56*yglukhov joined #nim
19:27:06*yglukhov quit (Remote host closed the connection)
19:27:21*yglukhov joined #nim
19:27:53*yglukhov quit (Remote host closed the connection)
19:28:13*yglukhov joined #nim
19:28:40*yglukhov quit (Remote host closed the connection)
19:28:56*yglukhov joined #nim
19:29:27*yglukhov quit (Remote host closed the connection)
19:30:06*yglukhov joined #nim
19:30:14*yglukhov quit (Remote host closed the connection)
19:40:21*yglukhov joined #nim
19:40:22*yglukhov quit (Remote host closed the connection)
19:40:41*yglukhov joined #nim
19:40:46dom96mratsim: nice website you put together for arraymancer, maybe it's time to submit that to HN? :)
19:41:09*yglukhov quit (Remote host closed the connection)
19:41:27*yglukhov joined #nim
19:41:56*yglukhov quit (Remote host closed the connection)
19:42:22FromGitter<zacharycarter> It'd be cool to see some practical examples using arraymancer
19:42:36*yglukhov joined #nim
19:42:44*yglukhov quit (Remote host closed the connection)
19:42:54FromGitter<zacharycarter> I don't know enough about tensors or scientific computing to make any real conclusions about how I might use the library
19:43:15*lastjedi joined #nim
19:46:39*yglukhov joined #nim
19:50:46FromGitter<zacharycarter> I also have a feeling there aren't simple examples really when it comes to this kind of computing either
19:53:25subsetparkdistance matrices are fun and fairly simple to understand
19:57:34ArrrrI see that pure doesn't work as it used to, but i don't know what really does now. Where can i read more about its new behavior?
20:00:10FromGitter<zacharycarter> In relation to what Arrrr? enums?
20:01:13Arrrryes
20:03:58FromGitter<zacharycarter> Hrm :/ I wasn't aware it had changed / was changing. I just checked the changelog as well and I don't see any mention of it there
20:04:35*miran quit (Quit: Konversation terminated!)
20:28:13*vlad1777d joined #nim
20:29:11*gokr quit (Ping timeout: 272 seconds)
20:52:06*sleepyqt quit (Read error: Connection reset by peer)
20:52:53*Arrrr quit (Read error: Connection reset by peer)
20:54:54*Vladar quit (Quit: Leaving)
20:58:28FromGitter<mratsim> @dom96 like last time, it’s the weekend :P
20:59:14FromGitter<mratsim> I was thinking of waiting for either sparse tensors support or OpenCL support (oneor the other would be the next big feature for my next version)
20:59:21FromGitter<mratsim> and thanks :)
20:59:24dom96well, it's up to you
20:59:32dom96I don't think weekend/weekday matters much :)
21:00:20FromGitter<mratsim> I think the glaring missing feature is loading from CSV or json at least, without that you can only use the library for batch of images (with arraymancer-vision)
21:01:07*endragor joined #nim
21:05:08*endragor quit (Ping timeout: 240 seconds)
21:07:27dom96isn't this kind of going in the direction of the sort of thing that pandas provides?
21:07:32dom96What's the scope of arraymancer?
21:07:57*solitudesf joined #nim
21:12:31FromGitter<mratsim> Numpy can load csv though.
21:13:19FromGitter<mratsim> Arraymancer scope is Deep Learning on unstructured data: images, sound, text, videos, games ...
21:14:11FromGitter<mratsim> I might add classic machine learning stuff as well, and clustering.
21:14:42*sz0 quit (Quit: Connection closed for inactivity)
21:15:10FromGitter<mratsim> In the future I’d like to add Bayesian neural networks (probabilistic neural networks) because I think they will improve a glaring issue in current neural nets: uncertainty and risk management.
21:16:30FromGitter<mratsim> classic machine learning would be a wrapper for XGBoost (gradient boosted trees), useful loss functions (F1 score, correlation matrix), utilities (one-hot encoding …)
21:17:14FromGitter<mratsim> and sparse tensors and sparse neural networks support (recommendation system typically deal with a lot of sparse data)
21:18:26FromGitter<mratsim> I leave the pandas stuff to bluenote and NimData, though we probably have to find a way to convert back and forth between our 2 libraries
21:19:01AraqI've implemented fmt"{0}{nimExpr}" for the stdlib but I wonder how alignment should be done
21:19:29Araq{x:y} passes 'y' as another argument to format, producing (x, y)
21:19:54Araqbut alignment is independent of the type specific formatters
21:20:13*gokr joined #nim
21:53:08FromGitter<dustinlacewell> Is there a Concurrent ML library for Nim?
21:57:19*gokr quit (Ping timeout: 248 seconds)
22:06:00*d10n-work quit (Quit: Connection closed for inactivity)
22:13:25*mrcl joined #nim
22:13:33mrclhey guys
22:14:42FromGitter<francewar> hey there
22:15:20*mrcl quit (Client Quit)
22:17:52*nsf joined #nim
22:18:18*Jesin quit (Quit: Leaving)
22:49:37*solitudesf quit (Ping timeout: 248 seconds)
23:01:56FromGitter<Varriount> Araq: Is allotment really needed?
23:02:02FromGitter<Varriount> *alignment
23:02:08*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
23:02:21FromGitter<Varriount> 99% of the time, people just want expression substitution
23:02:40AraqI copied Python's syntax
23:03:25AraqI think it's {expr:5<} for left alignment and {expr:5>} for right alignment
23:03:31FromGitter<Varriount> You mean its f-string syntax, or its format() syntax?
23:04:17Araqthe f-string syntax calls format()
23:04:46Araqhmm I could have checked if I had Python installed :P
23:06:19FromGitter<dustinlacewell> Well I think a CML lib for Nim would be pretty hot
23:06:20FromGitter<Varriount> F-strings are my favorite new feature in Python.
23:06:39FromGitter<dustinlacewell> https://github.com/Hopac/Hopac/blob/master/Docs/Programming.md#introduction
23:07:28dom96Araq: huh? what about my proposal?
23:07:35dom96I thought you were happy with it
23:07:57*benoliver999 quit (Ping timeout: 246 seconds)
23:09:28FromGitter<zacharycarter> CML = customizable math library?
23:09:46FromGitter<zacharycarter> err configurable I mean
23:10:53Araqdom96, I'm implementing your proposal
23:11:01*benoliver999 joined #nim
23:11:49dom96Araq: oh I see, awesome.
23:12:18dom96We can either have each formatter specify its own alignment format
23:12:57dom96or provide some way to pass multiple parameters to the format() proc?
23:13:58FromGitter<mratsim> @dustinlacewell seems like concurrent ML is a mix between coroutines + channels
23:14:25FromGitter<Varriount> dom96: Can I see your proposal?
23:15:11FromGitter<Varriount> How does python handle the alignment case?
23:15:28dom96https://github.com/nim-lang/Nim/pull/6507#issuecomment-345071140
23:15:38FromGitter<mratsim> I don’t see the difference between Concurrent ML and Erlang BEAM but I don’t know that much about ML lang
23:15:47dom96That is a good question, how does Python handle this?
23:17:12FromGitter<dustinlacewell> @mratsim https://wingolog.org/archives/2016/09/20/concurrent-ml-versus-go
23:19:07FromGitter<mratsim> You can look into Nim coroutines but I’m not sure if many re using them so you might be on your own
23:20:36FromGitter<mratsim> and maybe async/await. Nim channels uses system threads so they are not lightweight jobs like in Hopac
23:22:34FromGitter<dustinlacewell> Yeah in Hopac threads are just ints which can be garbage collected
23:22:44FromGitter<dustinlacewell> It uses one system thread per core and then implements its own scheduler
23:22:50FromGitter<dustinlacewell> Work is modeled as contiuations
23:23:21FromGitter<dustinlacewell> @mratsim You may be interested in the very interesting and accessible book Concurrent Programming in ML by John Reppy which is currently blowing my mind
23:24:04FromGitter<dustinlacewell> I wrote this line in F# the other day using Hopac: let doFetch () = run <| delay ^->. Alt.choose [ timeout; result ]
23:24:38FromGitter<dustinlacewell> Which defines a function which returns a task that blocks the main thread to delay for a bit, and then either fetch and succesfully return a response, or timeout which ever happens first
23:24:57FromGitter<dustinlacewell> All with error handling built into the job monad, type safe return values from the server, etc
23:25:01FromGitter<dustinlacewell> I’m having a good time :)
23:27:24FromGitter<mratsim> You can do similar things in Nim with Futures, for the monad, either use a checked exception instead, or return a tuple/object. But blocking a thread (or doing async processing) while waiting for a response is supported
23:27:47FromGitter<dustinlacewell> Does Nim have the ability to express the Maybe monad?
23:27:53FromGitter<dustinlacewell> I’m guessing so.
23:28:15FromGitter<dustinlacewell> Also, I’m aware you can do concurrent programming in just about any language.
23:29:01FromGitter<dustinlacewell> Anyway I was just curious if someone had done it. I’ll stop hogging the channel now.
23:29:14FromGitter<mratsim> https://nim-lang.org/docs/options.html
23:29:49FromGitter<mratsim> In the future there will be core language support for Maybe: https://nim-lang.org/araq/destructors.html see the “opt” paragraph
23:30:48*yglukhov quit (Remote host closed the connection)
23:30:55FromGitter<mratsim> You can check the “Nim in Action” book, there is a step by step tutorial to build an async messaging app like Slack/IRC/Gitter
23:34:33*qih joined #nim
23:34:48qihHi, how do I delete an account on the Nim Forum>
23:35:39qihs/>/?
23:45:32FromGitter<ephja> @mratsim as in a language feature? why?
23:45:53FromGitter<Varriount> qih: Why?
23:52:58FromGitter<dustinlacewell> ….language support for Maybe?
23:53:12FromGitter<dustinlacewell> You just need a descriminated union and user typeclasses I believe
23:53:19FromGitter<dustinlacewell> But I’m a dummy, or that’s what you meant
23:55:15qihVarriount: Different account name and email address from what I am now using.
23:56:11FromGitter<Varriount> qih: You'll probably have to talk to dom96
23:56:44qihOK ty
23:56:50dom96you can't
23:57:07dom96for now at least
23:57:36qihAh right, well it can sit dormant then, I have never posted from it, and the email address will be deleted today
23:58:38qihFrom in IRC, how do you mention or highlight someone's nick, which is using gitter.im?