00:18:22 | * | Trustable quit (Remote host closed the connection) |
00:40:43 | * | Nikky quit (Ping timeout: 255 seconds) |
00:50:46 | * | Nikky joined #nim |
00:51:08 | * | yglukhov joined #nim |
00:55:27 | * | yglukhov quit (Ping timeout: 248 seconds) |
01:02:38 | FromGitter | <Gooseus> <treeform> added list_objects and list_buckets method to the S3Client |
01:20:12 | * | gokr quit (Ping timeout: 260 seconds) |
01:41:17 | * | yglukhov joined #nim |
01:45:35 | * | yglukhov quit (Ping timeout: 248 seconds) |
01:59:08 | * | UxerUospr joined #nim |
02:00:40 | GitDisc | <treeform> wow nice thank you! |
02:01:17 | FromGitter | <superfunc> @Yardanico sorry about my useless PR the other day, my stuff had gotten quite out of sync :D |
02:16:01 | * | def-pri-pub joined #nim |
02:20:32 | * | chemist69_ quit (Ping timeout: 255 seconds) |
02:34:08 | * | chemist69 joined #nim |
02:59:12 | * | libman quit (Quit: Connection closed for inactivity) |
03:04:08 | * | couven92 quit (Ping timeout: 240 seconds) |
03:08:46 | * | derlafff quit (Ping timeout: 255 seconds) |
03:27:57 | * | UxerUospr quit (Remote host closed the connection) |
03:28:51 | * | yglukhov joined #nim |
03:29:32 | * | Snircle quit (Ping timeout: 246 seconds) |
03:29:39 | * | Snircle_ joined #nim |
03:33:31 | * | yglukhov quit (Ping timeout: 255 seconds) |
03:38:49 | * | couven92 joined #nim |
03:39:13 | * | derlafff joined #nim |
03:44:07 | * | Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com) |
04:20:57 | * | cspar__ joined #nim |
04:23:27 | * | cspar_ quit (Ping timeout: 240 seconds) |
04:29:22 | * | def-pri-pub quit (Quit: Leaving.) |
04:35:00 | * | couven92 quit (Read error: Connection reset by peer) |
04:41:01 | * | yglukhov joined #nim |
04:45:08 | * | yglukhov quit (Ping timeout: 240 seconds) |
04:58:05 | * | def-pri-pub joined #nim |
04:59:41 | * | vlad1777d joined #nim |
05:07:32 | * | def-pri-pub quit (Quit: Leaving.) |
06:19:08 | FromGitter | <Yardanico> @superfunc what PR you're talking about ? :) |
06:19:26 | FromGitter | <Yardanico> ah, about l warning, nothing bad |
06:19:33 | FromGitter | <Yardanico> it's not easy to spot changes in nim devel sometimes |
06:19:35 | FromGitter | <superfunc> 6613, yeah |
06:20:29 | FromGitter | <Yardanico> so Araq used `l` in dfa.nim and then removed the warning because it's annoying :P |
06:20:40 | FromGitter | <superfunc> lol |
06:21:14 | FromGitter | <superfunc> I'm looking at 6420 right now, but its a bit weird, I'm trying to understand the errno behavior |
06:22:13 | FromGitter | <superfunc> In the open function in system.nim, errno doesn't seem to be set after a failed open call, but it does get set after the IOException is rasied. |
06:24:36 | FromGitter | <Yardanico> all platform-dependent functions from system.nim are implemented in sysio.nim |
06:24:43 | FromGitter | <Yardanico> lib/system/sysio.nim |
06:25:57 | * | yglukhov joined #nim |
06:26:38 | FromGitter | <gogolxdong> @PMunch var client = jsnew net.createConnection(JsObject{ path:"qemu+tcp://192.168.4.151/system".cstring }, proc () = ⏎ console.log("Connected to server!") ⏎ ) |
06:26:56 | FromGitter | <gogolxdong> @PMunch |
06:27:05 | FromGitter | <gogolxdong> var client = jsnew net.createConnection(JsObject{ path:"qemu+tcp://192.168.4.151/system".cstring }, proc () = ⏎ console.log("Connected to server!") ⏎ ) |
06:27:16 | FromGitter | <Yardanico> why are you deleting your messages? |
06:27:34 | FromGitter | <gogolxdong> var client = jsnew net.createConnection(JsObject{ path:"qemu+tcp://192.168.4.151/system".cstring }, proc () = ⏎ console.log("Connected to server!") ⏎ ) |
06:27:53 | FromGitter | <gogolxdong> can't ctrl+enter |
06:28:41 | FromGitter | <gogolxdong> `````` |
06:28:51 | FromGitter | <Yardanico> ```like thid``` |
06:28:54 | FromGitter | <Yardanico> *this :) |
06:28:57 | FromGitter | <superfunc> I think you want shift+enter |
06:29:10 | * | nsf joined #nim |
06:29:29 | FromGitter | <gogolxdong> ```code paste, see link``` ⏎ ⏎ yeah, exactly :) [https://gitter.im/nim-lang/Nim?at=59f8184932e080696e472cfb] |
06:29:40 | FromGitter | <Yardanico> @gogolxdong I'm just saying that because your message has been sent to IRC three times :) |
06:29:44 | * | XZentus joined #nim |
06:30:20 | FromGitter | <gogolxdong> ok , I am aware of that. |
06:31:47 | FromGitter | <gogolxdong> @PMunch nim-electron can't connect socket in this form |
06:35:13 | FromGitter | <gogolxdong> I tried this path with libvirt-python client, it works well. |
06:36:35 | FromGitter | <Yardanico> why are you using JS here? |
06:36:41 | FromGitter | <Yardanico> you can connect using Nim without JS FFI |
06:37:16 | * | earenndil quit (Quit: ZNC 1.6.3+deb1 - http://znc.in) |
06:37:24 | FromGitter | <superfunc> @Yardanico Is errno platform dependent since its in c99? |
06:37:47 | FromGitter | <Yardanico> @superfunc it seems so http://www.ioplex.com/~miallen/errcmp.html |
06:37:57 | FromGitter | <Yardanico> but mostly they're equal |
06:38:01 | FromGitter | <gogolxdong> We are presenting a crossing platform dashboard, web is a reasonable choice. |
06:38:14 | FromGitter | <superfunc> @Yardanico Whats that link supposed to be to? |
06:38:20 | FromGitter | <superfunc> It looks like a dead link |
06:38:25 | FromGitter | <Yardanico> @superfunc it's not a dead linjk |
06:38:34 | FromGitter | <Yardanico> An identifier is defined for platforms that have a numeric value listed (even though there may not be an associated message shown). Column 2 is a score that indicates the fraction of platforms on which the identifier is found (1 meaning all). |
06:38:49 | FromGitter | <superfunc> Huh, I get a 404 on that page |
06:40:07 | FromGitter | <Yardanico> maybe your browser incorrectly parses it? |
06:40:12 | FromGitter | <Yardanico> it's fine with google chrome |
06:40:22 | FromGitter | <superfunc> I'm on chrome too |
06:40:43 | FromGitter | <Yardanico> try this http://www.ioplex.com/~miallen/errcmp.html |
06:40:47 | FromGitter | <Yardanico> https://goo.gl/PebG8P |
06:41:05 | FromGitter | <superfunc> Still 404, on ffox as well |
06:41:33 | FromGitter | <gogolxdong> and I want to use tcp to work around wsgi for better lantency. |
06:42:51 | FromGitter | <Yardanico> @superfunc I don't really know |
06:43:17 | FromGitter | <superfunc> ¯\_(ツ)_/¯ |
06:48:53 | FromGitter | <superfunc> It can be done in sysio.nim anyways. |
06:59:29 | * | yglukhov quit (Remote host closed the connection) |
07:00:04 | * | yglukhov joined #nim |
07:04:01 | * | yglukhov quit (Ping timeout: 240 seconds) |
07:12:06 | * | couven92 joined #nim |
07:21:40 | * | claudiuinberlin joined #nim |
07:33:18 | * | tdc joined #nim |
07:38:54 | * | PMunch joined #nim |
07:39:44 | FromGitter | <sptorin_twitter> try exclude some chars from string, can't do it via `strip`... what right way? |
07:41:26 | FromGitter | <superfunc> strutils.multireplace |
07:42:08 | couven92 | ah! `strutils.multireplace`, my own little baby! :P |
07:42:50 | couven92 | (I can't really take any credit for that one though, Araq made me do it :D ) |
07:43:52 | FromGitter | <Yardanico> @superfunc but it's only for strings :) |
07:44:03 | FromGitter | <Yardanico> I mean you can use single-char strings too |
07:44:24 | FromGitter | <Yardanico> but this is a (little bit) less efficient :D |
07:45:58 | FromGitter | <sptorin_twitter> multiReplace change one char, and if I want cut from string 5 chars? |
07:46:44 | couven92 | `align` or `leftAlign` maybe? |
07:47:27 | Araq | s.setLen s.len - 5 |
07:48:32 | FromGitter | <sptorin_twitter> I mean other (baaaad english). Have str1 = "a! b? c.." and need cut all punctuation marks for result "a b c" |
07:49:07 | couven92 | sptorin_twitter, then `multiReplace` is the way to go |
07:49:12 | FromGitter | <superfunc> multiReplace can replace as many strings as you want. |
07:50:13 | FromGitter | <superfunc> ```code paste, see link``` ⏎ ⏎ results in `ccc` [https://gitter.im/nim-lang/Nim?at=59f82b34b20c6424296ba9c6] |
07:50:20 | FromGitter | <Yardanico> @superfunc you can use {} syntax |
07:50:37 | FromGitter | <Yardanico> echo strutils.multiReplace(str, {"a": ""), ("b": ""}) |
07:50:51 | FromGitter | <couven92> @Yardanico you can???? :O |
07:50:55 | FromGitter | <Yardanico> ah sorry |
07:51:01 | FromGitter | <Yardanico> echo strutils.multiReplace(str, {"a": ""}, {"b": ""}) |
07:51:17 | FromGitter | <superfunc> So in your case, something like `strutils.multiReplace(str, @["!", "?", "."])` |
07:51:19 | FromGitter | <Yardanico> ah no |
07:51:22 | FromGitter | <Yardanico> it doesn't work :( |
07:51:50 | FromGitter | <Yardanico> but I remember that it worked last time ... |
07:52:04 | FromGitter | <Yardanico> yes |
07:52:04 | FromGitter | <Yardanico> https://github.com/Yardanico/twitchrelay/blob/master/twitchrelay.nim#L70 |
07:52:25 | FromGitter | <Yardanico> strutils.multiReplace(str1, {"a": "", "b": ""}) works |
07:53:16 | FromGitter | <couven92> @superfunc @sptorin_twitter no, the proper way to do it is as follows: ⏎ ⏎ ```echo strutils.multiReplace("a! b? c..", ("!", ""), ("?", ""), (".", ""))``` [https://gitter.im/nim-lang/Nim?at=59f82bece44c43700a9b7cd2] |
07:53:26 | FromGitter | <couven92> make use of varargs! ;) |
07:53:51 | FromGitter | <Yardanico> {} is nicer :P |
07:53:53 | FromGitter | <superfunc> yes yes, wasn't concerned about that bit :p |
07:54:16 | FromGitter | <sptorin_twitter> Tnx! I try use only one param like: `("!", "")` in multiReplace |
07:54:21 | FromGitter | <couven92> @superfunc you also realized your mistake as I typed out the correction I see |
07:55:11 | FromGitter | <superfunc> It was missing the groupings yeah |
07:55:22 | FromGitter | <superfunc> Though I still wrote it out as a seq |
07:55:47 | couven92 | :) IRC is persistent! Your mistake has been logged :P |
07:56:02 | FromGitter | <superfunc> :) |
07:56:27 | couven92 | yeah, doing it as a seq only creates (very tiny) overhead, varargs or array is cleaner here |
07:56:54 | FromGitter | <superfunc> No argument here |
07:57:32 | FromGitter | <Yardanico> couven92: why not {} ? |
07:57:34 | FromGitter | <Yardanico> syntax |
07:58:02 | couven92 | I have no idead! I guess, because that syntax is completely foreign to me! :P |
07:58:06 | FromGitter | <Yardanico> it has no overhead too |
07:58:19 | FromGitter | <Yardanico> well it's very convenient to anyone who has used dictionaries or tables |
07:58:23 | FromGitter | <Yardanico> in other languages too |
07:58:30 | couven92 | I only know the curlies for sets |
07:58:53 | * | couven92 triggers the **noob** alert sign! |
07:59:32 | FromGitter | <Yardanico> https://nim-lang.org/docs/manual.html#statements-and-expressions-table-constructor |
08:00:01 | * | Arrrr joined #nim |
08:00:01 | * | Arrrr quit (Changing host) |
08:00:01 | * | Arrrr joined #nim |
08:00:11 | couven92 | huh! sometimes I really wonder how Araq dares to let me anywhere near the stdlib! :D |
08:01:09 | * | yglukhov joined #nim |
08:01:39 | Araq | couven92: fix the html generation |
08:02:11 | couven92 | oh! yeah, will do asap |
08:02:20 | PMunch | Did you break something couven92? |
08:02:26 | couven92 | PMunch, not yet |
08:02:52 | couven92 | not since my major hickup with the Android build.sh bug |
08:03:13 | Araq | no need to wonder, we have code reviews and tests to squeeze out quality |
08:04:45 | couven92 | yeah! I have learned a LOT from you by getting review feedback! Makes me write slightly better Nim code next time :) |
08:15:23 | yglukhov | dom96: you around? |
08:30:21 | * | Vladar joined #nim |
08:31:32 | FromGitter | <mratsim> @krux02 @Araq, I’d love to have this PR soon: https://github.com/nim-lang/Nim/pull/5664 ⏎ ⏎ I tracked down my OpenMP perf issue. ⏎ It was due to multiple thread writing/reading to the same cache line during parallel reductions. I need to evaluate the sizeof(each_thread_result) at compile-time to make them at-least a cache line apart [https://gitter.im/nim-lang/Nim?at=59f834e44ff065ac1898dccc] |
08:32:27 | Araq | can't merge it |
08:33:13 | Araq | tried, it breaks too much stuff and krux02 was removing things that really need to remain |
08:34:16 | FromGitter | <mratsim> ok. too bad :/ |
08:38:37 | * | jjido joined #nim |
08:39:28 | * | obadz quit (Ping timeout: 252 seconds) |
08:39:53 | * | obadz joined #nim |
08:57:09 | * | XZentus quit () |
09:03:38 | * | gokr joined #nim |
09:16:38 | * | Senketsu joined #nim |
09:23:16 | * | Senketsu quit (Quit: leaving) |
09:28:38 | * | Senketsu joined #nim |
09:29:34 | FromGitter | <mratsim> Yeah another programming language: https://github.com/LiXizhi/NPLRuntime/wiki/WhatIsNPL, NPL (neural parallel language) is based on luajit, target networking, graphics, audio and comes with a 3d physics engine |
09:29:59 | Arrrr | So ... why is type forwarding done with pragma instead of by leaving its body empty? Like proc forward declaration. |
09:33:54 | * | slim_jim_jiss joined #nim |
09:41:37 | * | gokr quit (Ping timeout: 255 seconds) |
09:44:21 | * | Senketsu quit (Quit: leaving) |
09:46:51 | * | Senketsu joined #nim |
09:51:21 | * | Senketsu quit (Client Quit) |
09:53:27 | * | Tanger quit (Ping timeout: 240 seconds) |
09:53:54 | * | floppydh joined #nim |
09:56:08 | * | Senketsu joined #nim |
09:58:39 | * | cspar_ joined #nim |
09:59:07 | * | Tanger joined #nim |
10:01:02 | * | thomasross__ quit (Remote host closed the connection) |
10:01:40 | * | cspar__ quit (Ping timeout: 248 seconds) |
10:01:40 | * | d10n quit (Ping timeout: 248 seconds) |
10:01:40 | * | redlegion quit (Ping timeout: 248 seconds) |
10:01:40 | * | arnetheduck joined #nim |
10:01:40 | * | jackv quit (Ping timeout: 248 seconds) |
10:01:52 | * | thomasross_ joined #nim |
10:02:18 | * | jackv joined #nim |
10:02:22 | * | d10n joined #nim |
10:02:22 | * | d10n quit (Changing host) |
10:02:22 | * | d10n joined #nim |
10:02:51 | * | redlegion joined #nim |
10:02:51 | * | redlegion quit (Changing host) |
10:02:51 | * | redlegion joined #nim |
10:04:02 | * | gmpreussner quit (Ping timeout: 260 seconds) |
10:04:10 | * | gmpreussner joined #nim |
10:04:27 | * | demi- quit (Ping timeout: 240 seconds) |
10:04:37 | * | avsej quit (Ping timeout: 260 seconds) |
10:04:41 | * | slim_jim_jiss quit (Ping timeout: 246 seconds) |
10:04:47 | * | demi- joined #nim |
10:06:17 | * | avsej joined #nim |
10:06:17 | * | avsej quit (Changing host) |
10:06:17 | * | avsej joined #nim |
10:07:14 | * | JappleAck joined #nim |
10:13:54 | * | Senketsu quit (Quit: leaving) |
10:14:29 | * | Senketsu joined #nim |
10:19:47 | * | Tanger quit (Ping timeout: 260 seconds) |
10:24:40 | * | Tanger joined #nim |
10:30:16 | * | slim_jim_jiss joined #nim |
10:32:19 | * | floppydh quit (Quit: WeeChat 1.9.1) |
10:33:53 | * | ibutra joined #nim |
10:34:48 | * | floppydh joined #nim |
10:38:20 | * | qwertfisch is now known as zombiefisch |
10:40:27 | * | gokr joined #nim |
10:41:05 | * | slim_jim_jiss quit (Ping timeout: 246 seconds) |
10:50:48 | * | slim_jim_jiss joined #nim |
10:52:29 | couven92 | I have a macro with a generic type parameter `T`, how do I get the type of T as a NimNode? when I use `getType(T)` I only get `Error: undeclared field: 'T'` |
10:53:33 | * | Trustable joined #nim |
10:56:00 | Araq | couven92: it seems currently impossible, I stumpled upon this too |
10:56:24 | couven92 | So take the type as typedesc parameter instead of generic? |
10:56:46 | * | Arrrr quit (Ping timeout: 264 seconds) |
10:57:08 | Araq | couven92: sounds good |
11:02:05 | couven92 | what is happening here? https://play.nim-lang.org/?gist=3611e4c134adb4d2aaecb201d25d9177 |
11:03:35 | * | Snircle joined #nim |
11:03:57 | couven92 | why does nim say that the array has to be discarded? |
11:05:22 | couven92 | and why does it work when the macro returns untyped instead? |
11:05:50 | FromGitter | <Yardanico> use untyped unless you really need to use typed |
11:05:59 | couven92 | really? :O |
11:06:09 | couven92 | elaborate please |
11:06:12 | FromGitter | <Yardanico> yes, in macros you almost alwayse untyped |
11:06:19 | FromGitter | <Yardanico> ask @krux02 :D |
11:10:02 | FromGitter | <Yardanico> but I didn't encounter a situation where I need typed macro, I don't really know what are the differences |
11:10:04 | FromGitter | <Yardanico> ask Araq :) |
11:10:27 | FromGitter | <Yardanico> I mean sometimes I need "typed" argument for a macro, but not typed result |
11:10:51 | PMunch | Typed means that your AST is type checked before it's handed back. Your AST is illegal by itself since it doesn't discard the array, it's only when it's placed in the context of the assignment that it is legal. If you use untyped the AST is not type checked and you can return anything you like, even completely illegal Nim code. It will then be type-checked at a later point, in this case after it's been placed in the assignment context. |
11:11:16 | couven92 | ah, thx PMunch |
11:12:07 | FromGitter | <alehander42> btw I remember I saw somewhere semityped discussion was it here or github ? I had some situations where I had to generated a macro(typed) invocation in a macro(untyped) and I wondered if this kind of mode would help me |
11:13:11 | PMunch | alehander42, we talked about it here yesterday |
11:14:11 | PMunch | And yes, it would probably help |
11:14:32 | PMunch | semityped will basically allow you to get type information, but you have to manage errors yourself |
11:14:48 | FromGitter | <Yardanico> Araq wants to make "typed" work like "semityped" |
11:14:58 | FromGitter | <Yardanico> but it would be hard to do as you might expect :) |
11:15:29 | FromGitter | <alehander42> thanks, I'll look up for it |
11:16:05 | FromGitter | <mratsim> You can still do type checking in an untyped macro by delegating to a compile-time proc |
11:16:55 | FromGitter | <Yardanico> how? |
11:17:09 | FromGitter | <Yardanico> you accept NimNode arguments in compile-time proc |
11:17:30 | FromGitter | <mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/private/ast_utils.nim |
11:18:41 | FromGitter | <Yardanico> hmm, what is this pragma syntax ? :) never seen this one before :) just curious |
11:19:05 | FromGitter | <mratsim> https://github.com/mratsim/Arraymancer/blob/93dcc00d7924d0eae0735078a1cfcbffa1e80bd8/src/tensor/private/p_accessors_macros_read.nim#L161 |
11:19:25 | FromGitter | <mratsim> And the `hasType`is called there |
11:19:33 | PMunch | Another benefit of semityped is that templates and macros within will be expanded before you get the result |
11:19:47 | * | dddddd joined #nim |
11:20:09 | FromGitter | <mratsim> Oh the weird pragma is probably due to mass find/replace |
11:20:32 | FromGitter | <mratsim> Like the one who did {.noInit, noInit.} |
11:21:57 | FromGitter | <mratsim> But I agree needing both typed and untyped args in a macro is non-trivial |
11:23:00 | FromGitter | <alehander42> hm I kinda need typed info for a sub-element of an untyped expression :D |
11:23:12 | FromGitter | <Yardanico> @mratsim well it is easy to understand |
11:23:15 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f85d225a1758ed0f6f4c42] |
11:23:19 | FromGitter | <Yardanico> that untyped arguments aren't type checked |
11:23:25 | FromGitter | <Yardanico> but typed arguments are checked for errors |
11:24:10 | FromGitter | <alehander42> I can't just use typed here, because it wouldn't typecheck, but then I can't just getType of a child of an untyped node, so I need to generate `expand(string)` from s and then expand to get `typed` |
11:24:32 | FromGitter | <Yardanico> @alehander42 yes |
11:24:44 | FromGitter | <Yardanico> that's why semityped is needed, or typed needs to be chancked |
11:24:50 | FromGitter | <Yardanico> *changed |
11:25:13 | FromGitter | <mratsim> @alehander42 do it like me, call a typed macro on the subargs from the untyped macro |
11:25:34 | * | jjido quit (Ping timeout: 252 seconds) |
11:25:53 | PMunch | Hmm, mratsim does that actually work? |
11:25:59 | FromGitter | <mratsim> https://github.com/mratsim/Arraymancer/blob/93dcc00d7924d0eae0735078a1cfcbffa1e80bd8/src/tensor/accessors_macros_read.nim#L56 |
11:26:04 | FromGitter | <mratsim> You bet it does |
11:28:00 | PMunch | Does that expand templates as well? |
11:28:31 | FromGitter | <mratsim> With getAST maybe |
11:28:45 | PMunch | Hmm, interesting |
11:31:09 | FromGitter | <alehander42> well that's what I am doing, I am doing |
11:31:13 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f85f01976e63937e0bcdf9] |
11:31:41 | FromGitter | <alehander42> or at least it seems similar to ⏎ ⏎ ```result = quote do: ⏎ inner_typed_dispatch(`t`, `new_args`)``` [https://gitter.im/nim-lang/Nim?at=59f85f1c976e63937e0bce9b] |
11:32:00 | FromGitter | <mratsim> You need the do |
11:33:16 | FromGitter | <alehander42> why ? it works fine for me without `do` |
11:33:22 | FromGitter | <mratsim> getAST documentation is awfully short compared to how useful it is https://nim-lang.org/docs/macros.html#getAst,untyped |
11:33:49 | FromGitter | <mratsim> Oh? Interesting, have to check more what does the do do |
11:34:22 | FromGitter | <alehander42> :D I didn't know I can pass a block myself, I thought quote: was the only form |
11:34:34 | FromGitter | <Yardanico> it just allows you to construct ast nodes in a more convenient way |
11:34:43 | FromGitter | <Yardanico> e.g. like (almost) usual nim code |
11:34:56 | FromGitter | <Yardanico> quote do returns a nim ast too |
11:36:03 | FromGitter | <Yardanico> template + getAst is practically the same |
11:37:01 | FromGitter | <alehander42> I use quote all the time, I wondered if quote:block and quote do: block differ in behavior somehow |
11:37:21 | FromGitter | <Yardanico> ah, you was talking about quote vs quote do |
11:37:22 | FromGitter | <Yardanico> IDK really |
11:38:39 | * | ibutra quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
11:49:57 | FromGitter | <Yardanico> Araq: is using ..< and .. without spaces before and after it fine? ⏎ E.g. "for x in 1..<6" or "for x in 1..5" |
11:50:10 | FromGitter | <Yardanico> just asking for my " projects" :) |
11:50:26 | couven92 | I like spaces between |
11:51:00 | FromGitter | <Yardanico> well I want to know what's the true nim-way |
11:51:01 | couven92 | if only for consistency (I think it better, too, but that's subject to opinion) |
11:51:48 | couven92 | I see .. and ..< as operators, and my general rule is: spaces between operands and operators |
11:53:16 | FromGitter | <Yardanico> yay, I get programmer ads on reddit: ⏎ "Are you fluent in C++? If so, we would like to meet you. Our offer in a nutshell: a successful product + development without deadlines + challenging problems + 120k a year" |
11:53:49 | * | jjido joined #nim |
11:54:18 | FromGitter | <Yardanico> sadly it's not about Nim :P |
11:58:23 | GitDisc | <awr> how do you get the capacity of a sequence? |
11:58:43 | federico3 | Yardanico: with a good enough compiler nobody will know you are actually writing in Nim |
11:59:11 | GitDisc | <awr> you can specify the capacity of a new sequence with newSeqOfCap but i can't find a way to retreive the capacity of an existing sequence |
11:59:18 | FromGitter | <Yardanico> awr: why do you need it? |
11:59:49 | FromGitter | <Yardanico> federico3: well you can search for string containing Nim in binaries :P |
12:00:58 | FromGitter | <mratsim> Development without deadlines ? Smells fishy :p |
12:01:36 | federico3 | Yardanico: erhm, I was joking that you can generate C++ and claim it's written by you |
12:01:37 | GitDisc | <awr> i guess i don't really need to actually get the capacity |
12:02:23 | FromGitter | <Yardanico> federico3: well yeah, you can do that xD |
12:02:38 | FromGitter | <Yardanico> "my code is a bit weird but it works" |
12:03:04 | FromGitter | <mratsim> "why is it copyrighted Andreas Rumpf" |
12:03:04 | GitDisc | <awr> how does newSeq() choose the capacity of its result seq |
12:03:16 | FromGitter | <Yardanico> you can see it in the source :) |
12:03:36 | FromGitter | <mratsim> It's Len + 50 iirc? |
12:04:17 | FromGitter | <mratsim> Or a power of two |
12:04:55 | GitDisc | <awr> https://github.com/nim-lang/Nim/blob/badba83d38371726bafba5870d5fb927eb453e41/lib/system.nim#L3191 |
12:05:18 | FromGitter | <Yardanico> it's not the thing that you're looking for I think |
12:06:27 | GitDisc | <awr> tbat seems to be it tho |
12:06:28 | GitDisc | <awr> https://github.com/nim-lang/Nim/blob/e5cb1a2dd547827ee750abbb21039d1cf0a30988/lib/system/mmdisp.nim#L161 |
12:07:41 | FromGitter | <Yardanico> but really you shouldn't need capacity |
12:08:46 | FromGitter | <Yardanico> lol, I'll probably port https://github.com/matheuss/google-translate-token/blob/master/index.js and https://github.com/matheuss/google-translate-api/blob/master/index.js to nim :) |
12:09:40 | FromGitter | <Yardanico> the token generation stuff is insane |
12:09:44 | FromGitter | <Yardanico> it seems to be simpler here: https://github.com/Stichoza/google-translate-php/blob/master/src/Stichoza/GoogleTranslate/Tokens/GoogleTokenGenerator.php |
12:10:05 | GitDisc | <awr> why are addInt and mulInt used there anyway instead of operators + and *? |
12:10:45 | GitDisc | <awr> (forgive me for my ignorance, i don't know a whole lot about compilers) |
12:10:52 | FromGitter | <Yardanico> it seems to be a ASM instruction |
12:11:20 | FromGitter | <Yardanico> well I mean magic proc which has backend-specific implementation |
12:11:34 | FromGitter | <Yardanico> you can find it here |
12:11:35 | FromGitter | <Yardanico> https://github.com/nim-lang/Nim/blob/5f685bb0e6b2d68b9796e6a7d29469ce3f3b38ec/lib/system/arithm.nim |
12:23:01 | * | elrood joined #nim |
12:23:54 | * | bjz joined #nim |
12:24:14 | * | bjz quit (Client Quit) |
12:24:25 | floppydh | this is legit no?: emit a c-function Foo then import it via: proc foo() = {.importc: "Foo".} no? |
12:24:52 | FromGitter | <Yardanico> you don't need = here |
12:25:09 | FromGitter | <Yardanico> proc foo() {.importc: "Foo".} maybe |
12:25:59 | floppydh | right, then my issue is elsewhere, thanks |
12:27:38 | floppydh | I'm getting "conflicting types for Foo" somehow |
12:27:56 | floppydh | Foo returns a "const char*" and importcs it to a proc that returns a cstring so should work no :/ |
12:28:50 | floppydh | oh googling tells me it has something to do with me statically linking stuff apparently |
12:30:12 | floppydh | doing it like this atm: {.passl: gorge("pkg-config xcb --static --libs").} |
12:30:16 | floppydh | apparently that's not supported anymore? |
12:34:12 | * | Amun_Ra quit (Ping timeout: 252 seconds) |
12:35:59 | * | Amun_Ra joined #nim |
12:36:27 | floppydh | apparently the issue with static-linking is that I can't importc the things I have just emitted anymore or so? - if I don't emit and then importc a function from the emitted block but instead write a proc and then as a proc-body emit the c-code and capture the arguments/result-var in the emitted block, it works |
12:46:29 | * | guelosk joined #nim |
12:56:40 | * | UxerUospr joined #nim |
12:59:21 | FromGitter | <couven92> @Araq in the recent (parallel) testament runs I can see tests failing, but the test run in itself succeeded. Why is that? |
13:01:46 | * | yglukhov quit (Remote host closed the connection) |
13:02:40 | FromGitter | <couven92> For example, I can see my NaN test fail, because apparently different OSes and compilers have different ways of stringifying NaN (which I didn't know before) |
13:03:12 | * | yglukhov joined #nim |
13:04:26 | * | yglukhov quit (Remote host closed the connection) |
13:04:39 | * | yglukhov joined #nim |
13:12:13 | FromGitter | <dandevelo> I have this gist: https://gist.github.com/anonymous/2ffddd1c82e9e72d84b9e093ecdbf843 |
13:13:26 | FromGitter | <dandevelo> Can I create a some sort of template that would expand the handler1 and handler2 fields with Obj1 as parameter in order to avoid writing those fields twice? |
13:14:01 | FromGitter | <dandevelo> the only difference between those fields definitions is Obj1 and Obj2. Can I generate those field definitions using a template/ |
13:15:50 | FromGitter | <Yardanico> can you post an example how you want to use this template? |
13:16:03 | FromGitter | <dandevelo> sure, just a moment |
13:17:09 | FromGitter | <dandevelo> https://gist.github.com/anonymous/2750b2180fa74f0d339c94e872658bd9 |
13:18:41 | FromGitter | <Yardanico> ah, like this |
13:21:53 | FromGitter | <dandevelo> Is that something that can be accomplished with Nim? |
13:25:26 | FromGitter | <Yardanico> well, as usual: why do you want this ? :) |
13:26:27 | FromGitter | <dandevelo> I want to be able to define Obj1.handler1() and Obj2.handler1() for two different object types without having to duplicate code |
13:27:17 | FromGitter | <Yardanico> why not Obj.handler() and Obj2.handler() ? |
13:27:25 | FromGitter | <Yardanico> or use object inheritance after all? |
13:30:07 | FromGitter | <dandevelo> I first tried doing it using inheritance and that didn't go well. Guess I will try it again |
13:31:11 | FromGitter | <Yardanico> well I mean - why would you need things like that ? :) |
13:34:15 | FromGitter | <dandevelo> These are event handlers for some custom controls. The handler functions look the same except for the first parameter (which is different based on the object type |
13:35:28 | FromGitter | <dandevelo> The event handlers are stored as fields and not procedures so that I can easily swap implementation for a particular event if I need to |
13:35:52 | FromGitter | <dandevelo> Does this make sense? |
13:43:39 | FromGitter | <dandevelo> I also thought of something like generic types: https://gist.github.com/anonymous/abec9e5ea2855a60fcb95687424ef92f |
13:43:52 | FromGitter | <dandevelo> But this doesn't seem to compile |
13:43:58 | * | couven92 quit (Read error: Connection reset by peer) |
13:44:10 | FromGitter | <mratsim> @floppydh did you try {.compile: your c file.} ? If you have a source code this is easy |
13:44:38 | floppydh | mratsim I didn't, will shortly |
13:46:16 | FromGitter | <mratsim> @dandevelo I'm like Yardanico, I'm sure you are trying something strange. |
13:46:39 | FromGitter | <mratsim> But you should probably use a template |
13:46:54 | FromGitter | <mratsim> let me fetch you an example |
13:47:03 | FromGitter | <dandevelo> @mratsim I would appreciate that :) |
13:47:57 | FromGitter | <mratsim> Here: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/fallback/blas_l3_gemm_micro_kernel.nim |
13:48:15 | FromGitter | <mratsim> At the bottom I have almost the exact same proc except for the types |
13:48:43 | FromGitter | <mratsim> I define a template that accepts "C: typed" |
13:49:00 | FromGitter | <mratsim> And the procs at the bottom just call that template |
13:49:31 | FromGitter | <mratsim> Template are inlined so there is no indirection/overhead at runtime |
13:51:24 | elrood | dandevelo: if you want to avoid duplicating code, why stop at generating the handlers? would something along these lines work? https://gist.github.com/anonymous/7c23fe24e816de7733748de952841506 |
13:52:15 | FromGitter | <mratsim> ^ |
13:52:32 | FromGitter | <dandevelo> @martsim I will take a look now. Do you believe templates would also work inside type definitions? |
13:52:58 | FromGitter | <mratsim> Elrood solution is probably the best actually |
13:53:14 | FromGitter | <mratsim> Check identifier construction on the manual as well |
13:53:39 | FromGitter | <dandevelo> @elrood that looks like a good idea except fields(such as field:string in your example) would be different for different objects |
13:54:07 | FromGitter | <dandevelo> @elrood how would I add additional fields (like field2:string to Obj2 in that example? |
13:54:44 | FromGitter | <mratsim> But why do you need the handler be part of the object type? |
13:55:19 | FromGitter | <mratsim> Just keep data and metadata in the object and proc apart, this way you can generate the proc with a template |
13:56:19 | FromGitter | <dandevelo> I need this in order to be able to easily swap handlers when needed |
13:56:39 | FromGitter | <dandevelo> like this obj1.handler1 = otherImplementation() |
13:56:46 | FromGitter | <mratsim> I see |
13:58:59 | FromGitter | <mratsim> Check this as well, this is how I store proc in an object https://github.com/mratsim/nim-rmad/blob/master/src/autograd.nim |
14:01:17 | FromGitter | <dandevelo> Taking a look now. I noticed you use .noSideEffect a few times. Never really undestood how that works |
14:03:40 | GitDisc | <awr> is func getting added in 0.18 |
14:04:25 | GitDisc | <awr> as an alias to proc ... {.nosideeffect.} |
14:06:33 | FromGitter | <mratsim> @dandevelo noSideEffect tells the compiler to check that I only read/modify variable passed as arguments to the function. i.e. function is pure: if it calls with the exact same arguments it will always give the same result |
14:07:44 | FromGitter | <mratsim> Using global variables, accessing string/stdout or using threading in a function will throw a compile error when noSideEffect is enabled |
14:07:58 | elrood | dandevolo: https://gist.github.com/anonymous/9943f7dcf88089fc8e63e6127b15c834 <- you could do this, but for more fields and types that'd become awkward quite quickly, in that case a better separation between data and handlers would probably make more sense |
14:10:26 | * | gggs quit (Ping timeout: 248 seconds) |
14:10:55 | FromGitter | <mratsim> @dandevelo some more info/propaganda (serious) https://alvinalexander.com/scala/fp-book/benefits-of-pure-functions (silly version) http://www.deadcoderising.com/2017-06-13-why-pure-functions-4-benefits-to-embrace-2/ |
14:11:27 | * | gggs joined #nim |
14:14:06 | FromGitter | <dandevelo> Thank you @mratsim going to read it now. |
14:14:35 | FromGitter | <dandevelo> @elrood agree that looks awkward |
14:15:45 | FromGitter | <mratsim> I think it's ok |
14:17:02 | FromGitter | <mratsim> It's much better than the classFactory in Java |
14:17:46 | FromGitter | <dandevelo> Yes, that is ok for few fields |
14:21:03 | FromGitter | <Yardanico> awr: no |
14:21:16 | FromGitter | <Yardanico> func doesn't have noSideEffect ATM IIRC |
14:25:41 | FromGitter | <data-man> Hi! ⏎ is anyone using the Midnight Commander? |
14:27:45 | * | miran__ joined #nim |
14:30:24 | federico3 | data-man me |
14:31:44 | FromGitter | <alehander42> @data-man my father :D |
14:32:20 | FromGitter | <data-man> I want to implement a Nim syntax highlighting for mcedit, but doing it manually is too lazy for me. :) |
14:32:20 | FromGitter | <alehander42> i've been literaly told tales of it for sleeping when I was little |
14:34:25 | FromGitter | <data-man> is there any ready-made utility for generating all a proc names of the stdlib? |
14:35:59 | subsetpark | your father told you about file managers as a bedtime story? |
14:36:35 | FromGitter | <data-man> nim genTags ... would be perfect :) |
14:38:17 | PMunch | subsetpark, probably an easy way to make him sleep :P |
14:38:28 | * | nsf quit (Quit: WeeChat 1.9.1) |
14:38:56 | * | sleepyqt joined #nim |
14:38:59 | subsetpark | I've gotta hear these stories |
14:40:19 | FromGitter | <alehander42> well obviously he wouldn't tell me stories about dependent typing |
14:40:22 | FromGitter | <alehander42> I was just a child |
14:40:42 | subsetpark | haha |
14:44:07 | FromGitter | <stisa> @data-man I don't think there is, you could try using the json generated by running `nim jsondoc2 <lib.nim>` |
14:46:00 | FromGitter | <stisa> or maybe check how https://nim-lang.org/docs/theindex.html is generated |
14:48:53 | FromGitter | <data-man> @stisa: Thanks! I think I'll do a PR to the ctags. :) |
14:52:08 | subsetpark | universal ctags support would be awesome |
14:57:30 | * | Sentreen quit (Quit: WeeChat 1.6) |
14:57:38 | FromGitter | <dandevelo> Ok, I managed to create a sample to illustrate better what I am trying to achieve: https://play.nim-lang.org/?gist=a452b1fe4026d92b6cad9fc94a75d8ef |
14:57:40 | * | Sentreen joined #nim |
14:58:09 | FromGitter | <dandevelo> The thing is, this crashes the compiler. Any idea what am I doing wrong? |
15:00:18 | FromGitter | <dandevelo> This is the code: https://gist.github.com/anonymous/a452b1fe4026d92b6cad9fc94a75d8ef |
15:02:23 | FromGitter | <dandevelo> @mratsim @Yardanico @elrood do you see anything wrong with this code? |
15:04:15 | * | dandevelo joined #nim |
15:07:28 | FromGitter | <Yardanico> probably FirstControl* = ref object of EventHandler[FirstControl] ⏎ ⏎ ``` someField: int``` [https://gitter.im/nim-lang/Nim?at=59f891b0614889d475226f46] |
15:07:34 | FromGitter | <Yardanico> maybe it does the infinity recursion |
15:08:59 | FromGitter | <dandevelo> Do you think that could be written another way? |
15:11:01 | FromGitter | <dandevelo> I wonder what @Araq thinks about this segmentation fault |
15:11:16 | FromGitter | <Yardanico> ah no wait |
15:11:31 | FromGitter | <Yardanico> yeah, it's recursion: |
15:11:33 | FromGitter | <alehander42> that's just infinite recursion because you construct your type that way, not a segfault |
15:11:47 | FromGitter | <alehander42> what are you trying to achieve>? |
15:12:03 | FromGitter | <dandevelo> @alehander42 that is what the compiler reports: Segmentation fault: 11 |
15:12:17 | FromGitter | <Yardanico> @dandevelo it reports that with release mode |
15:12:27 | FromGitter | <Yardanico> try it in debug mode, it'll show full traceback as any nim program :) |
15:12:38 | FromGitter | <Yardanico> full compiler log: https://gist.github.com/Yardanico/108c893809bc98535d86dc625e115d83 |
15:13:37 | FromGitter | <alehander42> exactly |
15:13:48 | FromGitter | <dandevelo> Do you have any idea on how to fix that? |
15:16:53 | FromGitter | <lguzzon> Just put new after equal ... ⏎ var ctrl1 = FirstControl() ⏎ var ctrl2 = SecondControl() |
15:17:12 | FromGitter | <lguzzon> var ctrl1 = new FirstControl() ⏎ var ctrl2 = new SecondControl() |
15:17:22 | FromGitter | <lguzzon> may be ... |
15:17:36 | FromGitter | <Yardanico> @lguzzon no |
15:17:41 | FromGitter | <Yardanico> well yeah, his code is incorrect here |
15:17:47 | FromGitter | <Yardanico> but compiler crash is because of recursion at line 10 |
15:18:03 | FromGitter | <Varriount> @dandevelo Use a ref as that generic parameter |
15:18:23 | FromGitter | <Yardanico> so it will be ref of ref ? :D |
15:18:40 | FromGitter | <Yardanico> because FirstControl itself is a ref |
15:19:57 | FromGitter | <dandevelo> So the question is how do we get rid of that recursion at line 10 |
15:21:43 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8950732e080696e49e9c9] |
15:21:46 | FromGitter | <alehander42> use concepts |
15:21:52 | FromGitter | <Yardanico> ohhh |
15:22:13 | FromGitter | <Yardanico> @alehander42 fancy stuff ! :) |
15:22:32 | FromGitter | <Yardanico> ah no |
15:22:32 | FromGitter | <Yardanico> wait |
15:22:36 | FromGitter | <Yardanico> he can't use that |
15:22:53 | FromGitter | <Yardanico> @dandevelo said that he need to be able to change handlers |
15:23:00 | FromGitter | <dandevelo> Yes, that's the thing |
15:23:12 | FromGitter | <Yardanico> you couldn't do that at runtime with concepts |
15:23:23 | FromGitter | <alehander42> so you want to be able to do `ctrl1.onKeyPress = handler` ? |
15:23:29 | FromGitter | <dandevelo> Right |
15:24:12 | FromGitter | <mratsim> You can store a concept proc as a closure no? |
15:24:38 | FromGitter | <Yardanico> well you can |
15:24:48 | FromGitter | <Yardanico> but you can't change a handler of a type at runtime |
15:24:54 | FromGitter | <mratsim> The current limitation in concept is to do a collection of heterogenous types |
15:24:56 | FromGitter | <Yardanico> because concepts are resolved at compile-time |
15:25:20 | FromGitter | <Yardanico> @mratsim e.g change the keypress handler of ctrl1 object at runtime |
15:25:26 | FromGitter | <mratsim> But the proc type signature is the same so if only implementation changes it's ok? |
15:26:29 | FromGitter | <Yardanico> well I can't explain why it isn't possible, but it's not possible AFAIK :) |
15:26:37 | FromGitter | <Yardanico> because all this stuff is compiletime anyway |
15:27:26 | FromGitter | <mratsim> Na it is, if type signature for all handlers of a type is the same they can all be stored in a field |
15:27:54 | FromGitter | <mratsim> The only question is about recursion |
15:27:57 | FromGitter | <Yardanico> can you show an example how that would work? :) |
15:28:24 | FromGitter | <mratsim> Going home first, wait for a bit |
15:28:48 | FromGitter | <stisa> maybe look at how stream does it? https://nim-lang.org/docs/streams.html |
15:29:19 | FromGitter | <Yardanico> yeah, streams way is the most efficient one |
15:29:34 | FromGitter | <Yardanico> nim-way of writing *interfaces* :) |
15:29:43 | FromGitter | <Yardanico> and it's the most efficient way to do that |
15:29:45 | * | gokr quit (Ping timeout: 246 seconds) |
15:29:57 | * | jjido quit (Ping timeout: 240 seconds) |
15:32:47 | FromGitter | <lguzzon> here my dime on the table: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8979f210ac2692053287c] |
15:33:35 | * | UxerUospr quit (Quit: leaving) |
15:35:57 | * | PMunch quit (Quit: Leaving) |
15:37:14 | * | UxerUospr joined #nim |
15:37:29 | FromGitter | <alehander42> you can do ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ but I admit that's not too great [https://gitter.im/nim-lang/Nim?at=59f898b9f7299e8f5355722c] |
15:38:35 | FromGitter | <data-man> https://github.com/xomachine/metaevents ? |
15:39:34 | FromGitter | <Yardanico> lol |
15:39:45 | FromGitter | <Yardanico> If you can't acces some website on Chrome because of invalid HSTS |
15:39:50 | FromGitter | <Yardanico> you can type "badidea" in that chrome window |
15:39:53 | FromGitter | <Yardanico> and it will load this page :P |
15:40:34 | * | abc joined #nim |
15:40:58 | * | abc is now known as Guest6875 |
15:41:07 | FromGitter | <Yardanico> https://chromium.googlesource.com/chromium/src/+/90b6605758feea9d4f2a56ad3f6992e1e868b445/components/security_interstitials/core/browser/resources/interstitial_v2.js |
15:42:14 | Guest6875 | Hi, I am new to Nim. Just downloaded it and tried to send get request. I get this error on running the code `Error: unhandled exception: No such host is known`. The website is correct and I can send GET through other programming languages. That link just redirects to another link. |
15:42:57 | FromGitter | <andreaferretti> @Yardanico cool! Not that I have a page to test this :-) |
15:43:45 | FromGitter | <dandevelo> @lguzzon I am not sure how to call onKeyPress with your example |
15:44:34 | FromGitter | <dandevelo> This is because the self parameter is a FirstControl_Fields |
15:46:41 | FromGitter | <Yardanico> Guest6875: what's the url? |
15:47:28 | Guest6875 | https://amizone.net/ |
15:48:57 | FromGitter | <dandevelo> @alehander42 this might work, reading now to understand the concepts part |
15:50:22 | Guest6875 | I just ran this code - var client = newHttpClient() var response = client.get("https://amizone.net/") |
15:51:57 | Guest6875 | and compiling with `-d:ssl` |
15:52:25 | FromGitter | <dandevelo> @Yardanico @stisa going to take a look at the streams approach |
15:53:10 | FromGitter | <Yardanico> Guest6875: hmm, happens to me too, it can be either one on these: misconfiguration of this server, or bug in httpclient :) report it to github issues |
15:53:31 | FromGitter | <Yardanico> or bug in net/nativesockets |
15:54:46 | Guest6875 | No github account, sorry. Can someone else open the issue please. |
15:55:28 | FromGitter | <Yardanico> ok |
15:55:52 | federico3 | I'll do it |
15:56:10 | FromGitter | <Yardanico> ok, do it :) |
15:56:23 | Guest6875 | thanks! |
15:57:58 | FromGitter | <stisa> strange, doing the request on `https://amizone.net/amizone/` seem to work |
15:58:26 | Guest6875 | Yeah. |
15:58:50 | Guest6875 | Using dart as well as Red, the GET request works on "https://amizone.net/" also |
15:58:53 | FromGitter | <Gooseus> is quite strange... fails if use just http as well |
15:59:10 | FromGitter | <gogolxdong> what is the right way to translate ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=59f89dce210ac26920534f94] |
15:59:17 | federico3 | getaddrinfo is failing before the connect |
15:59:37 | FromGitter | <Yardanico> yep |
15:59:42 | FromGitter | <Yardanico> and a strange thing |
15:59:49 | FromGitter | <Yardanico> for some reason nim tries to resolve amizone.netamizone |
15:59:54 | federico3 | getaddrinfo returns -2 |
15:59:58 | FromGitter | <Yardanico> after tring amizone.net |
16:00:00 | FromGitter | <Yardanico> *trying |
16:00:47 | FromGitter | <Yardanico> yeah it successes 0_0 |
16:00:50 | FromGitter | <Yardanico> or wait |
16:01:44 | FromGitter | <Yardanico> try to echo address at line 1537 in net.nim |
16:01:54 | FromGitter | <Yardanico> it would echo it - so it succedes |
16:02:02 | FromGitter | <lguzzon> @dandevelo ⏎ https://play.nim-lang.org/?gist=05423cd1a2a1f6afb5f42a9cc2953318 |
16:02:04 | FromGitter | <Gooseus> @Varriount let me know your feedback on the nimaws from yesterday, was hoping to clean it up some more today |
16:03:40 | FromGitter | <Yardanico> federico: will you make an issue? or you already fixed it? :D |
16:03:57 | FromGitter | <dandevelo> Thanks @lguzzon looks like a little bit of code to write in case of more than 2 handlers |
16:04:10 | federico3 | Yardanico: almost |
16:07:15 | FromGitter | <Yardanico> 47 issues to close |
16:07:20 | FromGitter | <Yardanico> to have 3k closed issues :) |
16:09:57 | GitDisc | <GooRoo> @Yardanico JFYI: whenever you see C++, 120k and Berlin in one sentence, you can most certainly say it's a job in think-cell |
16:10:58 | GitDisc | <GooRoo> their ad is everywhere |
16:16:58 | FromGitter | <data-man> @subsetpark: my progress on the Nim support in the ctags is here: https://github.com/data-man/ctags/tree/nim_support ⏎ While the Nim parser is simply copied from Python. :) |
16:22:12 | * | Arrrr joined #nim |
16:22:12 | * | Arrrr quit (Changing host) |
16:22:12 | * | Arrrr joined #nim |
16:29:59 | * | gokr joined #nim |
16:37:32 | FromGitter | <dandevelo> @Yardanico @stisa I guess this is how it looks with the "streams" approach: https://gist.github.com/0a23d4cabb1edc42689f2657182991a0 |
16:37:48 | miran__ | Yardanico: we celebrate 3K closed issues with v1.0? :P |
16:46:00 | FromGitter | <dandevelo> Shorter version here: https://gist.github.com/7eec565e7157db7eddda3fc3c94970cd |
16:59:21 | * | floppydh quit (Quit: WeeChat 1.9.1) |
17:01:57 | * | Guest6875 quit (Quit: Page closed) |
17:04:00 | * | arnetheduck quit (Ping timeout: 248 seconds) |
17:08:08 | * | vivus joined #nim |
17:09:52 | * | JappleAck quit (Ping timeout: 252 seconds) |
17:12:03 | * | slim_jim_jiss quit (Remote host closed the connection) |
17:12:26 | * | slim_jim_jiss joined #nim |
17:12:34 | * | guelosk quit (Ping timeout: 260 seconds) |
17:20:56 | * | Ven joined #nim |
17:21:21 | * | Ven is now known as Guest12701 |
17:24:25 | * | PMunch joined #nim |
17:27:11 | * | JappleAck joined #nim |
17:36:27 | * | elrood quit (Quit: Leaving) |
17:50:25 | * | Vladar quit (Remote host closed the connection) |
17:51:20 | FromGitter | <mratsim> @dandevelo @yardanico Alternative with closure. You can metaprogramm the hell out of that too: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8b8184ff065ac189bd5fd] |
17:52:05 | FromGitter | <mratsim> @dandevelo I think it would be great if you put your problems and all the solutions on the forum, so that people can compare and we can show to new people how things can be done. |
17:52:21 | * | Jesin quit (Quit: Leaving) |
17:55:52 | * | Jesin joined #nim |
17:57:40 | * | yglukhov quit (Remote host closed the connection) |
17:58:16 | * | yglukhov joined #nim |
18:00:38 | FromGitter | <dandevelo> @mratsim that is a good idea |
18:00:50 | * | Trustable quit (Remote host closed the connection) |
18:00:59 | FromGitter | <mratsim> @dandevelo Metaprogrammed alternative, 23 lines ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8ba5ab20c6424296eff40] |
18:01:40 | FromGitter | <cabhishek> @mratsim My talk went well, got some good feedback which I'll incorporate in my next talk. Also, people were curious after the talk as no one had heard of Nim. There were few talks about making python fast/performant/type safe etc which acted as a segway for my talk on Nim |
18:01:53 | FromGitter | <mratsim> cool =) |
18:01:55 | FromGitter | <Yardanico> @cabhishek video ? :) |
18:02:07 | * | yglukhov quit (Read error: Connection reset by peer) |
18:02:14 | FromGitter | <mratsim> I saw Netflix Vectorflow by the way, i’m gonna eat that cake as well ;) |
18:02:25 | * | yglukhov joined #nim |
18:06:05 | * | dandevelo quit (Remote host closed the connection) |
18:06:57 | * | yglukhov quit (Ping timeout: 248 seconds) |
18:13:57 | * | gokr quit (Ping timeout: 240 seconds) |
18:17:03 | * | nsf joined #nim |
18:23:47 | * | slim_jim_jiss quit (Ping timeout: 246 seconds) |
18:29:09 | shashlick | dom96: does choosenim support proxies? I have http_proxy defined in env but choosenim is unable to connect |
18:31:44 | shashlick | the error I get is "Error: unhandled exception: No such host is known." |
18:34:53 | * | Vladar joined #nim |
18:35:47 | FromGitter | <Yardanico> say goodbye to our travis and appveyor :P |
18:36:05 | FromGitter | <Yardanico> 10 PRs in ONE HOUR |
18:36:06 | FromGitter | <Yardanico> :D |
18:38:56 | * | zolk3ri joined #nim |
18:47:45 | FromGitter | <mratsim> Travis has “Linux capacity issue” yesterday :/ |
18:48:19 | FromGitter | <data-man> 13 MuaHaHa :) |
18:49:16 | * | Guest12701 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:51:15 | federico3 | Yardanico when is the hour starting precisely? |
18:53:59 | FromGitter | <Yardanico> all these PRs |
18:54:00 | FromGitter | <Yardanico> (https://files.gitter.im/nim-lang/Nim/o01l/image.png) |
18:54:11 | FromGitter | <Yardanico> 11 already |
18:54:47 | federico3 | Yardanico PRs.inc ;) |
18:55:01 | FromGitter | <Yardanico> lol |
18:55:01 | FromGitter | <Yardanico> 12 |
18:55:06 | FromGitter | <Yardanico> well 11 already |
18:55:12 | FromGitter | <Yardanico> bitops was created at 20:52 (my time) |
18:55:18 | FromGitter | <Yardanico> now it's 21:55 |
18:55:47 | federico3 | hah! |
18:56:09 | * | yglukhov joined #nim |
18:56:28 | FromGitter | <cabhishek> @mratsim sounds good! I know the lead developer of vector flow incase you want his contact :) |
18:56:58 | * | yglukhov quit (Remote host closed the connection) |
18:57:12 | * | yglukhov joined #nim |
18:59:09 | * | yglukhov quit (Read error: Connection reset by peer) |
18:59:45 | * | yglukhov joined #nim |
19:14:35 | * | rauss quit (Read error: Connection reset by peer) |
19:16:25 | * | rauss joined #nim |
19:20:03 | FromGitter | <dom96> @shashlick I don't think so, please report an issue |
19:21:14 | FromGitter | <mratsim> @cabi |
19:21:56 | FromGitter | <mratsim> @cabhishek hehe, probably I’ll ask him to brag first when i covered all his use cases ;). |
19:23:58 | FromGitter | <Yardanico> Araq: just if you didn't knew, tester is broken - even if tests are failing it returns 0 :) |
19:25:41 | * | Ven joined #nim |
19:26:05 | * | Ven is now known as Guest53736 |
19:32:33 | * | Vladar quit (Remote host closed the connection) |
19:36:05 | * | Arrrr quit (Ping timeout: 240 seconds) |
19:43:41 | * | gokr joined #nim |
19:51:20 | * | Arrrr joined #nim |
19:51:20 | * | Arrrr quit (Changing host) |
19:51:20 | * | Arrrr joined #nim |
20:00:51 | Araq | yardanico: ouch, I thought I tested against that |
20:12:23 | * | Arrrr quit (Read error: Connection reset by peer) |
20:12:32 | GitDisc | <awr> oh cool when did circular module dependencies become an error? |
20:13:17 | GitDisc | <awr> i had accidentally done a circular dependency a while ago and, well, it breaks things |
20:13:57 | GitDisc | <awr> took me a while to track down what i was doing wrong |
20:19:12 | GitDisc | <awr> oh wait |
20:19:15 | GitDisc | <awr> what the hell |
20:19:38 | GitDisc | <awr> https://glot.io/snippets/ev2e2q930s |
20:26:23 | GitDisc | <awr> it only seems to error if `import b` precedes `let x* = 3` |
20:28:25 | * | Guest53736 is now known as Ven`` |
20:32:08 | FromGitter | <Gooseus> hey neat, node 8.9 is now LTS, so looks like I can start using async/await there as well |
20:33:05 | Araq | awr: Nothing really changed recently wrt recursive module deps |
20:33:13 | Araq | we added some detection |
20:33:19 | Araq | they never worked reliably |
20:33:34 | Araq | no regressions were reported, you're late |
20:34:17 | Araq | actually, devel now supports breaking up cycles via "Package scoped types" |
20:46:56 | FromGitter | <Gooseus> so question, this node 8.9 release has a new piece called N-API which provides a simple api for writing c/c++ v8 plugins... think this has any relevance here? https://medium.com/the-node-js-collection/n-api-next-generation-node-js-apis-for-native-modules-169af5235b06 |
20:54:39 | Araq | maybe, but I see Nim's value in standing on its own feet, not as means to expand the frightening node.js even further |
20:54:47 | * | PMunch quit (Quit: leaving) |
21:00:48 | FromGitter | <Gooseus> yeah, true, I was thinking that using Nim as a bridge to C for the node community would bring in a lot of interest and maybe you could get some converts and more library/core devs |
21:03:07 | * | Argon joined #nim |
21:03:57 | * | UxerUospr quit (Quit: leaving) |
21:04:54 | * | Argon left #nim (#nim) |
21:09:57 | FromGitter | <Yardanico> Araq: how to compiler C sources for a specific os? build.sh doesn't auto detect termux (android). I remember it's something like "sh build.sh --os:android" |
21:11:04 | * | couven92 joined #nim |
21:11:57 | * | miran__ quit (Ping timeout: 260 seconds) |
21:12:25 | FromGitter | <Yardanico> Ah nvm |
21:12:31 | FromGitter | <Yardanico> It's --os android |
21:16:13 | couven92 | yeah @Yardanico sorry doing --os space osname was just simpler to code into the `build.sh` |
21:16:55 | couven92 | I don't do shell! :P Only plain old Windows Command Prompt! cmd FTW!!!! :D |
21:17:18 | * | couven92 ducks pending incoming hits |
21:18:40 | * | smt` quit (Ping timeout: 258 seconds) |
21:19:28 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
21:19:56 | * | nsf quit (Quit: WeeChat 1.9.1) |
21:20:02 | FromGitter | <Yardanico> Couven92 what option I need to pass to Nim compiler to compile koch? |
21:20:09 | FromGitter | <Yardanico> After I compiled csources |
21:20:18 | couven92 | on android? |
21:20:33 | FromGitter | <Yardanico> Yes |
21:20:37 | couven92 | `nim compile --os:osname koch` |
21:20:58 | couven92 | (or rather `bin/nim compile --os:osname koch` |
21:23:08 | * | Snircle joined #nim |
21:23:51 | FromGitter | <Yardanico> https://gist.github.com/Yardanico/34c7cc4be173786359386eb2a465ce8d hmm, I thought that this one has been fixed |
21:24:27 | FromGitter | <Yardanico> So I should use some option like --shBinPatg |
21:24:38 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:24:45 | FromGitter | <Yardanico> shBinPath, I don't remember the exact name ;) |
21:24:45 | couven92 | uhm that's strange, that really is fixed! |
21:24:59 | couven92 | yeah, that won't work anymore, I removed that |
21:25:09 | couven92 | hang on, let me see |
21:27:00 | FromGitter | <Yardanico> Maybe it was fixed after 0.17.2 ? Hmm |
21:28:23 | FromGitter | <data-man> @Yardanico: Android on real device or emulated? |
21:28:23 | Araq | no |
21:29:45 | couven92 | @Yardanico, https://github.com/nim-lang/Nim/blob/devel/lib/pure/osproc.nim#L770 apparently you can still do `useShPath:/system/bin/sh` |
21:30:25 | couven92 | so then it'll be `nim c -d:useShPath:/system/bin/sh --os:android koch` |
21:31:27 | couven92 | and I'll do a PR to fix this better than it is now :) This is remnant from the time we didn't have the android define symbol |
21:32:19 | couven92 | AH! We added `@if termux` in https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L95 |
21:32:43 | couven92 | that's not good :/ |
21:33:30 | FromGitter | <Yardanico> @data-man real of course, Nim has been ported to android (termux) |
21:34:03 | FromGitter | <Yardanico> In this year |
21:37:31 | couven92 | @Yardanico, so --define:termux is probably the best option to go for... |
21:37:53 | FromGitter | <brentp> I'm trying to do this: ```{.emit:""" ⏎ ⏎ ===define bam_get_qual(b) ((b)->data + ((b)->core.n_cigar<<2) + (b)->core.l_qname + (((b)->core.l_qseq + 1)>>1))=== ⏎ ⏎ """.} ... [https://gitter.im/nim-lang/Nim?at=59f8ed31f7299e8f535777cc] |
21:37:57 | couven92 | However, the /system/bin/sh should always be used on android anyways, so I'll fix that |
21:39:30 | FromGitter | <brentp> @brentp blah this: https://pastebin.ca/raw/3902060 |
21:39:57 | FromGitter | <brentp> but I get `:(.text+0x745): undefined reference to `bam_get_qual'` |
21:43:48 | * | Ven joined #nim |
21:43:49 | FromGitter | <brentp> can I emit a macro like this? |
21:44:11 | * | Ven is now known as Guest77569 |
21:46:05 | FromGitter | <Yardanico> You should use emit in your proc too |
21:46:11 | FromGitter | <Yardanico> To use your C macro |
21:46:11 | couven92 | @Yardanico here you go: https://github.com/nim-lang/Nim/pull/6661 |
21:46:27 | FromGitter | <Yardanico> C macros can't be importc'ed AFAIK |
21:46:45 | couven92 | @Yardanico, yes they can! |
21:46:58 | couven92 | you just must not use dynlib |
21:47:14 | FromGitter | <Yardanico> C macros? |
21:47:16 | FromGitter | <Yardanico> What? |
21:47:42 | couven92 | but you must do: `proc fancypants(): void {.importc: "FANCYPANTS", header: "fancypants.h".}` |
21:47:48 | couven92 | header is important here! |
21:48:39 | FromGitter | <brentp> hmm. ok. |
21:49:15 | FromGitter | <brentp> so I emit and import from the header? |
21:49:42 | FromGitter | <Yardanico> Couven92: but @brentp emits this C macro and importc it the same Nim file |
21:49:50 | FromGitter | <Yardanico> *it in |
21:49:55 | couven92 | oh |
21:50:06 | couven92 | then don't use header, should still work |
21:50:34 | couven92 | importc basically only tells the nim compiler not to mess the name up, if I understand correctly |
21:51:31 | FromGitter | <brentp> so, I'm not following. How would I change the code that I have: https://pastebin.ca/raw/3902060 |
21:52:11 | couven92 | @brentp I apparently cannot open your pastebin link :( |
21:52:19 | couven92 | I get invalid post ID |
21:52:49 | FromGitter | <brentp> https://gist.github.com/brentp/bb97f755387cc250f78015322baad22d |
21:55:47 | couven92 | @brentp this works fine for me |
21:55:49 | couven92 | https://gist.github.com/ae554cdd08b34b6bc3bb8d1e443ffcdb |
21:56:14 | couven92 | (emits a macro for printf and then calls that macro) |
21:59:06 | FromGitter | <data-man> And why didn't anyone remember Halloween today? ⏎ Congratulations! :) |
21:59:44 | FromGitter | <Yardanico> Well as you may know we don't really celebrate it in Russia |
22:00:25 | FromGitter | <brentp> hmm @couven92 I can't get the corresponding thing to work for my problem. will keep looking. |
22:01:01 | FromGitter | <data-man> I know, I'm in Russia :) |
22:02:40 | couven92 | @brentp that's strange |
22:03:00 | FromGitter | <Yardanico> @brentp did you try to write it in Nim? |
22:03:03 | couven92 | Araq, I started with testament HTML, I was blocked immdediately: https://github.com/nim-lang/Nim/issues/6663 |
22:03:08 | FromGitter | <Yardanico> E.g without emit |
22:03:27 | couven92 | @Yardanico can you tag that issue with `crash` label please |
22:04:25 | couven92 | thanks! :) |
22:06:17 | FromGitter | <Yardanico> Well I labeled it before I saw your message :) |
22:06:43 | couven92 | you're the label master! :) |
22:06:57 | FromGitter | <Yardanico> I use FastHub as a Github client for android btw |
22:11:48 | FromGitter | <Yardanico> Couven92: I labeled it as a regression if it worked with 0.17.2 |
22:12:06 | couven92 | +1 |
22:13:24 | FromGitter | <brentp> got a little farther. I was calling it from an inlined function. that doesn't work. but now it's giving errors inside the macro |
22:13:29 | FromGitter | <brentp> `````` |
22:13:40 | FromGitter | <brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8f594d6c36fca31be643c] |
22:14:16 | FromGitter | <brentp> I guess I'll write it in nim. wanted to avoid hopping around the pointer arithmetic |
22:27:39 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
22:28:47 | * | Guest77569 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:30:20 | * | Ven joined #nim |
22:30:44 | * | Ven is now known as Guest44505 |
22:35:17 | FromGitter | <brentp> by the way. I started learning nim a few months ago. I wrote a simple command-line tool for genomics. |
22:35:23 | FromGitter | <brentp> then people started using it a lot. |
22:35:43 | FromGitter | <brentp> I wrote it up and it's now published here: https://academic.oup.com/bioinformatics/article/4583630 |
22:37:16 | FromGitter | <brentp> https://github.com/brentp/mosdepth |
22:37:24 | * | def-pri-pub joined #nim |
22:39:48 | couven92 | Araq, what is the problem with testament HTML gen? It seems to be working fine for me... (except for nim crashing on compile) |
22:40:15 | couven92 | I should maybe remove CPU and OS though, since they aren't used anymore? |
22:41:28 | * | Trustable joined #nim |
22:48:15 | * | Guest44505 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:52:27 | FromGitter | <zetashift> @brentp How was your experience with Nim in this area? Isn't most user work done with R? |
22:53:56 | * | libman joined #nim |
22:57:45 | FromGitter | <data-man> @brentp: then you need to write like this: "... and hacking in python, go, C, bash, Nim (the best!)" :) |
22:59:24 | Araq | couven92, it takes too much time and seems to be an O(n^2) algorithm |
22:59:42 | couven92 | ah, okay, that I can fix |
22:59:45 | Araq | you iterate over the results in a weird way and I don't understand why, simplify it |
22:59:52 | couven92 | will do |
23:00:06 | Araq | btw your NaN tests fail |
23:00:09 | couven92 | any idea why nim stack overflows while compiling testament |
23:00:11 | Araq | for mingw |
23:00:12 | couven92 | yeah I know |
23:00:34 | couven92 | But TravisCI and AppVeyor didn't catch that in the CI run |
23:00:43 | couven92 | why is that? |
23:01:27 | Araq | I broke the tester, that's why |
23:01:35 | couven92 | I'll just remove the NaN tests and replace with a call to isNan or sth... stringify isn't really that important, detecting Nan is |
23:01:43 | Araq | er nope |
23:01:54 | Araq | stringify needs to produce consistent results |
23:02:00 | couven92 | oh |
23:02:02 | Araq | and we have lots of hacks for that already anyway |
23:02:13 | Araq | only needs a little tweaking |
23:02:15 | couven92 | okay, I'll see into it |
23:02:56 | couven92 | what do you prefer? `NaN` like JavaScript |
23:03:36 | couven92 | maybe a nice infinity unicode rune for INFINITY? :P |
23:04:15 | couven92 | should I care about differentiating between signaling NaN and non-signaling NaN? |
23:06:48 | Araq | no |
23:07:13 | Araq | also it's "nan" and "inf" apparently |
23:07:25 | couven92 | okay fine :) |
23:09:35 | FromGitter | <brentp> Actually the experience was very good I was wrapping a C library and then writing custom stuff on top of that. |
23:11:57 | FromGitter | <brentp> I'm already doing other projects in Nim as well |
23:17:19 | * | zolk3ri quit (Remote host closed the connection) |
23:21:27 | * | tdc quit (Ping timeout: 240 seconds) |
23:23:44 | * | yglukhov quit (Remote host closed the connection) |
23:26:24 | GitDisc | <treeform> Isn't there are like 8 Nans? |
23:27:48 | GitDisc | <treeform> I stand corrected there are 16,777,214 32 bit NaNs. |
23:30:09 | * | vlad1777d quit (Ping timeout: 248 seconds) |
23:36:51 | * | couven92 quit (Quit: Client Disconnecting) |
23:38:28 | * | Trustable quit (Remote host closed the connection) |
23:38:37 | * | couven92 joined #nim |
23:39:41 | FromGitter | <Gooseus> jeez, what a rabbit hole... I just caught the end of this conversation and did some googling after drinking some beers - https://stackoverflow.com/questions/19800415/why-does-ieee-754-reserve-so-many-nan-values |
23:40:57 | * | Sentreen quit (Ping timeout: 240 seconds) |
23:43:33 | federico3 | does anyone has a theaded / async implementation of map/mapIt? |
23:47:39 | * | sleepyqt quit (Remote host closed the connection) |
23:53:45 | * | Sentreen joined #nim |
23:54:14 | Araq | couven92, in fact, the HTML output is slow that Chrome refuses to show the page after a while |
23:59:12 | FromGitter | <mratsim> @federico3, I have an OpenMP implementation but it’s only suitable to non-GCed types |