00:00:42 | * | Jesin joined #nim |
00:00:42 | * | vivus quit (Quit: Leaving) |
00:10:03 | * | Sentreen quit (Quit: WeeChat 1.6) |
00:10:32 | * | couven92 quit (Ping timeout: 260 seconds) |
00:11:13 | * | Sentreen joined #nim |
00:19:37 | * | Sentreen quit (Quit: WeeChat 1.6) |
00:20:03 | * | Sentreen joined #nim |
00:23:43 | * | Sentreen quit (Client Quit) |
00:26:21 | * | Sentreen joined #nim |
00:29:22 | * | Sentreen quit (Client Quit) |
00:29:46 | * | Sentreen joined #nim |
00:30:02 | * | endragor joined #nim |
00:34:05 | * | endragor quit (Ping timeout: 240 seconds) |
00:36:15 | dozn | Jesus, you guys have a nim playground and don't even talk about it on the homepage? The example at the very least should have a link to the playground =b |
00:36:55 | dozn | I was looking for "nim online compiler" the entire time |
00:41:10 | * | mahmudov quit (Quit: Leaving) |
00:41:23 | * | mahmudov joined #nim |
01:06:04 | * | chemist69 quit (Ping timeout: 276 seconds) |
01:19:20 | * | chemist69 joined #nim |
01:34:05 | * | jinshil_ joined #nim |
01:34:45 | * | jinshil quit (Quit: Good-bye!) |
01:34:45 | * | jinshil_ quit (Client Quit) |
01:34:59 | * | jinshil joined #nim |
01:46:38 | mahmudov | https://play.nim-lang.org/ has paste api ? |
02:05:46 | FromGitter | <Sud0nim> @dozn Totally agree - I use and abuse that thing daily at the moment, but it's hard to find |
02:21:35 | FromGitter | <vegansk> @TiberiumN , yes it's possible, but I'm not using jnim on Android so can't help you with it, sorry |
02:23:06 | FromGitter | <zetashift> can somebody help me doing the Nim-way of the toString method of : http://craftinginterpreters.com/scanning.html#location-information |
02:23:49 | FromGitter | <zetashift> I can't figure out how to concatenate the enum and string; Should I overload the '&' operator? |
02:27:33 | FromGitter | <zetashift> currently have only " proc toString*(token: Token): string = " and then I'm hopeless! |
02:32:41 | FromGitter | <Sud0nim> Unless I'm misunderstanding what you need, you should be able to say: $enumType & "hello" |
02:33:02 | FromGitter | <Sud0nim> So just put a '$' in front of the enum to convert it to a string |
02:33:22 | FromGitter | <zetashift> oh sweet |
02:33:57 | FromGitter | <zetashift> it even works for the literal field which is a RootObj! |
02:34:12 | FromGitter | <zetashift> Thank you. :) |
02:34:20 | FromGitter | <Sud0nim> Nim is full of awesome surprises |
02:34:50 | FromGitter | <zetashift> Feels spartan and rewarding |
02:39:52 | * | arnetheduck quit (Ping timeout: 260 seconds) |
03:00:29 | * | pilne quit (Quit: Quitting!) |
03:05:15 | * | mahmudov quit (Remote host closed the connection) |
03:07:56 | * | endragor joined #nim |
03:37:38 | * | def-pri-pub quit (Quit: leaving) |
04:26:10 | * | rauss quit (Ping timeout: 240 seconds) |
04:28:21 | * | rauss joined #nim |
04:35:04 | * | rauss quit (Quit: WeeChat 1.9) |
04:35:25 | * | rauss joined #nim |
04:51:58 | dozn | Yeah, it's such a different type of language from what I'm used to, but the experience has been very rewarding |
04:52:20 | dozn | I do hope v1 will bring on a slew of people who enjoy it as well |
04:52:55 | dozn | I'm a patient man though, I'd rather the language be exactly where Araq wants it, so the first impression is a good one |
04:56:20 | dozn | Forward declarations are a big one personally, I enjoy reading code top-down |
04:56:37 | dozn | I can deal with it regardless of course, but it would be fantastic =) |
05:30:54 | * | Trustable joined #nim |
05:30:58 | * | rauss quit (Quit: WeeChat 1.9) |
05:31:41 | * | Trustable quit (Client Quit) |
05:36:24 | * | tdc joined #nim |
05:41:01 | * | dankrad quit (Ping timeout: 276 seconds) |
05:48:17 | * | Vladar joined #nim |
06:06:24 | * | sz0 joined #nim |
06:20:20 | * | yglukhov joined #nim |
06:24:22 | * | nsf joined #nim |
06:24:28 | * | yglukhov quit (Ping timeout: 240 seconds) |
07:09:23 | * | skrylar joined #nim |
07:10:14 | skrylar | bson module reads all the things now afaik |
07:10:27 | skrylar | just needs some more unit tests |
07:15:42 | * | Ven joined #nim |
07:16:06 | * | Ven is now known as Guest15800 |
07:19:50 | * | Guest15800 quit (Ping timeout: 240 seconds) |
07:25:44 | * | yglukhov joined #nim |
07:30:13 | * | yglukhov quit (Ping timeout: 255 seconds) |
07:31:25 | * | yglukhov joined #nim |
07:39:39 | FromGitter | <TiberiumN> skrylar did you see bson from nimongo? |
07:39:58 | skrylar | i saw there was some binding to a c lib in some subproject |
07:40:06 | skrylar | but nothing in nimble |
07:40:22 | skrylar | this is 100% native nim |
08:03:38 | FromGitter | <TiberiumN> well there's pure nim |
08:03:48 | FromGitter | <TiberiumN> https://github.com/SSPkrolik/nimongo/blob/master/nimongo/bson.nim |
08:04:02 | FromGitter | <TiberiumN> it doesn't depend on any other modules rather stdlib |
08:04:20 | FromGitter | <TiberiumN> well it does (just on simple timeit module) |
08:04:46 | * | couven92 joined #nim |
08:05:26 | * | skrylar shrug. |
08:05:30 | dozn | toml v4 would be important |
08:06:15 | dozn | v0.4* |
08:10:04 | skrylar | toml is ok. bit weird. |
08:13:17 | skrylar | i need to store neural networks on disk and it was either this or ebml |
08:29:23 | * | sz0 quit (Quit: Connection closed for inactivity) |
08:32:05 | * | nattefrost joined #nim |
08:36:14 | * | flyx quit (Quit: ZNC - http://znc.in) |
08:36:49 | * | flyx joined #nim |
08:37:08 | * | flyx quit (Client Quit) |
08:37:29 | * | flyx joined #nim |
08:44:34 | FromGitter | <TiberiumN> hmm, wait, so concepts can be used instead of classes in some cases? |
08:44:53 | * | tankfeeder joined #nim |
08:45:28 | tankfeeder | hi all |
08:45:55 | FromGitter | <TiberiumN> hi! |
08:45:59 | couven92 | hi tankfeeder |
08:48:22 | tankfeeder | https://pastebin.com/SjhdwzVh |
08:48:28 | tankfeeder | this is pseudo like code |
08:48:43 | tankfeeder | is it possible to implement for strings and seq? |
08:49:01 | tankfeeder | in one function |
08:49:20 | FromGitter | <TiberiumN> generics? |
08:49:24 | tankfeeder | do ord only when input is string |
08:49:32 | FromGitter | <TiberiumN> well |
08:49:35 | FromGitter | <TiberiumN> what is data_size? |
08:49:44 | tankfeeder | 3 |
08:49:53 | FromGitter | <TiberiumN> oh wait |
08:49:54 | tankfeeder | mike("abc", 3) |
08:50:01 | tankfeeder | forget to write |
08:51:13 | couven92 | tankfeeder couldn't you use a concept for that? |
08:51:21 | FromGitter | <TiberiumN> hmm |
08:51:22 | FromGitter | <TiberiumN> it works |
08:51:26 | FromGitter | <TiberiumN> but |
08:51:44 | FromGitter | <TiberiumN> https://gist.github.com/zacharycarter/4b3c8e56220d696e12d5997fd7d18bd2 |
08:52:00 | FromGitter | <TiberiumN> so I added "string | seq" and "when data is seq" |
08:52:04 | FromGitter | <TiberiumN> because this would be compile-time check |
08:52:30 | tankfeeder | Tiberium: oh, how it named? i want find it in documentation |
08:52:55 | FromGitter | <TiberiumN> what do you want to find? |
08:52:58 | tankfeeder | this thing "string | seq" |
08:53:03 | FromGitter | <TiberiumN> it's a generic |
08:53:15 | FromGitter | <TiberiumN> https://nim-lang.org/docs/tut2.html#generics |
08:53:27 | FromGitter | <TiberiumN> https://nim-lang.org/docs/manual.html#generics |
08:53:35 | FromGitter | <TiberiumN> The is operator checks for type equivalence at compile time. It is therefore very useful for type specialization within generic code: |
08:54:35 | tankfeeder | i dont see | operator in documentation |
08:54:48 | tankfeeder | https://nim-lang.org/docs/manual.html#pattern-operators-the-operator |
08:54:50 | tankfeeder | this one / |
08:54:52 | FromGitter | <TiberiumN> Nim also allows for type classes and regular types to be specified as type constraints of the generic type parameter: |
08:55:11 | FromGitter | <TiberiumN> scroll a bit after https://nim-lang.org/docs/manual.html#generics-type-classes |
08:55:51 | tankfeeder | ok |
08:56:12 | couven92 | it's actually very nice how C# recntly changed the switch statement to do pattern matching instead... Even though the type checking is done at runtime, not at compiletime :) |
08:56:38 | * | couven92 quit (Quit: Client disconnecting) |
08:57:00 | * | couven92 joined #nim |
08:57:01 | FromGitter | <TiberiumN> I actually realized now that this code (mike) looks like usual python code with "isistance" checks lol |
08:57:12 | FromGitter | <TiberiumN> but everything is checked at compile-time and everything is type safe :) |
08:57:13 | * | skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
08:57:30 | couven92 | yeah, it's fantastic! :D |
08:57:37 | tankfeeder | found |
08:57:37 | tankfeeder | proc onlyIntOrString[T: int|string](x, y: T) = discard |
08:57:41 | tankfeeder | ok |
08:57:44 | FromGitter | <TiberiumN> yep |
08:58:24 | * | skrylar joined #nim |
09:01:31 | * | Ven joined #nim |
09:01:55 | * | Ven is now known as Guest81141 |
09:04:37 | * | smt quit (Ping timeout: 246 seconds) |
09:05:55 | * | jinshil quit (Quit: Good-bye!) |
09:06:40 | couven92 | @TiberiumN, I have looked over your Android test results BTW... First, you haven't installed some of the nimbles that testament uses (zip, opengl and jester) look at .travis.yml for reference... Some of your test failures come from a missing internet connection, some are boehm GC and coro which Araq said we shouldn't bother with yet |
09:07:34 | FromGitter | <TiberiumN> ok, I just didn't knew because I didn't test Nim before |
09:08:09 | FromGitter | <TiberiumN> well IDK about internet connection |
09:08:20 | FromGitter | <TiberiumN> maybe termux went to some state of "sleep" so internet was disabled |
09:08:27 | FromGitter | <TiberiumN> because I've used my phone at the same time |
09:08:34 | * | skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
09:08:35 | * | Guest81141 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:09:06 | couven92 | yeah... maybe... anyways, from what I can see only 3 of your 18 fails are actually relevant for us right now! That's nice! :) |
09:10:01 | couven92 | `coroutines/twait.nim`, `newconfig/tfoo.nim` and `stdlib/tnre.nim` |
09:10:12 | FromGitter | <TiberiumN> nre |
09:10:22 | FromGitter | <TiberiumN> probably because I didn't had pcre installed? |
09:10:37 | couven92 | Oh, yeah that might be! :) |
09:10:47 | couven92 | Okay, down to two then! :D |
09:11:41 | FromGitter | <TiberiumN> https://nim-lang.org/docs/nre.html |
09:11:48 | FromGitter | <TiberiumN> I don't know if we can install nre on termux |
09:11:53 | FromGitter | <TiberiumN> *pcre |
09:12:00 | FromGitter | <TiberiumN> ah |
09:12:02 | FromGitter | <TiberiumN> it seems we can |
09:12:58 | FromGitter | <TiberiumN> yes |
09:13:03 | FromGitter | <TiberiumN> I just ran tnre test itself |
09:13:07 | FromGitter | <TiberiumN> everything is OK |
09:13:13 | couven92 | great! :) |
09:14:08 | FromGitter | <TiberiumN> on "tfoo" it says that createDir is undeclared at lib/pure/ospaths.nim(548, 12) |
09:14:31 | couven92 | yeah... I have a feeling where that is coming from... |
09:14:38 | FromGitter | <TiberiumN> elif defined(android): |
09:14:41 | FromGitter | <TiberiumN> yep |
09:15:59 | couven92 | yeah... that's my wrong-doing... uhm... |
09:17:07 | * | mahmudov joined #nim |
09:20:11 | couven92 | Uhm, Araq, how should I deal with createDir not being declared yet in ospaths.nim for android? Remember I try to create the temp dir when it's not there? |
09:21:19 | * | Ven_ joined #nim |
09:35:51 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:45:41 | * | Arrrr joined #nim |
09:45:41 | * | Arrrr quit (Changing host) |
09:45:41 | * | Arrrr joined #nim |
09:47:39 | Arrrr | Are exceptions for bad engineers? |
09:54:48 | Araq_ | no, they are for IO failures |
09:56:11 | couven92 | Araq_, actually regarding the createDir not being declared... Is that maybe because of nimscript? |
09:56:25 | * | Arrrr quit (Read error: Connection reset by peer) |
09:57:15 | couven92 | because stuff like nimble compiles fine, but running for example `nim e tests/test_nimscript.nims` fails... |
10:01:25 | Araq_ | I'm not sure but os.nim needs to be fixed, it imports ospaths and includes it at the same time |
10:02:23 | couven92 | yeah... I'm trying to circumvent createDir with `when declared(os):` for now... that should help |
10:02:34 | couven92 | btw, what's up with your nick Araq_? |
10:06:18 | * | Araq_ is now known as Araq |
10:06:42 | couven92 | now that's much better! :) |
10:25:45 | couven92 | Araq, what is coro? and why doesn't it work on Android? Or rather, why did you say that we shouldn't worry much about that? |
10:43:30 | * | arnetheduck joined #nim |
10:45:41 | * | haha_ joined #nim |
10:48:46 | Araq | coroutine support for Nim |
10:49:05 | Araq | but it's broken on OSX as well and nobody is working on it, unfortunately |
10:49:49 | FromGitter | <TiberiumN> coroutine like in go and another languages? |
10:50:58 | couven92 | okay... not my area of expertise, so I'll pass on that, too... sorry... What about VM not being great on x86? I'm cross-compiling Nim right now on Windows to produce x86 Nim and going to run testament for that to see if the same error occur outside of android as well |
10:53:06 | FromGitter | <TiberiumN> are these coroutines multithreaded? so they can run on different threads? |
11:03:15 | FromGitter | <TiberiumN> lol |
11:03:16 | FromGitter | <TiberiumN> When comparing D vs Nim, the Slant community recommends Nim for most people. In the question“What is the best programming language to learn first?” Nim is ranked 20th while D is ranked 21st. The most important reason people chose Nim is: |
11:03:25 | FromGitter | <TiberiumN> https://www.slant.co/versus/118/395/~d_vs_nim |
11:03:30 | FromGitter | <TiberiumN> but we can add a lot to "pros" :) |
11:06:24 | FromGitter | <TiberiumN> omg, almost everything from D cons can be added to nim |
11:16:15 | * | dddddd joined #nim |
11:51:45 | * | enthus1ast- quit (Remote host closed the connection) |
11:52:32 | * | maxcroud joined #nim |
11:53:15 | * | krux02 joined #nim |
11:54:42 | krux02 | Araq: How do you think to fix the echo with binary zeros in the string? |
12:02:23 | * | Nimbecile joined #nim |
12:03:40 | maxcroud | Hello. I've tried to wrap C printf function. Then I've faced with absence of C variadic arguments in Nim. Is there a better way to implement such a procedure? My option uses emit pragmas to operate with varargs list. https://pastebin.com/7C4TtJeL |
12:03:58 | * | Nimbecile left #nim (#nim) |
12:04:16 | FromGitter | <TiberiumN> there are variadic arguments |
12:04:16 | couven92 | maxcroud, use echo? |
12:04:36 | FromGitter | <TiberiumN> also yes, why not echo? |
12:04:52 | couven92 | why would you explicitly want to printf? |
12:05:08 | maxcroud | Because echo doesn't support complex formatting. Look at the code example |
12:05:16 | FromGitter | <TiberiumN> use strutils |
12:05:24 | FromGitter | <TiberiumN> and logging library |
12:06:07 | FromGitter | <TiberiumN> but I don't know about stuff like %08x |
12:06:14 | maxcroud | Okay. I didn't find in strutils or logging supporting such stuff %08x |
12:06:41 | FromGitter | <TiberiumN> there is however third-party library if you're ok with that |
12:06:57 | FromGitter | <TiberiumN> nimble install strfmt |
12:06:59 | FromGitter | <TiberiumN> https://bitbucket.org/lyro/strfmt/src/f8afe166924f479e99ad08ecebda51585c8bb744/strfmt.nim?at=default&fileviewer=file-view-default |
12:07:18 | FromGitter | <TiberiumN> The syntax of the format specification string is similar to ⏎ ⏎ ---`Python's Format Specification Mini-Language--- ⏎ ⏎ ---<https://docs.python.org/3.4/library/string.html#formatspec>`_.--- [https://gitter.im/nim-lang/Nim?at=598857f5614889d47526b089] |
12:12:50 | Araq | formatFloat is better than weird chars in the format string and the precision is not related to i18n anyway, so it's a mistake to conflate these two things |
12:13:24 | Araq | krux02: there is a github issue for that, describing the implementation |
12:16:52 | couven92 | Araq, should I make issues for the 32-bit VM failures? I get them also when I run testament on x86 Windows |
12:17:04 | couven92 | just so that we remember doing that? |
12:17:10 | Araq | yes me too, I tried to tell you yesterday |
12:17:25 | Araq | I'm aware of them but an official bug report cannot hurt |
12:17:41 | Araq | in fact, these are regressions |
12:18:14 | couven92 | yeah, I just wanted to make sure we get exactly the same error outside of Android... To make sure we're not hitting some weird Android-only issues as well |
12:18:36 | couven92 | one test too many can never hurt, right ;) |
12:19:13 | krux02 | Araq: what should `$` on an array of '\0' characters become? |
12:20:17 | krux02 | I think "[,,,,,]" is fine and very distinguishable from "[ , , , , , ]" (array of spaces) |
12:21:27 | * | dozn quit (Ping timeout: 240 seconds) |
12:23:31 | Araq | well the \0 in general should be some Unicode blank/filler |
12:24:03 | Araq | it's not different from \1 or any ascii control char really |
12:25:08 | Araq | and I don't want $ to handle it, that's the terminal emulator's business |
12:25:36 | Araq | and if it fails, I can still redirect the output to an editor that can show it properly |
12:25:53 | krux02 | ok I think I understand |
12:26:11 | krux02 | at the moment echo redirectos to printf (afaik) |
12:26:38 | krux02 | I see if printf has something that does not stop printing at \0 |
12:27:35 | * | mahmudov quit (Ping timeout: 240 seconds) |
12:28:55 | Araq | fputs() could also be used |
12:30:09 | * | Nimbecile joined #nim |
12:36:19 | Nimbecile | I'm struggling a bit with user defined operators...what is their scope? I see examples where inside procedures the "." is treated as a object dereference operator...the custom definition does not seem to apply. Outside the proc, the custom definition applies. |
12:41:15 | Nimbecile | if the "signature" for the custom operator is the same as the built-in, how does compiler decide which to use? |
12:44:37 | krux02 | Araq: fwrite is the function to be used |
12:46:48 | Araq | krux02: please check it has the right buffering behaviour too |
12:47:13 | Araq | and Windows probably has its own buffer behaviour, ignoring what Ansi C says :P |
12:48:32 | FromGitter | <timmyjose> @Nimbecile That is a cool name! :D |
12:50:34 | Araq | Nimbecile: hmm? what's the question? the rule is: the types are used to figure out the "best" match |
12:51:06 | Araq | if there are 2 best matches but one is the module's own, then this is picked |
12:51:33 | Nimbecile | @FromGitter one of my few creative moments :) it also accurately indicates my level of proficiency |
12:51:34 | FromGitter | Nimbecile, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
12:52:58 | FromGitter | <timmyjose> Hahaha |
12:54:27 | * | Snircle joined #nim |
12:55:24 | maxcroud | Is it possible to cast NimNode to varargs[untyped] in macro? |
12:56:06 | maxcroud | ```macro debug(format: string{lit}, args: varargs[untyped]): untyped = result = strVal(format).fmt(args)``` |
12:58:19 | Nimbecile | araq my question relates to the winim module...it creates a custom "." definition that takes a com object, a method, and optional args and calls invoke. If I want to dereference the com object to get it's "disp" member, the compiler applies custom operator and thinks I want to invoke "disp" method which does not exist. Can I tell the compiler which operator I want to use? |
13:04:46 | Araq | maxcroud: they are NimNode in the macro body |
13:05:19 | Araq | Nimbecile: ugh, tough nut, winim shouldn't have used overloaded '.' (I don't like these at all) |
13:05:59 | Araq | in fact, this whole project is a pain, it's not its job to make Nim look like VB |
13:06:10 | maxcroud | Araq: yes, they are. But how I can wrap `fmt` macro? |
13:07:00 | Araq | that's not how macros work, better use a template until you're enlightened :P |
13:07:21 | Araq | you don't call 'fmt', you create an AST that calls 'fmt' |
13:12:02 | Araq | but it's easier to do in a template |
13:13:07 | Nimbecile | Araq when they pass a com object as a parameter to a procedure, within that procedure it appears to treat the "." as a dereference operator. Does the procedure scope exclude custom definitions? I can tell you don't like talking about winim, but just trying to understand programming concepts exposed there. |
13:13:48 | Araq | I think it's this: |
13:14:01 | maxcroud | Yes. Thank you Araq! I did it. I I did not even think about the templates, because I got confused about what is being expanded earlier |
13:14:32 | Araq | proc foo*(o: Obj): T = o.foo # foo is a private field in 'Obj' |
13:15:07 | Araq | the rule is "builtin dot access preferred" but when you're outside the module, the private field is invisible and so the foo getter is called instead |
13:17:14 | Nimbecile | Araq Thanks! |
13:31:59 | * | krux02 quit (Remote host closed the connection) |
13:39:24 | * | rauss joined #nim |
13:53:14 | * | salewski joined #nim |
13:55:47 | salewski | When I have a macro similar to https://github.com/StefanSalewski/gintro/blob/master/tests/gen.nim#L947 |
13:56:01 | salewski | with first parameter: widget: gobject.Object; |
13:57:04 | salewski | It is possible to write something like "if widget is Button:" at the beginning of the macro? |
13:57:42 | salewski | Of course that makes not much sense, as widget is a NimNode in the macro, I know. |
13:58:11 | salewski | But later in the quote do: section I can cast to the real widget type. |
13:58:25 | salewski | But I want to get the exact type earlier. |
13:58:38 | * | Nimbecile quit (Ping timeout: 240 seconds) |
14:01:32 | Araq | let x = widget.getType() |
14:01:57 | Araq | if sameTypes(x, bindSym"Button"): ... |
14:02:22 | salewski | Thanks. |
14:06:50 | salewski | Araq, works great. But name is sameType() without terminating s. |
14:07:49 | Araq | right |
14:08:32 | salewski | I have seen your forum comment to my latest thread. But I think I will just use a array of strings and do a search. |
14:08:35 | salewski | Bye. |
14:09:04 | * | salewski quit (Quit: WeeChat 1.4) |
14:12:27 | Araq | you should really get a bouncer |
14:16:02 | couven92 | Araq, I opened https://github.com/nim-lang/Nim/issues/6197 for the vm issue... I have written my findings from running testament on Android ARMv7 and x86 Windows. There might be more, but we can add that as this gets adressed? |
14:18:09 | Araq | sure |
14:28:42 | FromGitter | <cooldome> Hi Araq, I have posted a question on TIdTables in compiler on the forum. If you could please have a look |
14:28:59 | FromGitter | <TiberiumN> is there any good IRC clients for mac? |
14:29:44 | * | couven92 quit (Quit: Client disconnecting) |
14:30:21 | flyx | TiberiumN: Textual |
14:30:27 | FromGitter | <TiberiumN> ok, thanks |
14:30:42 | flyx | open source if you can build it; can also be bought for money |
14:30:58 | FromGitter | <TiberiumN> yeah I saw that, pretty common thing |
14:31:03 | FromGitter | <TiberiumN> even on android |
14:31:07 | FromGitter | <TiberiumN> or mac :) |
14:33:49 | Araq | cooldome: idTableGet() (sucks, I know, the compiler predates generics) |
14:35:59 | yglukhov | dom96: pls check out https://github.com/nim-lang/nimble/pull/385 |
14:38:44 | * | mahmudov joined #nim |
14:40:33 | * | adeohluwa joined #nim |
14:42:40 | FromGitter | <cooldome> @Araq: it is clear that it is old code and not type safe, just please explain how to contruct a key for now |
14:43:02 | Araq | let concrete = PType(idTableGet(key)) |
14:43:13 | Araq | you can find an example in sigmatch.nim |
14:44:56 | FromGitter | <cooldome> this piece is clear, I don't undestand how to get key in your example |
14:46:26 | Araq | well you need to "have" it just like for every other lookup data structure |
14:46:28 | FromGitter | <cooldome> the key for the return type |
14:47:56 | * | nattefrost quit (Remote host closed the connection) |
14:48:21 | FromGitter | <cooldome> It is clear that the key is somewhere in TCandidate, but I don't know the code well enough get to the actual answer |
14:59:56 | * | PMunch joined #nim |
15:08:30 | * | Tiberium joined #nim |
15:09:48 | * | Tiberium quit (Client Quit) |
15:10:00 | * | Tiberium joined #nim |
15:14:35 | * | endragor quit (Remote host closed the connection) |
15:14:53 | * | Trustable joined #nim |
15:18:43 | Araq | the return type of a proc is t.sons[0] |
15:19:00 | * | Tiberium left #nim ("Textual IRC Client: www.textualapp.com") |
15:19:13 | * | Tiberium joined #nim |
15:20:13 | Tiberium | flyx, thanks for suggestion, compiled and installed it :) |
15:20:26 | * | endragor joined #nim |
15:23:45 | * | dave24 quit (Ping timeout: 248 seconds) |
15:24:35 | * | dave24 joined #nim |
15:24:49 | * | endragor quit (Ping timeout: 248 seconds) |
15:29:23 | * | v17d joined #nim |
15:32:02 | dom96 | yglukhov: Reviewed. Iterators plz. |
15:32:23 | yglukhov | dom96: thats what i wanted to do, but they can't be recursive :( |
15:33:25 | dom96 | D: |
15:37:15 | * | krux02 joined #nim |
15:37:22 | krux02 | Araq: http://ix.io/yWR |
15:37:29 | krux02 | what do you think? |
15:38:09 | krux02 | with that code a string "abc\0def" is printed with 7 characters |
15:38:56 | Araq | that's not threadsafe |
15:40:59 | * | ofelas joined #nim |
15:41:11 | krux02 | what do you mean? |
15:42:03 | * | smt joined #nim |
15:42:30 | krux02 | was printing from different threads ever threadsafe? |
15:44:55 | Araq | the point is that: |
15:45:06 | Araq | thread A: echo "a", "b" |
15:45:13 | Araq | thread B: echo "c", "d" |
15:45:21 | Araq | never can produce as output: |
15:45:27 | Araq | acbd |
15:45:56 | Araq | only abcd or cdab are allowed |
15:46:45 | Araq | you need to do some explicit file locking for your solution to work |
15:47:00 | Araq | posix flock call or whatever |
15:47:53 | Araq | note that echo "a", "b" is different from echo "a"; echo "b" even if ignore the different newlines |
15:48:33 | * | ofelas quit (Quit: shutdown -h now) |
15:49:57 | krux02 | http://ix.io/yWT |
15:50:39 | Araq | that doesn't work if the argument passed to 'echo' raises an exception :P |
15:50:40 | * | ofelas joined #nim |
15:50:48 | Araq | better use an AST rewrite internally |
15:50:59 | * | yglukhov quit (Remote host closed the connection) |
15:51:23 | krux02 | wat? |
15:52:56 | krux02 | how about putting the implementation in sysstr.nim? |
15:52:56 | subsetpark | dom96: a while ago we had been talking about how to run multithreaded code within a jester handler... seems like the solution we had come up with doesn't actually work as intended |
15:53:57 | Araq | krux02: sysio sounds better for that |
15:53:58 | subsetpark | i have a while(true) checking for flowVar.isReady, and if not `yield sleepAsync 1` - but it never actually kicks control back to the event handler loop that way |
15:57:26 | subsetpark | Any other thoughts? |
15:58:44 | subsetpark | or Araq too - generally, how to dispatch a thread in an async proc, check for result of the flowVar, and efficiently yield to the event handler if not ready? |
15:59:56 | Araq | subsetpark: wait for the next upcoming version of 'spawn' or create your own thread pool (not that much work), sorry. |
16:00:22 | subsetpark | ah :) its not in devel is it? |
16:00:23 | Araq | spawn currently is not good at concurrency, it is allowed to block |
16:01:25 | Araq | "would my code work as 'foo()' instead of 'spawn foo()'?" |
16:01:41 | Araq | if yes, you have parallelism in your code. if no, you have concurrency. |
16:01:51 | Araq | and spawn wasn't written for concurrency. |
16:02:10 | subsetpark | trust me, i know the difference... in this case i am simply trying to combine the two |
16:03:20 | Araq | it's not in devel but yglokhov has it and is usually around. (but not right now) |
16:04:06 | * | yglukhov joined #nim |
16:04:47 | * | yglukhov quit (Remote host closed the connection) |
16:06:40 | * | Ven joined #nim |
16:07:03 | * | Ven is now known as Guest63750 |
16:07:19 | dom96 | You can ensure that a `^` won't block on a FlowVar by using `isReady` |
16:07:24 | dom96 | so spawn can be using with async |
16:07:52 | dom96 | subsetpark: Maybe you should yield a longer sleepAsync time interval? |
16:07:55 | Araq | dom96: that doesn't work according to him though |
16:09:28 | * | Nimbecile joined #nim |
16:10:06 | * | Nimbecile left #nim (#nim) |
16:10:38 | * | arnetheduck quit (Ping timeout: 240 seconds) |
16:11:17 | Tiberium | parallel testament is pretty fast: tests/testament/tester_parallel 268,56s user 25,25s system 213% cpu 2:17,90 total. |
16:11:33 | Tiberium | but low cpu is probably because SQLite |
16:11:37 | subsetpark | It doesn't seem to have anything to do with the interval - even sleeping on 100 still only ever runs one thread at a time |
16:12:01 | * | Guest63750 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:14:36 | * | Ven_ joined #nim |
16:16:03 | dom96 | It definitely works because I am using this in my book's chat application. |
16:16:12 | dom96 | Can you take a look at that? |
16:16:15 | subsetpark | the spawn() itself is not blocking though - i am able to get into the while true: block. |
16:16:21 | subsetpark | yes, dom96, that's what i use for my model |
16:16:38 | subsetpark | is it possible that something in the fact that it's a jester handler is gumming up the works |
16:16:39 | subsetpark | ? |
16:16:56 | subsetpark | Whereas in your example you're calling poll() directly |
16:17:18 | krux02 | Araq: Is there any reason not to implement "echo" with "write" in system.nim? |
16:17:48 | krux02 | and what does benign mean? |
16:18:49 | dom96 | subsetpark: possibly. Can you come up with a small example that fails? |
16:20:19 | * | yglukhov joined #nim |
16:22:30 | subsetpark | sure... |
16:25:04 | * | maxcroud quit (Ping timeout: 260 seconds) |
16:25:12 | krux02 | Araq: well I give up for today, if you want echo to behave the same way as ststem.write, maybe you should implement it. |
16:25:47 | Araq | krux02: the issue description had an implementation ready to go |
16:25:54 | Araq | iirc |
16:28:08 | * | Tiberium quit (Quit: Textual IRC Client: www.textualapp.com) |
16:31:41 | subsetpark | dom96: https://www.irccloud.com/pastebin/pCXcYeEE/ |
16:32:51 | krux02 | well my implementation for echo: http://ix.io/yWY |
16:33:14 | krux02 | no magic no fuzz |
16:33:48 | FromGitter | <TiberiumN> xd ;) |
16:34:39 | * | dankrad joined #nim |
16:34:40 | krux02 | it works, I tested it |
16:35:11 | krux02 | the debug echo could be a problem though |
16:37:06 | Araq | that is not threadsafe |
16:37:41 | subsetpark | dom96: here's how I'm testing: |
16:37:49 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:37:58 | subsetpark | https://www.irccloud.com/pastebin/FmCFx7WE/ |
16:38:56 | subsetpark | (the second line is echoed by httperf; you can ignore it) |
16:39:12 | subsetpark | but it produces output like this: |
16:39:16 | subsetpark | https://www.irccloud.com/pastebin/2QyBEWft/ |
16:40:09 | subsetpark | Where a new request handler is never started before the previous one fully completes |
16:44:53 | * | ofelas quit (Quit: shutdown -h now) |
16:49:23 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
16:55:13 | * | yglukhov quit (Remote host closed the connection) |
16:57:04 | krux02 | Araq: how is that not thread safe? |
16:57:30 | * | yglukhov_ joined #nim |
17:00:11 | * | PMunch quit (Quit: leaving) |
17:01:35 | * | yglukhov_ quit (Ping timeout: 240 seconds) |
17:09:15 | * | krux02 quit (Remote host closed the connection) |
17:12:07 | * | Jesin quit (Quit: Leaving) |
17:12:59 | subsetpark | dom96: any thoughts? |
17:13:52 | * | Ven joined #nim |
17:14:15 | * | Ven is now known as Guest88849 |
17:15:07 | * | ofelas joined #nim |
17:17:37 | * | Jesin joined #nim |
17:33:03 | * | couven92 joined #nim |
17:33:21 | * | yglukhov_ joined #nim |
17:35:06 | * | sakalli joined #nim |
17:37:44 | * | yglukhov_ quit (Ping timeout: 260 seconds) |
17:38:11 | * | Guest88849 is now known as Ven`` |
17:38:13 | * | nhywyll joined #nim |
17:42:50 | * | Ven`` quit (Ping timeout: 240 seconds) |
17:43:52 | * | ipjk joined #nim |
17:44:01 | * | sakalli quit (Remote host closed the connection) |
17:44:08 | * | tdc quit (Ping timeout: 240 seconds) |
17:44:45 | * | Ven_ joined #nim |
17:48:56 | * | sakalli joined #nim |
17:49:21 | * | Ven_ quit (Ping timeout: 248 seconds) |
17:58:51 | couven92 | Araq, geat! :) |
17:59:26 | couven92 | I'll have testament ready in a minute now :) |
18:00:19 | * | endragor joined #nim |
18:04:48 | * | endragor quit (Ping timeout: 260 seconds) |
18:12:59 | subsetpark | what's testament, a new unit testing framework? |
18:15:08 | * | Ven joined #nim |
18:15:31 | * | Ven is now known as Guest20233 |
18:15:31 | * | nsf quit (Quit: WeeChat 1.9) |
18:20:57 | euantor | testament tests the Nim compiler |
18:21:05 | euantor | and stdlib |
18:21:13 | couven92 | euantor, yup |
18:21:56 | FromGitter | <TiberiumN> couven92: multiReplace can be very useful, thanks for it! |
18:22:22 | couven92 | yup! :) My Testament upgrade will make use of it as well |
18:22:30 | * | yglukhov joined #nim |
18:23:15 | FromGitter | <TiberiumN> also I'm waiting for parallel testament upgrade |
18:23:49 | FromGitter | <TiberiumN> because I can run low-priority VM on Azure (with 16 cores and 56gb of ram) and run it here :) ⏎ but sadly low-priority VMs can be deleted in any time (but they're A LOT cheaper than usual VMs) |
18:26:45 | subsetpark | ah ha, got it |
18:41:56 | * | Matthias247 joined #nim |
18:42:26 | couven92 | okay, pretty testament HTML ready for review: https://github.com/nim-lang/Nim/pull/6058 |
18:56:36 | * | Guest20233 quit (Ping timeout: 260 seconds) |
19:01:33 | * | ipjk quit (Quit: Leaving) |
19:06:21 | * | tankfeeder quit (Quit: Connection closed for inactivity) |
19:16:29 | * | tankfeeder joined #nim |
19:19:25 | * | Trustable quit (Remote host closed the connection) |
19:23:16 | * | couven92 quit (Ping timeout: 276 seconds) |
19:24:22 | * | mahmudov quit (Ping timeout: 260 seconds) |
19:26:47 | * | couven92 joined #nim |
19:41:28 | * | Nobabs27 joined #nim |
19:46:25 | * | nsf joined #nim |
19:50:03 | * | mahmudov joined #nim |
19:50:05 | FromGitter | <TiberiumN> https://www.reddit.com/r/nim/comments/6hiijm/implementing_sprintf_in_pure_nim/ ⏎ Oh, I didn't knew before how to use --gc:stack. ⏎ Maybe I should look at https://github.com/samanthadoran/Mero again |
19:50:23 | FromGitter | <TiberiumN> (btw, it compiles with latest nim without any issues IIRC) |
19:51:18 | FromGitter | <TiberiumN> and it also has it's own alloc |
19:53:47 | * | yglukhov quit (Remote host closed the connection) |
19:55:41 | FromGitter | <TiberiumN> hmm, a question - if I import some stdlib module from multiple modules would generated C code contain only 1 copy of stdlib module or many of them? |
19:56:51 | * | couven92 quit (Quit: Client Disconnecting) |
19:58:15 | * | Sentreen quit (Ping timeout: 268 seconds) |
20:01:54 | * | Nobabs27 quit (Quit: Leaving) |
20:02:42 | * | Vladar quit (Quit: Leaving) |
20:12:03 | * | Sentreen joined #nim |
20:12:43 | * | yglukhov joined #nim |
20:16:20 | Araq | TiberiumN: ONly once of course except for os.nim which currently has a bug (uses a wrong include) |
20:17:28 | Araq | couven92: I can merge it now but this sqlite stuff needs to be rethought, see the parallel tester PR |
20:23:08 | FromGitter | <TiberiumN> yeah this tester raises A LOT of exceptions (unhandled) |
20:23:14 | FromGitter | <TiberiumN> about database being locked :) |
20:25:42 | FromGitter | <TiberiumN> but it would be very cool anyway |
20:26:06 | FromGitter | <TiberiumN> because almost every user nowadays has 4 or even 8-core CPU (for nim development and testing it will be much faster) |
20:26:23 | FromGitter | <TiberiumN> heck, even my phone has 8 cores and instead of 1 hrs and 30 minutes it can go under 30 minutes |
20:34:38 | * | Sentreen quit (Ping timeout: 268 seconds) |
20:36:49 | * | haha_ quit (Quit: haha_) |
20:39:17 | FromGitter | <faustinoaq> Hello people, I'm new in Nim, thanks for create this awesome language |
20:45:35 | * | sakalli quit (Ping timeout: 240 seconds) |
20:48:14 | * | Sentreen joined #nim |
20:50:42 | FromGitter | <TiberiumN> hi :) |
20:52:33 | FromGitter | <TiberiumN> about question you asked to dom96: he's chatting via IRC, so you don't see him online at gitter (there's irc to gitter bridge here) |
20:52:50 | FromGitter | <TiberiumN> but sometimes he's using gitter too |
20:53:33 | * | Jesin quit (Quit: Leaving) |
20:58:11 | * | Jesin joined #nim |
21:05:54 | * | rauss quit (Quit: WeeChat 1.9) |
21:08:19 | * | ofelas quit (Quit: shutdown -h now) |
21:09:21 | * | dankrad quit (Ping timeout: 248 seconds) |
21:11:22 | * | dankrad joined #nim |
21:24:44 | * | PMunch joined #nim |
21:26:21 | * | tankfeeder quit (Quit: Connection closed for inactivity) |
21:26:37 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:27:49 | * | Ven joined #nim |
21:28:13 | * | Ven is now known as Guest44413 |
21:28:20 | * | Guest44413 is now known as Ven`` |
21:38:05 | * | nhywyll quit (Quit: nhywyll) |
21:50:20 | * | yglukhov quit (Remote host closed the connection) |
21:52:00 | * | Nimbecile joined #nim |
22:04:12 | * | v17d quit (Ping timeout: 260 seconds) |
22:08:03 | TheManiac | Hi all: does anyone understand enough about concepts to tell me what 'too nested for type matching means' as an error message? |
22:08:42 | * | TheManiac sent a long message: TheManiac_2017-08-07_22:08:41.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/YhjFbliaZPYupTmcIJhLVkKV> |
22:09:14 | TheManiac | ^-- I want a concept that describes a string, but also a seq[X] for some type X |
22:10:01 | TheManiac | I feel like I copied the Stack[T] example from the manual, but I must have missed something :( |
22:13:05 | TheManiac | That much compiles, but if I call `proc foo[T](t: Text[T])` as foo("hello") it gives me a world of error messages |
22:15:30 | Nimbecile | Seems simple but I haven't been able to find in documentation...how do you do a double dereference in Nim like **ptr in C++...I tried ptr[][] but it doesn't work. |
22:17:40 | subsetpark | like this? https://www.irccloud.com/pastebin/m4aVyNyw/ |
22:18:26 | Nimbecile | Thank you! |
22:28:27 | * | mahmudov quit (Ping timeout: 240 seconds) |
22:30:22 | Nimbecile | see if understand...line 5 and 6 are equivalent, right? when you say new(b) does compiler create Bar pointer Foo pointer and integer, then b[]=f makes copy of f? |
22:31:44 | subsetpark | ah, you know what - line 5 is actually wrong, i meant to remove it |
22:32:09 | subsetpark | line 5 produces a type error, because you are trying to assign an `int` to a `ref int` |
22:33:57 | subsetpark | new(b) allocates space on the heap - before you do that, it's semantically meaningless to assign to b[] |
22:34:34 | subsetpark | https://www.irccloud.com/pastebin/FrI372QT/ |
22:36:01 | dom96 | subsetpark: hrm, interesting. Please submit it as an issue in Jester's repo |
22:36:06 | dom96 | I will take a look at it tomorrow |
22:36:17 | dom96 | Busy today with other things, sorry |
22:36:18 | subsetpark | dom96: awesome, will do |
22:37:15 | subsetpark | Nimbecile: you can also do an allocation in one step - `var f = new(Foo)` |
22:37:46 | subsetpark | (or for that matter var f = Foo.new) |
22:43:52 | * | Ven`` quit (Ping timeout: 260 seconds) |
22:46:32 | subsetpark | dom96: no doubt painfully exhaustive: https://github.com/dom96/jester/issues/117 |
22:47:13 | dom96 | thanks |
22:50:48 | * | yglukhov joined #nim |
22:54:22 | * | rauss joined #nim |
22:54:50 | * | yglukhov quit (Ping timeout: 240 seconds) |
22:55:11 | * | PMunch quit (Quit: leaving) |
23:05:47 | Nimbecile | @subsetpark sorry, got sidetracked...thank you very much! Your examples were very helpful. |
23:11:16 | subsetpark | my pleasure. i'm the 'advanced beginner'... once you start writing your own macros and opengl libraries, you'll be out of my league |
23:17:14 | Nimbecile | I'd like to get there, but old dog new tricks ;-) |
23:18:29 | * | nsf quit (Quit: WeeChat 1.9) |
23:42:12 | * | jinshil joined #nim |
23:53:16 | * | mahmudov joined #nim |
23:53:43 | FromGitter | <zetashift> Having trouble figuring out how to handle 'nil' in nim while following this book: http://craftinginterpreters.com/scanning.html#the-scanner-class, I currently have: https://pastebin.com/ADnwSW7d |
23:54:13 | FromGitter | <zetashift> Defining the literal field as 'nil' gives me an error but saying literal: null doesn't :S |
23:55:40 | * | oddduck joined #nim |
23:57:37 | * | rosshadden joined #nim |
23:58:24 | FromGitter | <TiberiumN> just don't declare it? |
23:58:49 | FromGitter | <TiberiumN> well it would be with default values |
23:59:57 | FromGitter | <TiberiumN> also |