00:01:37 | * | leorize quit (Ping timeout: 268 seconds) |
00:36:02 | * | leorize joined #nim |
00:39:37 | FromGitter | <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:41 | FromGitter | <kaushalmodi> @arnetheduck noooo! |
00:42:16 | FromGitter | <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:15 | FromGitter | <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:51 | shashlick | @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:57 | FromGitter | <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:07 | leorize | Araq: 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:16 | FromGitter | <timotheecour> use case? |
03:59:55 | * | zachcarter joined #nim |
04:02:10 | * | Marumto_ joined #nim |
04:04:56 | leorize | timotheecour: 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:18 | FromGitter | <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:51 | leorize | I mean for symbols that's generated by the compiler |
04:09:03 | leorize | like the implicit `result` variable when you don't specify one |
04:09:15 | leorize | `proc a: int = 1` |
04:09:24 | leorize | the compiler will insert a `result` variable here |
04:09:27 | * | skellock quit (Ping timeout: 240 seconds) |
04:09:43 | leorize | it's not in the actual source, but nimsuggest will still create suggestion based on it |
04:10:17 | leorize | the lineinfo of `result` for the line above is the beginning of the line |
04:10:18 | FromGitter | <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:39 | shashlick | can you get a tuple from NimNode, like strVAl |
04:11:54 | FromGitter | <timotheecour> @leorize would the hack of ignoring a suggestion if its col is 0 work? |
04:11:54 | leorize | timotheecour: nimsuggest intergrates directly into the compiler... |
04:12:05 | leorize | that won't work for everything |
04:12:18 | leorize | macros generated expression is leaked as well |
04:13:37 | FromGitter | <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:18 | leorize | this is an example of macro generated expressions: https://ptpb.pw/37cn.png |
04:14:30 | FromGitter | <timotheecour> @shashlick u want to read or create a tuple? |
04:14:54 | FromGitter | <timotheecour> creating is easy, eg: `quote do: (1,”foo”)` |
04:14:55 | leorize | the blue part is a call generated by the macro, but it leaks outside regardless |
04:15:44 | shashlick | no i am getting a tuple as a macro param |
04:15:49 | shashlick | want to get to the values |
04:16:25 | leorize | it's a "Par" node |
04:16:55 | FromGitter | <timotheecour> `treeRepr(input)` will tell u everything no? |
04:17:38 | FromGitter | <timotheecour> then: `for elt in myTuple` shd work |
04:17:51 | leorize | yep, treeRepr will tell you everything |
04:18:24 | FromGitter | <timotheecour> @shashlick both treeRepr and repr r very useful when debugging macros |
04:20:08 | FromGitter | <timotheecour> @leorize idk ; maybe u can also check `owner` field but i don’t think u can tell based on that |
04:22:13 | leorize | I'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:43 | shashlick | Cool will try |
05:04:32 | * | leorize quit (Remote host closed the connection) |
05:16:34 | Tanger | Anybody 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:00 | FromGitter | <gogolxdong> My httpclient header keys are all lower-cased, How to keep the original? |
07:44:56 | FromGitter | <gogolxdong> var client = newHttpClient() ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c496cf71cb70a372a2b38b9] |
07:45:07 | FromGitter | <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:08 | FromGitter | ... "x-tc-version": @["2017-03-12"]} |
07:46:44 | FromGitter | <bung87> I think you can’t , it always call toLowerAscii when you get or set |
07:47:46 | FromGitter | <gogolxdong> yeah, noticed, interesting. |
07:47:58 | FromGitter | <bung87> you should handle the key case-insensitive |
07:48:24 | FromGitter | <bung87> according to http protocol |
07:48:44 | FromGitter | <gogolxdong> not me, it's Tencent, it need Capitalized headers, exactly as the code. |
07:52:54 | * | Vladar joined #nim |
07:54:02 | FromGitter | <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:59 | FromGitter | <gogolxdong> How to setCookie with Karax? |
08:40:22 | Araq | leorize, what is a "macro within the compiler"? |
08:40:38 | Araq | koch temp -d:useNodeIds c foo.nim |
08:40:48 | Araq | # patch the compiler to echo n.id |
08:41:07 | Araq | # edit ast.nim, line 1049 |
08:41:20 | Araq | with the n.id it told you in the first run |
08:41:23 | Araq | rerun |
08:41:27 | Araq | koch temp -d:useNodeIds c foo.nim |
08:41:34 | Araq | and see where node comes from. |
08:41:53 | Araq | it'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:00 | leorize | Araq: I mean implicitly generated symbols/expression |
09:46:20 | leorize | an 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:44 | leorize | nodes produced by macros are also highlighted, although they don't exists within the written source |
10:04:19 | * | vlad1777d joined #nim |
10:08:44 | Araq | leorize, sorry I'm not following you |
10:09:15 | * | zestyr joined #nim |
10:10:17 | leorize | Araq: http://ix.io/1z6m/nim |
10:16:36 | leorize | I can either give these autogenerated nodes invalid lineinfo so they won't show up |
10:16:45 | Araq | gah |
10:16:48 | leorize | for figure out a way to block them from going to nimsuggest |
10:16:59 | Araq | better specialize 'resultPos' instead |
10:17:06 | Araq | somehow |
10:17:10 | leorize | result is just one example |
10:17:21 | leorize | `for i in [0, 1, 2]` |
10:17:37 | leorize | the hidden items() iterator call generated here also got into nimsuggest |
10:23:23 | Araq | then don't hack the line info |
10:23:36 | Araq | but filter the results |
10:25:24 | leorize | the thing is how can I filter this? |
10:25:37 | leorize | do we already exposed anything for these kind of nodes? |
10:27:51 | Araq | well if the file != currentFile, it's obviously not to be shown |
10:28:48 | leorize | that's how it always worked :P |
10:28:57 | leorize | these nodes have lineinfo within the file |
10:31:16 | * | stefanos82 joined #nim |
11:08:17 | * | JnR quit (Remote host closed the connection) |
11:10:16 | Araq | leorize, use this idea https://github.com/nim-lang/Nim/blob/devel/compiler/nimfix/prettybase.nim#L25 for filtering |
11:10:43 | Araq | note that I said *idea*, not *code*. |
11:23:29 | Araq | is 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:32 | Zevv | why is pairs on {:} different then pairs on {:}.newTable :( |
11:55:51 | Zevv | (yeah I *know* why, but still) |
12:00:29 | narimiran | Zevv: code sample? |
12:00:59 | Araq | it's not clear what you're complaining about. |
12:01:20 | Araq | if it is "Table should keep insertion order" I will agree completely with you |
12:01:29 | Zevv | http://paste.ubuntu.com/p/P6dXTSPd2F/ |
12:01:41 | Araq | we need to copy Python's dict implementation |
12:01:54 | Zevv | It's completely trivial, but iterating over a [(key, val), (key, val)] table with pairs does not yield key, val |
12:02:21 | Zevv | it's one of these little things I run into every now and then. |
12:02:58 | Zevv | for keeping insertion order there is ordereTable? |
12:03:10 | Araq | yeah, you meant a different problem |
12:03:25 | Zevv | not "problem", more "slight annoyance" |
12:03:39 | narimiran | Zevv: because {...} is a shorthand for [(...)] |
12:03:47 | Araq | narimiran, he knows why. |
12:03:52 | Zevv | Of course, but the result is not "the least surprising" to happen |
12:03:55 | Araq | but it's annoying |
12:04:14 | Zevv | and it's not something that can be ever be changed without breaking tons of stuff |
12:04:22 | Araq | the implicit 'pairs' is bad |
12:04:34 | Araq | it also bites us for tuple unpacking |
12:04:45 | FromGitter | <alehander42> yeah, i remember watching a heitenger talk about the new python dict impl, it had some crafty ideas |
12:04:50 | narimiran | yeah, 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:13 | Araq | {:} is fine, a good design IMO |
12:05:23 | Araq | it's the implicit pairs that is bad |
12:05:32 | Araq | plus the pairs for arrays which sucks |
12:05:53 | Araq | and there is an RFC to remove it and embrace enumerate() |
12:06:10 | Araq | which became possible to implement with Nim's for loop macros. |
12:06:32 | narimiran | remove sucking pairs = part of the system.nim cleanup? :) |
12:06:40 | Zevv | \o/ |
12:06:48 | Araq | indeed. |
12:08:34 | narimiran | and who knows, maybe i'll get what i want :) https://github.com/nim-lang/RFCs/issues/38 |
12:08:56 | narimiran | you want to unpack something? use (.., ..) |
12:09:04 | Araq | there is a PR for it |
12:09:06 | * | skellock joined #nim |
12:10:00 | Zevv | narimiran: good proposal, next best to proper pattern matching |
12:10:32 | narimiran | Zevv: thanks :) |
12:10:46 | Araq | also... we need non-owning collections. |
12:10:51 | narimiran | Zevv: btw, see gara and unpack libraries |
12:11:06 | Zevv | how 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:23 | Araq | like databases offer it "he is my data, but please use these indices" |
12:14:04 | * | skellock quit (Ping timeout: 272 seconds) |
12:15:40 | Araq | Zevv, we ignore them until sombody pokes us with a stick |
12:15:44 | Zevv | hehe |
12:16:53 | * | narimiran grabs a stick |
12:18:23 | FromGitter | <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:50 | Zevv | Well, as the language allows implementation in libs, there is no need to put it in the language I guess |
12:22:21 | FromGitter | <alehander42> yeah. it seems not many people know about them tho: often i see similar questions in discussion sites |
12:23:41 | FromGitter | <alehander42> in february, i should try to finish gara 0.3 and at least make better docs |
12:24:25 | narimiran | @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:33 | FromGitter | <alehander42> before, haha, sorry, a little bit busy this month, but i'll try to finish this sooner |
12:45:13 | narimiran | thanks :) |
12:56:48 | * | kobi7 joined #nim |
12:56:50 | kobi7 | Hello |
12:56:59 | narimiran | hi kobi7 |
12:57:41 | kobi7 | hi narimiran, good job with the documentation efforts. docs are of important |
12:58:02 | kobi7 | s/of// |
12:58:24 | narimiran | kobi7: 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:46 | narimiran | it is the most frequent complaint about nim, btw |
13:01:25 | kobi7 | is there a page that describes the nim internals? for example, if I want to help with a feature request |
13:02:14 | kobi7 | like 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:48 | FromGitter | <mratsim> exceptions are in the manual |
13:14:15 | FromGitter | <mratsim> effect system mmmh, besides the write tracking log post (about a future (?) feature, I never saw one) |
13:15:44 | FromGitter | <alehander42> kobi7: well there was some docs in the wiki |
13:16:09 | FromGitter | <alehander42> e.g. https://github.com/nim-lang/Nim/wiki/Compiler-module-reference |
13:16:23 | FromGitter | <alehander42> but it might be outdated |
13:16:50 | FromGitter | <alehander42> but it should give a very high level overview of it |
13:17:26 | FromGitter | <alehander42> so the effect/exception tracking happens in sempass2 |
13:17:32 | FromGitter | <alehander42> .nim |
13:18:01 | FromGitter | <alehander42> i guess you can play with that and ask questions here |
13:20:11 | narimiran | ...but notice that the new features are low priority currently. bug fixing is more important. |
13:22:40 | FromGitter | <alehander42> many error messages need improvement tho, so this would be useful |
13:23:34 | narimiran | true |
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:21 | Araq | https://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:17 | Zevv | https://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:33 | Araq | coming soon: "why does apt require sudo and install software into /usr/bin"? |
13:50:01 | FromGitter | <timotheecour> just use `linuxbrew` which fixes all flaws w apt |
13:50:27 | Zevv | .com |
13:50:28 | Araq | a nonstandard package manager? :P |
13:50:46 | Zevv | I was forced to work with snaps over the last few days |
13:51:19 | Zevv | which was loads of fun :/ |
13:51:48 | Araq | "I've got the power"? |
13:51:53 | narimiran | pacman is fine ;) |
13:52:02 | FromGitter | <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:54 | FromGitter | <timotheecour> `brew install dmd tig tmux nim` and be done |
13:53:28 | skellock | narimiran: btw, you use arch |
13:53:56 | narimiran | skellock: hehehe, i was waiting if somebody will write that :D (btw, i use manjaro) |
13:54:01 | FromGitter | <timotheecour> and most important u can have full isolation, installing independent linuxbrews in ur system, no sudo needed |
13:57:46 | Araq | sounds too innovative, give me ma good old "can't install software, somebody holds some lock, use google to fix it" system |
14:01:58 | livcd | i have no idea what are snaps |
14:02:07 | livcd | but i also used it |
14:03:00 | livcd | i also heard of flatpak |
14:04:35 | * | kobi7 quit (Quit: Leaving) |
14:04:39 | FromGitter | <timotheecour> > sounds too innovative ⏎ ⏎ coming from you? |
14:09:46 | FromGitter | <mratsim> there's snap, flatpack and appimage |
14:20:36 | Araq | timotheecour: 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:22 | FromGitter | <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:06 | FromGitter | <kaushalmodi> def-: Are you here? |
15:32:49 | shashlick | @kaushalmodi - just replied |
15:35:54 | shashlick | @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:14 | shashlick | If 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:07 | OrganicAnywhere | Does mratsim still swing by here? |
16:19:15 | Zevv | I'd like to add a `lines()` proc without arguments to system that defaults to stdin, does that make sense? |
16:19:20 | Zevv | OrganicAnywhere: definately |
16:19:30 | OrganicAnywhere | Ok, good :) |
16:20:19 | * | Perkol quit (Remote host closed the connection) |
16:22:59 | narimiran | OrganicAnywhere: yeah, you just need to put @ in front for him to spot it ;) @mratsim |
16:23:12 | FromGitter | <mratsim> ? |
16:23:18 | narimiran | see :) |
16:23:20 | OrganicAnywhere | o_O |
16:23:29 | OrganicAnywhere | So that's the secret |
16:24:05 | FromGitter | <mratsim> what can I do for you? |
16:24:06 | OrganicAnywhere | @mratsim, You work with data science, yes? |
16:24:26 | FromGitter | <mratsim> technically I work with blockchain and do data science at night :p |
16:24:41 | FromGitter | <mratsim> but yeah I do |
16:25:01 | * | Trustable joined #nim |
16:26:20 | OrganicAnywhere | I 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:33 | FromGitter | <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:39 | OrganicAnywhere | I 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:41 | FromGitter | <mratsim> data-frames |
16:28:18 | FromGitter | <mratsim> no XGBoost but that's just a wrapper away, I may even have seen one |
16:28:43 | FromGitter | <mratsim> and there is no data viz at all |
16:28:57 | FromGitter | <mratsim> basically the supporting tools are missing |
16:29:12 | OrganicAnywhere | Are you referring to Nvidia DALI or Arraymancer? |
16:29:21 | FromGitter | <mratsim> also w.r.t. to Arraymancer, the NN part is not on GPU |
16:29:47 | FromGitter | <mratsim> there is no way to do proper data preprocessing in Nim currently |
16:29:52 | FromGitter | <mratsim> DALI would allow that |
16:29:55 | OrganicAnywhere | I see. |
16:30:51 | FromGitter | <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:07 | FromGitter | <mratsim> Caffe2/Tensorflow can't do the same as Keras/Torchvision |
16:31:12 | FromGitter | <mratsim> regarding images |
16:31:40 | * | dom96_w joined #nim |
16:31:50 | FromGitter | <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:01 | FromGitter | <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:16 | FromGitter | <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:24 | FromGitter | <mratsim> Today Nim could serve as glue with Python (thanks to nimpy) C and C++ |
16:35:49 | FromGitter | <mratsim> but depending on your domain, deploying without Python may be impossible |
16:36:09 | * | Perkol joined #nim |
16:36:32 | OrganicAnywhere | I'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:06 | FromGitter | <mratsim> It's not even a Nim issue, even C/C++ tools are not there |
16:37:26 | FromGitter | <mratsim> either they ship dockers with Python inside |
16:37:47 | FromGitter | <mratsim> or they recode from scratch in C/C++ once research in Python has satisfactory results |
16:37:53 | OrganicAnywhere | I 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:22 | FromGitter | <mratsim> for image processing I could for simple algorithms |
16:38:32 | FromGitter | <mratsim> like image recognition |
16:39:07 | OrganicAnywhere | Oh, 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:22 | FromGitter | <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:30 | FromGitter | <mratsim> yes exactly |
16:40:09 | FromGitter | <mratsim> This is also what the nimtorch guys are doing: https://github.com/fragcolor-xyz/nimtorch |
16:41:03 | FromGitter | <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:13 | OrganicAnywhere | I'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:24 | FromGitter | <mratsim> for recommender system definitely Python, unless you can wrap a good C or C++ library |
16:44:40 | OrganicAnywhere | As 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:01 | OrganicAnywhere | (medical diagnostics) |
16:45:23 | FromGitter | <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:53 | FromGitter | <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:09 | OrganicAnywhere | Wow, nice! |
16:46:47 | FromGitter | <mratsim> https://www.kaggle.com/c/rsna-pneumonia-detection-challenge |
16:48:25 | FromGitter | <mratsim> This guy: https://www.kaggle.com/alexandrecc |
16:50:12 | federico3 | 1st Place - $ 12,000 meh, kaggle... |
16:53:19 | OrganicAnywhere | I have to leave now. Thank you for the talk @mratsim! I'm keeping an eye on Arraymancer :) |
16:53:31 | FromGitter | <mratsim> this was 500k ;) - https://www.kaggle.com/c/data-science-bowl-2017#prizes |
16:53:48 | FromGitter | <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:56 | narimiran | yglukhov[m]: you here? nimpy has made it to pycoder's weekly newsletter :) |
18:17:15 | narimiran | probably 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:19 | FromGitter | <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:05 | FromGitter | <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:26 | narimiran | @iffy you can also do `./koch temp` to create `./bin/nim_temp` for your experiments |
20:02:03 | FromGitter | <iffy> oh that's neat |
20:03:41 | * | birdspider quit (Remote host closed the connection) |
20:03:55 | shashlick | is 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:05 | dom96 | narimiran: awesome! Maybe a tweet is in order? |
20:06:28 | rayman22201 | @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:18 | shashlick | looks like there's a dynlib module - might be able to do it with that |
20:09:50 | rayman22201 | ah yeah. Sure is. It does the platform specific stuff for you too. cool. |
20:13:00 | shashlick | yep, works great |
20:18:09 | dom96 | let's vote for Nim! https://stackoverflow.blog/2019/01/23/our-2019-developer-survey-is-open-to-coders-everywhere/ |
20:20:23 | Zevv | 1 vote = 1 beer |
20:21:37 | Zevv | The vote is broken, get "Sorry unexpected error" all the time |
20:22:02 | Zevv | oh adblock |
20:25:58 | Zevv | hehe, is IRC "social media" :) |
20:28:04 | dom96 | jesus, this survey is super long |
20:28:14 | dom96 | The things I do for Nim :P |
20:29:29 | * | taparcon_ quit (Quit: Leaving) |
20:33:00 | Zevv | "How long did yoy find this survey? [ ] Too short [ ] Just good [X] To long" |
20:33:24 | FromGitter | <kaushalmodi> .. and I then even left out that last "more comments" box |
20:35:15 | dom96 | [X] Outrageously long |
20:36:39 | Zevv | Well, there was one (1) box where I could fill in "Nim". The rest was about my feelins about my gender |
20:36:57 | Zevv | I'm pleased with my gender, thank you |
20:38:21 | dom96 | There was some plain silly questions too |
20:38:29 | dom96 | Have you turned it off and on again? |
20:38:33 | dom96 | hurr durr lolz |
20:39:24 | Zevv | [x] what? |
20:39:40 | FromGitter | <Clyybber> I remember trying to do that survey last year. Canceled it halfway through, too many (personal/unrelated) questions IMO. |
20:40:30 | FromGitter | <kaushalmodi> Zevv: IT Crowd |
20:40:31 | FromGitter | <kaushalmodi> https://www.youtube.com/watch?v=nn2FB1P_Mn8 |
20:41:12 | Zevv | Yeah I know |
20:41:17 | Zevv | (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:10 | zestyr | they're just datamining lol |
20:53:49 | zestyr | it 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:33 | dom96 | !eval echo(20000-1 / 500) |
21:11:33 | NimBot | Compile failed: <no output> |
21:11:36 | dom96 | :/ |
21:21:53 | shashlick | have started using the links browser for Nim documentation in gui mode, pretty nice |
21:22:06 | shashlick | but search doesn't work |
21:33:34 | * | narimiran quit (Ping timeout: 246 seconds) |
21:36:55 | FromGitter | <iffy> How do I turn a pointer (or ptr string) back into that string? |
21:38:48 | FromGitter | <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:54 | FromGitter | <kaushalmodi> @iffy I am not a C/string expert, but here's a snippet based off what I learned recently |
21:45:58 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4a3216f780a1521f631857] |
21:47:06 | FromGitter | <iffy> @kaushalmodi thank you; the second to last line makes a copy of the string, right? |
21:48:06 | FromGitter | <kaushalmodi> I believe so. I hadn't thought of that earlier. |
21:48:36 | FromGitter | <kaushalmodi> so yes, the comment should probably say `# copy cstring to string` |
21:49:16 | * | elrood quit (Remote host closed the connection) |
21:50:26 | FromGitter | <kaushalmodi> @iffy I think this seals it: https://forum.nim-lang.org/t/3850#23935 |
21:50:27 | FromGitter | <kaushalmodi> :) |
22:04:53 | FromGitter | <iffy> but surely there's a good way to pass strings to/from C++? |
22:05:38 | FromGitter | <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:59 | FromGitter | <kaushalmodi> I am working on a Nim-C FFI integration at the moment |
22:10:07 | FromGitter | <kaushalmodi> and there the string gets passed as cstring |
22:10:14 | FromGitter | <kaushalmodi> I don't have experience with C++. |
22:10:24 | FromGitter | <kaushalmodi> May be someone else can chime in on that |
22:10:51 | FromGitter | <kaushalmodi> *also not sure how the Nim + node + C++ combination works :)* |
22:11:27 | FromGitter | <kaushalmodi> .. or are you trying to make Nim and node talk via C++? |
22:12:26 | FromGitter | <iffy> C++ is between Nim and Node |
22:12:38 | FromGitter | <iffy> Node <-> C++ <-> Nim |
22:12:54 | FromGitter | <kaushalmodi> yup, that's what I meant |
22:13:17 | FromGitter | <kaushalmodi> Not that you asked, but I am working on SystemVerilog <-> C <-> Nim |
22:13:32 | FromGitter | <iffy> I miss verilog/vhdl |
22:14:16 | FromGitter | <kaushalmodi> you miss? As in you changed fields? |
22:14:21 | FromGitter | <kaushalmodi> or you miss that from your courses |
22:14:29 | FromGitter | <iffy> changed fields |
22:14:37 | FromGitter | <kaushalmodi> interesting |
22:14:51 | FromGitter | <kaushalmodi> I feel myself more and more vested in asic verification |
22:16:08 | FromGitter | <kaushalmodi> There's so much out there in the real software world, it's scary :) |
22:21:23 | shashlick | @iffy: maybe share a larger snippet? |
22:21:58 | FromGitter | <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:56 | rayman22201 | nim 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:22 | FromGitter | <iffy> I'm happy to copy; I'm happy to do anything to make this code work :) |
22:23:53 | rayman22201 | lol. fair enough |
22:29:58 | shashlick | How come you are compiling without --app:lib |
22:30:14 | shashlick | It's just making an Exe |
22:31:16 | FromGitter | <iffy> me? |
22:31:38 | shashlick | Ya |
22:31:43 | FromGitter | <iffy> I don't think the .node file is an executable, is it? |
22:32:01 | shashlick | And why use the cpp in the middle |
22:32:16 | shashlick | Just use Nim and emit anything if required |
22:32:22 | rayman22201 | he is doing --compileOnly, so it just produces C code |
22:32:30 | rayman22201 | if you look at the makefile |
22:32:37 | FromGitter | <iffy> node-gyp is what does the compiling |
22:32:55 | FromGitter | <iffy> I would love to do this all in Nim |
22:33:02 | rayman22201 | but your @shashlick's point about doing it all in nim is a good point lol |
22:33:50 | FromGitter | <iffy> are you suggesting that I could compile (using --app:lib) to make the hellolib.node file directly? |
22:33:51 | FromGitter | <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:40 | shashlick | @iffy - that's what I think but ya, if there's an established way to do node modules, go with that |
22:45:58 | shashlick | i've never done it before so keep a grain of salt handy |
22:46:11 | FromGitter | <iffy> And it's Node, so a double grain of salt |
22:46:11 | rayman22201 | @deech make a nim.cfg in your project like this: https://pastebin.com/raw/qtAgCpyh |
22:46:56 | shashlick | there's node-ffi so you could just import a dll/so that way |
22:47:00 | rayman22201 | ugg, ignore that |
22:47:05 | rayman22201 | this one is better: https://pastebin.com/raw/Ab9ihMa1 |
22:47:11 | rayman22201 | typo |
22:47:13 | * | jxy joined #nim |
22:47:20 | rayman22201 | We need better docs for .cfg / .nims |
22:47:35 | rayman22201 | I couldn't find docs for the "cc" option anywhere :-( |
22:48:05 | FromGitter | <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:16 | FromGitter | <iffy> I suppose it wouldn't hurt to see how far that gets, though |
22:48:20 | FromGitter | <kaushalmodi> rayman22201: https://github.com/nim-lang/Nim/issues/9056 |
22:48:59 | rayman22201 | Thanks @kaushalmodi |
22:49:00 | shashlick | well, if it is a known headache, better to avoid |
22:51:12 | shashlick | going back to what you have - what if you first convert message into a string, before passing to strforamt |
22:52:22 | FromGitter | <iffy> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4a41a635350772cf84e737] |
22:52:55 | FromGitter | <kaushalmodi> you need to do `var s_message = $message` |
22:53:03 | FromGitter | <iffy> yeah, compiler just told me that |
22:53:04 | FromGitter | <iffy> :) |
22:53:15 | FromGitter | <kaushalmodi> the regular conversion using `TYPE(variable)` won't work |
22:53:20 | FromGitter | <kaushalmodi> ok :) |
22:53:26 | FromGitter | <iffy> still crashes |
22:54:20 | FromGitter | <iffy> (in the same way at the same place) |
22:55:32 | FromGitter | <iffy> If I `echo GC_getStatistics()` inside hello_echo, it goes from the starting values of |
22:55:32 | FromGitter | <iffy> [GC] total memory: 528384 ⏎ [GC] occupied memory: 61528 |
22:55:49 | FromGitter | <iffy> To this just before the crash: |
22:55:50 | FromGitter | <iffy> [GC] total memory: 15208448 ⏎ [GC] occupied memory: 428640 |
22:56:26 | FromGitter | <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:26 | rayman22201 | gc is going crazy in your function... |
22:56:51 | FromGitter | <iffy> rayman22201: are you running it? |
22:57:03 | rayman22201 | just based on that error message. |
22:57:59 | FromGitter | <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:08 | rayman22201 | kind of silly, but what if you do `GC_disable()` at the top of your hello_echo function |
22:58:41 | FromGitter | <iffy> I've run it with GC_disable outside hello_echo (so, disabled for the whole program) and it runs without problem |
22:58:58 | FromGitter | <iffy> Are you saying turn it off at the beginning and turn it on before returning? |
22:59:03 | rayman22201 | yeah |
22:59:58 | FromGitter | <iffy> still crashes and makes the statistics go crazy: |
22:59:58 | FromGitter | <iffy> [GC] total memory: 120832000 ⏎ [GC] occupied memory: 94983136 |
23:00:18 | rayman22201 | interesting. what doesn't the gc like there? |
23:00:50 | rayman22201 | * that was a rhetorical question lol |
23:03:05 | rayman22201 | I 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:37 | FromGitter | <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:46 | rayman22201 | If you just echo a static string, and don't use the `message` argument. does it still crash? |
23:06:17 | rayman22201 | I'm curious if it is the `echo` that is the problem, or the `cstring` directly |
23:08:36 | FromGitter | <iffy> like `echo "foo"`? let me try |
23:10:15 | FromGitter | <iffy> It doesn't seem to die, though the memory usage does keep going up |
23:10:19 | FromGitter | <iffy> [GC] total memory: 16785408 ⏎ [GC] occupied memory: 1035480 |
23:10:34 | FromGitter | <iffy> when I killed it on iteration 6205 |
23:12:15 | FromGitter | <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:29 | FromGitter | <iffy> Err wait, the GC stuff is on the heap, right? |
23:12:58 | rayman22201 | I have a feeling it is related to the gc_bottom |
23:13:47 | rayman22201 | Confusing terminologies. The GC is for the heap, yes. But it organizes itself like a stack. |
23:14:26 | rayman22201 | *hand waves* GC magic |
23:15:12 | FromGitter | <iffy> So at the beginning, GC stack bottom is: 0x7fff5fbfb2f0 |
23:15:32 | FromGitter | <iffy> The C++ const char* message is 0x7fff5fbfb361 |
23:16:38 | FromGitter | <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:08 | FromGitter | <iffy> The address of the cstring returned hello_echo is 0x102e96248 the first iteration (according to C++) |
23:18:42 | FromGitter | <iffy> And that address increments each iteration |
23:19:42 | rayman22201 | Yeah. 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:09 | FromGitter | <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:36 | rayman22201 | Hrmm. Let me download this thing and try it myself. I'm curious... |
23:32:07 | * | stefanos82 quit (Remote host closed the connection) |
23:37:42 | FromGitter | <timotheecour> @iffy @kaushalmodi was ur qq how to convert a string to a cstring? (looks like it was?) ; just : `mystring.cstring` |
23:38:42 | FromGitter | <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:09 | FromGitter | <timotheecour> then it’s just: `$mycstring` |
23:42:54 | * | theelous3 quit (Read error: Connection reset by peer) |
23:43:05 | FromGitter | <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:37 | FromGitter | <iffy> @timotheecour Here's the full problem: https://github.com/iffy/node-nim-memory-bug |
23:47:16 | FromGitter | <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:18 | rayman22201 | @iffy, you need to add `graceful-fs` to your npm dependencies fyi |
23:48:24 | FromGitter | <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:48 | rayman22201 | nodejs -> C++ -> nim -> c++ -> nodejs |
23:48:58 | * | leorize quit (Quit: WeeChat 2.3) |
23:49:53 | FromGitter | <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:46 | rayman22201 | It is relevant b/c the c string comes from a nodejs object |
23:51:30 | FromGitter | <timotheecour> they might as well be generated from a C function |
23:51:32 | FromGitter | <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:54 | FromGitter | <timotheecour> ok so write a simplified case where a C function generates a cstring and a nim program receives it |
23:53:28 | FromGitter | <timotheecour> (eg via malloc or, in C++, new, or even std::string) |
23:57:28 | * | a__b__m is now known as abm |