00:06:51 | * | krux02_ joined #nim |
00:07:28 | FromDiscord | <Skaruts> yea I didn't know about insert until a moment ago... |
00:08:33 | FromDiscord | <Skaruts> there's also `del` if you don't care about the item order -- O(1) according to docs |
00:09:43 | * | krux02 quit (Ping timeout: 246 seconds) |
00:12:48 | axion | What should I use instead of newIdentNode? The compiler is telling me it's deprecated, but jumping to the definition doesn't have any documentation telling me what to use instead. |
00:13:46 | * | zedeus quit (Ping timeout: 250 seconds) |
00:19:30 | leorize | axion: ident"ident here" |
00:20:19 | axion | How do I create an ident node from an untyped argument? |
00:20:30 | axion | i'm struggling here, even with the deprecated way |
00:23:30 | * | zedeus joined #nim |
00:25:18 | rayman22201 | an ident is just a nimNode with the type "nnkIdent", so you could construct it directly |
00:25:27 | leorize | axion: untyped argument are ident by default :P |
00:25:54 | leorize | you have two ways to force it to be nnkIndent: either with expectIdent |
00:26:04 | axion | Yeah I tried that... |
00:26:16 | leorize | or with the less documented feature of `arg: untyped{nkIdent}` |
00:26:29 | axion | i can't even make an ident node from a string type |
00:26:36 | axion | i have a bit to learn it seems |
00:27:17 | rayman22201 | static[string]? |
00:27:31 | rayman22201 | what are you trying to do? |
00:27:55 | leorize | I'd say be absolutely careful when using static[T] with macros |
00:28:09 | axion | one sec |
00:29:49 | axion | https://play.nim-lang.org/#ix=2exA |
00:30:05 | axion | trying to get rid of the hard-coded "<" infix op |
00:36:32 | * | dadada joined #nim |
00:36:56 | * | dadada is now known as Guest39039 |
00:37:50 | * | dwdv quit (Ping timeout: 256 seconds) |
00:40:24 | * | ftsf quit (Read error: Connection reset by peer) |
00:42:05 | rayman22201 | https://play.nim-lang.org/#ix=2exD |
00:42:10 | rayman22201 | static string works in this case |
00:42:57 | axion | I actually want to pass it in as an identifier and not a string |
00:46:25 | rayman22201 | Nim tries to parse the the expression passed to the macro before it sends to the macro, so just doing `foo(<, v1, v2)` errors. :-/ |
00:46:31 | rayman22201 | hrmmmm. not sure how to get around that |
00:47:16 | Yardanico | for < you need backticks |
00:47:18 | Yardanico | `<` |
00:47:23 | * | Hideki_ joined #nim |
00:47:32 | rayman22201 | ah, duh |
00:47:55 | rayman22201 | https://play.nim-lang.org/#ix=2exH |
00:48:38 | axion | Ah thanks! |
00:48:38 | * | zedeus quit (Ping timeout: 246 seconds) |
00:49:00 | rayman22201 | operators must have backticks, I always forget. one of those silly things |
00:52:00 | * | Hideki_ quit (Ping timeout: 256 seconds) |
00:52:41 | * | Zectbumo quit (Remote host closed the connection) |
01:00:07 | * | clyybber quit (Quit: WeeChat 2.7.1) |
01:05:25 | * | Zectbumo joined #nim |
01:08:22 | * | Guest39039 quit (Ping timeout: 250 seconds) |
01:08:49 | FromGitter | <zetashift> So I'm not familiar with CI's, but last days everytime I browse Nim on GitHub I see some comment on CI blocking stuff, is that normal? |
01:10:14 | * | dadada__ joined #nim |
01:12:04 | FromGitter | <Knaque> Hey, out of curiosity, is `--d:release` basically the equivalent of 02 in C? |
01:13:01 | Yardanico | well kinda yeah, but Nim itself uses -O3 for compiled C (I mean when it passes C code to the C compiler). |
01:13:07 | Yardanico | -d:danger is like C's -O3 |
01:13:25 | Yardanico | all checks disabled |
01:15:02 | FromGitter | <Knaque> But it's still stable even though its O3? |
01:15:09 | Yardanico | yes |
01:15:15 | FromGitter | <Knaque> Nice. |
01:16:36 | * | Skaruts quit (Ping timeout: 240 seconds) |
01:21:17 | * | zedeus joined #nim |
01:23:43 | * | opal quit (Ping timeout: 240 seconds) |
01:27:07 | * | opal joined #nim |
01:31:20 | * | zedeus quit (Ping timeout: 246 seconds) |
01:38:01 | FromDiscord | <Rika> ive been whining about this for months now but |
01:38:15 | FromDiscord | <Rika> im still irked by the fact that space indentation is enforced in nim |
01:39:17 | leorize | zetashift: no, the CI service we are using was broken then |
01:39:34 | leorize | I managed to push a walkaround so things work again |
01:39:59 | * | zedeus joined #nim |
01:40:01 | leorize | and now we have a fallback pipeline so if the main ever die again we won't get blocked |
01:51:30 | * | zedeus quit (Ping timeout: 256 seconds) |
01:56:07 | * | krux02_ quit (Remote host closed the connection) |
02:03:37 | * | gangstacat quit (Ping timeout: 272 seconds) |
02:05:01 | * | gangstacat joined #nim |
02:06:16 | dadada__ | is the linenoise package from nimble working for anybody? just installed and imported it |
02:06:27 | dadada__ | and it doesn't find the symbols |
02:06:30 | * | dadada__ is now known as dadada |
02:06:48 | dadada | Error: undeclared identifier: 'linenoisePrompt' |
02:07:29 | dadada | nimble install linenoise |
02:07:34 | dadada | import linenoise in a nim file |
02:07:44 | dadada | and put a call linenoisePrompt("test") there |
02:08:45 | FromDiscord | <Rika> linenoise is stdlib |
02:09:02 | FromDiscord | <Rika> what package are you talking about? |
02:09:17 | FromDiscord | <Rika> dadada ^ |
02:09:32 | dadada | the one that I found on nimble |
02:09:52 | dadada | https://nimble.directory/pkg/linenoise |
02:10:14 | shashlick | Someone ported it recently wholesale |
02:11:16 | FromDiscord | <Rika> you can just use `std/linenoise` and then it's `readLine` instead of `linenoisePrompt` |
02:11:54 | dadada | Rika: did they also port the original linenoise code to nim? |
02:12:36 | FromDiscord | <Rika> no, its just a wrapper |
02:12:41 | FromDiscord | <Rika> the stdlib one |
02:13:04 | dadada | ok, I'm missing a way to timeout the readLine proc |
02:13:13 | FromDiscord | <Rika> dont think you can |
02:13:24 | dadada | yeah, I noticed it from googling around :-( |
02:13:31 | FromDiscord | <Rika> i ported linenoise to pure-ish-not-really nim |
02:14:56 | FromDiscord | <Rika> https://github.com/de-odex/linenoise-nim if you want to adapt it, i'm pretty sure there are still some bugs in the code but it mostly works |
02:15:10 | FromDiscord | <Rika> i estimate around like 70% of it works but oh well it was just an experiment |
02:16:25 | dadada | please take this experiment to something useful :D |
02:16:57 | dadada | if you add a way to timeout the readline, I'm for sure going to use that! |
02:17:07 | FromDiscord | <Rika> i dont know of any bugs right now, afaik hints and completion work, history works (not the same as linenoise, but similar) |
02:17:32 | FromDiscord | <Rika> oh yeah btw the stdlib doesnt have hints or mask mode |
02:17:49 | FromDiscord | <Rika> which is interesting, maybe that linenoise needs a bit of updating |
02:18:11 | dadada | the linenoise c library has regular activity on github, I just saw it |
02:18:27 | FromDiscord | <Rika> anyway, timing out the readline sounds maybe doable? i dont know how i'd implement |
02:18:36 | FromDiscord | <Rika> *it, maybe you can dadada |
02:19:05 | FromDiscord | <Rika> it's almost idiomatic nim, aka not like raw C-converted nim |
02:19:10 | FromDiscord | <Rika> so yeah maybe you can do it |
02:19:13 | FromDiscord | <Rika> i have to sleep |
02:19:19 | FromDiscord | <Rika> ill consider doing it if you cant |
02:19:23 | FromDiscord | <Rika> anyway see you |
02:19:43 | dadada | good night! |
02:19:48 | dadada | thanks for the chat |
02:32:53 | * | ilyacher joined #nim |
02:33:22 | * | ilyacher left #nim (#nim) |
02:36:59 | * | zedeus joined #nim |
02:40:03 | * | chemist69_ joined #nim |
02:42:50 | * | chemist69 quit (Ping timeout: 250 seconds) |
02:47:47 | * | rockcavera quit (Remote host closed the connection) |
03:09:16 | * | muffindrake quit (Ping timeout: 246 seconds) |
03:11:34 | * | muffindrake joined #nim |
03:54:23 | * | Zectbumo quit (Remote host closed the connection) |
04:05:22 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
04:50:19 | * | nsf joined #nim |
05:16:47 | dadada | Rika: did you see this? https://github.com/jangko/nim-noise |
05:33:32 | * | dddddd quit (Ping timeout: 246 seconds) |
05:38:52 | * | narimiran joined #nim |
05:40:00 | * | silvernode-mobil joined #nim |
05:44:24 | * | silvernode-mobil quit (Ping timeout: 256 seconds) |
05:48:58 | * | silvernode-mobil joined #nim |
05:53:03 | * | opal quit (Ping timeout: 240 seconds) |
05:53:04 | * | silvernode-mobil quit (Ping timeout: 250 seconds) |
05:57:30 | * | silvernode joined #nim |
06:01:56 | * | opal joined #nim |
06:14:03 | * | opal quit (Ping timeout: 240 seconds) |
06:17:24 | * | opal joined #nim |
06:24:16 | silvernode | so I think if I want to create an inventory system, I probably want to use tables and hashes instead of seqs but I am not sure. I just found out there were tables in Nim. |
06:34:01 | * | solitudesf joined #nim |
06:41:45 | * | zahary joined #nim |
06:53:08 | FromDiscord | <Elegant Beef> Well sequences dont give you the a -> b logic that tables do, indicies dont indicate exactly what the value represents |
06:54:07 | * | MarderIII joined #nim |
06:57:13 | * | silvernode quit (Ping timeout: 264 seconds) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:50 | * | gmpreussner joined #nim |
07:09:27 | * | silvernode-mobil joined #nim |
07:11:28 | * | gmpreussner quit (Ping timeout: 246 seconds) |
07:13:07 | FromGitter | <gogolxdong> build Nim got error `undefined reference to `__builtin_saddll_overflow'` |
07:16:31 | FromGitter | <gogolxdong> with gcc-4.8.5 |
07:23:34 | FromGitter | <gogolxdong> (https://files.gitter.im/nim-lang/Nim/jDui/image.png) |
07:23:54 | * | zahary quit (Quit: Leaving.) |
07:24:32 | FromGitter | <gogolxdong> Does this mean gcc 6.56 is needed at least? |
07:25:56 | * | PMunch joined #nim |
07:44:58 | FromGitter | <timotheecour> that was my suspicion, that we need to detect whether `builtin_saddll_overflow’` is available |
07:46:30 | * | zahary joined #nim |
07:47:25 | FromGitter | <timotheecour> @gogolxdong see https://github.com/nim-lang/Nim/issues/13645 |
07:47:27 | disbot | ➥ Generate c code cannot compile with recent devel version ; snippet at 12https://play.nim-lang.org/#ix=2ecR |
07:48:59 | * | silvernode-mobil quit (Ping timeout: 246 seconds) |
07:49:15 | * | tdog joined #nim |
07:49:20 | * | silvernode-mobil joined #nim |
07:57:04 | * | zahary quit (Quit: Leaving.) |
08:04:14 | * | zahary joined #nim |
08:17:02 | * | zahary quit (Quit: Leaving.) |
08:17:20 | Araq | GCC is at version 9 now |
08:17:30 | Araq | I think we're fine with requiring at least GCC version 6 |
08:19:04 | * | MarderIII quit (Quit: Leaving) |
08:21:15 | * | zahary joined #nim |
08:25:46 | * | zahary quit (Client Quit) |
08:30:29 | FromGitter | <kristianmandrup> Trying to make a React 16 minimal sample app. Getting `Error: undeclared identifier: 'document'` even though I `import dom`. What am I missing? |
08:31:31 | FromDiscord | <Varriount> Hi Araq |
08:32:37 | * | zahary joined #nim |
08:35:01 | PMunch | Hmm, is there a way to ignore overflow errors? |
08:37:37 | * | zahary quit (Quit: Leaving.) |
08:40:59 | * | endragor joined #nim |
08:43:05 | PMunch | mratsim, your video is now up at the FOSDEM site: https://fosdem.org/2020/schedule/event/nimultralowoverheadruntime/ |
08:43:21 | PMunch | Apparently the guy in charge of putting the links up got married and was busy with that :P |
08:44:09 | PMunch | kristianmandrup, that does indeed sound strange, do you have any example code? |
08:55:09 | dadada | isn't when false: supposed to be effectively like commented out code? |
08:55:31 | dadada | I've something in there that generated a syntax error |
08:56:18 | * | crem joined #nim |
08:56:54 | dadada | PMunch: thanks, I'm watching mratsim's presentation now |
08:56:55 | FromGitter | <kristianmandrup> I solved it by importing `document` directly |
08:57:19 | FromGitter | <kristianmandrup> Still having loads of issues simply operating on the dom |
08:57:21 | FromGitter | <kristianmandrup> https://github.com/kristianmandrup/react-16.nim/issues/1#issuecomment-600497229 |
08:57:22 | disbot | ➥ [Error] rtype.nim errors |
08:57:31 | dadada | first thing I learned is that I need a nim shirt |
08:58:03 | PMunch | dadada, yes `when false` is like commented out code to the compiler, a syntax checker should still look at it as it's still code. |
08:58:23 | PMunch | dadada, have you seen the other talks as well? |
08:59:33 | PMunch | kristianmandrup, how did you import document directly? |
08:59:44 | PMunch | You probably ended up only importing document.. |
09:00:00 | PMunch | But I still think you're doing something weird, it should just work with import dom |
09:01:59 | FromGitter | <kristianmandrup> `from dom import document, Element, Document` |
09:04:54 | PMunch | Yeah, no wonder that doesn't work. You haven't imported the `getElementById` procedure. |
09:05:39 | FromGitter | <kristianmandrup> Got it working no with `import dom` like you said. Not sure why I had issues before |
09:05:51 | FromGitter | <kristianmandrup> I have this weird problem now |
09:05:51 | PMunch | Nim doesn't have classes in the same way that most OO languages have. So when you import `Document` you don't import a class with all it's procedures, you're just importing the `Document` type itself. |
09:05:52 | FromGitter | <kristianmandrup> var ⏎ React*{.importc, nodecl.}: ReactGlobal ⏎ ReactDOM*{.importc, nodecl.}: ReactDOMGlobal |
09:06:00 | FromGitter | <kristianmandrup> proc render*(reactDom: ReactDOMGlobal, node: Document, el: Element) |
09:06:23 | FromGitter | <kristianmandrup> using `ReactDOM.render(makeTopLevel(), content)` it complains |
09:06:38 | FromGitter | <kristianmandrup> type mismatch: got <ReactDOMGlobal, ReactNode, Element> ⏎ but expected one of: ⏎ macro `.()`(obj: JsObject; field: untyped; args: varargs[JsObject, jsFromAst]): JsObject ⏎ first type mismatch at position: 1 ⏎ required type for obj: JsObject ... [https://gitter.im/nim-lang/Nim?at=5e71e49eb720913bec9e04bd] |
09:07:37 | PMunch | You seem to be missing the render procedure. Those errors are generated by a macro `.()` that rewrites itself whenever you have a unknown procedure call |
09:08:04 | PMunch | And please don't paste code into Gitter, it comes through to IRC as completely unreadable and fills up the channel. |
09:08:09 | PMunch | Use a paste site instead |
09:08:24 | PMunch | Like ix or hastebin |
09:09:11 | FromGitter | <kristianmandrup> ok |
09:09:48 | PMunch | If you don't need it you can probably do import jsffi except `.()` to avoid having that error. |
09:10:01 | PMunch | It still won't work, but at least you might get a better error message |
09:14:09 | FromGitter | <kristianmandrup> solved it now. Helped a lot to know that was the cause of the error, a missing import |
09:14:16 | FromGitter | <kristianmandrup> Tanks PMunch |
09:14:28 | PMunch | No problem :) |
09:14:58 | * | Zectbumo joined #nim |
09:17:43 | Araq | dadada, 'when false' still requires syntactically valid Nim code |
09:17:47 | Araq | that's kind of its point |
09:18:19 | * | Vladar joined #nim |
09:18:34 | * | dwdv joined #nim |
09:19:03 | * | Zectbumo quit (Remote host closed the connection) |
09:23:22 | PMunch | Hmm "Error: illegal capture 'ipAddr_str' because ':anonymous' has the calling convention: <inline>" is this a new error? |
09:24:05 | * | tane joined #nim |
09:24:17 | Araq | not really but it makes sense, right? |
09:30:06 | PMunch | Well, this project used to build, and has been running in production for a while now. So why did it use to work? |
09:38:13 | Araq | the compiler was less picky in previous versions |
09:42:11 | PMunch | But it worked, that's what I'm curious about |
09:42:32 | PMunch | Was that procedure just never inlined because it couldn't be? |
09:42:42 | Araq | yup |
09:42:53 | Araq | the compiler turned it into a .closure under your hood |
09:43:10 | PMunch | Ah okay, so it's just the compiler now telling you that you're doing something dumb :P |
09:57:19 | * | disbot quit (Ping timeout: 258 seconds) |
09:57:38 | * | disruptek quit (Ping timeout: 256 seconds) |
09:59:44 | * | junland_ joined #nim |
09:59:55 | * | shashlick_ joined #nim |
10:01:22 | * | d10n_ joined #nim |
10:03:10 | * | luis_ joined #nim |
10:04:48 | * | dom96 quit (*.net *.split) |
10:04:48 | * | d10n quit (*.net *.split) |
10:04:48 | * | yumaikas quit (*.net *.split) |
10:04:48 | * | mwbrown quit (*.net *.split) |
10:04:49 | * | shashlick quit (*.net *.split) |
10:04:49 | * | junland quit (*.net *.split) |
10:05:17 | * | mwbrown joined #nim |
10:05:35 | * | dom96 joined #nim |
10:05:35 | * | dom96 quit (Changing host) |
10:05:35 | * | dom96 joined #nim |
10:06:06 | * | yumaikas joined #nim |
10:06:21 | * | clyybber joined #nim |
10:11:50 | * | krux02 joined #nim |
10:23:11 | * | luis_ quit (Quit: luis_) |
10:23:40 | * | luis_ joined #nim |
10:27:43 | * | luis_ quit (Client Quit) |
10:29:14 | xace | does `nim c` have an option for running `strip -s` on the resulting binary? |
10:30:45 | Araq | nah |
10:40:47 | clyybber | Araq: AFAICT the first snippet here: http://ix.io/2ezf does the same thing (effectively) as the second one |
10:41:12 | clyybber | Do we not analyze closure captures like in the second case or are we overly pessimistic in the first? |
10:43:55 | * | silvernode-mobil quit (Ping timeout: 246 seconds) |
10:45:52 | Araq | these snippets are not comparable |
10:49:09 | livcd | Araq can you help Ward with arc ? :-) |
10:50:20 | Araq | link? |
10:56:59 | livcd | https://forum.nim-lang.org/t/6072 |
10:57:33 | Araq | fixed on devel |
11:05:55 | * | silvernode-mobil joined #nim |
11:06:45 | * | narimiran quit (Ping timeout: 250 seconds) |
11:33:49 | * | NimBot joined #nim |
11:34:17 | * | ng0 is now known as nikita` |
11:34:39 | * | wowaname joined #nim |
11:35:23 | * | opal quit (Ping timeout: 240 seconds) |
11:49:48 | * | nsf quit (Quit: WeeChat 2.7) |
11:58:20 | * | rockcavera joined #nim |
12:12:56 | PMunch | macroutils package now available on the playground: https://play.nim-lang.org/#ix=2ezy |
12:19:57 | * | zahary joined #nim |
12:26:16 | FromGitter | <kaushalmodi> PMunch: Can playground nimble install all the "popular" nimble packages, at least the ones in nim test suite? |
12:29:04 | PMunch | kaushalmodi, you mean like these ones? https://play.nim-lang.org/#ix=2ezF |
12:30:12 | PMunch | PRs welcome to this list to add new packages: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble |
12:31:47 | * | narimiran joined #nim |
12:34:24 | PMunch | That list was seeded with the important_packages list, but some things were dropped (like some GUI stuff that didn't make sense to run on the playground). |
12:34:39 | FromGitter | <kaushalmodi> PMunch: Awesome! I didn't know that. Thanks! |
12:35:12 | * | nsf joined #nim |
12:36:35 | PMunch | :D |
12:38:27 | FromDiscord | <demotomohiro> There is /playground/nimble/nimcuda. That means Nim playground server has nvidia GPU? |
12:38:59 | PMunch | Hehe, no |
12:39:08 | PMunch | It's just a package that hasn't been pruned yet |
12:41:12 | FromDiscord | <demotomohiro> iirc, you cannot use CUDA without nvidia GPU. |
12:43:09 | Araq | true |
12:45:08 | FromGitter | <alehander92> @kristianmandrup |
12:45:14 | FromGitter | <alehander92> did you fix your react code |
12:47:33 | * | Hideki_ joined #nim |
12:52:56 | clyybber | PMunch: Is superQuote a replacement for quote? |
12:53:04 | clyybber | Without quote's issues? |
12:53:23 | PMunch | Well, it rewrites to a quote statement. But the idea is for it to fix the issues with quote, yes |
12:53:49 | Araq | ha, many have tried |
12:53:53 | Araq | many have failed :P |
12:53:56 | PMunch | The only one it does now though is to lift the contents of the quotes out as variables so you're able to put more than simple identifiers in there. |
12:54:49 | PMunch | Araq, I already managed to fix the "result" in quote issue ;) And that could've been done in a macro like this instead of my PR to the Nim repo. |
12:55:18 | PMunch | So I'm optimistic that I'll be able to apply various fixes and workarounds this way |
12:55:24 | Araq | Cloning into 'Nim'... |
12:55:24 | Araq | + cd Nim |
12:55:24 | Araq | + git checkout -q 670735e4436976eb82c121d47d4617dcd303ba89 |
12:55:24 | Araq | error: Your local changes to the following files would be overwritten by checkout: |
12:55:24 | Araq | tests/tools/second.nim |
12:55:25 | Araq | Please commit your changes or stash them before you switch branches. |
12:55:29 | Araq | what up with this shit? |
12:55:43 | PMunch | Yeah I got that on the playground as well |
12:55:44 | Araq | I only changed the newlines in there to LF |
12:56:05 | Araq | probably because |
12:56:06 | Araq | # tests expects the text files associated with them have LF only as EOL |
12:56:06 | Araq | **/test*/**/* text eol=lf |
12:56:09 | PMunch | git clone https://github.com/nim-lang/Nim; cd Nim; git checkout v1.0.6 |
12:56:13 | PMunch | Caused a similar issue |
12:56:19 | Araq | in our new .gitattributes |
12:56:26 | PMunch | I just changed it to "git checkout -f v1.0.6" though |
12:57:24 | Araq | no idea how to do that with build.ht.rs |
13:04:40 | * | silvernode-mobil quit (Ping timeout: 250 seconds) |
13:05:00 | * | silvernode-mobil joined #nim |
13:07:53 | * | endragor quit (Remote host closed the connection) |
13:09:01 | * | endragor joined #nim |
13:12:25 | * | lritter joined #nim |
13:13:40 | * | smitop joined #nim |
13:14:01 | * | endragor quit (Ping timeout: 264 seconds) |
13:27:54 | * | Tungki joined #nim |
13:29:20 | * | dddddd joined #nim |
13:29:31 | * | Tungki quit (Read error: Connection reset by peer) |
13:29:38 | clyybber | Araq: Hmm, is an infinite recursion with nimDestroyAndDispose a bug? |
13:30:21 | * | zahary quit (Quit: Leaving.) |
13:30:41 | clyybber | with --gc:arc that is |
13:39:44 | Araq | clyybber, yeah but not the bug you think it is |
13:39:47 | Araq | it's a corruption |
13:41:35 | Araq | I'm about to merge my scope based destruction branch but will disable the logic |
13:41:43 | Araq | in order to prevent it from bitrotting |
13:44:14 | * | junland_ quit (Ping timeout: 246 seconds) |
13:44:56 | * | d10n_ quit (Ping timeout: 246 seconds) |
13:45:52 | * | d10n joined #nim |
13:46:59 | * | d10n quit (Changing host) |
13:46:59 | * | d10n joined #nim |
13:49:10 | * | junland joined #nim |
13:53:20 | FromGitter | <gogolxdong> centos7 ships gcc-4.8.5 or have to build from source |
13:55:08 | * | zahary joined #nim |
13:55:47 | leorize | Araq: is --staticBoundChecks array-only? |
13:56:33 | leorize | or do we have plans to extend it to range[]? |
13:57:05 | * | Hideki_ quit (Remote host closed the connection) |
13:58:15 | * | Hideki_ joined #nim |
13:58:41 | * | Hideki_ quit (Remote host closed the connection) |
13:58:56 | * | Hideki_ joined #nim |
14:01:23 | * | silvernode-mobil quit (Ping timeout: 250 seconds) |
14:06:13 | * | sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in) |
14:10:34 | * | Vladar quit (Quit: Leaving) |
14:11:46 | * | Zectbumo joined #nim |
14:12:01 | * | sacredfrog joined #nim |
14:23:31 | * | Hideki_ quit (Remote host closed the connection) |
14:24:14 | * | Hideki_ joined #nim |
14:25:38 | * | jjido joined #nim |
14:28:34 | * | Hideki_ quit (Ping timeout: 256 seconds) |
14:30:27 | * | disruptek joined #nim |
14:31:08 | * | xet7 quit (Quit: Leaving) |
14:31:33 | * | disbot joined #nim |
14:37:50 | * | Hideki_ joined #nim |
14:41:18 | * | natrys joined #nim |
14:42:50 | * | silvernode-mobil joined #nim |
14:44:04 | * | nsf quit (Quit: WeeChat 2.7) |
14:48:24 | axion | Sigh. I think I need help fixing up my macro. |
14:49:02 | FromDiscord | <Rika> sure |
14:49:06 | FromDiscord | <Rika> what's it doing? |
14:49:28 | axion | Well I have to extend it a little. Let me make a playground |
14:50:45 | * | skrylar[m] quit (Ping timeout: 245 seconds) |
14:51:09 | * | Demos[m] quit (Ping timeout: 245 seconds) |
14:51:35 | * | reversem3 quit (Ping timeout: 245 seconds) |
14:52:03 | * | skrylar[m] joined #nim |
14:52:43 | * | mattmurr quit (Disconnected by services) |
14:52:51 | * | mattmurr joined #nim |
14:54:29 | * | Demos[m] joined #nim |
14:55:34 | axion | @Rika: https://play.nim-lang.org/#ix=2eAH |
14:55:42 | * | reversem3 joined #nim |
14:55:57 | FromDiscord | <Rika> i can run it right now? |
14:56:06 | FromDiscord | <Rika> i mean it runs in playground? |
14:56:18 | axion | Yeah |
14:56:35 | FromDiscord | <Rika> whats the issue exactly |
14:56:59 | * | mattmurr quit (Client Quit) |
14:57:12 | axion | the TODO |
14:58:03 | FromGitter | <russmack> Oh, I didn't know there was a nim playground :) |
14:58:15 | FromDiscord | <Rika> one moment then ill think |
14:58:32 | Yardanico | @russmack it's available for quite a while now :) |
14:58:34 | axion | @Rika also should probably be a pragma macro but i couldnt figure that out |
14:59:13 | FromGitter | <russmack> Nice. I've only been Nimming for a month or two. |
15:00:36 | FromGitter | <russmack> What is an example of using an exception where the finally block executes without subsequent code running? ie this answer doesn't seem applicable to Nim: https://stackoverflow.com/questions/50618/what-is-the-point-of-the-finally-block |
15:01:12 | * | shashlick_ quit (Quit: quit) |
15:01:14 | Yardanico | "If there is a finally part, it is always executed after the exception handlers." |
15:01:20 | FromDiscord | <Rika> axion, you want the same macro to handle both infix and prefix |
15:01:28 | FromGitter | <russmack> right, but so is the next bit of code |
15:01:30 | Yardanico | so for example in try you open a socket, in "except" you catch an exception, and in "finally" you always close the socket |
15:01:34 | * | shashlick joined #nim |
15:02:00 | Yardanico | @russmack but if an exception occurs code after exception won't be called |
15:02:02 | Yardanico | but finally will |
15:02:12 | Yardanico | "The exception is consumed in an except part. If an exception is not handled, it is propagated through the call stack. This means that often the rest of the procedure - that is not within a finally clause - is not executed (if an exception occurs)." from tutorial 2 |
15:02:16 | Yardanico | https://nim-lang.org/docs/tut2.html#exceptions-try-statement |
15:02:24 | axion | Rika: Yes, and I want to get rid of the duplication in the proc definition. It should be able to tell how to call the macro based on the proc signature...which is why I thought to use a pragma |
15:02:48 | axion | Rika: I forgot to add the usage with echo's: https://play.nim-lang.org/#ix=2eAM |
15:03:01 | FromDiscord | <Rika> one moment, i need to remember some macro stuff |
15:03:12 | FromDiscord | <Rika> its been a week since i wrote macro nim code |
15:03:42 | FromGitter | <russmack> ah got it, thanks @Yardanico |
15:04:09 | Yardanico | the link you gave also provides an answer like that |
15:04:13 | Yardanico | "Depends on the language as there might be some slight semantic differences, but the idea is that it will execute (almost) always, even if the code in the try block threw an exception." |
15:05:22 | FromGitter | <russmack> yeah, my issue was that in my examples subsequent code was always executing too. But, fixed now. Thanks. |
15:11:41 | FromDiscord | <Rika> ok axion, a few issues: 1) your macro only handles procs that return booleans |
15:11:50 | FromDiscord | <Rika> is that intended? |
15:11:58 | FromDiscord | <Rika> not a few, just one i think |
15:12:00 | FromDiscord | <Rika> sorry |
15:12:16 | axion | For the time being it's fine. I think I only have these 3 predicates |
15:13:20 | FromDiscord | <Rika> give me a proc that's prefix and returns boolean (do you need a not for a vec??) |
15:14:43 | FromDiscord | <Rika> OH i think i misunderstood |
15:14:48 | FromDiscord | <Rika> okay okay okay |
15:17:53 | axion | Rika the ~= in that code |
15:18:27 | FromDiscord | <Rika> yeah yeah sorry i misunderstood HEAVILY |
15:18:51 | axion | No prob. It's probably me. I'm not fully awake yet |
15:21:17 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:27:08 | * | xet7 joined #nim |
15:27:16 | * | Hideki_ quit (Remote host closed the connection) |
15:28:25 | * | Hideki_ joined #nim |
15:32:33 | * | smitop quit (Quit: Connection closed for inactivity) |
15:32:57 | * | Hideki_ quit (Remote host closed the connection) |
15:33:09 | * | Hideki_ joined #nim |
15:33:29 | dadada | microsoft has started to support vt terminals, stuff like tmux and midnight commander now work under stock Windows, not a windows user here, however as a dev who was pissed of at MS for not supporting enough standards this is a welcome change |
15:34:28 | dadada | it means that writing portable terminal apps has just become a lot easier, since you can basically develop and run them anywhere |
15:34:48 | dadada | anywhere being, Windows, Mac and any Unixy system |
15:34:58 | * | Hideki_ quit (Remote host closed the connection) |
15:35:02 | dadada | only question is, what took them so long :D |
15:35:02 | FromDiscord | <Rika> windows not under 10 20smthsmth* |
15:35:23 | dadada | who cares, this is just a question of time now, eventually everybody moves to a newer system |
15:35:41 | dadada | supporting older systems only makes sense if you have paying customers who want that |
15:36:01 | FromDiscord | <Rika> axion i have nonworking code but its almost there, i dont know how to solve this last problem |
15:36:05 | Araq | ha! |
15:36:08 | * | Hideki_ joined #nim |
15:36:10 | FromDiscord | <Rika> "how to get the size of the Vec being used" |
15:36:14 | axion | Rika: Ok thanks! |
15:36:23 | FromDiscord | <Rika> WAIT im dumb |
15:36:27 | FromDiscord | <Rika> sorry that was very dumb |
15:36:27 | axion | `len`? |
15:36:37 | Araq | that's like saying "supporting 40 different Linux distros only makes sense if you have paying customers who want that" |
15:36:39 | krux02 | dadada, does the terminal replace all terminal activity on windows? |
15:36:39 | FromDiscord | <Rika> ah no |
15:36:52 | dadada | https://www.golem.de/news/microsoft-das-windows-terminal-bekommt-mauseingabe-2003-147335.html |
15:36:54 | FromDiscord | <Rika> still not sure how to do this, you'd have to move the for loop from compiletime to runtime |
15:37:19 | * | Hideki_ quit (Remote host closed the connection) |
15:37:21 | Araq | hint: often you have zero people on Linux who pay for anything whatsoever... *cough* |
15:37:24 | axion | That would be surprising if you have to do that with Nim :) |
15:37:30 | axion | My Lisp code does not |
15:37:36 | * | Hideki_ joined #nim |
15:38:43 | FromDiscord | <Rika> its probably because of lack of knowledge |
15:39:23 | * | Hideki_ quit (Remote host closed the connection) |
15:39:29 | disruptek | that's why i don't pay for anything: i'm too stupid. |
15:40:09 | * | Hideki_ joined #nim |
15:40:24 | dadada | Araq: I think you're missing my point, I was distinguishing systems that are older, surely no linuxer would say it's reasonable to support fedora 26, when we'll soon have fedora 33, and upgrading is not only free, but dead easy |
15:40:29 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2eAX what i got so far axion |
15:41:02 | FromDiscord | <Rika> upgrading is not dead easy when you have software that frequently changes |
15:41:11 | * | Hideki_ quit (Remote host closed the connection) |
15:41:25 | * | Hideki_ joined #nim |
15:41:37 | Yardanico | disruptek: I spend like $20 monthly on subscriptions/servers/internet :P |
15:41:39 | FromDiscord | <Rika> you have to update all older software to work with the new version (esp. if the upgrade is between major versions) and this can take a lot of time if the older software was large |
15:41:56 | Yardanico | hetzner 3 euro, youtube premium ~$2.5, nim donation $5, home internet + mobile plan ~$7.5 |
15:41:59 | FromDiscord | <Rika> companies are not willing to spend resources for what they think are "minor improvements" |
15:43:02 | dadada | Rika: okay, well I'm upgrading my system every half year when there's a new fedora release, in my experience its dead easy and software problems, if any, are minor, most of the time there aren't any, that's my experience, sorry if yours differs |
15:43:12 | * | Hideki_ quit (Remote host closed the connection) |
15:43:27 | FromDiscord | <Rika> its noy my experience, mine is fine |
15:43:33 | FromDiscord | <Rika> i upgrade literally every few weeks |
15:43:39 | FromDiscord | <Rika> (rolling release operating systems) |
15:43:43 | Yardanico | I run xbps-install -Su almost daily |
15:43:45 | * | Hideki_ joined #nim |
15:43:45 | Yardanico | rolling too |
15:44:02 | disruptek | i've run emerge @world twice since this convo started. |
15:44:11 | FromDiscord | <Rika> but companies dont like updating |
15:44:12 | Yardanico | what beastly CPU do you have |
15:44:19 | FromDiscord | <Rika> because that potentially means money loss |
15:44:20 | Yardanico | two EPYC 7742 ? |
15:44:34 | disruptek | just teasing you knuckleheads. |
15:44:34 | krux02 | Windows 10 is a rolling release, too. At least that is what I understood. |
15:44:54 | Yardanico | well I wouldn't really say so, it's still separated in releases |
15:44:57 | Yardanico | it has versions |
15:45:06 | axion | I do a rolling upgrade every day and been running the same install (on some PC's) since 2000. Issues are rare, but they are time consuming to solve, often requiring coding patches yourself or waiting for upstream. |
15:45:22 | * | smitop joined #nim |
15:45:49 | krux02 | what distro are you using since 2000? |
15:45:56 | axion | Arch, since beta days. |
15:46:04 | krux02 | In 2000 I din't even know Linux is a thing |
15:46:05 | dadada | axion: the trick is to always upgrade to a stable branch, that's basically what a Fedora release is, and an upgrade cycle of every half a year, while not as great as Arch, is still decent |
15:46:16 | Yardanico | In 2000 I didn't even know what knowing is :P |
15:46:18 | axion | Before that Slackware for many years |
15:46:25 | krux02 | interesting. |
15:46:26 | axion | I guess I'm old |
15:46:40 | dadada | started with Linux in roughly 2000, I think |
15:46:48 | krux02 | probably. I am too young for Linux in the 90s, I used Windows 3.11 and 95 |
15:47:09 | krux02 | it was buggy and had a lot of blue screens. But Windows back then wasn't slow. |
15:47:17 | FromDiscord | <Rika> i wasnt alive in 2000 |
15:47:26 | Yardanico | you mean wasnt born* |
15:47:29 | disruptek | linux in the 90s was more of a mindfuck because the potential was just so explosive. |
15:47:37 | FromDiscord | <Rika> still works |
15:47:50 | Yardanico | i was born in 2000 :P |
15:48:09 | krux02 | I really wonder what people did in the 90s with Linux, as for what I've known so far it was a slow and incomplete experience. |
15:48:10 | FromDiscord | <Rika> yardanico-nii-san |
15:48:27 | axion | krux02: It was faster. |
15:48:28 | Yardanico | :insert_bruh_emote_here: |
15:48:40 | disruptek | did a lot of programming, email, the early web browsers, etc. whatever you do now. |
15:49:06 | krux02 | yea probably. |
15:49:12 | disruptek | it was more hardware-sensitive then, but i wouldn't say it was slow. |
15:49:15 | krux02 | emacs and vim already were a thing back then. |
15:49:16 | axion | We didn't have the bloat problem. A complete graphical system ran in under 50MB of ram on my PC's in the late 90's. |
15:49:43 | Araq | great but I had 8MB of RAM... after an upgrade |
15:49:43 | dadada | krux02: depends, Mandrake had a pretty nice GUI for setting up things, as did SuSe, then there were very barebones distributions as well, I started with Mandrake/SuSe, so it was a manageable experience, then I setup my own Linux From Scratch and that was when I knew that I had gone too deep down the rabbit hole :D |
15:49:45 | disruptek | built kernels with 4mb of memory. sure, it grew to take all day, but it was the only way. |
15:50:26 | * | nsf joined #nim |
15:50:45 | Araq | hmm I remember booting Linux in the 90ies. we were like "yeah, take that M$! we are running Linux now" |
15:50:45 | krux02 | yay what an experience. |
15:50:57 | krux02 | lol |
15:50:59 | Araq | we did that for an afternoon |
15:51:29 | Araq | after that afternoon we knew what "operating system" meant. Hint: it's for running *other* software |
15:51:36 | disruptek | we ran MUDs and email, so we were locked in. |
15:51:38 | dadada | well, in the 90s I was a Windows user I must admit, but that's also the reason why I'm not anymore, because my experience with Windows back then was terrible |
15:51:46 | * | Zectbumo quit (Remote host closed the connection) |
15:51:46 | krux02 | I think I had a happier life for not knowing about Linux in the 90s. |
15:52:05 | krux02 | All I cared about back then was playing Games. |
15:52:49 | dadada | to be fair, there were also a few nice games and applications on Windows, but the limitations of the system were very apparent, and crashes :D |
15:53:20 | Araq | the crashes of KDE were very apparent too fwiw |
15:53:51 | FromDiscord | <Lantos> lol krud |
15:53:51 | disruptek | linux crashed back then, too. admittedly, not as often. |
15:53:53 | FromDiscord | <Lantos> krux |
15:54:04 | FromDiscord | <Lantos> I was also happier not knowing about linux |
15:54:04 | FromDiscord | <Rika> krud |
15:54:32 | dadada | Araq: I used IceWM for a long time, it was extremely stable, and later I used the stable OpenBox |
15:54:33 | * | Hideki_ quit (Remote host closed the connection) |
15:55:00 | dadada | OpenBox is extremely configurable btw, great underestimated little thing |
15:55:15 | * | Hideki_ joined #nim |
15:56:08 | disruptek | pulseaudio is pretty mature yet i triggered crash bugs in it yesterday. also a nim compiler bug, fwiw. |
15:56:17 | disruptek | everyone writes bugs. |
15:56:23 | shashlick | did you still need a wrapper? got some time now |
15:56:41 | disruptek | i mean, i would use it, but i would never impose upon you. 😉 |
15:56:53 | shashlick | okay lets see how easy it is |
15:57:33 | disruptek | i am using dbus and i got it lookin' pretty cute. |
15:57:37 | disruptek | i dunno, may delete later. |
15:57:52 | disruptek | !repo disruptek/pulseauto |
15:57:53 | disbot | https://github.com/disruptek/pulseauto -- 9pulseauto: 11setup pulseaudio stream levels via app names or pids 15 0⭐ 0🍴 |
15:58:02 | krux02 | disruptek, That reasoning is why `rust` became a thing and popular. |
15:58:15 | disruptek | well, it's not wrong. |
15:58:33 | disruptek | now if we could just get everyone writing /comments/ too... |
15:59:11 | krux02 | disruptek, have you ever written elisp with flycheck enabled? |
15:59:18 | disruptek | nope. |
15:59:23 | krux02 | It tells you to write comments and how to write them. |
15:59:40 | disruptek | i haven't written lisp in like 15 years now, i'm ashamed to admit. |
15:59:41 | * | Hideki_ quit (Ping timeout: 250 seconds) |
16:00:03 | krux02 | well at least you did write lisp 15 years ago |
16:00:06 | FromDiscord | <Rika> dadada hows the port |
16:00:06 | disruptek | also i left tech for more than a decade, so... |
16:00:26 | dadada | Rika: what do you mean? |
16:00:39 | FromDiscord | <Lantos> 15 years ago.. |
16:00:46 | FromDiscord | <Lantos> how old where you when you started coding? |
16:00:51 | disruptek | i have to look into this flycheck thing. |
16:00:54 | FromDiscord | <Rika> you were the one who needed the timeout thing on linenoise right? did you figure out how to add it? |
16:01:13 | disruptek | i started with basic when i was 8. |
16:01:36 | krux02 | The linter for elisp (flycheck) will tell you how to write the comments and it will ensure that you include all arguments in the first in the correct formatting. It will ensure that you start with a capital letter and that you end the sentence with a full stop. |
16:01:55 | krux02 | I can't remember if it also has some grammar checking in there. |
16:02:08 | krux02 | but it really pushes you to write comments in a consistent style. |
16:02:37 | krux02 | Nim could do the same thing. |
16:03:08 | dadada | Rika: no, I moved on to a few other things... I'm thinking it would probably be nice to have generalized extremely easy way (perhaps with a macro) to define a timeout for any function call. |
16:03:32 | disruptek | we could have an editor command that adds a comment block to the current proc and sets up a line each for arguments and formats them in rst. |
16:03:33 | FromDiscord | <Rika> i dont think thats trivial |
16:03:50 | Yardanico | maybe there's some vscode extension for this? :P |
16:04:47 | disruptek | flycheck supports rust, python, haskell, c++, D... hmmph. |
16:05:20 | disruptek | i'm looking for an animated demo of comments. |
16:06:04 | disruptek | i've been programming for a long time, but i'm a terrible programming. |
16:06:07 | disruptek | programmer, too. |
16:06:23 | disruptek | i just enjoy it. |
16:06:49 | * | Trustable joined #nim |
16:07:05 | FromDiscord | <Lantos> all that matters is you enjoy it |
16:07:31 | disruptek | yep. |
16:07:53 | dadada | right |
16:08:05 | krux02 | Well, I don't enjoy fixing other people's bugs. |
16:08:30 | disruptek | yep, this is why we have so many. |
16:08:38 | krux02 | But when I live in my own bubble where I am surrounded by code that is just my code, I am a happy programmer. |
16:09:22 | krux02 | well actually I am currentliy trying to fix bugs in Nim. |
16:09:44 | * | zahary quit (Quit: Leaving.) |
16:09:51 | krux02 | It is just when I fix sometheng here, something somewhere else completely unrelated breaks. |
16:10:22 | disruptek | it's maddening that the stream manager lets you edit the title of your stream but doesn't give you a way to /save/ the edit. |
16:11:13 | disruptek | i jut don't understand... does no one test this shit? |
16:11:38 | Yardanico | in twitch? |
16:11:43 | Yardanico | I think it should save automatically |
16:11:59 | disruptek | it doesn't. |
16:12:18 | Yardanico | ah nvm, where are you editing it? |
16:12:39 | Yardanico | there should be a pencil button under your stream (on your twitch page) on twitch.tv/disruptek |
16:12:50 | disruptek | yep, that's the only place you can edit it. |
16:12:50 | Yardanico | under the buttons in the video on the right |
16:12:55 | Yardanico | well, there's a "Done" button |
16:13:00 | disruptek | yes. |
16:13:04 | Yardanico | press it :P |
16:13:07 | disruptek | but not in the Stream Manager. |
16:13:10 | disruptek | ya feel? |
16:13:16 | disruptek | ~stream |
16:13:17 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
16:13:21 | disruptek | i'll show you if you really want... |
16:13:50 | krux02 | disruptek: alwas this music |
16:14:00 | disruptek | what? |
16:14:18 | krux02 | In your stream |
16:14:21 | disruptek | we almost never hear badu. |
16:14:22 | krux02 | you always have music |
16:14:25 | disruptek | what do you want to hear? |
16:14:37 | Yardanico | krux02: music is good :P |
16:14:45 | krux02 | yea not complaining |
16:14:50 | krux02 | it is just something I realized |
16:15:25 | krux02 | but isn't music a problem with licensing and stuff? |
16:15:29 | disruptek | i need music because no one is on live audio chat. |
16:15:36 | disruptek | they just mute my videos. |
16:15:38 | disruptek | i don't give a shit. |
16:15:41 | krux02 | I don't have mumble |
16:17:05 | * | ljoonal quit (Quit: ljoonal.xyz) |
16:19:02 | FromDiscord | <Lantos> I'm not sure why more people don't use discord over mumble/irc |
16:19:19 | FromDiscord | <Lantos> is irc just easier ? |
16:20:10 | dadada | Lantos: IRC is oldschool as f*** and irssi is a client that is perfection in my view |
16:20:17 | Yardanico | @Lantos Electron |
16:20:25 | Yardanico | and using it in a web browser is meh |
16:20:51 | * | ljoonal joined #nim |
16:21:00 | vegai | discord is an incredible pain to use |
16:21:11 | dadada | Lantos: I used IRC for almost two decades, saying that I should use something else is making my roll my eyes, this is a time tested protocol, at best I'll use something additionally, but never to replace IRC |
16:21:12 | vegai | that's my reason anyway :) |
16:21:17 | Yardanico | also IRC is entirely open :P |
16:21:27 | Yardanico | I mostly use IRC and Telegram |
16:22:19 | axion | dadada: +1 |
16:23:31 | dadada | irc.freenode.org is one of the nicest places on the internet, if not the best one ... so many fond memories |
16:23:33 | vegai | Matrix is capable of replacing IRC for me, if a decent client comes by and people actually start using it |
16:23:34 | axion | IRC is older than the web. I cannot stand all those GUI chat services. All you need is a TUI to communicate effectively, and arguably moreso. THE SNR is very low with all those emojis, avatars, and the like |
16:23:40 | vegai | gomuks is almost there already |
16:24:05 | Yardanico | axion: 🙂 |
16:24:40 | shashlick | disruptek: here's a quick and dirty wrapper - http://ix.io/2eBl/nim |
16:24:47 | FromDiscord | <Lantos> ah, the open part is a plus |
16:25:13 | shashlick | not a full-fledged rapper that downloads and builds since i presume you will use this on linux only and use the package manager to install it |
16:25:29 | axion | Matrix is horrible. One of our dev channels has a bridge and messages are constantly arriving/received minutes, sometimes hours later. |
16:25:38 | shashlick | pulseaudio wrapper ^^ |
16:27:05 | krux02 | Araq, Simon the Sorceror is great |
16:27:17 | disruptek | shashlick: thanks! |
16:27:17 | Araq | lol |
16:28:35 | disruptek | this is the whole wrapper? |
16:28:44 | disruptek | just this one file and the nimterop import? |
16:28:47 | shashlick | the output yes |
16:28:50 | disruptek | is this the new codepath? |
16:29:04 | shashlick | the wrapper is http://ix.io/2eBn/nim |
16:29:06 | shashlick | generator |
16:29:22 | shashlick | if you have pulseaudio installed, you can use getHeader() with -d:pulseaudioStd |
16:29:35 | axion | What's the most idiomatic way to write a for loop that iterates over every N indices of an array? Like if I had an array of length 16, i'd like to do something on indices 0,5,10,15, where N is 4 in this case |
16:30:08 | shashlick | new codepath is around 80% done compared to current functionality |
16:30:20 | axion | or well 5 i suppose :) |
16:30:23 | shashlick | not counting bugs of course |
16:31:03 | axion | That is it post-increments (starts at 0) |
16:32:10 | krux02 | disruptek, still struggling with mumble, first time usage. |
16:32:21 | dadada | axion: I'd write an iterator probably |
16:32:31 | Yardanico | disruptek: im here as well |
16:32:39 | axion | dadada: For a one off usage of a large array? Seems like overkill |
16:32:54 | Yardanico | disruptek: for showing IRC/twitch messages on your stream |
16:32:58 | Yardanico | is it an OBS plugin? |
16:34:36 | dadada | axion: why not a while loop? |
16:34:51 | PMunch | axion, the most idiomatic would be to use countup |
16:34:56 | axion | This is one thing I miss from lisp: (loop :for x :by 5 ...) |
16:35:30 | Yardanico | there's countup though |
16:35:58 | axion | I'll check it out, thanks |
16:36:28 | PMunch | https://play.nim-lang.org/#ix=2eBt |
16:36:54 | Yardanico | yeah, countup has an optional step argument |
16:36:57 | Yardanico | so does countdown |
16:51:09 | * | Hideki_ joined #nim |
16:51:23 | * | nsf quit (Quit: WeeChat 2.7) |
17:00:51 | FromDiscord | <Kiloneie> You guys tell me i shouldn't make too many videos per week, but the analytics say otherwise D: |
17:01:23 | Yardanico | wdym? |
17:02:41 | FromDiscord | <Kiloneie> the bigger the gap between my videos, the less views i get, it doesn't grow, it declines. Then a jump when a new video is uploaded which raises the views for the following days, but it decays with every day. |
17:02:56 | FromDiscord | <Rika> thats natural |
17:03:02 | narimiran | you're too obsessed with views and potential financial gains from it |
17:03:16 | FromDiscord | <Rika> were not saying youll get more views by slowing down |
17:03:24 | stefantalpalaru | They could be radioactive. Just saying... |
17:03:27 | disruptek | you make the videos once. make them as well as you can. you reap the dividends indefinitely. |
17:03:29 | FromDiscord | <Rika> we're saying that its healthier to slow down |
17:04:08 | FromDiscord | <Kiloneie> I know, i sadly cant get the mic setup atm, so i will have to do quite some fixing on quite a few videos once i do |
17:04:16 | narimiran | btw, how many view did you get when you had a long break because you had a burnout? :P |
17:04:25 | FromDiscord | <Kiloneie> ummm still a lot... |
17:04:36 | FromDiscord | <Kiloneie> first video was about 400-500 views |
17:04:40 | FromDiscord | <Kiloneie> now it's 2400 |
17:04:54 | FromDiscord | <Kiloneie> subs ? i think about 65, now it's 153 ? |
17:05:01 | FromDiscord | <Kiloneie> it kept growing... |
17:05:20 | narimiran | so, you don't have a relevant information about the newest videos, right? because it is much much newer than that one |
17:05:41 | FromDiscord | <Kiloneie> what do you mean ? |
17:06:19 | narimiran | newest video = 3 days old; oldest video = 90 days old (i just invented those numbers) |
17:06:40 | FromDiscord | <Kiloneie> well the newest are getting more views than i did back then |
17:06:56 | FromDiscord | <Kiloneie> 100 in a week, then it slows down a ton |
17:07:35 | FromDiscord | <Kiloneie> but, when i first started, average views and watch duration went up with every video. I am making the too slow atm |
17:07:51 | FromDiscord | <Kiloneie> i did take time to think trough how i want to go on with this |
17:08:20 | FromDiscord | <Kiloneie> and i know why the views are what they are atm, we don't really have many beginners to programming at all |
17:08:28 | FromDiscord | <Kiloneie> that's what the surveys say |
17:09:31 | FromDiscord | <Kiloneie> Also on the potential financial part, well im broke D:, fcking corona crap. |
17:10:06 | narimiran | broke or not, don't count on the idea that your videos will make you significant amount of money |
17:10:25 | Yardanico | well yeah, actual programming videos won't earn you money :P |
17:10:30 | FromDiscord | <Kiloneie> i know they won't, not until years from now |
17:11:09 | FromDiscord | <Rika> i dont think they ever do |
17:11:34 | Yardanico | i wouldn't like a programming video showing ads :P patreon or something like that will be better |
17:11:54 | FromDiscord | <Kiloneie> i know, i wouldn't do that |
17:12:13 | FromDiscord | <Kiloneie> i would only do maybe at the end, and some easy ones you get at the bottom of the screen most people do |
17:12:23 | FromDiscord | <Kiloneie> patreon is the way to go |
17:12:29 | * | sealmove quit (Ping timeout: 250 seconds) |
17:12:56 | FromDiscord | <Kiloneie> but till any of that, i need hundreds of videos that not only cover the beginner spectrum but also intermediate, and more advanced |
17:13:15 | FromDiscord | <Kiloneie> something maybe any of you could find useful |
17:13:27 | FromDiscord | <Rika> does nim have a counterpart to python's `string.decode()` |
17:13:28 | * | Hideki_ quit (Ping timeout: 256 seconds) |
17:13:35 | Yardanico | no, since nim strings are just bytes |
17:13:43 | FromDiscord | <Rika> i mean |
17:13:46 | FromDiscord | <Rika> in nimble perhaps |
17:13:47 | FromGitter | <Kvothe87> Hi guys i'm trying to run a program that leorize helped yesterday, but i get the following error: Error: unhandled exception: Error: cannot open: (kind: pcFile, path: "C:\\Users\\**\\**\\**\\**\\**\\**\\***.csv") [CsvError] |
17:14:06 | FromDiscord | <Rika> thats one hell of a path |
17:14:10 | Yardanico | @Rika for what? |
17:14:13 | FromDiscord | <Kiloneie> im gonna start making videos on nim's standard library now, been planning that for a while |
17:14:23 | Yardanico | I mean why you need .decode |
17:14:24 | * | sealmove joined #nim |
17:14:43 | Yardanico | There's https://nim-lang.org/docs/encodings.html if you need to encode/decode stuff |
17:14:50 | Yardanico | with different encodings |
17:15:05 | FromGitter | <Kvothe87> where in the error i receive all the slashes are doubled |
17:15:14 | Yardanico | that's okay |
17:15:15 | FromDiscord | <Rika> im converting a python library |
17:15:29 | Yardanico | well most of the time you wouldn't need stuff like that in nim |
17:15:36 | Yardanico | and it was probably written for python 2 |
17:15:52 | Yardanico | in Python 3 strings are UTF-8 by default too, so you need encode/decode only when actually dealing with different encodings |
17:16:00 | FromGitter | <Kvothe87> is this a problem of opening the file or is it of passing a wrong type ? |
17:16:07 | FromDiscord | <Rika> it says it deals with 'utf-8-sig' |
17:16:32 | Yardanico | is that lib open source? |
17:16:56 | FromDiscord | <Rika> ill just |
17:16:57 | FromDiscord | <Rika> hu |
17:16:58 | FromDiscord | <Rika> uh* |
17:17:01 | FromDiscord | <Rika> remove the code |
17:17:08 | FromDiscord | <Rika> i dont think its significamnt |
17:17:14 | FromDiscord | <Rika> im pretty sure its not significant the decode part |
17:28:55 | * | sealmove quit (Ping timeout: 272 seconds) |
17:30:36 | * | sealmove joined #nim |
17:54:00 | leorize | Kvothe87: can we see the code? |
17:59:52 | * | oculux quit (Ping timeout: 256 seconds) |
18:02:33 | * | smitop quit (Quit: Connection closed for inactivity) |
18:08:48 | shashlick | question - how do you default initialize a ref object param to nil in a proc signature? |
18:09:09 | disruptek | foo: Something = nil |
18:11:02 | * | silvernode-mobil quit (Ping timeout: 264 seconds) |
18:12:01 | leorize | or foo = Something(nil) |
18:16:05 | shashlick | thanks |
18:44:12 | * | Zectbumo joined #nim |
18:44:46 | rayman22201 | @axion, if you are still around. Here is the fix to your macro: https://play.nim-lang.org/#ix=2eC6 |
18:45:00 | rayman22201 | you can treat infix operators as prefix. They are just normal function calls. |
18:45:03 | rayman22201 | very lisp like |
18:45:15 | rayman22201 | just remember the backticks :-P |
18:45:35 | rayman22201 | !last axion |
18:45:36 | disbot | axion spoke in 12#nim 2 hours ago |
18:47:25 | FromDiscord | <Rika> rayman22201, uh, i think they want the macro to generate a proc that allows for 3 parameters if the given proc has 3 parameters |
18:47:38 | FromDiscord | <Rika> and if only 2, use infix, if more, use prefix |
18:48:38 | rayman22201 | I'm not sure if that is what they are asking. But it's also unnecessary |
18:49:03 | rayman22201 | the Nim compiler allows you to treat all operators as function calls, and does the right thing in the backend anyway |
18:52:57 | FromDiscord | <Rika> he wants to be able to use the extra "tolerance" parameter when needed |
18:53:06 | FromDiscord | <Rika> and use the regular infix version if not needed |
18:55:20 | axion | rayman22201: Inspecting, thanks |
18:55:53 | clyybber | PMunch: With which version did you build your macroutils docs? |
18:56:00 | clyybber | Did you use that RST script? |
18:56:08 | clyybber | Because its missing dark-mode |
18:56:38 | PMunch | Which docs? |
18:57:10 | rayman22201 | ok, that's just a matter of passing an optional arg to a function. pretty easy to do in a macro if it's just generating a function call. |
18:59:01 | FromDiscord | <Rika> its generating the function body |
18:59:11 | FromDiscord | <Rika> consisting of function calls |
18:59:29 | FromDiscord | <Rika> eh i think my solution was overkill yeah |
19:00:51 | rayman22201 | I see what you are saying though. |
19:01:18 | axion | Yeah I need to be able to pass the tolerance arg in too, and work for any predicate with arbitrary number of args |
19:02:19 | rayman22201 | I see. That will get a bit more complicated. The macro will have to look up the proc definition of `op` and pull are the arguments, then add maching parameters to the output ast. |
19:02:38 | rayman22201 | *all the arguments |
19:03:00 | axion | I see |
19:04:01 | FromDiscord | <Rika> w-was my solution even looked at |
19:04:09 | axion | I didn't expect this to be so hard. I suppose I'm just too used to there being no difference between code and AST as with Lisp. The macro in Lisp is just a couple lines |
19:04:17 | * | zahary joined #nim |
19:04:27 | axion | Oh well, not a big deal. |
19:04:59 | FromDiscord | <Rika> ;; |
19:05:06 | FromDiscord | <Rika> i guess it wasnt looked at lmao |
19:05:21 | clyybber | PMunch: https://uploads.peterme.net/macroutils.html <- these ones |
19:05:22 | axion | Yeah it was |
19:06:56 | * | muffindrake quit (Ping timeout: 246 seconds) |
19:08:20 | PMunch | Oh those, that was just meant as a teaser of the real thing :P |
19:08:32 | PMunch | But they should've been made with 1.0.6 or devel |
19:08:50 | rayman22201 | Rika, I didn't see it. sorry, just skimmed the irc history. You have the right idea. |
19:08:57 | clyybber | oh ok, wheres the real thing? |
19:09:24 | * | muffindrake joined #nim |
19:09:40 | FromDiscord | <Rika> it relies on the assumption that the signature on the pragma'd proc is the same as the scalar proc |
19:10:25 | axion | I didn't get a chance to try it yet, because I've been in the middle of refactoring 3000 lines all day trying to get back to working status :) |
19:10:35 | * | Hideki_ joined #nim |
19:10:49 | FromDiscord | <Recruit_main707> ok, id need some help, when i compile with --NoMain to a dll (having a DllMain function), using a tool, the only function i can call is NimMain, why? |
19:11:07 | FromDiscord | <Recruit_main707> (id post this in off topic but bridge is down |
19:11:12 | FromDiscord | <Rika> its ***nonworking*** but the last hurdle is figuring out the length of the Vec being used on compile time (which afaik is the wrong approach i think) |
19:11:17 | PMunch | clyybber, well I was hoping it would've been built by the directory. But alas: https://nimble.directory/docs/macroutils |
19:11:29 | PMunch | federico3, am I doing something wrong with my packages? |
19:12:27 | federico3 | https://nimble.directory/pkg/macroutils --> install test |
19:12:56 | axion | PMunch: I'll need these for matrices too: Mat[R,C: static[int]] = array[R*C, float32] |
19:13:17 | axion | But I'd just use the N or R*C type parameters to get the length |
19:13:36 | PMunch | federico3, wait, you're not building with 1.0.6? |
19:14:01 | axion | PMunch: err sorry, Rika I meant |
19:14:18 | PMunch | Haha, I was confused there for a second |
19:15:07 | * | Hideki_ quit (Ping timeout: 250 seconds) |
19:15:07 | federico3 | no, 1.0.4 but I'll backport .6 |
19:15:33 | FromDiscord | <Rika> i really have no idea what to do for the macro vector length issue, maybe pmunch can actually help there |
19:16:43 | PMunch | Uhm, what is the issue? |
19:17:46 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2eAX <-- has an issue regards getting "N" |
19:17:56 | FromDiscord | <Rika> which is the length of the vec being worked on |
19:17:58 | rayman22201 | Rika, oohhhhh. I see what you mean now. won't work |
19:18:13 | FromDiscord | <Rika> i dont know of any solutions for that issue |
19:18:15 | axion | We can hold off on thinking about it until I make a first commit and anyone interested can help me simplify the final API with a macro :) |
19:18:16 | rayman22201 | It works in the original because of the generic param |
19:18:20 | FromDiscord | <Rika> yeah |
19:18:26 | rayman22201 | you need this: https://nim-lang.org/docs/macros.html#bindSym%2C%2CBindSymRule |
19:18:29 | rayman22201 | experimental feature |
19:18:29 | axion | Because this macro should be able to be called with 2 vectors, or 2 matrices, which have different type signatures |
19:19:09 | FromDiscord | <Rika> i dont know if you want to add an experimental feature to your lib |
19:19:23 | rayman22201 | Problem is, you want to do things with the types (formal proc args in this case) but macros run before type checking |
19:20:17 | axion | Probably not. I just want to write this and be done with it, rather than rewrite a good portion of the library if that feature doesn't make it to a release |
19:20:39 | rayman22201 | Rika, your solution pulls out the ast, and "guesses" the params will be the same. But you loose the generic N (which comes from the type checking) |
19:20:41 | FromDiscord | <Recruit_main707> is the creator of winim in here? |
19:20:43 | axion | I see |
19:21:09 | rayman22201 | You need to bind the symbol, so that you can find the type, so you can actually look up the correct args |
19:21:22 | rayman22201 | I think this can be solved, it's just a PITS |
19:21:25 | rayman22201 | PITA even |
19:21:49 | axion | Well for another time when I can better specify what I want with actual code commited :) |
19:22:14 | FromDiscord | <Rika> it really is a PITA i think |
19:22:25 | axion | That playground code is just a subset of what I need, so probably not worth trying to solve it now if it's a PITA |
19:22:36 | FromDiscord | <Rika> rayman, i did say that it relies on the assumption that ... (see log) |
19:23:15 | rayman22201 | yeah, I saw, I'm just telling you why the N doesn't work |
19:24:18 | rayman22201 | we need a higher level macro wizard like mratsim to help lol |
19:24:27 | axion | I appreciate all the help though! Hopefully I'll have an initial revision of my first Nim library pushed soon, and we can go from there. |
19:24:46 | rayman22201 | Macros can write macros, so I wonder if you can do it in stages |
19:25:04 | rayman22201 | It's a fun problem :-) |
19:25:09 | FromDiscord | <Rika> rayman, i know N doesnt work, i just copied the code from the old macro |
19:25:27 | rayman22201 | but you said you didn't know why |
19:25:52 | FromDiscord | <Rika> i dont know how |
19:26:02 | FromDiscord | <Rika> i mean how to get N |
19:26:11 | FromDiscord | <Rika> i know why N doesnt work i just dont know how to get it |
19:26:18 | rayman22201 | the only way to get that N is through the type pass. A.K.A you need the `[N: static[int]]` part |
19:28:33 | shashlick | are regular comments not stored in the AST? |
19:28:39 | shashlick | i don't see any node type for it |
19:28:42 | shashlick | only documentation comments |
19:28:51 | rayman22201 | long standing debate. no they are not :-P |
19:29:13 | shashlick | ugh, nimterop will lose the comment feature then |
19:32:18 | FromDiscord | <Rika> F |
19:32:49 | FromGitter | <dumjyl> axion: Haven't really been following, but you might need the template swizzle trick: https://play.nim-lang.org/#ix=2eCl |
19:38:21 | * | luis_ joined #nim |
19:39:17 | rayman22201 | axion, you want to pass the extra "tolerance" down to the generated proc right? |
19:39:35 | rayman22201 | "tolerance" argument |
19:41:54 | * | wowaname is now known as opal |
19:44:43 | * | zahary quit (Quit: Leaving.) |
19:48:02 | axion | Yeah, optionally since it is a named parameter. |
19:48:14 | axion | or one with a default value, rather |
19:48:43 | axion | But, not limited to 1 argument. If I write another predicate that has 2 extra arguments, it should be possible to use them both. |
19:50:17 | rayman22201 | right. you want it generic. You basically want to "lift" the types of the first two args into some higher collection type while keeping the rest. |
19:53:25 | * | luis_ quit (Ping timeout: 246 seconds) |
19:53:44 | Araq | rayman22201, how is your async going? I'm looking forward to it |
19:54:09 | rayman22201 | lol. How goes the arc fixes for the current async? |
20:15:14 | axion | Where in the nim source tree is the sequtils module stored? |
20:16:05 | FromDiscord | <Rika> huh? |
20:16:11 | FromDiscord | <Rika> `import sequtils` |
20:16:42 | axion | That wasn't my question :) |
20:16:43 | FromGitter | <kaushalmodi> axion: You can go to https://github.com/nim-lang/Nim, hit `t` and type `sequtils` |
20:16:55 | axion | I'm trying to find the actual source files on github |
20:16:59 | FromDiscord | <Rika> ah |
20:17:05 | FromDiscord | <Rika> its in pure |
20:17:07 | FromDiscord | <Rika> im pretty sure |
20:17:14 | FromGitter | <kaushalmodi> axion: You will find it in `lib/pure/collections/sequtils.nim` |
20:17:32 | axion | Thanks |
20:17:44 | PMunch | axion, the official docs have a "source" button below each procedure that takes you to the GitHub sources :) |
20:17:53 | FromGitter | <kaushalmodi> axion: If you are using Emacs/projectile or similar packages in other editors, you don't need to remember the path |
20:17:54 | axion | Oh good to know |
20:18:42 | axion | I ask because sequtils is a good example of good documentation, and I haven't written any markup languages in a while so I'd like to see the documentation comments :) |
20:21:18 | axion | What is the difference between `foo` and ``foo``? Not seeing any difference in rendering, but seeing the latter used a lot. |
20:21:49 | FromDiscord | <Rika> they look identical to me |
20:22:17 | axion | Indeed. My question is why sequtils uses a mixture of both. I don't know the rules of this markup language. |
20:23:01 | FromDiscord | <Rika> how do you know theyre different? |
20:23:19 | axion | I do not. I'm asking if and how they are. |
20:23:30 | axion | and why sequtils comments use both if they are not. |
20:24:02 | FromDiscord | <Rika> im not sure i'm understanding what you mean, let me take a look |
20:25:39 | FromDiscord | <Rika> i dont see what you mean after reading both the docs and the code |
20:25:45 | FromGitter | <kaushalmodi> axion: you mean difference between single backquoting and double-backquoting? |
20:26:11 | axion | For example, line 166 uses single backticks for `n`. Line 180 uses double backticks for ``isSorted`` and ``true``. |
20:26:24 | FromGitter | <kaushalmodi> the docs were originally strictly rst format which requiring double-backquoting |
20:26:49 | FromGitter | <kaushalmodi> later on, changes were made in the nim docgen, so now we have a hybrid format support: markdown + rst |
20:26:57 | FromGitter | <kaushalmodi> so now single-backquoting works too |
20:27:05 | FromGitter | <kaushalmodi> in rst, single-backquoting is italics |
20:27:06 | FromDiscord | <Rika> discord doesnt show the double and single backticks |
20:27:45 | FromGitter | <kaushalmodi> in rst, wrapping in single stars is also italics |
20:28:05 | axion | I see |
20:28:09 | FromGitter | <kaushalmodi> so I would use the single star wrapping for italics and markdown style single backquoting for code markup |
20:28:46 | axion | What is double backquote in RST? |
20:29:00 | FromGitter | <kaushalmodi> code markup |
20:29:30 | axion | So then I should probably use single star for italics, and double backquote (rather than single as you said) for code, so it renders in both as intended? |
20:29:36 | FromGitter | <kaushalmodi> in the latest nim docgen both both single and double backquoting does code markup |
20:30:10 | FromGitter | <kaushalmodi> axion: you can.. it's my bias towards more markdown like doc syntax that makes me say that |
20:30:34 | axion | Thanks |
20:30:41 | FromGitter | <kaushalmodi> for the rst syntax that nim doc gen understands, see https://forum.nim-lang.org/about/rst |
20:31:07 | axion | I'm really not familiar with RST at all. Just gfmd |
20:31:20 | FromGitter | <kaushalmodi> then use markdown! |
20:31:28 | FromGitter | <kaushalmodi> and it will still Just Work :) |
20:31:37 | axion | Got it |
20:31:50 | FromGitter | <kaushalmodi> and it's easy to test your edits.. |
20:32:05 | FromGitter | <kaushalmodi> edit foo.nim and run `nim doc foo.nim` and see the generated HTML in a browser |
20:32:19 | axion | Yup been doing that |
20:36:07 | lqdev[m] | yeah rst is really picky when it comes to syntax mistakes |
20:36:46 | lqdev[m] | but one upside is that your documents are still readable as ASCII |
20:37:05 | axion | what is this runnableExamples thingy? |
20:37:11 | PMunch | I find markdown just as readable.. |
20:37:27 | lqdev[m] | axion: it's for automated testing when you generate documentation |
20:37:30 | FromGitter | <kaushalmodi> `nim doc` will fail if the code under `runnableExamples:` fails |
20:37:41 | Demos[m] | I like markdown more because it works better with flexable width fonts |
20:37:42 | PMunch | axion, runnableExamples is examples that end up in your documentation that is also compiled and executed during documentation generation |
20:37:44 | lqdev[m] | you can write examples and they will be semchecked on `nim doc` |
20:37:46 | FromGitter | <kaushalmodi> that allows the doc examples to stay current |
20:37:47 | axion | do i have to import that from somewhere? |
20:37:53 | PMunch | So it makes sure that your examples can actually run |
20:38:08 | lqdev[m] | no, it's in system |
20:38:12 | axion | awesome |
20:38:20 | PMunch | I like markdown better because it's actually possible to write on the first try |
20:38:23 | axion | Nim is becoming more awesome by the minute |
20:38:39 | FromGitter | <kaushalmodi> axion: you might like the doc examples here too: https://github.com/kaushalmodi/elnim/blob/master/src/elnim.nim |
20:38:53 | FromGitter | <kaushalmodi> (as I believe that you have somewhat fondness for lisp) |
20:39:03 | * | PMunch quit (Quit: leaving) |
20:39:25 | axion | ha cool |
20:40:41 | axion | So with runnableExamples, I might even be able to remove all my nimble unit tests |
20:40:52 | FromGitter | <kaushalmodi> yes |
20:41:12 | axion | They took me days to write...time to port them to the actual documentation :) |
20:41:25 | FromGitter | <kaushalmodi> then you just have Travis or your favorite CI run nim doc and you have testing+doc generation happen in one go |
20:42:39 | * | shadowbane quit (Ping timeout: 250 seconds) |
20:44:53 | axion | kaushalmodi: what is the difference between doAssert and assert? I just saw you using doAssert for the first time |
20:45:08 | Demos[m] | doAssert always runs |
20:45:13 | FromGitter | <kaushalmodi> yep |
20:45:26 | axion | when does assert not? |
20:45:42 | FromGitter | <kaushalmodi> they can be disabled using a nim switch |
20:45:48 | axion | Ah ok |
20:46:17 | FromGitter | <kaushalmodi> ```> nim --fullhelp | rg assert ⏎ -a, --assertions:on|off turn assertions on|off``` [https://gitter.im/nim-lang/Nim?at=5e728899190ad049722ac02b] |
20:46:53 | FromGitter | <kaushalmodi> axion: Also, if you haven't already, bookmark https://nim-lang.github.io/Nim/theindex.html |
20:47:14 | FromGitter | <kaushalmodi> you can Ctrl+F any stdlib proc/macro/etc on that page.. e.g. Ctrl+F doAssert |
20:47:25 | axion | Nice |
20:49:44 | axion | Hmm. I cant get runnableExamples to work |
20:50:48 | FromDiscord | <Rika> what's wrong |
20:50:57 | lqdev[m] | axion: keep in mind that you must import any other modules you use in all runnableExamples sections too |
20:51:13 | axion | even those I import the module that has the Vec4 type, I get this: https://gist.github.com/mfiano/b1533071f15cba9027b09b2acc18789c |
20:51:42 | narimiran | Vec vs Vec4? |
20:52:05 | FromDiscord | <Rika> Vec: for any size |
20:52:05 | lqdev[m] | is Vec4 in the same module? |
20:52:09 | axion | I can use Vec4.init anywhere else besides runnableExamples |
20:53:21 | FromGitter | <kaushalmodi> axion: save this to a foo.nim file and run `nim doc foo.nim` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e728a418efb7417d7c89006] |
20:53:46 | FromGitter | <kaushalmodi> now flip one of those doAsserts and run `nim doc foo.nim` and you will see it fail |
20:54:24 | axion | I understand. I just can't get it to see my types |
20:55:17 | FromGitter | <kaushalmodi> can you share a snippet? |
20:55:31 | narimiran | axion: see lqdev[m]'s question above |
20:56:23 | FromGitter | <kaushalmodi> axion: nevermind I saw the lqdev is already helping you based off your snippet |
20:56:30 | FromGitter | <kaushalmodi> s/the/that |
20:56:43 | FromDiscord | <Rika> "the lqdev" |
20:57:10 | FromGitter | <kaushalmodi> may be he is *the* lqdev around here :) |
20:57:35 | axion | sec |
20:57:46 | lqdev[m] | gotta make a new game and call it "i wanna be the lqdev" |
20:58:26 | clyybber | like no one ever was |
20:58:27 | axion | https://play.nim-lang.org/#ix=2eCV |
20:59:22 | clyybber | axion: Does it work when you import the file yourself in the runnableExamples? |
20:59:56 | Araq | clyybber, I merged my PR |
20:59:58 | axion | clyybber: Yep |
21:00:06 | Araq | but it's disabled (scope based destruction) |
21:00:08 | axion | That is rather unfortuante I have to do that for every example |
21:00:09 | narimiran | axion: it works for me locally |
21:01:36 | disruptek | miran: you still sick? |
21:01:55 | narimiran | disruptek: i'm feeling fine currently |
21:02:24 | disruptek | 👍 |
21:03:47 | axion | My type definition is in another file from the init proc, and at the top of the file I do import types.nim. So my examples don't see it because apparantly runnableExamples doesn't import the same module |
21:03:59 | axion | So is there a way around that apart from importing in every single example? |
21:04:22 | FromGitter | <kaushalmodi> axion: I confirm that your example works for me on devel fb641483f0e2ed974b89d629ea5ec28e5e6145ce as well |
21:04:41 | axion | Right but did you put the type definition in another file that is imported? |
21:04:43 | lqdev[m] | axion: no, each runnableExamples has to import your module |
21:05:44 | axion | I fixed it by putting `export types` after I import it. |
21:05:53 | narimiran | (`include` might do the trick) |
21:09:57 | axion | `include` is wrong here because the generated documentation will duplicate what is included. |
21:10:15 | * | oculux joined #nim |
21:13:36 | clyybber | Araq: Ah, nice. I'll have a go at it once I figure out this corruption |
21:13:51 | * | narimiran quit (Ping timeout: 250 seconds) |
21:16:18 | FromDiscord | <Spy653> Does nim have anything in the works regarding on metal development |
21:16:35 | disruptek | well, it works. |
21:16:46 | disruptek | --os:any --gc:none etc. |
21:17:01 | disruptek | or it's --os:ansi_c ... i cannot remember. |
21:17:38 | Zevv | https://nim-lang.github.io/Nim/nimc.html#nim-for-embedded-systems |
21:19:51 | FromDiscord | <exelotl> It's generally good for it. You will need to generate C code if you want to store data in ROM though (besides a few trivial cases, like numeric LUTs) |
21:21:03 | clyybber | Zevv: ping |
21:21:24 | clyybber | Zevv: It looks like --threads:on --gc:arc --d:useMalloc doesn't work |
21:27:55 | * | blackbeard420 quit (Quit: ZNC 1.7.5 - https://znc.in) |
21:28:15 | * | blackbeard420 joined #nim |
21:28:58 | * | tdog quit (Ping timeout: 246 seconds) |
21:32:17 | FromDiscord | <Recruit_main707> i am pretty sure there is a big issue with winim |
21:32:37 | FromDiscord | <Recruit_main707> are there any other wrappers for kernel32? |
21:36:57 | FromDiscord | <Recruit_main707> how can i install this? |
21:36:57 | FromDiscord | <Recruit_main707> https://nim-lang.org/0.11.0/windows.html |
21:36:59 | * | natrys quit (Quit: natrys) |
21:37:28 | leorize | Recruit_main707: what's you problem with winim? |
21:37:32 | leorize | I think it works kinda well |
21:37:47 | FromDiscord | <Recruit_main707> u see, hModule is just a typedef of LPVOID |
21:38:23 | FromDiscord | <Recruit_main707> but if i try to pass hModule to something expecting LPVOID, i cant, (which its what i see being done in c++) |
21:38:34 | leorize | what's the error message? |
21:38:42 | leorize | what's your code? |
21:39:01 | Araq | clyybber, https://github.com/nim-lang/Nim/pull/13685 |
21:39:02 | disbot | ➥ enable --tlsEmulation:on for --gc:arc |
21:41:29 | FromDiscord | <Recruit_main707> leorize: https://play.nim-lang.org/#ix=2eD7 |
21:42:05 | leorize | if you believe that they are interchangable just convert it? |
21:43:19 | leorize | I'm pretty sure HMODULE is distinct from LPVOID is to prevent you from mixing it up |
21:43:27 | leorize | HMODULE is typed and LPVOID is not |
21:43:43 | leorize | welcome to the superior type system |
21:43:56 | leorize | :P |
21:44:20 | leorize | note that for pointers, you don't really have to cast |
21:44:28 | leorize | just LPVOID() is enough |
21:45:37 | disruptek | ~stream |
21:45:38 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
21:45:43 | disruptek | leorize: come explain ryu. |
21:45:50 | Araq | leorize, where is the PR? |
21:46:05 | leorize | ? |
21:47:21 | FromDiscord | <Recruit_main707> LPVOID(hModule) doesnt work :/ |
21:47:37 | leorize | cast then? |
21:47:50 | FromDiscord | <Recruit_main707> but even if it worked that way, c++ doesnt do all of this |
21:47:52 | disruptek | leorize: for ryu. |
21:50:52 | FromDiscord | <Recruit_main707> leorize: which doesnt work bc i tried :p |
21:51:08 | leorize | that sounds wrong, what's the error when you tried |
21:51:47 | FromDiscord | <Recruit_main707> well, first of all, that i do need an hModule in my function |
21:53:07 | FromDiscord | <Spy653> Sorry boys and girls got busy after sending the last one |
21:53:16 | FromDiscord | <Recruit_main707> and also errors at runtime if i dont use it |
21:55:23 | FromDiscord | <Spy653> I'm an entry level OS developer and currently use rust as my main language but am wondering which is realistically better or if they compliment each other well |
21:56:07 | FromDiscord | <Rika> what do you mean metal, metal as in baremetal or metal as in OSX's lib |
21:56:14 | FromDiscord | <Rika> oh |
21:56:16 | FromDiscord | <Rika> baremetal |
21:58:17 | FromDiscord | <Recruit_main707> anyway, how would i install this module windows thing? |
21:58:17 | FromDiscord | <Recruit_main707> https://nim-lang.org/0.11.0/windows.html |
21:58:36 | leorize | it's not there anymore |
21:58:42 | leorize | !packages windows |
21:58:43 | disbot | https://github.com/ba0f3/subhook.nim -- 9subhook: 11subhook wrapper |
21:58:43 | disbot | https://github.com/trustable-code/NiGui -- 9nigui: 11NiGui is a cross-platform, desktop GUI toolkit using native widgets. |
21:58:43 | disbot | https://github.com/ba0f3/uibuilder.nim -- 9uibuilder: 11UI building with Gnome's Glade 7& 10 more... |
21:58:48 | leorize | yea it's dead |
21:59:05 | FromDiscord | <Recruit_main707> u gotta be kidding D: |
21:59:42 | FromDiscord | <Rika> get it from the master branch, it MIGHT be there lmao |
22:00:51 | FromDiscord | <Recruit_main707> where is it though |
22:02:08 | FromDiscord | <Rika> theres a search in github |
22:04:34 | leorize | Recruit_main707: HMODULE is not LPVOID btw |
22:04:44 | leorize | it's an int |
22:04:45 | FromDiscord | <Recruit_main707> its typedef of LPVOID |
22:04:48 | FromDiscord | <Recruit_main707> ? |
22:04:53 | leorize | what's the C code that you base your code from? |
22:05:41 | FromDiscord | <Recruit_main707> cpp (i know its a bit shady, but i am not using it with malicius purposes) |
22:05:46 | FromDiscord | <Recruit_main707> https://pastebin.com/ywA9qzCg |
22:07:01 | leorize | https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types |
22:07:04 | leorize | no they aren't the same |
22:07:08 | leorize | HMODULE is not LPVOID |
22:07:42 | leorize | it's based on HANDLE and HANDLE is an int |
22:07:47 | FromDiscord | <Recruit_main707> they do use it as so |
22:08:36 | * | federico2 joined #nim |
22:09:24 | FromDiscord | <Recruit_main707> `CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));` |
22:09:48 | leorize | if it works that's luck :P |
22:09:57 | leorize | try passing the addr to hmodule |
22:10:22 | * | federico2 quit (Client Quit) |
22:10:39 | leorize | does that C code actually runs? |
22:10:59 | FromDiscord | <Recruit_main707> not only it runs, everyone uses it like that |
22:11:05 | leorize | you can read on this here: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread |
22:11:16 | leorize | lpParameter should be a pointer to the argument |
22:11:27 | leorize | you can `cast` if you insist |
22:11:28 | FromDiscord | <Recruit_main707> i know |
22:11:48 | leorize | if you're uncertain just check the C code |
22:12:23 | FromDiscord | <Recruit_main707> it seems ill have to |
22:13:19 | clyybber | oh oh :/ |
22:13:30 | leorize | oh yea this part is really really crucial |
22:13:31 | clyybber | I think I might ruin the release date |
22:13:35 | leorize | have you called NimMain? |
22:13:47 | leorize | if you don't call that the GC won't be initialized |
22:13:58 | FromDiscord | <Recruit_main707> yep, manually in fact, its the only one i can call |
22:14:28 | leorize | clyybber: what? :P |
22:14:41 | FromDiscord | <Recruit_main707> with an injector |
22:14:46 | FromDiscord | <Recruit_main707> oh, nvm |
22:15:18 | leorize | what does your winapi pragma resolves into? |
22:15:36 | leorize | looks like I get what they are doing now |
22:15:43 | leorize | this is pure luck |
22:16:03 | leorize | hModule has the same size as a pointer |
22:16:14 | FromDiscord | <Recruit_main707> i see |
22:16:16 | * | federico3_ joined #nim |
22:16:19 | leorize | and it will be passed verbatim to your thread proc |
22:16:29 | leorize | which is why it worked out for them |
22:16:32 | leorize | this is why I hate C |
22:16:56 | FromDiscord | <Recruit_main707> hmm, can i stick to this bad way of doing it in Nim? |
22:16:56 | clyybber | Araq: Thanks! |
22:17:03 | FromDiscord | <Recruit_main707> to keep things simple? |
22:17:16 | leorize | just cast and it should work |
22:17:27 | leorize | your bigger problem is why doesn't it work |
22:17:38 | leorize | what does your {.winapi.} pragma resolves into? |
22:17:38 | FromDiscord | <Recruit_main707> and then cast it back inside my function? |
22:17:49 | leorize | you don't have to, luckily |
22:19:16 | leorize | the part that matters would be why won't your function run |
22:19:30 | FromDiscord | <Recruit_main707> ok, then related to it not running... |
22:19:31 | leorize | ah... you're playing with fire here |
22:19:49 | leorize | GC-ed memory inside a thread not spawned by the stdlib |
22:20:24 | FromDiscord | <Recruit_main707> using echo could be the issue then? |
22:20:37 | leorize | yep, try --gc:arc instead |
22:20:44 | FromDiscord | <Recruit_main707> no devel :( |
22:20:48 | * | federico3_ quit (Client Quit) |
22:20:55 | leorize | if you're in an older version of nim, then call setupForeignThreadGc() |
22:21:02 | leorize | in the thread before anything else |
22:21:16 | leorize | remember to compile with --threads:on |
22:21:46 | leorize | note that you don't have to exportc your MyThread, but make sure that it's stdcall |
22:22:21 | FromDiscord | <Recruit_main707> where should i put that line? |
22:22:32 | leorize | first thing in the thread |
22:22:37 | leorize | in MyThread |
22:22:56 | FromDiscord | <Recruit_main707> and compile with gc:none? |
22:23:11 | leorize | you may use the GC after you call that |
22:23:15 | * | federico3_ joined #nim |
22:23:53 | leorize | but remember, no passing GC-ed data between threads |
22:24:16 | * | solitudesf quit (Ping timeout: 246 seconds) |
22:24:18 | Araq | just use --gc:arc |
22:25:13 | FromDiscord | <Recruit_main707> is there a little guide on how to install in windows? |
22:25:26 | FromDiscord | <Recruit_main707> i definetely will |
22:25:44 | leorize | https://github.com/nim-lang/nightlies/releases |
22:25:52 | leorize | there you go, or you can compile it yourself |
22:26:15 | FromDiscord | <Recruit_main707> fingers crossed |
22:26:30 | FromDiscord | <Recruit_main707> (that didnt work btw) |
22:26:41 | leorize | what didn't work :P |
22:26:57 | FromDiscord | <Recruit_main707> setupForeignThreadGc()... thing |
22:27:45 | leorize | what does your {.winapi.} pragma resolves into? |
22:29:15 | FromDiscord | <Recruit_main707> idk, i just use it wherever its used in cpp |
22:29:23 | FromDiscord | <Recruit_main707> it doesnt seem to do much |
22:29:34 | leorize | ofc it did nothing |
22:29:35 | FromDiscord | <Recruit_main707> code fails the same way if i dont use it |
22:29:38 | leorize | you didn't give it a meaning |
22:29:52 | leorize | WINAPI means `{.stdcall.}` in Nim |
22:30:24 | leorize | if you wanna keep `{.winapi.}`, then create a custom pragma with: `{.pragma: winapi, stdcall.}` |
22:31:15 | leorize | we need error messages for using a pragma that is not declared |
22:31:28 | FromDiscord | <Recruit_main707> winapi is a winim macro |
22:31:37 | leorize | ah ok then |
22:31:39 | leorize | phew |
22:32:23 | leorize | well add {.stdcall.} just to be sure |
22:32:32 | leorize | https://github.com/khchen/winim/blob/d300192c588f73dddef26e3c317f148aa23465c3/winim/inc/winimbase.nim#L21 |
22:32:38 | FromDiscord | <Recruit_main707> have it just in case ;) |
22:32:40 | leorize | because winapi doesn't mean stdcall in winim :) |
22:33:37 | leorize | with stdcall in place you might see less errors |
22:33:57 | leorize | looks like the winapi macro was an internal thing for winim :P |
22:34:41 | FromDiscord | <Recruit_main707> it didnt really even do nothing, ill get it out |
22:34:45 | leorize | maybe you can make a pr to winim to add stdcall into it so that it resembles the real thing: https://stackoverflow.com/questions/2348442/what-does-winapi-in-main-function-mean |
22:35:49 | FromDiscord | <Recruit_main707> o_0 Error: expression cannot |
22:35:49 | FromDiscord | <Recruit_main707> be cast to pointer |
22:36:13 | leorize | well the full message would be nicer |
22:36:20 | FromDiscord | <Recruit_main707> thats it XD |
22:36:31 | leorize | with line info and where is it lol |
22:37:02 | FromDiscord | <Recruit_main707> seems to be a problem with winim |
22:37:19 | leorize | I don't think so |
22:37:25 | FromDiscord | <Recruit_main707> winim-3.2.4\winim\winstr.nim(319, 14) |
22:37:38 | leorize | ah ok now it is :P |
22:39:11 | leorize | well just keep looking to see what go wrong :P |
22:39:56 | FromDiscord | <Recruit_main707> i might have done something wrong in installation |
22:40:08 | FromDiscord | <Recruit_main707> will run koch also |
22:41:01 | * | tane quit (Quit: Leaving) |
22:43:01 | FromDiscord | <Recruit_main707> ok, now it worked |
22:43:09 | FromDiscord | <Recruit_main707> compiled* |
22:45:21 | FromDiscord | <Recruit_main707> no luck |
22:45:33 | FromDiscord | <Recruit_main707> well, at least now i have nim 1.1.1 |
22:45:36 | leorize | :P what's the problem now? |
22:45:43 | FromDiscord | <Recruit_main707> same as b4 |
22:45:53 | FromDiscord | <Recruit_main707> gimme a sec and i copy the message |
22:47:00 | FromDiscord | <Recruit_main707> `Force load module failed:failed finding address of msvcrt!__dllonexit` |
22:47:08 | FromDiscord | <Recruit_main707> from injector |
22:47:13 | clyybber | aaaaargh, I'm so stupid |
22:47:42 | leorize | Recruit_main707: that doesn't sound like your problem... |
22:47:54 | leorize | does it work with other dlls on your machine? |
22:48:10 | clyybber | put a manual `=destroy` in a wrong location and spent hours searching for the bug |
22:48:26 | FromDiscord | <Recruit_main707> leorize, i do get it to run until CloseHandle(CreateThread(...)) |
22:49:03 | FromDiscord | <Recruit_main707> so essentially, yes, injector works fine, and code runs |
22:50:13 | leorize[m] | have you tried googling that error message? |
22:50:22 | leorize[m] | you can try to compare the generated C code too |
22:51:48 | FromDiscord | <Recruit_main707> only injector related issues, will look into the cache, is it impossible to trick the compiler and just run it without casting and all that? |
22:53:02 | leorize[m] | cast looks like an operation to you, but it literally means nothing |
22:53:13 | leorize[m] | it just tell the compiler to shut up because you know better |
22:54:38 | leorize[m] | besides, the passed hmodule is just a parameter, you aren't even touching it in your thread |
22:54:51 | leorize[m] | so it's not related to it |
22:57:09 | * | federico3_ quit (Quit: WeeChat 2.7.1) |
22:57:18 | FromDiscord | <Recruit_main707> if i dont create a thread and just call the function it works |
22:57:59 | * | federico3_ joined #nim |
22:58:35 | * | federico3_ quit (Client Quit) |
22:59:24 | leorize[m] | how does your code look like atm? |
22:59:37 | leorize[m] | and have you compared the C code? |
23:00:04 | leorize[m] | use the --nimcache parameter to specify where should the compiler generates it |
23:01:24 | FromDiscord | <Recruit_main707> sorry, was trying things |
23:08:06 | leorize[m] | I don't know if you can just use the stdlib facilities to spawn a thread instead of doing all this by yourself :p |
23:08:30 | FromDiscord | <Recruit_main707> in the cache, every time HMODULE should appear, `NI` appears, is that alright? |
23:09:10 | leorize[m] | yep, it's the same type |
23:12:06 | * | Hideki_ joined #nim |
23:12:15 | FromDiscord | <Recruit_main707> can i modify the cache code and then compile it? |
23:16:22 | FromDiscord | <Recruit_main707> c++ NULL = nil, |
23:16:22 | FromDiscord | <Recruit_main707> c++ nullptr = nil? |
23:16:34 | FromDiscord | <Recruit_main707> ptr nil? |
23:17:01 | * | Hideki_ quit (Ping timeout: 264 seconds) |
23:17:45 | FromDiscord | <Recruit_main707> ill do the only reasonable thing to do in this situation, individually wrap every function i use and make sure it does what i want |
23:25:59 | * | Trustable quit (Remote host closed the connection) |
23:41:38 | * | lritter quit (Ping timeout: 256 seconds) |
23:59:49 | * | clyybber quit (Quit: WeeChat 2.7.1) |