<< 24-01-2019 >>

00:01:37*leorize quit (Ping timeout: 268 seconds)
00:36:02*leorize joined #nim
00:39:37FromGitter<arnetheduck> here's another option: ⏎ ⏎ ```runnableExamples: ⏎ xxx ⏎ ⏎ implementation: ⏎ yyy``` [https://gitter.im/nim-lang/Nim?at=5c490949ba355012a48979c5]
00:39:48*a_b_m quit (Read error: Connection reset by peer)
00:40:41FromGitter<kaushalmodi> @arnetheduck noooo!
00:42:16FromGitter<arnetheduck> and another: ⏎ ⏎ ```## these are docs ⏎ $$ these are examples ⏎ var thisIsImp``` [https://gitter.im/nim-lang/Nim?at=5c4909e87a0f4d5b19f9a538]
00:47:12*skellock quit (Ping timeout: 250 seconds)
00:47:15FromGitter<arnetheduck> @kaushalmodi why not? since a named block is used for one, why not for the other, if supposedly they're "the same"?
00:59:12*ng0 quit (Quit: Alexa, when is the end of world?)
01:16:46*skellock joined #nim
01:24:51shashlick@kaushalmodi: looks like build did get split in two by date since its overnight GMT
01:26:38*zachk quit (Quit: Leaving)
01:35:31*stefanos82 quit (Remote host closed the connection)
01:57:48*avsej quit (Quit: Quit)
02:01:12*avsej joined #nim
02:01:12*avsej quit (Changing host)
02:01:12*avsej joined #nim
02:08:33*Tyresc quit (Quit: WeeChat 2.4-dev)
02:11:07*xet7 quit (Quit: Leaving)
02:12:57FromGitter<arnetheduck> reverse engineering of c++ exceptions, pretty nifty: https://blog.trailofbits.com/2019/01/21/how-mcsema-handles-c-exceptions/
02:15:47*mbomba joined #nim
02:16:31*mbomba left #nim ("'.'")
02:28:46*seni quit (Quit: Leaving)
02:30:03*skellock quit (Ping timeout: 245 seconds)
03:02:07*banc quit (Quit: Bye)
03:12:33*zachcart1r quit (Ping timeout: 245 seconds)
03:13:07leorizeAraq: is there anyway to check if a symbol or node was generated by a macro within the compiler?
03:23:10*banc joined #nim
03:27:07*darithorn quit (Ping timeout: 240 seconds)
03:46:01*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:50:20*smitop quit (Quit: Connection closed for inactivity)
03:52:26*skellock joined #nim
03:54:16FromGitter<timotheecour> use case?
03:59:55*zachcarter joined #nim
04:02:10*Marumto_ joined #nim
04:04:56leorizetimotheecour: I need to prevent nimsuggest from creating suggestions for nodes inserted by the compiler
04:05:14*Marumoto quit (Ping timeout: 250 seconds)
04:08:18FromGitter<timotheecour> and u have no control over these generated decls i guess ? (otherwise u could insert `{.ignoreme.}` and patch nimsuggest to ignore these pragmas)
04:08:51leorizeI mean for symbols that's generated by the compiler
04:09:03leorizelike the implicit `result` variable when you don't specify one
04:09:15leorize`proc a: int = 1`
04:09:24leorizethe compiler will insert a `result` variable here
04:09:27*skellock quit (Ping timeout: 240 seconds)
04:09:43leorizeit's not in the actual source, but nimsuggest will still create suggestion based on it
04:10:17leorizethe lineinfo of `result` for the line above is the beginning of the line
04:10:18FromGitter<timotheecour> actually, `nimfind` (not nimsuggest…) uses callbacks so u could perhaps `import/include nimfind and customize the callback `onDecl` to ignore what u want?
04:10:39shashlickcan you get a tuple from NimNode, like strVAl
04:11:54FromGitter<timotheecour> @leorize would the hack of ignoring a suggestion if its col is 0 work?
04:11:54leorizetimotheecour: nimsuggest intergrates directly into the compiler...
04:12:05leorizethat won't work for everything
04:12:18leorizemacros generated expression is leaked as well
04:13:37FromGitter<timotheecour> @leorize ur feature sounds useful; could be usd by `nim doc` to specify whether a generated proc is auto-generated or not
04:13:40*nsf joined #nim
04:14:18leorizethis is an example of macro generated expressions: https://ptpb.pw/37cn.png
04:14:30FromGitter<timotheecour> @shashlick u want to read or create a tuple?
04:14:54FromGitter<timotheecour> creating is easy, eg: `quote do: (1,”foo”)`
04:14:55leorizethe blue part is a call generated by the macro, but it leaks outside regardless
04:15:44shashlickno i am getting a tuple as a macro param
04:15:49shashlickwant to get to the values
04:16:25leorizeit's a "Par" node
04:16:55FromGitter<timotheecour> `treeRepr(input)` will tell u everything no?
04:17:38FromGitter<timotheecour> then: `for elt in myTuple` shd work
04:17:51leorizeyep, treeRepr will tell you everything
04:18:24FromGitter<timotheecour> @shashlick both treeRepr and repr r very useful when debugging macros
04:20:08FromGitter<timotheecour> @leorize idk ; maybe u can also check `owner` field but i don’t think u can tell based on that
04:22:13leorizeI'll see if I could just get rid of the lineinfo attached to them
04:30:19*darithorn joined #nim
04:38:22*catacombs joined #nim
04:55:43shashlickCool will try
05:04:32*leorize quit (Remote host closed the connection)
05:16:34TangerAnybody used nimpy and had to deal with decorators before?
05:38:02*dddddd quit (Remote host closed the connection)
05:39:32*darithorn quit (Quit: Leaving)
06:04:52*JnR joined #nim
06:05:26*lritter joined #nim
06:06:25*miran joined #nim
06:06:32*miran is now known as narimiran
06:07:45*leorize joined #nim
06:15:16*catacombs quit (Remote host closed the connection)
06:24:38*kapil____ joined #nim
06:28:46*leorize quit (Quit: WeeChat 2.3)
06:30:09*leorize joined #nim
06:31:47*leorize quit (Client Quit)
06:33:26*leorize joined #nim
06:57:23*krux02 joined #nim
07:06:53*Perkol joined #nim
07:14:51*Gertm left #nim ("Leaving")
07:26:34*Perkol quit (Quit: Leaving)
07:26:54*Perkol joined #nim
07:44:00FromGitter<gogolxdong> My httpclient header keys are all lower-cased, How to keep the original?
07:44:56FromGitter<gogolxdong> var client = newHttpClient() ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c496cf71cb70a372a2b38b9]
07:45:07FromGitter<gogolxdong> {"x-tc-action": @["DescribeInstances"], "content-type": @["application/json"], "authorization": @["TC3-HMAC-SHA256 Credential=AKIDnV3Pp8ZI6sWytguhzBB0jGguvkR1bOIH/2019-01-24/cvm/tc3_request,SignedHeaders=content-type;host,Signature=876d64ad4ce2475d394fd00504329f2d9d646bcff4c321384f60d6b7bec5dc96"], "x-tc-timestamp": @["1548315669"], "x-tc-region": @["ap-singapore"], "host": @["cvm.tencentcloudapi.com"],
07:45:08FromGitter... "x-tc-version": @["2017-03-12"]}
07:46:44FromGitter<bung87> I think you can’t , it always call toLowerAscii when you get or set
07:47:46FromGitter<gogolxdong> yeah, noticed, interesting.
07:47:58FromGitter<bung87> you should handle the key case-insensitive
07:48:24FromGitter<bung87> according to http protocol
07:48:44FromGitter<gogolxdong> not me, it's Tencent, it need Capitalized headers, exactly as the code.
07:52:54*Vladar joined #nim
07:54:02FromGitter<gogolxdong> have to hack it a bit.
08:04:47*Marumto_ quit (Ping timeout: 240 seconds)
08:07:01*skellock joined #nim
08:10:36*Perkol quit (Quit: Leaving)
08:11:18*skellock quit (Ping timeout: 245 seconds)
08:24:53*abm joined #nim
08:32:59FromGitter<gogolxdong> How to setCookie with Karax?
08:40:22Araqleorize, what is a "macro within the compiler"?
08:40:38Araqkoch temp -d:useNodeIds c foo.nim
08:40:48Araq# patch the compiler to echo n.id
08:41:07Araq# edit ast.nim, line 1049
08:41:20Araqwith the n.id it told you in the first run
08:41:23Araqrerun
08:41:27Araqkoch temp -d:useNodeIds c foo.nim
08:41:34Araqand see where node comes from.
08:41:53Araqit's like a very poor "go back in time" debugger but it works
08:43:24*MightyJoe joined #nim
08:45:47*cyraxjoe quit (Ping timeout: 240 seconds)
08:48:50*PMunch joined #nim
08:50:15*Vladar quit (Remote host closed the connection)
08:53:37*kapil____ quit (Quit: Connection closed for inactivity)
08:54:09*Vladar joined #nim
09:05:16*abm quit (Ping timeout: 246 seconds)
09:15:04*zestyr quit (Ping timeout: 246 seconds)
09:45:00leorizeAraq: I mean implicitly generated symbols/expression
09:46:20leorizean implicitly generated result got lineinfo from the beginning of the proc definition. This is then used by nimsuggest to generate highlighting that override parts of the proc
09:47:44leorizenodes produced by macros are also highlighted, although they don't exists within the written source
10:04:19*vlad1777d joined #nim
10:08:44Araqleorize, sorry I'm not following you
10:09:15*zestyr joined #nim
10:10:17leorizeAraq: http://ix.io/1z6m/nim
10:16:36leorizeI can either give these autogenerated nodes invalid lineinfo so they won't show up
10:16:45Araqgah
10:16:48leorizefor figure out a way to block them from going to nimsuggest
10:16:59Araqbetter specialize 'resultPos' instead
10:17:06Araqsomehow
10:17:10leorizeresult is just one example
10:17:21leorize`for i in [0, 1, 2]`
10:17:37leorizethe hidden items() iterator call generated here also got into nimsuggest
10:23:23Araqthen don't hack the line info
10:23:36Araqbut filter the results
10:25:24leorizethe thing is how can I filter this?
10:25:37leorizedo we already exposed anything for these kind of nodes?
10:27:51Araqwell if the file != currentFile, it's obviously not to be shown
10:28:48leorizethat's how it always worked :P
10:28:57leorizethese nodes have lineinfo within the file
10:31:16*stefanos82 joined #nim
11:08:17*JnR quit (Remote host closed the connection)
11:10:16Araqleorize, use this idea https://github.com/nim-lang/Nim/blob/devel/compiler/nimfix/prettybase.nim#L25 for filtering
11:10:43Araqnote that I said *idea*, not *code*.
11:23:29Araqis this correct https://github.com/nim-lang/Nim/pull/10437 and if so, does it deserve a [backport]?
11:40:30*vonHabsi_ joined #nim
11:41:01*vonHabsi quit (Ping timeout: 246 seconds)
11:54:32Zevvwhy is pairs on {:} different then pairs on {:}.newTable :(
11:55:51Zevv(yeah I *know* why, but still)
12:00:29narimiranZevv: code sample?
12:00:59Araqit's not clear what you're complaining about.
12:01:20Araqif it is "Table should keep insertion order" I will agree completely with you
12:01:29Zevvhttp://paste.ubuntu.com/p/P6dXTSPd2F/
12:01:41Araqwe need to copy Python's dict implementation
12:01:54ZevvIt's completely trivial, but iterating over a [(key, val), (key, val)] table with pairs does not yield key, val
12:02:21Zevvit's one of these little things I run into every now and then.
12:02:58Zevvfor keeping insertion order there is ordereTable?
12:03:10Araqyeah, you meant a different problem
12:03:25Zevvnot "problem", more "slight annoyance"
12:03:39narimiranZevv: because {...} is a shorthand for [(...)]
12:03:47Araqnarimiran, he knows why.
12:03:52ZevvOf course, but the result is not "the least surprising" to happen
12:03:55Araqbut it's annoying
12:04:14Zevvand it's not something that can be ever be changed without breaking tons of stuff
12:04:22Araqthe implicit 'pairs' is bad
12:04:34Araqit also bites us for tuple unpacking
12:04:45FromGitter<alehander42> yeah, i remember watching a heitenger talk about the new python dict impl, it had some crafty ideas
12:04:50narimiranyeah, it would be great if {x: y} would be a table, without the need for .newTable, but i guess that would break a lot of things
12:05:13Araq{:} is fine, a good design IMO
12:05:23Araqit's the implicit pairs that is bad
12:05:32Araqplus the pairs for arrays which sucks
12:05:53Araqand there is an RFC to remove it and embrace enumerate()
12:06:10Araqwhich became possible to implement with Nim's for loop macros.
12:06:32narimiranremove sucking pairs = part of the system.nim cleanup? :)
12:06:40Zevv\o/
12:06:48Araqindeed.
12:08:34narimiranand who knows, maybe i'll get what i want :) https://github.com/nim-lang/RFCs/issues/38
12:08:56narimiranyou want to unpack something? use (.., ..)
12:09:04Araqthere is a PR for it
12:09:06*skellock joined #nim
12:10:00Zevvnarimiran: good proposal, next best to proper pattern matching
12:10:32narimiranZevv: thanks :)
12:10:46Araqalso... we need non-owning collections.
12:10:51narimiranZevv: btw, see gara and unpack libraries
12:11:06Zevvhow does that work with RFC's anyway. There's tons of them, but there is no formal rule that says when things get a final judgement
12:11:23Araqlike databases offer it "he is my data, but please use these indices"
12:14:04*skellock quit (Ping timeout: 272 seconds)
12:15:40AraqZevv, we ignore them until sombody pokes us with a stick
12:15:44Zevvhehe
12:16:53*narimiran grabs a stick
12:18:23FromGitter<alehander42> zevv: there are several 3rd party libs for pattern matching, i don't expect it to be something that would enter the actual language
12:20:50ZevvWell, as the language allows implementation in libs, there is no need to put it in the language I guess
12:22:21FromGitter<alehander42> yeah. it seems not many people know about them tho: often i see similar questions in discussion sites
12:23:41FromGitter<alehander42> in february, i should try to finish gara 0.3 and at least make better docs
12:24:25narimiran@alehander42 speaking of better docs.... :D jsffi docs coming before or after that? :)
12:28:41*dddddd joined #nim
12:29:59*ng0 joined #nim
12:33:35*nsf quit (Quit: WeeChat 2.3)
12:43:33FromGitter<alehander42> before, haha, sorry, a little bit busy this month, but i'll try to finish this sooner
12:45:13narimiranthanks :)
12:56:48*kobi7 joined #nim
12:56:50kobi7Hello
12:56:59narimiranhi kobi7
12:57:41kobi7hi narimiran, good job with the documentation efforts. docs are of important
12:58:02kobi7s/of//
12:58:24narimirankobi7: thanks! it is lots of work, and this is just a beginning
12:58:42*ng0 quit (Quit: Alexa, when is the end of world?)
12:58:46narimiranit is the most frequent complaint about nim, btw
13:01:25kobi7is there a page that describes the nim internals? for example, if I want to help with a feature request
13:02:14kobi7like a general overview. right now I am interested in the effect system, and error messages.
13:04:53*NimBot joined #nim
13:07:14*nuxdie quit (Quit: Connection closed for inactivity)
13:08:28*abm joined #nim
13:13:48FromGitter<mratsim> exceptions are in the manual
13:14:15FromGitter<mratsim> effect system mmmh, besides the write tracking log post (about a future (?) feature, I never saw one)
13:15:44FromGitter<alehander42> kobi7: well there was some docs in the wiki
13:16:09FromGitter<alehander42> e.g. https://github.com/nim-lang/Nim/wiki/Compiler-module-reference
13:16:23FromGitter<alehander42> but it might be outdated
13:16:50FromGitter<alehander42> but it should give a very high level overview of it
13:17:26FromGitter<alehander42> so the effect/exception tracking happens in sempass2
13:17:32FromGitter<alehander42> .nim
13:18:01FromGitter<alehander42> i guess you can play with that and ask questions here
13:20:11narimiran...but notice that the new features are low priority currently. bug fixing is more important.
13:22:40FromGitter<alehander42> many error messages need improvement tho, so this would be useful
13:23:34narimirantrue
13:25:13*NimBot joined #nim
13:26:48*Snircle joined #nim
13:27:42*skellock joined #nim
13:32:37*skellock quit (Ping timeout: 272 seconds)
13:34:21Araqhttps://hub.packtpub.com/remote-code-execution-flaw-in-apt-linux-package-manager-allows-man-in-the-middle-attack/
13:37:51*skellock joined #nim
13:37:51*pwntus quit (Remote host closed the connection)
13:40:17Zevvhttps://whydoesaptnotusehttps.com/
13:46:20*dom96_w joined #nim
13:47:51*pwntus joined #nim
13:47:51*pwntus quit (Changing host)
13:47:51*pwntus joined #nim
13:49:33Araqcoming soon: "why does apt require sudo and install software into /usr/bin"?
13:50:01FromGitter<timotheecour> just use `linuxbrew` which fixes all flaws w apt
13:50:27Zevv.com
13:50:28Araqa nonstandard package manager? :P
13:50:46ZevvI was forced to work with snaps over the last few days
13:51:19Zevvwhich was loads of fun :/
13:51:48Araq"I've got the power"?
13:51:53narimiranpacman is fine ;)
13:52:02FromGitter<timotheecour> it’s not that nonstandard anymore, it’s been around for a while, has a ton of packages, almost always more recent versions than apt, and is regularly synced to upstream homebrew on osx
13:52:54FromGitter<timotheecour> `brew install dmd tig tmux nim` and be done
13:53:28skellocknarimiran: btw, you use arch
13:53:56narimiranskellock: hehehe, i was waiting if somebody will write that :D (btw, i use manjaro)
13:54:01FromGitter<timotheecour> and most important u can have full isolation, installing independent linuxbrews in ur system, no sudo needed
13:57:46Araqsounds too innovative, give me ma good old "can't install software, somebody holds some lock, use google to fix it" system
14:01:58livcdi have no idea what are snaps
14:02:07livcdbut i also used it
14:03:00livcdi also heard of flatpak
14:04:35*kobi7 quit (Quit: Leaving)
14:04:39FromGitter<timotheecour> > sounds too innovative ⏎ ⏎ coming from you?
14:09:46FromGitter<mratsim> there's snap, flatpack and appimage
14:20:36Araqtimotheecour: I was kidding
14:23:01*NimBot joined #nim
14:25:05*PMunch quit (Remote host closed the connection)
14:30:21*ng0 joined #nim
14:38:42*dddddd quit (Ping timeout: 246 seconds)
14:42:05*dddddd joined #nim
14:45:32*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:48:22FromGitter<kaushalmodi> Can someone answer this Nim + audio question: https://stackoverflow.com/q/53512264/1219634 ?
14:52:27*vlad1777d quit (Ping timeout: 240 seconds)
14:54:31*elrood joined #nim
15:10:53*Marumto_ joined #nim
15:12:04*kapil____ joined #nim
15:23:11*brainproxy quit (Quit: WeeChat 2.3)
15:25:06FromGitter<kaushalmodi> def-: Are you here?
15:32:49shashlick@kaushalmodi - just replied
15:35:54shashlick@timotheecour - regarding https://github.com/nim-lang/Nim/issues/10441, is it because the h file referenced in header calls didn't get recompiled or the c file referenced in the compile pragma?
15:36:14shashlickIf it is either of those then we can fix within Nim since it looks at both of those. If it is a dep for either of those then ya, will require tracking all deps which is a separate discussion
15:38:46*Perkol joined #nim
15:41:57*darithorn joined #nim
15:42:34*Marumto_ quit (Remote host closed the connection)
16:18:51*OrganicAnywhere joined #nim
16:19:07OrganicAnywhereDoes mratsim still swing by here?
16:19:15ZevvI'd like to add a `lines()` proc without arguments to system that defaults to stdin, does that make sense?
16:19:20ZevvOrganicAnywhere: definately
16:19:30OrganicAnywhereOk, good :)
16:20:19*Perkol quit (Remote host closed the connection)
16:22:59narimiranOrganicAnywhere: yeah, you just need to put @ in front for him to spot it ;) @mratsim
16:23:12FromGitter<mratsim> ?
16:23:18narimiransee :)
16:23:20OrganicAnywhereo_O
16:23:29OrganicAnywhereSo that's the secret
16:24:05FromGitter<mratsim> what can I do for you?
16:24:06OrganicAnywhere@mratsim, You work with data science, yes?
16:24:26FromGitter<mratsim> technically I work with blockchain and do data science at night :p
16:24:41FromGitter<mratsim> but yeah I do
16:25:01*Trustable joined #nim
16:26:20OrganicAnywhereI see. My question might not be that relevant then but I'll ask anyway. You're currently working on Arraymancer and that seems to be progressing along nicely, you've expressed that you're quite productive working in Nim. Do you use Nim in a professional setting? What would the limiations of Nim, as it is currently, be if one wanted to use it for data science professionally.
16:27:33FromGitter<mratsim> Preprocessing the data, though I played with Nvidia DALI and I'm quite impressed so I can re-used it once they have a C/C++ API
16:27:39OrganicAnywhereI understand that in many cases, a data scientist chooses tools (including language) based on their client's needs or even specific requested tools.
16:27:41FromGitter<mratsim> data-frames
16:28:18FromGitter<mratsim> no XGBoost but that's just a wrapper away, I may even have seen one
16:28:43FromGitter<mratsim> and there is no data viz at all
16:28:57FromGitter<mratsim> basically the supporting tools are missing
16:29:12OrganicAnywhereAre you referring to Nvidia DALI or Arraymancer?
16:29:21FromGitter<mratsim> also w.r.t. to Arraymancer, the NN part is not on GPU
16:29:47FromGitter<mratsim> there is no way to do proper data preprocessing in Nim currently
16:29:52FromGitter<mratsim> DALI would allow that
16:29:55OrganicAnywhereI see.
16:30:51FromGitter<mratsim> even from a production point of view, there is no proper way to do preprocessing in a served model as what you can do with Python researh
16:31:07FromGitter<mratsim> Caffe2/Tensorflow can't do the same as Keras/Torchvision
16:31:12FromGitter<mratsim> regarding images
16:31:40*dom96_w joined #nim
16:31:50FromGitter<mratsim> and there is no equivalent to sklearn/pandas in C++ or a compiled language so if you're working on structured data you need to ship a Python environment (proably docker)
16:33:01FromGitter<mratsim> for text there is Faceboo's FastText, and maybe other but I'm not sure there are libraries in C/C++ that do simple Latent Semantic Analysis (Tf-Idf + SVD)
16:34:16FromGitter<mratsim> or just Tf-Idf since SVD is available in Lapack, though it's a pain to wrap lapack, you have to initialize all the buffer with back and forth calls to Fortran
16:35:24FromGitter<mratsim> Today Nim could serve as glue with Python (thanks to nimpy) C and C++
16:35:49FromGitter<mratsim> but depending on your domain, deploying without Python may be impossible
16:36:09*Perkol joined #nim
16:36:32OrganicAnywhereI'm not a data scientist so I haven't used these tools. I can't estimate how much Nim can be used in the field. I understand that Nim is not yet reached 1.0 and tools are still being developed for it. That takes time, understandably.
16:37:06FromGitter<mratsim> It's not even a Nim issue, even C/C++ tools are not there
16:37:26FromGitter<mratsim> either they ship dockers with Python inside
16:37:47FromGitter<mratsim> or they recode from scratch in C/C++ once research in Python has satisfactory results
16:37:53OrganicAnywhereI suppose one question I have it: Assuming Nim 1.0 would be out and tools were available, if a client requests that you use Python or Scala or whatever, then you'd use that. But during what circumstances would you as a data scientist have the option of choosing to work with Nim?
16:38:22FromGitter<mratsim> for image processing I could for simple algorithms
16:38:32FromGitter<mratsim> like image recognition
16:39:07OrganicAnywhereOh, right, by the way, I have read that Python is used a lot for research, and I think I also read somewhere that you said something about Nim having the potential of closing the bridge between research and production?
16:39:22FromGitter<mratsim> I would need to add GPU support to my high-level neural net instantiation language but it's just wrapping the low-level parts that are done
16:39:30FromGitter<mratsim> yes exactly
16:40:09FromGitter<mratsim> This is also what the nimtorch guys are doing: https://github.com/fragcolor-xyz/nimtorch
16:41:03FromGitter<mratsim> but the first thing is, I need to know what are you working on? Image, Time series, sound, text, categorical data (like web traffic with product, customers, webpages ...)
16:43:13OrganicAnywhereI'm not working on anything personally, I'm working with someone who is working with recommendation systems. We just started so I'm not sure yet about the details but possibly targeted towards the telecom and finance sectors.
16:44:24FromGitter<mratsim> for recommender system definitely Python, unless you can wrap a good C or C++ library
16:44:40OrganicAnywhereAs a side note, I decided I should learn some data science, I might be able to contribute in the future (I already have most of the maths down). I've personally lately been interested in bioinformatics and ML/DL in diagnostics among other things, but that's years into the future.
16:45:01OrganicAnywhere(medical diagnostics)
16:45:23FromGitter<mratsim> there is already libFFM that could handle factorization matrices,, though the latest advance in recommender system use reinforcement learning and strategies similar to AlphaGo.
16:45:45*craigger quit (Quit: bye)
16:45:53FromGitter<mratsim> there a radiologist who started recently on Kaggle and got first place on a CT scan comptition
16:45:58*craigger joined #nim
16:46:09OrganicAnywhereWow, nice!
16:46:47FromGitter<mratsim> https://www.kaggle.com/c/rsna-pneumonia-detection-challenge
16:48:25FromGitter<mratsim> This guy: https://www.kaggle.com/alexandrecc
16:50:12federico31st Place - $ 12,000 meh, kaggle...
16:53:19OrganicAnywhereI have to leave now. Thank you for the talk @mratsim! I'm keeping an eye on Arraymancer :)
16:53:31FromGitter<mratsim> this was 500k ;) - https://www.kaggle.com/c/data-science-bowl-2017#prizes
16:53:48FromGitter<mratsim> and on lung cancer
16:58:55*krux02 quit (Remote host closed the connection)
17:00:58*craigger quit (Quit: bye)
17:01:09*craigger joined #nim
17:15:04*ryukoposting joined #nim
17:23:57*ryukoposting quit (Quit: Lost terminal)
17:43:23*lritter quit (Ping timeout: 245 seconds)
17:48:34*darithorn quit (Ping timeout: 250 seconds)
17:49:32*kapil____ quit (Quit: Connection closed for inactivity)
17:50:42*nsf joined #nim
17:51:29*darithorn joined #nim
17:53:55*OrganicAnywhere quit (Remote host closed the connection)
18:06:02*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:06:10*Perkol quit (Quit: Leaving)
18:10:26*zachcarter quit (Ping timeout: 240 seconds)
18:15:56narimiranyglukhov[m]: you here? nimpy has made it to pycoder's weekly newsletter :)
18:17:15narimiranprobably because it was mentioned here https://robert-mcdermott.gitlab.io/posts/speeding-up-python-with-nim/ , which is also in the newsletter
18:45:36*zachcarter joined #nim
18:53:48*zachk joined #nim
18:54:03*Trustable quit (Remote host closed the connection)
18:56:53*Jjp137 quit (Read error: Connection reset by peer)
18:57:19FromGitter<iffy> Can I just mention how cool I think it is that I feel confident making local changes to Nim for testing. I don't think I've ever felt confident doing that to any other language. The single quick build step (`sh build_all.sh`) is just great. Thanks!
18:57:33*Jjp137 joined #nim
19:18:03*nsf quit (Quit: WeeChat 2.3)
19:22:05FromGitter<iffy> How do I print the hex memory location of a cstring and a string? Like what repr does but without the contents of the string
19:26:51*birdspider joined #nim
19:44:42*taparcon_ joined #nim
19:48:26narimiran@iffy you can also do `./koch temp` to create `./bin/nim_temp` for your experiments
20:02:03FromGitter<iffy> oh that's neat
20:03:41*birdspider quit (Remote host closed the connection)
20:03:55shashlickis it possible to load a dll at runtime? if you use dynlib, it gets loaded at startup so you cannot check if dll exists and then load
20:06:05dom96narimiran: awesome! Maybe a tweet is in order?
20:06:28rayman22201@shashlick You are going to have to do it like you would in C. Using dlopen http://man7.org/linux/man-pages/man3/dlopen.3.html
20:08:18shashlicklooks like there's a dynlib module - might be able to do it with that
20:09:50rayman22201ah yeah. Sure is. It does the platform specific stuff for you too. cool.
20:13:00shashlickyep, works great
20:18:09dom96let's vote for Nim! https://stackoverflow.blog/2019/01/23/our-2019-developer-survey-is-open-to-coders-everywhere/
20:20:23Zevv1 vote = 1 beer
20:21:37ZevvThe vote is broken, get "Sorry unexpected error" all the time
20:22:02Zevvoh adblock
20:25:58Zevvhehe, is IRC "social media" :)
20:28:04dom96jesus, this survey is super long
20:28:14dom96The things I do for Nim :P
20:29:29*taparcon_ quit (Quit: Leaving)
20:33:00Zevv"How long did yoy find this survey? [ ] Too short [ ] Just good [X] To long"
20:33:24FromGitter<kaushalmodi> .. and I then even left out that last "more comments" box
20:35:15dom96[X] Outrageously long
20:36:39ZevvWell, there was one (1) box where I could fill in "Nim". The rest was about my feelins about my gender
20:36:57ZevvI'm pleased with my gender, thank you
20:38:21dom96There was some plain silly questions too
20:38:29dom96Have you turned it off and on again?
20:38:33dom96hurr durr lolz
20:39:24Zevv[x] what?
20:39:40FromGitter<Clyybber> I remember trying to do that survey last year. Canceled it halfway through, too many (personal/unrelated) questions IMO.
20:40:30FromGitter<kaushalmodi> Zevv: IT Crowd
20:40:31FromGitter<kaushalmodi> https://www.youtube.com/watch?v=nn2FB1P_Mn8
20:41:12ZevvYeah I know
20:41:17Zevv(Little Britain)
20:50:52*jken left #nim ("Leaving")
20:51:12*jken joined #nim
20:52:10*Marumoto joined #nim
20:52:58*skellock quit (Ping timeout: 245 seconds)
20:53:10zestyrthey're just datamining lol
20:53:49zestyrit even says many of the answers will be kept "private", hmmm... wonder what the purpose of that is
21:02:18*oculux quit (Quit: blah)
21:02:27*skellock joined #nim
21:02:46*oculux joined #nim
21:11:33dom96!eval echo(20000-1 / 500)
21:11:33NimBotCompile failed: <no output>
21:11:36dom96:/
21:21:53shashlickhave started using the links browser for Nim documentation in gui mode, pretty nice
21:22:06shashlickbut search doesn't work
21:33:34*narimiran quit (Ping timeout: 246 seconds)
21:36:55FromGitter<iffy> How do I turn a pointer (or ptr string) back into that string?
21:38:48FromGitter<iffy> What I'm really trying to do is make this Nim proc return a string to C++ in a memory-safe way: https://github.com/iffy/node-nim-memory-bug/blob/master/clib.nim
21:40:01*vonHabsi joined #nim
21:40:55*vonHabsi_ quit (Ping timeout: 246 seconds)
21:44:56*oculux quit (Quit: blah)
21:45:54FromGitter<kaushalmodi> @iffy I am not a C/string expert, but here's a snippet based off what I learned recently
21:45:58FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4a3216f780a1521f631857]
21:47:06FromGitter<iffy> @kaushalmodi thank you; the second to last line makes a copy of the string, right?
21:48:06FromGitter<kaushalmodi> I believe so. I hadn't thought of that earlier.
21:48:36FromGitter<kaushalmodi> so yes, the comment should probably say `# copy cstring to string`
21:49:16*elrood quit (Remote host closed the connection)
21:50:26FromGitter<kaushalmodi> @iffy I think this seals it: https://forum.nim-lang.org/t/3850#23935
21:50:27FromGitter<kaushalmodi> :)
22:04:53FromGitter<iffy> but surely there's a good way to pass strings to/from C++?
22:05:38FromGitter<iffy> Anyway, maybe the memory corruption I'm seeing isn't because of how I'm passing strings around. Maybe it's just Node doing something strange?
22:09:59FromGitter<kaushalmodi> I am working on a Nim-C FFI integration at the moment
22:10:07FromGitter<kaushalmodi> and there the string gets passed as cstring
22:10:14FromGitter<kaushalmodi> I don't have experience with C++.
22:10:24FromGitter<kaushalmodi> May be someone else can chime in on that
22:10:51FromGitter<kaushalmodi> *also not sure how the Nim + node + C++ combination works :)*
22:11:27FromGitter<kaushalmodi> .. or are you trying to make Nim and node talk via C++?
22:12:26FromGitter<iffy> C++ is between Nim and Node
22:12:38FromGitter<iffy> Node <-> C++ <-> Nim
22:12:54FromGitter<kaushalmodi> yup, that's what I meant
22:13:17FromGitter<kaushalmodi> Not that you asked, but I am working on SystemVerilog <-> C <-> Nim
22:13:32FromGitter<iffy> I miss verilog/vhdl
22:14:16FromGitter<kaushalmodi> you miss? As in you changed fields?
22:14:21FromGitter<kaushalmodi> or you miss that from your courses
22:14:29FromGitter<iffy> changed fields
22:14:37FromGitter<kaushalmodi> interesting
22:14:51FromGitter<kaushalmodi> I feel myself more and more vested in asic verification
22:16:08FromGitter<kaushalmodi> There's so much out there in the real software world, it's scary :)
22:21:23shashlick@iffy: maybe share a larger snippet?
22:21:58FromGitter<iffy> shashlick: this repo is the smallest runnable example I can make of my problem: https://github.com/iffy/node-nim-memory-bug
22:22:56rayman22201nim strings and cstrings are different enough that I think you are going to have to copy at some point.... or just use cstrings all the way around.
22:23:22FromGitter<iffy> I'm happy to copy; I'm happy to do anything to make this code work :)
22:23:53rayman22201lol. fair enough
22:29:58shashlickHow come you are compiling without --app:lib
22:30:14shashlickIt's just making an Exe
22:31:16FromGitter<iffy> me?
22:31:38shashlickYa
22:31:43FromGitter<iffy> I don't think the .node file is an executable, is it?
22:32:01shashlickAnd why use the cpp in the middle
22:32:16shashlickJust use Nim and emit anything if required
22:32:22rayman22201he is doing --compileOnly, so it just produces C code
22:32:30rayman22201if you look at the makefile
22:32:37FromGitter<iffy> node-gyp is what does the compiling
22:32:55FromGitter<iffy> I would love to do this all in Nim
22:33:02rayman22201but your @shashlick's point about doing it all in nim is a good point lol
22:33:50FromGitter<iffy> are you suggesting that I could compile (using --app:lib) to make the hellolib.node file directly?
22:33:51FromGitter<deech> How do I get Nim to compile with `clang` and to use the C++ backend by default?
22:36:12*Vladar quit (Remote host closed the connection)
22:41:20*Tyresc joined #nim
22:41:50*jxy quit (Remote host closed the connection)
22:45:40shashlick@iffy - that's what I think but ya, if there's an established way to do node modules, go with that
22:45:58shashlicki've never done it before so keep a grain of salt handy
22:46:11FromGitter<iffy> And it's Node, so a double grain of salt
22:46:11rayman22201@deech make a nim.cfg in your project like this: https://pastebin.com/raw/qtAgCpyh
22:46:56shashlickthere's node-ffi so you could just import a dll/so that way
22:47:00rayman22201ugg, ignore that
22:47:05rayman22201this one is better: https://pastebin.com/raw/Ab9ihMa1
22:47:11rayman22201typo
22:47:13*jxy joined #nim
22:47:20rayman22201We need better docs for .cfg / .nims
22:47:35rayman22201I couldn't find docs for the "cc" option anywhere :-(
22:48:05FromGitter<iffy> shashlick: my understanding is that node-ffi has more overhead than a n-api addon (I could be wrong), and also has trouble inside Electron (which is where I'm ultimately headed).
22:48:16FromGitter<iffy> I suppose it wouldn't hurt to see how far that gets, though
22:48:20FromGitter<kaushalmodi> rayman22201: https://github.com/nim-lang/Nim/issues/9056
22:48:59rayman22201Thanks @kaushalmodi
22:49:00shashlickwell, if it is a known headache, better to avoid
22:51:12shashlickgoing back to what you have - what if you first convert message into a string, before passing to strforamt
22:52:22FromGitter<iffy> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4a41a635350772cf84e737]
22:52:55FromGitter<kaushalmodi> you need to do `var s_message = $message`
22:53:03FromGitter<iffy> yeah, compiler just told me that
22:53:04FromGitter<iffy> :)
22:53:15FromGitter<kaushalmodi> the regular conversion using `TYPE(variable)` won't work
22:53:20FromGitter<kaushalmodi> ok :)
22:53:26FromGitter<iffy> still crashes
22:54:20FromGitter<iffy> (in the same way at the same place)
22:55:32FromGitter<iffy> If I `echo GC_getStatistics()` inside hello_echo, it goes from the starting values of
22:55:32FromGitter<iffy> [GC] total memory: 528384 ⏎ [GC] occupied memory: 61528
22:55:49FromGitter<iffy> To this just before the crash:
22:55:50FromGitter<iffy> [GC] total memory: 15208448 ⏎ [GC] occupied memory: 428640
22:56:26FromGitter<iffy> Am I reading that correctly that that means my Nim code is leaking? Or could it still be the C++/Node code that's leaking?
22:56:26rayman22201gc is going crazy in your function...
22:56:51FromGitter<iffy> rayman22201: are you running it?
22:57:03rayman22201just based on that error message.
22:57:59FromGitter<iffy> When I turn on `-d:logGC` it really does go crazy right at the end, repeatedly incRef/decRef-ing the same memory location a bunch of times
22:58:08rayman22201kind of silly, but what if you do `GC_disable()` at the top of your hello_echo function
22:58:41FromGitter<iffy> I've run it with GC_disable outside hello_echo (so, disabled for the whole program) and it runs without problem
22:58:58FromGitter<iffy> Are you saying turn it off at the beginning and turn it on before returning?
22:59:03rayman22201yeah
22:59:58FromGitter<iffy> still crashes and makes the statistics go crazy:
22:59:58FromGitter<iffy> [GC] total memory: 120832000 ⏎ [GC] occupied memory: 94983136
23:00:18rayman22201interesting. what doesn't the gc like there?
23:00:50rayman22201* that was a rhetorical question lol
23:03:05rayman22201I wonder how well nimterop would work with https://github.com/nodejs/node/blob/master/src/node_api.h. That would let you skip the C++ in the middle.... that's a conversation for another time
23:04:37FromGitter<iffy> Yes, disabling GC (and useSysAssert and useGcAssert) lets the program run far beyond where it normally crashes (though I don't know if it finishes because it takes forever)
23:05:46rayman22201If you just echo a static string, and don't use the `message` argument. does it still crash?
23:06:17rayman22201I'm curious if it is the `echo` that is the problem, or the `cstring` directly
23:08:36FromGitter<iffy> like `echo "foo"`? let me try
23:10:15FromGitter<iffy> It doesn't seem to die, though the memory usage does keep going up
23:10:19FromGitter<iffy> [GC] total memory: 16785408 ⏎ [GC] occupied memory: 1035480
23:10:34FromGitter<iffy> when I killed it on iteration 6205
23:12:15FromGitter<iffy> Araq suggested it was a memory corruption problem, not a gc problem. Could it be that Nim chooses a stack bottom once, but every time JS/C++ calls into Nim, the stack should be readjusted to a new place?
23:12:29FromGitter<iffy> Err wait, the GC stuff is on the heap, right?
23:12:58rayman22201I have a feeling it is related to the gc_bottom
23:13:47rayman22201Confusing terminologies. The GC is for the heap, yes. But it organizes itself like a stack.
23:14:26rayman22201*hand waves* GC magic
23:15:12FromGitter<iffy> So at the beginning, GC stack bottom is: 0x7fff5fbfb2f0
23:15:32FromGitter<iffy> The C++ const char* message is 0x7fff5fbfb361
23:16:38FromGitter<iffy> And C++ reuses the same address for the first 14 iterations, then uses 0x102814fa0 for a while (which I think indicates it's using the heap now)
23:17:22*a_b_m joined #nim
23:18:08FromGitter<iffy> The address of the cstring returned hello_echo is 0x102e96248 the first iteration (according to C++)
23:18:42FromGitter<iffy> And that address increments each iteration
23:19:42rayman22201Yeah. Nim keeps allocating a new cstring every time
23:20:53*abm quit (Ping timeout: 245 seconds)
23:21:49*a__b__m joined #nim
23:22:09FromGitter<iffy> sampling of the output: https://gist.github.com/iffy/0f407f9adcee5c43fc6f158d7a39992c
23:25:26*a_b_m quit (Ping timeout: 240 seconds)
23:25:56*vonHabsi quit (Ping timeout: 240 seconds)
23:29:37*theelous3 joined #nim
23:31:36rayman22201Hrmm. Let me download this thing and try it myself. I'm curious...
23:32:07*stefanos82 quit (Remote host closed the connection)
23:37:42FromGitter<timotheecour> @iffy @kaushalmodi was ur qq how to convert a string to a cstring? (looks like it was?) ; just : `mystring.cstring`
23:38:42FromGitter<iffy> @timotheecour it was sort of the other way (cstring -> string) but that was just to try and fix my problem in one way -- there's maybe a better way to fix my problem
23:39:09FromGitter<timotheecour> then it’s just: `$mycstring`
23:42:54*theelous3 quit (Read error: Connection reset by peer)
23:43:05FromGitter<iffy> well, that makes a copy of the string, which isn't what I needed. I'm trying to return a cstring to some C code in a GC and memory-friendly way.
23:43:37FromGitter<iffy> @timotheecour Here's the full problem: https://github.com/iffy/node-nim-memory-bug
23:47:16FromGitter<timotheecour> Ok, the stuff u had written above led me to believe u were ok w copies; there r ways to make everything GC safe, i’ve done this before :)
23:47:18rayman22201@iffy, you need to add `graceful-fs` to your npm dependencies fyi
23:48:24FromGitter<timotheecour> that repo is too big for me to read; can u summarize in 1 sentence what u’re trying to do? u want a C lib to return a cstring to nim or u want a nim proc to send a cstring to C?
23:48:48rayman22201nodejs -> C++ -> nim -> c++ -> nodejs
23:48:58*leorize quit (Quit: WeeChat 2.3)
23:49:53FromGitter<timotheecour> i doubt nodejs is relevant, the core of the problem shd be explainable w just 1 nim program + 1 extern C function
23:50:46rayman22201It is relevant b/c the c string comes from a nodejs object
23:51:30FromGitter<timotheecour> they might as well be generated from a C function
23:51:32FromGitter<iffy> I'm trying to send strings between Node and Nim. Node provides a method for including C++ dependencies, so I've gone that route. I could try seeing what happens without Node
23:52:54FromGitter<timotheecour> ok so write a simplified case where a C function generates a cstring and a nim program receives it
23:53:28FromGitter<timotheecour> (eg via malloc or, in C++, new, or even std::string)
23:57:28*a__b__m is now known as abm