00:05:32 | * | CodeVance quit (Read error: Connection reset by peer) |
00:10:59 | PMunch | Hi, data-man |
00:11:11 | PMunch | Did you see my PR in the parsetoml repo? |
00:14:44 | FromDiscord | <Aearnus> Holy crap, I just saw how my discord message was formatted in the Gitter. That's _awful_ -- does Gitter not support multiline messages? |
00:14:49 | FromDiscord | <Aearnus> Also I won't do that again haha |
00:15:08 | PMunch | Yeah, not looking too good over here on IRC either |
00:15:27 | PMunch | I think the issue is that the gitter bot grabs it's input from IRC |
00:16:05 | PMunch | The gitter bot automatically creates a paste of multiline could though |
00:16:09 | FromGitter | <data-man> @PMunch: Hello! Not yet. Feel free to merge. :) |
00:16:33 | PMunch | data-man, it's not quite merge-ready. Just wanted to see if it was something we wanted to have for TOML |
00:16:44 | PMunch | Basically makes TOML as easy to work with as JSON |
00:18:39 | FromGitter | <data-man> I don't use TOML yet, so I cann't say anything. |
00:22:20 | * | NimBot joined #nim |
00:27:57 | * | gokr quit (Ping timeout: 240 seconds) |
00:31:49 | PMunch | Hmm, can I have a generic type with a static array of a size given at compile-time? |
00:39:52 | * | Pisuke joined #nim |
00:39:59 | FromGitter | <data-man> @PMunch: It's nice additions! I propose ```%t``` instead of ```%*```. ⏎ Maybe ```%j``` for json and ```%y``` for NimYAML. :) |
00:41:09 | * | MyMind quit (Ping timeout: 264 seconds) |
00:41:42 | PMunch | Is that even possible? |
00:41:51 | PMunch | I think they have to be an operator |
00:42:31 | FromGitter | <data-man> Why isn't possible? |
00:44:10 | PMunch | https://nim-lang.org/docs/manual.html#lexical-analysis-operators |
00:44:22 | PMunch | Otherwise you would need to call it with `%t`: |
00:57:44 | FromGitter | <data-man> My bad :( ⏎ !echo import macros; macro `toml`*(x: untyped): untyped = newCall(bindSym"echo", x); toml @[123] |
00:58:32 | FromGitter | <data-man> !eval import macros; macro toml*(x: untyped): untyped = newCall(bindSym"echo", x); toml @[123] |
00:58:33 | NimBot | Compile failed: in.nim(1, 58) Error: expression 'newCall(bindSymecho, [x])' is of type 'NimNode' and has to be discarded |
01:00:01 | PMunch | hmm, yeah I guess with command syntax it could work |
01:00:11 | PMunch | Not entirely sure if you can pass blocks like that though.. |
01:00:21 | FromGitter | <data-man> Huh, locally it's works. Silly NimBot. :) |
01:04:34 | * | cavariux joined #nim |
01:06:36 | FromGitter | <data-man> @PMunch: So will you move your parsing-repos to a new address? ;) |
01:07:37 | * | cavariux quit (Client Quit) |
01:07:57 | PMunch | Not before I know what the purpose of the org is :P |
01:08:10 | PMunch | Is it all parsers, or parser for specific formats |
01:08:23 | FromGitter | <kayabaNerve> The purpose of my org is buying an island |
01:08:38 | FromGitter | <kayabaNerve> I want an island. Plain and simple |
01:10:02 | * | cavariux joined #nim |
01:10:30 | * | cavariux quit (Client Quit) |
01:10:45 | * | cavariux joined #nim |
01:13:18 | * | cavariux quit (Client Quit) |
01:13:31 | * | cavariux joined #nim |
01:13:56 | FromGitter | <data-man> @PMunch: Just created https://github.com/flyx/NimYAML/issues/57 |
01:26:46 | * | leorize joined #nim |
01:37:52 | FromGitter | <Varriount> Aernus: There's an options module |
01:38:24 | FromGitter | <Varriount> For other needs, you normally just use object variants |
01:45:22 | FromDiscord | <Aearnus> Varriount: I use options quite a bit |
01:46:04 | FromDiscord | <Aearnus> but what do you mean by object variants? |
01:46:56 | FromDiscord | <Aearnus> either way, `Either` gives you free monadic definitions & it allows higher level abstractions |
01:47:13 | FromDiscord | <citycide> your `Either` actually is an object variant already |
01:57:49 | FromGitter | <arnetheduck> @Aearnus @Varriount @citycide https://github.com/vegansk/nimfp/blob/master/src/fp/either.nim or what I started playing around with, https://github.com/arnetheduck/nim-result/pull/1 |
02:00:36 | * | PMunch quit (Quit: leaving) |
02:04:21 | * | skrzyp quit (Ping timeout: 240 seconds) |
02:05:23 | FromDiscord | <Aearnus> ah! I didn't know that those type level case statements were object variants |
02:05:42 | * | skrzyp joined #nim |
02:06:28 | FromDiscord | <Aearnus> hmm, I guess that Nim just has language level support for `Either`-ish types |
02:06:52 | FromDiscord | <Aearnus> that's pretty cool, if not bizarre |
02:14:23 | * | rockcavera joined #nim |
02:23:20 | FromGitter | <arnetheduck> bizarre / cool? it's not exactly a new thing: https://en.wikipedia.org/wiki/Tagged_union |
02:33:12 | FromDiscord | <Aearnus> https://hastebin.com/alekiloxuc.rb ? |
02:33:19 | FromDiscord | <Aearnus> that's a bit of a strange error |
02:33:32 | FromDiscord | <Aearnus> i gave it the perms it needed |
02:33:42 | FromDiscord | <Aearnus> eh, maybe I messed up and clicked the wrong perms |
02:35:44 | FromGitter | <Varriount> @zacharycarter Just got signed URL queries working. That will help with S3 integration. |
02:37:37 | FromGitter | <Varriount> gogolxdong: ^ |
02:39:02 | FromDiscord | <Aearnus> Do I need to make a git repo for my package before I nimble publish? |
02:39:35 | FromGitter | <Varriount> Yes. Nimble uses git (and possibly mercurial) |
02:39:48 | FromGitter | <Varriount> Though, you might be able to install locally from a path. |
02:41:49 | FromGitter | <Varriount> @arnetheduck `import ... boost.types'`?! |
02:43:47 | FromGitter | <arnetheduck> @Varriount https://github.com/vegansk/nimboost |
02:44:04 | FromGitter | <Varriount> What heresy is this. O_O |
02:44:19 | FromGitter | <Varriount> Oh, it's not the C++ boost. Good |
02:52:01 | * | dddddd quit (Remote host closed the connection) |
03:06:25 | FromGitter | <gogolxdong> @Varriount Good to know, and have you fixed the cmp implementation? |
03:07:29 | FromGitter | <gogolxdong> Will you use other services except EC2 and S3? |
03:08:24 | FromGitter | <gogolxdong> We have difficulties in issuing Price List service requests. |
03:12:52 | * | endragor joined #nim |
03:16:14 | FromGitter | <Varriount> The cmp implementation is fixed, I just need to upload the changes. |
03:18:09 | FromGitter | <Varriount> @gogolxdong Regarding the price list API, I don't see what is stopping you from using it. |
03:19:33 | FromGitter | <Varriount> The test client code assumes a certain URI format, which doesn't work with the pricing API, but that is why it is test code - it's meant to serve as an example. |
03:44:19 | * | endragor_ joined #nim |
03:46:52 | * | endrago__ joined #nim |
03:47:10 | * | endragor quit (Ping timeout: 252 seconds) |
03:48:45 | FromDiscord | <awr> anyone familiar with the nim-mode plugin for emacs |
03:48:52 | FromDiscord | <awr> how do i turn off the auto-indent on paste |
03:49:27 | * | endragor_ quit (Ping timeout: 240 seconds) |
03:49:33 | FromDiscord | <awr> disabling electric-indent-mode does nothing |
03:53:35 | * | smt` is now known as smt |
03:57:48 | FromDiscord | <awr> fixed it, it was a spacemacs problem. fixed by adding ` (add-to-list 'spacemacs-indent-sensitive-modes 'nim-mode)` to user-config |
04:09:59 | FromDiscord | <citycide> y'all want a pure `glob` library 😉 https://github.com/citycide/glob |
04:17:11 | * | cavariux quit (Quit: WeeChat 2.1) |
04:20:35 | FromDiscord | <Aearnus> Aw hell yeah |
04:23:35 | FromGitter | <Varriount> citycide: Does the 'glob' function require filesystem access? |
04:24:07 | FromGitter | <Varriount> Or can this be used as a general string matching library? |
04:34:32 | FromDiscord | <citycide> the `regexer` submodule parses globs into regexes which can be used without the filesystem |
04:35:27 | FromDiscord | <citycide> https://citycide.github.io/glob/glob/regexer.html |
04:36:40 | FromDiscord | <citycide> that's the raw proc, the main middle re-exports it though and has some wrapper functions |
04:36:52 | FromDiscord | <citycide> Main module* |
04:43:33 | FromDiscord | <citycide> bottom line is, if you just do `"foo.nim".matches("*.nim")` there's no I/O. Only when you use `walkGlob` or `listGlob` |
04:46:54 | FromDiscord | <Aearnus> Ooh, purity |
04:49:31 | FromGitter | <Varriount> citycide: Nice! |
04:49:43 | * | leorize quit (Quit: WeeChat 2.1) |
04:49:59 | FromGitter | <Varriount> I've had a few occasions where I needed glob-style matching, but wasn't working with files. |
04:51:28 | FromDiscord | <Aearnus> Why not just use a regex in a situation like that? |
04:51:45 | FromDiscord | <citycide> globs are much nicer imo |
04:52:00 | FromDiscord | <citycide> for file matching anyway |
04:55:16 | FromGitter | <data-man> @citycide: Thanks! ⏎ Also see https://github.com/nim-lang/Nim/pull/7836 :) |
05:01:11 | FromGitter | <data-man> Maybe use pegs instead of regex (optional)? For remove dependency. |
05:04:31 | FromDiscord | <citycide> @data-man I thought about it but I don't have much experience with pegs. that would probably be cool to add though |
05:06:54 | * | nsf joined #nim |
05:07:06 | FromGitter | <data-man> Or even to use scanf (compile-only patterns) :-D |
05:09:46 | FromGitter | <data-man> *compile-time |
05:20:33 | * | gokr joined #nim |
05:25:50 | FromDiscord | <Aearnus> yeah, I can't get nimble publish to work |
05:26:15 | FromDiscord | <Aearnus> what perms does it need? does it require you to have previously forked packages? |
05:31:27 | FromGitter | <Varriount> Is it giving you an error? |
05:31:43 | * | seabee joined #nim |
05:33:46 | FromDiscord | <Aearnus> Varriount: yeah |
05:33:53 | FromDiscord | <Aearnus> no matter what I change, it still gives me that same error |
05:35:17 | FromDiscord | <Aearnus> ah |
05:35:35 | FromDiscord | <Aearnus> I have to use a keypair with github to use nimble publish |
05:35:38 | FromDiscord | <Aearnus> that's... a pain |
05:36:05 | FromGitter | <Varriount> Do you use some other hosting service? |
05:36:31 | FromDiscord | <Aearnus> no, no, it just never told me I had to do that |
05:36:39 | FromDiscord | <Aearnus> it never even hinted at it |
05:36:48 | FromDiscord | <Aearnus> in the instructions, at least |
05:37:38 | FromGitter | <Varriount> Likely a documentation oversight. |
05:37:51 | FromDiscord | <Aearnus> ¯\_(ツ)_/¯ |
05:40:46 | FromGitter | <Varriount> You could put up a pull request with that note |
05:40:54 | FromGitter | <Varriount> Or an issue at least |
05:41:49 | * | seabee quit (Quit: leaving) |
05:47:24 | FromDiscord | <Aearnus> https://github.com/nim-lang/nimble/pull/494 |
05:48:47 | * | leorize joined #nim |
05:50:33 | FromGitter | <Varriount> Aearnus: Thanks! |
05:51:02 | * | SenasOzys quit (Ping timeout: 256 seconds) |
05:56:52 | * | leorize quit (Ping timeout: 245 seconds) |
05:58:22 | FromGitter | <Varriount> Aearnus: By the way, you might be interested in this: https://gist.github.com/Varriount/9f7e140cc34850a898256f731a4094c2 |
06:01:59 | FromDiscord | <Aearnus> i am indeed |
06:02:13 | FromDiscord | <Aearnus> ya learn more every day. thanks! |
06:15:55 | FromDiscord | <Aearnus> there, I published my little library. that's the first thing i've published onto any sort of repos |
06:19:35 | * | leorize joined #nim |
06:26:35 | * | leorize quit (Quit: WeeChat 2.1) |
06:29:05 | * | xkapastel quit (Quit: Connection closed for inactivity) |
06:35:22 | * | uran[m] joined #nim |
06:40:48 | * | uran[m] is now known as uran[m]1 |
06:41:03 | * | uran[m]1 is now known as yglukhov1 |
06:41:49 | * | yglukhov quit () |
06:42:03 | * | yglukhov[i] joined #nim |
06:42:13 | * | yglukhov1 is now known as yglukhov |
06:44:14 | * | yglukhov[i] quit (Client Quit) |
07:51:09 | Araq | IMO Nimble should search github too automatically |
07:51:34 | Araq | 'nimble publish' is often forgotten :P |
07:51:46 | FromDiscord | <Aearnus> hey, what does the `interface` keyword do? |
07:52:00 | Araq | nothing, it's reserved for the future |
07:52:28 | FromDiscord | <Aearnus> ah, got it |
07:52:50 | FromDiscord | <Aearnus> is the `constraint` keyword mature enough to use in real code? |
07:53:13 | Araq | there is no such keyword, do you mean 'concept'? |
07:53:23 | FromDiscord | <Aearnus> er, yeah |
07:53:23 | FromDiscord | <Aearnus> sorryu |
07:54:13 | Araq | well, expect concept to land into .experimental |
07:54:28 | Araq | but sure, you can use it. |
07:54:47 | Araq | its syntax will likely change, but the feature itself will remain |
07:57:20 | FromDiscord | <Aearnus> alright, thanks! |
07:59:41 | * | CodeVance joined #nim |
08:02:50 | * | Vladar joined #nim |
08:03:13 | FromDiscord | <Aearnus> how do you specify that a certain type follows a concept at compile time? |
08:03:41 | Araq | static: doAssert Foo is MyConcept ? |
08:04:53 | * | gmpreussner quit (Ping timeout: 256 seconds) |
08:05:38 | * | gmpreussner joined #nim |
08:06:51 | FromDiscord | <Aearnus> so is there no way to do it within the type specification itself? like haskell has the `instance` declarations and all that |
08:07:32 | Araq | we don't bind procs to types so we can't check it at the type declaration site ;-) |
08:08:32 | Araq | also, usually the point is that types match implicitly, so that you don't have to edit system to proclaim system.array matches your Iterable concept |
08:09:22 | FromDiscord | <Aearnus> that makes sense. does the compiler detect when a non-concept-matching type gets passed to a function that takes a certain concept? |
08:10:15 | Araq | sure, what else would be the point of concept... |
08:10:40 | FromDiscord | <Aearnus> I was just afraid of runtime errors ¯\_(ツ)_/¯ |
08:11:19 | FromDiscord | <Aearnus> I think I got this all figured out now though. thanks a ton! |
08:48:48 | FromGitter | <data-man> @Araq: checking for sideEffects can't be disabled? Something like --sideEffectChecks:off This would be useful for debugging. |
08:49:08 | Araq | use debugEcho instead of echo |
08:49:25 | FromGitter | <data-man> Great! Thanks! |
08:56:43 | * | sz0 quit (Quit: Connection closed for inactivity) |
09:05:58 | * | mrshu2 is now known as mrshu |
09:08:40 | * | FuntDobra joined #nim |
09:15:13 | * | skrylar joined #nim |
09:21:44 | FromGitter | <mratsim> @Aearnus: if you want Haskell Instances in Nim here you go: https://github.com/nigredo-tori/classy |
09:27:49 | * | Vladar quit (Quit: Leaving) |
09:31:04 | FromDiscord | <Aearnus> mratsim: noted |
09:31:22 | FromDiscord | <Aearnus> i was reading through some of that lib's example code though and i saw this line: `proc fmap[A, B](fa: Option[A], g: A -> B): Option[B] =` |
09:31:46 | FromDiscord | <Aearnus> is that `A -> B` standard syntax? or is it part of some macro they wrote or something |
09:32:19 | * | Vladar joined #nim |
09:37:00 | skrylar | mratsim: do you have an issue on your arch box where -lOpenCL doesn't seem to exist even with the drivers installed? |
09:38:02 | FromGitter | <ephja> so the exe trying to load libui.dll gives me this: "could not load: libui.dll" and process monitor shows this: "main.exe QueryOpen ...\libui.dll SUCCESS" |
09:40:12 | * | FuntDobra quit (Ping timeout: 245 seconds) |
09:41:06 | FromGitter | <ephja> but it's opening, memory mapping and closing the same path twice (with success) and then it proceeds to look for the dll in other locations |
09:41:50 | * | xkapastel joined #nim |
09:42:37 | FromGitter | <ephja> well I'm gonna try it with loadLib directly |
09:46:40 | FromGitter | <mratsim> @skrylar, trying |
09:46:52 | * | ARCADIVS quit (Ping timeout: 245 seconds) |
09:49:07 | * | ARCADIVS joined #nim |
09:50:45 | FromGitter | <mratsim> I have some openblas linking issue :/ I upgraded my whole datascience stack last weekend. |
09:50:53 | * | FuntDobra joined #nim |
09:52:19 | * | Trustable joined #nim |
09:53:04 | FromGitter | <mratsim> OpenCL is working fine for me |
09:54:11 | crem | I'm writing app, which at the same time: waits for input from stdin, waits for input from subprocess'es stdout, waits http request to complite, waits for timer. dom96 pointed to this https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L39 code, but how exactly would it be best to work?. spawn evertyhing in subtread and do a busy wait of all thread's isReady()? |
09:55:11 | skrylar | weird. i wonder why i don't have an opencl lib |
09:55:43 | dom96 | crem: I would do it like this: use thread only for stdin, use async for the rest on the main thread. cheatfate has a package which has an 'asyncproc' module that you can use |
09:59:12 | FromGitter | <ephja> SDL2.dll can be loaded so now I'm trying hard to detect system call differences :p |
09:59:30 | crem | Ok, went to read about async. :) Read it many times, also for C++ and javascript, but somehow doesn't stick to my mind if I don't use it. |
10:01:18 | FromDiscord | <Aearnus> wait a second -- I have a type defined as `Money = ref object of GameResource` but the operator `proc `$`(x: GameResource): string` refuses to take it |
10:01:30 | FromDiscord | <Aearnus> what's going on here? |
10:04:36 | FromDiscord | <Aearnus> Damn, I have to use a concept as well don't I. I thought I could get away with plain inheretence |
10:08:13 | dom96 | crem: feel free to ask questions |
10:14:02 | skrylar | ah its the ocl-icd package |
10:24:14 | FromGitter | <ephja> might there be issues with vs 15 dll's? I'm gonna try it with an earlier version |
10:30:03 | CodeVance | Aearnus. Check how system module does it |
10:32:46 | FromGitter | <mratsim> @Aernus the -> operator and => comes from the sugar module in stdlib (previously future) |
10:32:53 | FromGitter | <mratsim> @Aearnus* |
10:33:49 | FromGitter | <mratsim> @Aearnus you don’t need concept. |
10:34:41 | FromGitter | <mratsim> is your GameResource a ref object? Everything must be ref for inheritance, do you have a short snippet? It hsould work. |
10:44:15 | * | ARCADIVS quit (Quit: WeeChat 2.0.1) |
10:44:40 | crem | If await blocks until data is ready, why not just call the proc synchronously?.. |
10:45:10 | crem | Is it possible to await several things whatever finishes first?.. |
10:47:24 | dom96 | await blocks *the current async procedure* |
10:47:27 | crem | Also, here: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L39 if line 37 is not blocking, how is it guaranteed that connect() finishes before socket.send() starts?.. |
10:47:29 | dom96 | it doesn't block your whole program |
10:48:11 | dom96 | Indeed, there is no guarantee |
10:48:22 | crem | But I thought my mainloop should be async procedure if it calls await. And for me that means that it blocks main loop. |
10:48:52 | dom96 | That's a known bug in this code sadly. But it's unlikely to come up in practice, unless you start sending messages really fast |
10:49:52 | crem | It may take long to create connection. Especially if connect resolves DNS names inside, but even if it doesn't, one packet lost and there is 1 second delay. |
10:50:57 | dom96 | Yes, it may. It's an oversight that failed to catch before publishing my book. |
10:51:09 | dom96 | *that I |
10:51:57 | crem | But that's fine, I still don't understand how can I use await to spawn "wait for input from stdin", "wait for input from subprocess" and "wait for http request to be ready" and process whatever finishes first in a main loop.. |
10:52:32 | crem | plus timeout. :) |
10:53:48 | crem | I can understand how to use three spawns though.. With busywait. But is there "wait for multiple flowvar" proc? |
10:53:57 | crem | awaitAny, see it |
10:54:12 | dom96 | You should only have one spawn though |
10:54:17 | dom96 | Busywait on it |
10:54:25 | dom96 | and use futures + await/async for the rest |
10:55:01 | crem | I should use spawn for "read from stdin", right?.. |
10:55:41 | crem | For "read from subprocess" (also line by line).. await?. |
10:55:58 | crem | But to do that, main loop should be .async. too, right?.. |
10:56:19 | crem | Uh, that modern multithreading confusing. |
10:56:22 | crem | is |
10:57:59 | crem | Book says async returns Future[T], while docs say await accepts FlowVarBase. But book also mentioned FlowVar[T] somewhere too.. |
10:58:23 | crem | What's the difference between Future[T] and FlowVar[T]? |
10:59:52 | FromGitter | <abijahm> @crem FlowVar[T] is for spawned procedure in a thread and Future[T] is for async procedures |
11:00:14 | crem | And you await both? |
11:00:51 | dom96 | That's really needlessly confusing |
11:01:05 | dom96 | threadpool shouldn't have a 'await' unless it works just like the async await *sigh* |
11:01:40 | dom96 | 'await' in an async procedure accepts futures |
11:01:46 | dom96 | don't use the threadpool await |
11:01:49 | dom96 | it will block your program |
11:01:51 | crem | Await (for async) is not a proc but a keyword? Docs only show await in threadpool module. |
11:02:35 | dom96 | yes |
11:03:17 | dom96 | I'm going to make a PR now to change the name of this 'await' |
11:03:52 | * | Snircle joined #nim |
11:05:59 | * | xet7 joined #nim |
11:06:45 | crem | is there any doc about async/await? I do have a book, but i'd like a more formal description |
11:07:02 | crem | https://nim-lang.org/docs/manual.html has nothhing.. |
11:07:06 | dom96 | https://nim-lang.org/docs/asyncdispatch.html |
11:07:33 | crem | thanks |
11:08:50 | crem | should be probably more discoverable |
11:14:20 | dom96 | agreed |
11:19:16 | crem | Book says "await keyword can only be used inside procedures marked with {. async .} pragma". Is it so? I'd think this pragma is needed for functions which are called with "await" but not for the calling function. |
11:19:46 | dom96 | it is so |
11:20:21 | crem | Hmm... |
11:20:22 | dom96 | 'await' is transformed to a 'yield' |
11:20:27 | dom96 | You can't have a yield inside a procedure |
11:20:40 | dom96 | You need a coroutine (closure iterator in Nim) and that is what the 'async' macro creates |
11:20:48 | dom96 | btw I added a note here: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L37 |
11:20:50 | dom96 | Hope it helps |
11:21:11 | crem | It also forces function to return Future[T]. If I need a function that does async magic inside but then return normal result, what do I do? |
11:22:23 | * | athenot joined #nim |
11:23:13 | Araq | call: waitFor theAsyncProc() |
11:25:32 | dom96 | That's true, that's another solution. I should add that to my post. |
11:25:33 | crem | If proc f() returns Future[] anyway, what's the difrerence between var x = f() and var x = await f()? First one will just run it synchronously? |
11:27:02 | Araq | 'await' means "stop execution and come back later" |
11:27:17 | Araq | then the result is wrapped into another Future for you. |
11:27:18 | crem | Maybe "await" word is what adds confusion. It feels that it means wait, i.e. it will block. But instead it means "launch asyncronously and not wait". |
11:27:24 | crem | So await does block? |
11:27:31 | Araq | it blocks your "task" |
11:27:33 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:27:34 | dom96 | it blocks *the current async proc* |
11:27:58 | Araq | it doesn't block your program, but your asyncronous task/proc |
11:28:12 | crem | it does block, ok... |
11:28:13 | Araq | because you declared "halt! wait for this result first, can't work without out" |
11:28:27 | crem | What I need it to wait for whatever returns first. |
11:28:50 | Araq | that's the `or` operator or awaitAny |
11:30:03 | crem | But dom96 said that awaitAny is about threadpool/FlowVar and is nothing to do with async/Future. (as far as I understood) |
11:30:46 | Araq | just the 'or' operator then |
11:31:32 | crem | And how can I get the resulting value? (resulting return Future[] are of different types). |
11:32:13 | FromGitter | <xmonader> I'm happy! a colleague at work decided to do nim days in rust and that's his first day project https://github.com/andrewayoub/dmidecoder |
11:32:46 | crem | Hm, it seems that async is pretty useless for my case. Will do good old manual thread management. |
11:32:54 | crem | Or I don't understand it. |
11:33:13 | Araq | 'or' takes 2 futures and returns a future that is completed if A *or* B is completed |
11:33:26 | Araq | which is exactly what you were asking for, no? |
11:33:35 | Araq | you can 'await' the 'or' |
11:34:00 | crem | Yes, but I need to use the resulting value and know from where it came. |
11:34:27 | Araq | you can copy&adapt the stdlib's or. I have done that in the past too. |
11:34:47 | Araq | it's a very interesting piece of code. |
11:36:02 | crem | I need that to be done by today's evening.. Probably makes sense to do in C++ instead. Maybe more lines of code but at least I know what to do. |
11:39:03 | Araq | proc `or`*[T, Y](fut1: Future[T], fut2: Future[Y]): Future[void] = |
11:39:03 | Araq | ## Returns a future which will complete once either ``fut1`` or ``fut2`` |
11:39:03 | Araq | ## complete. |
11:39:03 | Araq | var retFuture = newFuture[void]("asyncdispatch.`or`") |
11:39:03 | Araq | proc cb[X](fut: Future[X]) = |
11:39:04 | Araq | if fut.failed: retFuture.fail(fut.error) |
11:39:06 | Araq | if not retFuture.finished: retFuture.complete() |
11:39:08 | Araq | fut1.callback = cb[T] |
11:39:10 | Araq | fut2.callback = cb[Y] |
11:39:14 | Araq | return retFuture |
11:42:59 | * | Vladar quit (Quit: Leaving) |
11:44:24 | crem | Yeah, using threads with callbacks would probably be a way to go. |
11:44:43 | * | athenot joined #nim |
11:47:03 | dom96 | what? Adapt or? |
11:47:17 | dom96 | var fut1 = futProc(); var fut2 = futProc2(); await fut1 or fut2 |
11:47:29 | dom96 | if fut1.finished: ...; if fut2.finished: ...; |
11:51:30 | crem | book says that I cannot stdin.readLine in async procedure. Can I myproc.outputStream.readLine() in async proc? |
11:54:11 | enthus1ast | crem it got a reasonable performant async readline working with a thread (which readlines) and a asynctools/asyncpipe (which delivers the readline result to the main) |
11:54:25 | dom96 | ...no. That's why you use 'spawn' for the stdin.readLine |
11:54:46 | enthus1ast | the spawn readline is very slow |
11:54:52 | enthus1ast | at least for me |
11:55:23 | dom96 | what are you using it for? |
11:55:47 | crem | me? |
11:55:55 | dom96 | if it's interactivity for your process then I don't see why it would be slow |
11:55:56 | dom96 | no |
11:56:19 | Araq | dom96, oh good point, forgot about the 'finished' accessor that indeed can just be used |
11:56:21 | Araq | my bad. |
12:04:02 | enthus1ast | dom96: i've build a small shell in it, it was working but the response was way to slow. |
12:05:13 | dom96 | poll timeout too low? :) |
12:05:22 | dom96 | in the long run we need 'await' to work with FlowVar |
12:05:27 | dom96 | plz Araq |
12:06:49 | enthus1ast | asyncdispatch.poll()? |
12:07:00 | dom96 | or I should say "too high" |
12:07:24 | dom96 | yes, if you call it like that then you will get 500ms |
12:07:58 | enthus1ast | dom96: can you explain what this timeout really means? :) |
12:08:15 | dom96 | when you call `poll` it waits for events for the timeout you specify |
12:08:48 | dom96 | so your spawned flowvar will only be checked every 500ms at worst |
12:09:45 | enthus1ast | mhh let me check if it gets better with a smaller timeout |
12:11:59 | enthus1ast | yeah ok, the flowvar way is also fast :) |
12:16:52 | * | CodeVance quit (Read error: Connection reset by peer) |
12:29:16 | * | PMunch joined #nim |
12:38:52 | crem | So if I cannot do myproc.outputStream.readLine() in async.. how can I wait for two Future[]s and two FlowVar[]s at the same time? |
12:39:00 | crem | sigh... |
12:41:27 | crem | What does await/async offer extra/simplify relative to threadPool+spawn? |
12:42:05 | dom96 | Why do you need two FlowVars? |
12:43:05 | dom96 | `spawn` won't let you spawn an unlimited amount of threads (it's bound to the number of cores IIRC) |
12:43:06 | crem | To read from stdin (for user input), and to read from subprocess'es stdout (subprocess periodically updates it's status). |
12:43:14 | dom96 | but if you're more comfortable with threads then just use them |
12:43:37 | crem | I'd like to use async, but just it doesn't seem to support my use case. |
12:43:42 | * | Vladar joined #nim |
12:44:39 | crem | "user input" is actually waiting user to press 'q' to quit, It's getch() rather than reading stdin. Maybe that's supported in async? |
12:46:24 | * | fvs joined #nim |
12:46:28 | dom96 | nope |
12:46:41 | * | Sembei joined #nim |
12:47:22 | * | SenasOzys joined #nim |
12:47:39 | * | Pisuke quit (Ping timeout: 260 seconds) |
12:50:50 | crem | It does look like overkill to spawn process to read one char, but there's no other way. Even threadPool turned out not to be an option, as it's not guaranteed to run 5 threads in parallel. |
12:51:19 | crem | s/process/thread |
12:51:58 | crem | goroutines could do that easily :-) |
12:57:12 | Araq | sure, whatever, my servers usually don't read from stdin though |
13:02:32 | FromGitter | <Varriount> crem: Instead of a process, what about a thread + channel? |
13:02:43 | dom96 | spawn process? |
13:02:46 | dom96 | oh |
13:03:07 | dom96 | Spawn can do that easily too |
13:03:23 | dom96 | There is a highly commented example that shows exactly how to do it |
13:03:28 | dom96 | I'm not sure what else I can offer |
13:03:47 | FromGitter | <Varriount> dom96: Where is the example? |
13:04:19 | dom96 | https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim |
13:06:11 | FromGitter | <Varriount> Doesn't |
13:06:55 | FromGitter | <Varriount> That won't work for long running tasks though... |
13:06:57 | crem | It's not server. It's a client for lczero. Which runs subprocess, which does all the work, and when subprocess has data ready to send to server, subprocess issues "dataready <filename>" into it's stdout, and code has to upload that. Meanwhile it also shows dashboard with stats, and listens for user to press 'q'. That's it. |
13:09:00 | FromGitter | <Varriount> The Windows API thread pool has this problem too. It was solved by adding a "spawn long running task" procedure. |
13:09:06 | crem | dom96: but you said that spawn doesn't guarantee to start execution, instead it can just enqueue it. |
13:09:17 | crem | So threadpool/spawn doesn't work. |
13:09:21 | crem | for my case. |
13:09:43 | dom96 | Yes, if you spawn more than `x` threads |
13:09:44 | crem | For async IO, threadpools should not be used, they are for computation. |
13:09:45 | dom96 | but you won't |
13:09:48 | dom96 | You only need one or two |
13:10:18 | dom96 | You only really need one if you use cheatfate's asynctools package like I suggested |
13:10:21 | crem | that's fragile. Will it work on single core machine? Is main thread counted? |
13:10:49 | dom96 | Good question |
13:12:06 | crem | it seems that async is really for IO, but it doesn't support IO ops like reading from stdin or subprocess. |
13:12:38 | dom96 | it supports the latter outside the stdlib |
13:13:18 | Araq | our lack of knowledge does not make it "fragile" |
13:13:33 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:13:36 | dom96 | looking at the docs for threadpool it looks like it spawns up to MaxThreadPoolSize, depending on what you set: https://nim-lang.org/docs/threadpool.html#setMaxPoolSize,range[] |
13:13:43 | dom96 | Araq: Is that correct? |
13:13:50 | Araq | why wouldn't it work on a single core machine. |
13:15:21 | Araq | dom96, sure, also, work is on-going to make 'spawn' guaranteed non-blocking |
13:15:25 | Araq | whatever that means. |
13:15:45 | dom96 | yeah, yglukhov is working on that IIRC |
13:16:18 | * | athenot joined #nim |
13:19:42 | shashlick | araq, dom96: csources has build.sh which does arch detection, but separate build.bat and build64.bat for Windows which doesn't do arch detection |
13:20:02 | shashlick | do you think it is possible to enhance the batch file to do this detection or is .bat too dumb to pull it off |
13:20:15 | * | gokr quit (Ping timeout: 245 seconds) |
13:20:16 | * | FuntDobra quit (Ping timeout: 252 seconds) |
13:21:06 | * | FuntDobra joined #nim |
13:21:38 | Araq | no idea. seems easy enough to do |
13:22:42 | dom96 | It shouldn't be done though |
13:22:50 | dom96 | Windows users should have the choice |
13:23:38 | * | leorize joined #nim |
13:23:41 | shashlick | so on linux you cannot have 32-bit gcc on a 64-bit OS? |
13:24:21 | dom96 | 32-bit is practically nonexistent AFAIK |
13:25:44 | skrylar | 32-bit can be done on linux although many distros have dumped or relegated such things |
13:26:19 | leorize | is there any reason why StringStream is not available for the js backend? |
13:26:20 | shashlick | okay, so i'm not a fan of finish or choosenim installing a C compiler but given that's in place, there should be a flag to specify arch on install |
13:26:55 | skrylar | leorize, can't do pointer magic on js |
13:27:58 | skrylar | i get the impression stringstream is not so much a string builder analogue as it is for testing streams or composing packets, so it probably doesn't have edge cases for JS backends? |
13:29:20 | leorize | most of the parsers within the stdlib depends on StringStream, so they can't be used with js :( |
13:35:11 | shashlick | dom96: what OS is choosenim supported on |
13:35:44 | Yardanico | all major ones |
13:36:06 | Yardanico | windows/macos/linux |
13:36:30 | shashlick | okay how do you detect os arch in nim |
13:37:10 | Yardanico | os? well, when you compile your binaries you know which OS is the target |
13:37:15 | Yardanico | and about architecture - same |
13:44:06 | Calinou | in the GamingOnLinux survey of last year, 32-bit Linux was used by 3 respondents out of 2,300+ |
14:02:27 | * | SenasOzys quit (Ping timeout: 240 seconds) |
14:03:33 | * | SenasOzys joined #nim |
14:03:53 | * | leorize quit (Ping timeout: 260 seconds) |
14:06:29 | FromGitter | <qqtop> Just today installed Nim devel on an Samsung N150 32 bit with parrotOs linux on it and compiled some stuff, works great . |
14:08:26 | * | FuntDobra quit (Ping timeout: 268 seconds) |
14:13:24 | * | SenasOzys quit (Ping timeout: 260 seconds) |
14:14:38 | * | SenasOzys joined #nim |
14:16:49 | * | BitPuffin joined #nim |
14:17:36 | * | leorize joined #nim |
14:18:27 | * | PMunch quit (Quit: leaving) |
14:20:47 | FromGitter | <zetashift> @Calinou, don't know if that survey targeted gamers, but gamers in general don't mess with 32bit nowdays |
14:24:05 | shashlick | Yardanico: if you distribute app as source, you have to know at compile time what OS it is, how do you find out |
14:24:39 | Yardanico | well, you can write os-specific code via when defined(windows) or when defined(linux) |
14:25:14 | shashlick | yep :D |
14:27:16 | * | Vladar quit (Quit: Leaving) |
14:33:38 | * | dddddd joined #nim |
14:38:32 | * | Vladar joined #nim |
14:41:01 | FromGitter | <data-man> Oh, http://manning.com "This site can’t be reached manning.com refused to connect" for me. :( Opened through Tor. |
14:42:11 | FromGitter | <zetashift> I guess manning doesn't accept tor as a client? |
14:43:07 | FromGitter | <data-man> Sorry. Can't be opened without Tor. |
14:45:25 | shashlick | is build.bat for csources generated by niminst |
14:45:58 | FromGitter | <zetashift> @data-man weird works fine for me here |
14:46:26 | FromGitter | <data-man> It's written in it comments :) |
14:47:42 | FromGitter | <data-man> @zetashift: From what country? :) |
14:48:08 | FromGitter | <zetashift> The Netherlands |
14:49:18 | * | endrago__ quit (Remote host closed the connection) |
14:52:02 | FromGitter | <data-man> Well, if Manning blocks Russian IP addresses then it's sadly. |
14:52:48 | * | endragor joined #nim |
14:55:50 | federico3 | data-man: just change circuit |
14:57:26 | * | endragor quit (Ping timeout: 252 seconds) |
14:58:59 | shashlick | araq: is build.bat for csources still generated from niminst? I see changes in build.sh in csources not in niminst build.sh template |
15:00:02 | * | CodeVance joined #nim |
15:00:58 | FromGitter | <data-man> @federico3: Thanks. But I'm a novice *nix user, and don't know how to do this and I'm sorry to waste time for this. So I'm just use Tor. :) |
15:01:52 | federico3 | data-man: ctrl+shift+L in tor browser |
15:02:11 | federico3 | look at the menu on the onion button |
15:04:46 | Araq | shashlick: yeah it is still generated |
15:05:15 | * | endragor joined #nim |
15:08:16 | FromGitter | <data-man> @federico3: Doesn't work in Opera. Never mind, sorry for noise. |
15:09:25 | * | endragor quit (Ping timeout: 245 seconds) |
15:13:49 | shashlick | araq: I don't see this in the build.sh template https://github.com/nim-lang/csources/blame/da97f857af6f85990c4677a30f889b9184e38568/build.sh#L176 |
15:18:29 | Araq | my buildsh.tmpl contains logic for 'android' |
15:18:47 | Araq | note that niminst is in the compiler, the nimble package is not used for it |
15:19:20 | shashlick | I don't see it here: https://github.com/nim-lang/niminst/blob/master/buildsh.tmpl |
15:19:21 | * | leorize quit (Quit: WeeChat 2.1) |
15:19:47 | shashlick | oh okay, a sec |
15:20:28 | shashlick | might be worth deleting this niminst repo if it is unused |
15:20:54 | shashlick | or even a note stating its new location |
15:28:43 | * | gokr joined #nim |
15:38:22 | * | Trustable quit (Remote host closed the connection) |
15:48:02 | shashlick | is it possible to compile csources with vc++? |
15:48:18 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:51:27 | * | gokr quit (Ping timeout: 245 seconds) |
15:55:34 | * | nsf quit (Quit: WeeChat 2.1) |
15:57:20 | * | gokr joined #nim |
15:57:26 | Araq | I doubt it... |
16:13:58 | * | FuntDobra joined #nim |
16:17:00 | * | athenot joined #nim |
16:28:12 | * | sz0 joined #nim |
16:29:02 | shashlick | araq: I remember you mentioned gcc -dumpmachine isn't reliable - I just want to know if gcc is 32-bit or 64-bit version, is -dumpmachine not good enough for that? |
16:29:28 | * | FuntDobra quit (Ping timeout: 252 seconds) |
16:29:30 | shashlick | looking to detect gcc in build.bat, nim isn't compiled yet |
16:37:31 | Araq | well you read finish.nim's source code so I don't understand why you ask. |
16:37:52 | Araq | to detect the architecture reliably, do what finish.nim does |
16:41:44 | * | FuntDobra joined #nim |
16:51:53 | * | gokr quit (Quit: Leaving.) |
16:52:04 | * | gokr joined #nim |
16:57:37 | * | arecaceae quit (Remote host closed the connection) |
16:58:01 | * | arecaceae joined #nim |
17:01:13 | * | gokr quit (Ping timeout: 260 seconds) |
17:18:58 | * | skrylar quit (Remote host closed the connection) |
17:19:20 | * | FuntDobra quit (Ping timeout: 252 seconds) |
17:29:20 | * | yglukhov[i] joined #nim |
17:29:33 | * | yglukhov[i] quit (Client Quit) |
17:29:54 | * | yglukhov[i] joined #nim |
17:30:36 | * | yglukhov[i] quit (Client Quit) |
17:43:15 | shashlick | araq: there's a bug in stdtmpl |
17:43:33 | shashlick | if you have a single line with just ) in it, that gets omitted from the output |
17:43:35 | * | athenot quit (Ping timeout: 245 seconds) |
17:45:41 | * | athenot joined #nim |
17:46:01 | shashlick | data-man: unsure if this broke when you pushed https://github.com/nim-lang/Nim/commit/27631b1112bb10e4a7ca43b611c2d3bde2ba320f |
17:46:38 | shashlick | if you do koch csource, the generated build.bat is missing ) if it is the only char on the line, so generated bat file doesn't work |
17:46:44 | shashlick | just tested on win and lin |
17:46:55 | * | FuntDobra joined #nim |
17:47:34 | * | Ven`` joined #nim |
17:49:22 | * | heitzmann quit (Quit: WeeChat 2.1) |
17:51:30 | * | FuntDobra quit (Ping timeout: 245 seconds) |
17:52:12 | * | Ven` joined #nim |
17:52:17 | * | Ven`` quit (Read error: Connection reset by peer) |
17:55:25 | * | Vladar quit (Quit: Leaving) |
17:58:02 | * | elrood joined #nim |
18:06:38 | * | max3 joined #nim |
18:15:57 | * | yglukhov[i] joined #nim |
18:16:27 | * | SenasOzys quit (Ping timeout: 245 seconds) |
18:19:16 | shashlick | araq: I've gotten build.bat working to build with correct arch, are we good with deleting build64.bat or should I create a dummy that simply calls build.bat, or should I force 64-bit build |
18:22:48 | shashlick | I think creating dummy build64.bat with "call build.bat" is the best thing to do |
18:28:54 | * | gmpreussner quit (Ping timeout: 260 seconds) |
18:30:00 | * | gmpreussner joined #nim |
18:32:05 | Araq | I think there should be build.bat for auto detection |
18:32:26 | Araq | and build32.bat and build64.bat for the explicit archs |
18:33:14 | shashlick | so just assume that user knows what he's doing when he calls buildXX.bat? |
18:41:43 | Araq | yeah... |
18:41:54 | shashlick | ok so opened new issue: https://github.com/nim-lang/Nim/issues/7855 |
18:44:07 | FromGitter | <data-man> @Araq: Let's merge it, as is? #7836 ⏎ @shashlick: It's new candidate for you :) (for nimscript ) |
18:45:31 | FromGitter | <genotrance> nice |
18:52:55 | * | nsf joined #nim |
18:58:40 | * | Ven` quit (Read error: Connection reset by peer) |
18:59:00 | * | Ven`` joined #nim |
19:05:31 | * | PMunch joined #nim |
19:11:06 | * | SenasOzys joined #nim |
19:12:31 | * | nsf quit (Quit: WeeChat 2.1) |
19:15:15 | * | yglukhov[i] quit (Ping timeout: 245 seconds) |
19:16:05 | * | SenasOzys quit (Ping timeout: 260 seconds) |
19:22:44 | PMunch | Hmm, should I report the compileTime thing? |
19:23:33 | * | yglukhov[i] joined #nim |
19:29:34 | FromGitter | <data-man> @PMunch: what's wrong? |
19:31:48 | PMunch | I was trying to do the "completely unscientific benchmark" on compile-time, only echoing at runtime. |
19:31:49 | PMunch | http://ix.io/1aZJ |
19:31:53 | PMunch | That's the code I've got |
19:32:10 | PMunch | It runs both with and without the {.compileTime.} pragma, but returns different answers |
19:32:29 | Araq | well a smaller test program is welcome |
19:32:33 | Araq | in the bug report |
19:32:46 | PMunch | Yeah that's part of the problem. I have no idea what could go wrong.. |
19:37:45 | * | dkncgtik6mr0 quit (Quit: WeeChat 2.1) |
19:41:11 | FromGitter | <data-man> @PMunch: Good that you are here. validator can't parse all examples from toml-lang. :( |
19:41:32 | PMunch | Really? |
19:42:37 | FromGitter | <data-man> Yeah. I pushed new validator. We can add tests from toml-lang. |
19:44:39 | PMunch | A new one? |
19:44:46 | PMunch | What was wrong with the old one? |
19:46:04 | FromGitter | <data-man> Nothing. I added more convenient version. :) |
19:46:32 | PMunch | And what is failing now? |
19:49:51 | * | xkapastel quit (Quit: Connection closed for inactivity) |
19:50:27 | FromGitter | <data-man> example-v0.3.0.toml - unknown escape sequence "\T" ⏎ example-v0.4.0.toml - unknown escape sequence "\T" ⏎ example.toml - passed ⏎ fruit.toml - passed ⏎ hard_example.toml - passed ... [https://gitter.im/nim-lang/Nim?at=5b0323035a1d895fae5a0a35] |
19:50:50 | PMunch | Where are those from? |
19:51:38 | PMunch | I've validated against all these tests: https://github.com/BurntSushi/toml-test |
19:52:31 | * | Trustable joined #nim |
19:52:33 | FromGitter | <data-man> https://github.com/toml-lang/toml |
19:52:56 | PMunch | I found that one here by the way: https://github.com/toml-lang/toml/wiki#language-agnostic-test-suite-for-toml-decoders-and-encoders |
19:53:13 | PMunch | Oh, it's just all the examples on that page? |
19:53:58 | * | FuntDobra joined #nim |
19:54:40 | FromGitter | <data-man> https://github.com/toml-lang/toml/tree/master/examples ⏎ https://github.com/toml-lang/toml/tree/master/tests |
19:56:47 | shashlick | araq: https://github.com/nim-lang/Nim/pull/7856 |
19:58:48 | shashlick | data-man: not sure if your recent change in filters broke this - https://github.com/nim-lang/Nim/issues/7855 |
20:02:45 | * | FuntDobra quit (Ping timeout: 245 seconds) |
20:03:05 | FromGitter | <data-man> @shashlick: check on 0.18 please |
20:06:19 | shashlick | i'm on #head |
20:06:26 | shashlick | oh you mean release |
20:06:36 | FromGitter | <data-man> Yes |
20:08:02 | FromGitter | <data-man> If I broke it, I'll not fall asleep today. :) |
20:08:47 | shashlick | :) |
20:10:07 | FromGitter | <kayabaNerve> @data-man Can't break code if you don't write any |
20:12:05 | * | gokr joined #nim |
20:12:06 | shashlick | works on 0.17.2 and 0.18.0 |
20:12:43 | FromGitter | <data-man> :( |
20:14:58 | FromGitter | <kayabaNerve> I never write any code |
20:15:37 | FromGitter | <kayabaNerve> All my recent questions have been about code my computer randomly generated |
20:15:45 | FromGitter | <kayabaNerve> No wonder it needed me to ask questions |
20:17:15 | Araq | shashlick: smart solution, I like it |
20:17:45 | shashlick | awesome |
20:17:49 | shashlick | guess where I got it :P |
20:18:35 | FromGitter | <alehander42> As a |
20:18:59 | shashlick | data-man: tried on #head from 5/08 and that failed too |
20:24:11 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:25:49 | * | FuntDobra joined #nim |
20:26:43 | FromGitter | <data-man> :) BTW self-assigned |
20:29:46 | FromGitter | <data-man> Thanks for check! |
20:30:22 | shashlick | I think I have a guess |
20:30:42 | shashlick | https://github.com/nim-lang/Nim/pull/7763/commits/91e54e18f5abac2707b1e9e40e1eff7a46412cbb#diff-542c6941dcdbb1b75c8f3f0b4dd3d4acR68 |
20:30:42 | * | nsf joined #nim |
20:30:55 | shashlick | len-1 == 0 means 1 char |
20:31:38 | * | BitPuffin quit (Remote host closed the connection) |
20:31:59 | * | elrood quit (Quit: Leaving) |
20:38:14 | * | nsf quit (Quit: WeeChat 2.1) |
20:42:34 | FromGitter | <data-man> Sure, fixed. Thanks again! |
20:44:01 | shashlick | awesome |
20:50:04 | shashlick | verified |
20:51:08 | FromGitter | <data-man> I checked before commit. :) |
20:51:40 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:52:14 | shashlick | nift |
20:54:04 | FromGitter | <data-man> This? :) https://nift.ac.in |
20:54:53 | shashlick | araq: can we check in the updated bat files into csources? I understand we cannot impact older releases but at least any new git clones of csources (and choosenim) will get the newer batch files |
20:55:45 | shashlick | i can then continue to fix stuff from your choosenim wishlist |
21:02:06 | FromGitter | <kayabaNerve> @mratsim Update on NUInt the div/mod functions are to slow to be usable. RIP. Fixing them now by subtracting value * 2 until value * 2 > subtractor |
21:02:54 | FromGitter | <kayabaNerve> I couldn't even convert a UNIX timestamp to Hex |
21:13:48 | Araq | shashlick: well we will do it for 0.19 |
21:14:13 | shashlick | is that soon? |
21:15:33 | FromGitter | <data-man> This summer. :) |
21:19:35 | Araq | https://travis-ci.org/nim-lang/Nim/jobs/381787857 |
21:20:14 | Araq | clang-5.0: error: unable to execute command: Segmentation fault (core dumped) |
21:20:14 | Araq | clang-5.0: error: clang frontend command failed due to signal (use -v to see invocation) |
21:20:14 | Araq | clang version 5.0.0 (tags/RELEASE_500/final) |
21:20:29 | Araq | ^ any hints would be welcome |
21:21:49 | * | zszf6cefj5iz joined #nim |
21:25:12 | * | yglukhov[i] quit (Ping timeout: 245 seconds) |
21:26:21 | PMunch | data-man, I just pushed some fixes to parsetoml |
21:26:31 | PMunch | It should now work with the example for 0.4.0 |
21:26:40 | PMunch | And pass all the same tests in the validation suite |
21:26:58 | * | yglukhov[i] joined #nim |
21:30:09 | * | FuntDobra quit (Ping timeout: 252 seconds) |
21:31:05 | * | yglukhov[i] quit (Ping timeout: 245 seconds) |
21:32:41 | FromGitter | <data-man> @PMunch: Cool! |
21:34:13 | FromGitter | <Varriount> Araq: That crashed Clang? |
21:38:49 | * | nolanv quit (Read error: Connection reset by peer) |
21:39:18 | Araq | apparently |
21:39:58 | * | yglukhov[i] joined #nim |
21:42:14 | FromGitter | <data-man> update to clang 6.0? ⏎ I'm testing now, but not in Ubuntu |
21:45:16 | * | nolanv joined #nim |
21:53:13 | FromGitter | <data-man> Tests passed without crash. clang 6.0, ArchLinux |
21:54:46 | FromGitter | <mratsim> @kayabaNerve well string operations are slow ;) |
21:58:37 | shashlick | .bat is probably the crappiest language on the planet |
22:01:02 | FromGitter | <data-man> No. There are esoteric langs. :) |
22:01:57 | FromGitter | <kayabaNerve> @mratsim That's not the issue |
22:02:02 | FromGitter | <kayabaNerve> I don't think at least |
22:02:12 | FromGitter | <kayabaNerve> How can I invert a bool? !bool failed |
22:02:26 | PMunch | not bool |
22:03:02 | FromGitter | <kayabaNerve> Thanks |
22:03:24 | FromGitter | <kayabaNerve> I knew it was something simple. I was about to write != true |
22:08:21 | FromGitter | <data-man> @PMunch: Is ```validator hard_example_unicode.toml``` also passed for you? |
22:09:18 | PMunch | hard_example_unicode? |
22:09:54 | PMunch | Oh |
22:09:56 | FromGitter | <data-man> https://github.com/toml-lang/toml/blob/master/tests/hard_example_unicode.toml |
22:09:56 | PMunch | There are more |
22:10:42 | PMunch | Hmm, it appears to just hang |
22:11:03 | FromGitter | <data-man> Yes, same for me. |
22:12:27 | PMunch | Hmm, the parser reads char by char.. |
22:12:39 | * | xkapastel joined #nim |
22:12:49 | * | xet7 quit (Remote host closed the connection) |
22:12:51 | PMunch | So it probably messes up with Unicode |
22:12:52 | FromDiscord | <Kayaba> @mratsim What I meant to say, is I don't do any string operations besides & |
22:13:07 | FromDiscord | <Kayaba> That shifts the entire array, of course, which is slow |
22:13:34 | FromDiscord | <Kayaba> But the rest is digit by digit. I just subtract the ascii base from the digit and process it |
22:13:53 | FromDiscord | <Kayaba> In this case, the case is 0 |
22:13:58 | FromGitter | <data-man> PMunch: I think so. |
22:14:07 | FromDiscord | <Kayaba> *base |
22:14:32 | FromDiscord | <Kayaba> For base 58, there's 6 bases. For base 16, it's 0 and A (+an offset) |
22:14:51 | PMunch | data-man, hmm. There's no readRune in the streams or unicode module.. |
22:17:10 | shashlick | sizof(void *) randomly gives me a value of 3, instead of 4 |
22:17:14 | shashlick | what on earth |
22:17:46 | shashlick | araq ^^ |
22:18:10 | FromGitter | <mratsim> you’re not on Earth actually, that’s why |
22:18:20 | FromGitter | <data-man> :) |
22:18:42 | FromGitter | <mratsim> but sizeof(void *) should be 8 on any x86_64 machine no? |
22:19:21 | shashlick | i'm getting a value of 3 randomly |
22:19:30 | shashlick | both on 32-bit and 64-bit GCC |
22:19:41 | FromGitter | <mratsim> even in pure C? |
22:19:47 | shashlick | yep |
22:20:02 | * | nolanv quit (Read error: Connection reset by peer) |
22:22:57 | FromGitter | <data-man> @PMunch: Maybe we need fastRuneAt for openarray[byte|char] |
22:23:15 | PMunch | It reads from a stream though |
22:23:23 | PMunch | So we would need a readRune |
22:23:30 | PMunch | or readUtf8 in streams |
22:23:33 | PMunch | Or anywhere really |
22:24:40 | shashlick | can someone try this on windows a few times? |
22:25:20 | shashlick | echo int main^(^) { return sizeof^(void *^); } | gcc -o archtest -xc - && archtest |
22:26:38 | * | nolanv joined #nim |
22:26:51 | PMunch | I'm only getting 8's on my Linux machine |
22:27:51 | FromGitter | <data-man> No, not readRune in unicode. This module is free from imports. :) |
22:28:19 | PMunch | In streams then |
22:30:18 | FromGitter | <data-man> Ok. |
22:32:44 | * | Trustable quit (Remote host closed the connection) |
22:36:08 | * | nolanv quit (Quit: WeeChat 2.0.1) |
22:36:27 | * | yglukhov[i] quit (Ping timeout: 245 seconds) |
22:38:05 | PMunch | Something like this: http://ix.io/1b1a |
22:40:28 | * | skellock joined #nim |
22:40:53 | FromGitter | <data-man> I would prefer to read a block of data from a file in a parser. And implement fastRuneAt for openarrays. |
22:41:07 | * | yglukhov[i] joined #nim |
22:42:20 | PMunch | Why? |
22:42:38 | PMunch | A stream is just an "interface" |
22:43:18 | PMunch | So implement an OpenArrayStream and voilá, now readRune works for openarrays as well |
22:43:37 | PMunch | Well, openarray might not work, but you get the point :P |
22:43:38 | FromGitter | <data-man> Code duplication in streams. Even better to implement utf8stream |
22:44:42 | PMunch | Ah you don't want to have the readRune which is basically a copy of fastRuneAt |
22:44:52 | FromGitter | <data-man> Yes |
22:44:59 | PMunch | That's a fair point.. |
22:45:09 | PMunch | Nim should have some sort of conditional definition |
22:45:21 | PMunch | "if you have imported streams, create this procedure" |
22:48:09 | * | PMunch quit (Quit: leaving) |
22:48:35 | FromGitter | <data-man> Is ```when declared(...)``` not worked? |
23:34:04 | * | leorize joined #nim |
23:38:32 | * | yglukhov[i] quit (Ping timeout: 245 seconds) |
23:49:03 | * | skellock quit (Read error: Connection reset by peer) |
23:57:08 | * | skellock joined #nim |