00:09:57 | FromDiscord | <brainproxy> sent a long message, see http://ix.io/2su6 |
00:10:56 | Yardanico | you shouldn't need any specific configuration for that |
00:11:11 | Yardanico | vscode-nim will provide suggestions automatically for .nim files you open |
00:11:28 | Yardanico | if there's no autocompletion, check that nimsuggest is in your PATH and the plugin actually can find it |
00:16:38 | * | rockcavera quit (Remote host closed the connection) |
00:18:04 | FromDiscord | <brainproxy> nimsuggest is availble in PATH, just checked↵↵In e.g. `src/foo.nim` I `import nimcrypto` where nimcrypto is installed in `vendor/nimcrypto`. When `src/foo.nim` is opened in vscode I get a warning: `cannot open file: nimcrypto` and there are warnings/errors re: undeclared identifiers for procs, etc. in nimcrypto |
00:18:21 | Yardanico | and how do you compile? |
00:18:36 | Yardanico | you need to have proper configuration so nimsuggest works |
00:18:49 | Yardanico | e.g. if you specify --project on cmdline - you need to do that in the config file |
00:18:50 | FromDiscord | <brainproxy> a custom makefile system |
00:18:52 | Yardanico | same for include, import, etc |
00:19:05 | FromDiscord | <brainproxy> I wouldn't compile using vscode, just from command-line |
00:19:11 | Yardanico | yes, and how do you compile? |
00:19:18 | Yardanico | what command switches do you provide to nim? |
00:19:25 | FromDiscord | <brainproxy> https://github.com/status-im/nimbus-build-system/ |
00:19:41 | FromDiscord | <brainproxy> that injects a lot of stuff into the environment related to nim compiler params |
00:19:53 | FromDiscord | <brainproxy> and then you write make targets taking advantage of that |
00:20:17 | Yardanico | well you have to know how it actually manages the special nim compiler params |
00:20:23 | Yardanico | and replicate then in the .cfg (or .nims) file |
00:20:31 | Yardanico | to actually get nimsuggest to understand where stuff comes from |
00:20:51 | Yardanico | nimsuggest uses the compiler, so you need to make same config files as you would do for the compiler itself |
00:20:53 | FromDiscord | <brainproxy> fair enough |
00:21:03 | FromDiscord | <brainproxy> thanks for the tip! |
00:21:22 | FromDiscord | <brainproxy> will ask the nimbus folks if any of them have done that for their local vs code setup |
00:21:29 | FromDiscord | <brainproxy> (if any of them use vs code) |
00:22:20 | Yardanico | well it doesn't matter if it's vscode or not |
00:22:36 | Yardanico | you need to do that for any editor supporting nimsuggest (or nimlsp which uses nimsuggest) |
00:22:38 | FromGitter | <bung87> just setting compiler flags through config files |
00:22:43 | Yardanico | yes, as I said |
00:22:56 | FromDiscord | <brainproxy> ah right, sure |
00:23:06 | FromDiscord | <brainproxy> (edit) '(if' => '~~(if' | 'code)' => 'code)~~' |
00:23:54 | FromGitter | <bung87> extension doest know what you will pass to command line |
00:25:54 | * | FromDiscord quit (Remote host closed the connection) |
00:26:07 | * | FromDiscord joined #nim |
00:28:16 | FromGitter | <bung87> "backend" could be a valid switch? that extension may concerns |
00:28:35 | Yardanico | I think status mostly uses the C backend :) |
00:31:53 | FromGitter | <bung87> have known extension that aware of backend settings? I havnt know |
00:31:57 | Yardanico | ?? |
00:32:05 | Yardanico | I'm sorry, I don't understand :) |
00:32:48 | FromGitter | <bung87> I mean extension use some file detecting backend settings |
00:32:57 | Yardanico | it doesn't really |
00:33:00 | Yardanico | that's done by nimsuggest |
00:33:51 | FromDiscord | <Varriount> Yaaaaaardanico. Such a fun name to say. |
00:33:54 | FromGitter | <bung87> then provider editor features for that backend |
00:34:03 | Yardanico | i still don't understand :P |
00:34:20 | Yardanico | nimsuggest have "backend-specific" commands |
00:34:25 | Yardanico | doesn't have* |
00:35:32 | FromDiscord | <Varriount> shashlick: I'm having trouble getting Nimterop to work with config files. when I pass a mixture of command-line arguments and a config file to toast, it exits with non-zero exit code, but doesn't print any error messages. |
00:36:30 | FromGitter | <bung87> ok, that's fine. basically i just use c backend |
00:40:10 | * | Trustable quit (Remote host closed the connection) |
00:43:58 | FromGitter | <bung87> when you say "I'm sorry, I don't understand" reminds me of tv drama "humans" |
00:47:38 | FromGitter | <bung87> https://m.imdb.com/title/tt4122068/ |
01:04:06 | * | aurelius joined #nim |
01:05:21 | * | rockcavera joined #nim |
01:09:25 | * | aurelius quit (Ping timeout: 256 seconds) |
01:10:39 | * | maier joined #nim |
01:14:25 | FromDiscord | <impbox> I just watched the russian version "Better Than Us", the original Swedish version is great too |
01:15:48 | * | maier quit (Ping timeout: 256 seconds) |
01:17:48 | * | apahl quit (Ping timeout: 246 seconds) |
01:20:02 | * | apahl joined #nim |
01:21:42 | * | krux02_ quit (Remote host closed the connection) |
01:24:13 | FromGitter | <bung87> wow that looks nice two , i want watch |
01:37:51 | shashlick | @varriount snippet? |
01:45:25 | * | oriba quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
02:05:45 | FromDiscord | <Varriount> shashlick: Ah, I figured it out |
02:06:09 | FromDiscord | <Varriount> I had re-downloaded Nimterop, and forgot to add `noquote` to one of the lines |
02:06:19 | FromDiscord | <Varriount> of code in the nimterop source. |
02:07:48 | FromDiscord | <Varriount> shashlick: I'm planning on making a PR eventually which fixes the issues I've found. I also found a Clang bug 😐 |
02:07:51 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:09:58 | * | muffindrake joined #nim |
02:26:09 | shashlick | Nifty, always welcome |
02:36:36 | * | endragor quit (Remote host closed the connection) |
02:37:03 | * | endragor joined #nim |
02:42:50 | * | endragor quit (Ping timeout: 260 seconds) |
02:50:37 | * | lritter quit (Ping timeout: 264 seconds) |
02:50:55 | * | lritter joined #nim |
02:52:30 | * | aurelius joined #nim |
02:53:32 | * | endragor joined #nim |
02:57:50 | * | aurelius quit (Ping timeout: 265 seconds) |
03:05:11 | * | arecacea1 quit (Remote host closed the connection) |
03:06:03 | * | arecacea1 joined #nim |
03:07:17 | * | Zectbumo joined #nim |
03:10:31 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:11:30 | * | maier joined #nim |
03:16:19 | * | aurelius joined #nim |
03:16:54 | * | maier quit (Ping timeout: 260 seconds) |
03:16:59 | * | Zectbumo quit (Remote host closed the connection) |
03:58:01 | * | NimBot joined #nim |
04:01:26 | * | maier joined #nim |
04:02:19 | icyphox | does asyncnet work with UDP? |
04:02:49 | icyphox | it doesn't have a `sendTo()` proc like net |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:28 | * | maier quit (Ping timeout: 265 seconds) |
04:06:42 | * | supakeen joined #nim |
04:09:07 | icyphox | hmm maybe i can use `dial()` for this |
04:11:12 | * | rockcavera quit (Remote host closed the connection) |
04:11:52 | FromGitter | <bung87> in ast.nim `raiseRecoverableError` RecoverableError means what ? |
04:12:43 | FromGitter | <bung87> programs run recover from exception that I understand |
04:22:08 | * | B4s1l3 joined #nim |
04:22:14 | * | B4s1l3 is now known as opDispatch |
04:22:27 | * | opDispatch left #nim (#nim) |
04:38:06 | * | hoijui joined #nim |
04:43:22 | FromDiscord | <jcs224> sent a code paste, see https://play.nim-lang.org/#ix=2suE |
04:43:46 | FromDiscord | <jcs224> `finalHex` being a string |
04:48:09 | * | endragor quit (Remote host closed the connection) |
04:48:36 | * | endragor joined #nim |
04:49:56 | FromDiscord | <Elegant Beef> @jcs224 here you go↵https://play.nim-lang.org/#ix=2suF |
04:50:22 | FromDiscord | <Elegant Beef> alternatively you could use `newJString("Super Secure Password")` |
04:52:45 | FromDiscord | <jcs224> Nice, that did it, thanks! |
04:53:25 | ForumUpdaterBot | New thread by Arch: Are constructors supported ?, see https://forum.nim-lang.org/t/6606 |
04:54:22 | * | endragor quit (Ping timeout: 256 seconds) |
04:56:31 | * | endragor joined #nim |
05:09:03 | * | narimiran joined #nim |
05:22:03 | icyphox | how can i use asyncdispatch's `addTimer` proc to just modify a value every N seconds? |
05:22:10 | icyphox | or is there a better way to do this? |
05:37:32 | * | dzamo joined #nim |
05:56:31 | * | Vladar joined #nim |
05:58:36 | * | maier joined #nim |
06:10:08 | Zevv[m] | disruptek: dude go to bed man |
06:27:01 | FromDiscord | <Varriount> Zevv: He hasn't written anything for a while. |
06:27:19 | FromDiscord | <Varriount> Unless he's streaming or something |
06:31:42 | ForumUpdaterBot | New thread by Serge: Is the rule regarding parentheses as "blocs" still valid ?, see https://forum.nim-lang.org/t/6607 |
06:33:53 | * | solitudesf joined #nim |
06:38:45 | FromDiscord | <slymilano> Hey gang, in Elixir I can run credo to tell me about my code stank - is there something similar for Nim? Would like to make it a part of my CI process |
06:39:04 | FromDiscord | <slymilano> a "linter" for Nim so to speak. |
06:40:03 | FromDiscord | <Rika> code style only afaik |
06:40:11 | FromDiscord | <Rika> i mean, appearance |
06:40:28 | FromDiscord | <Rika> nimpretty for appearance of code |
06:40:39 | FromDiscord | <Rika> nothing for analysis, i dont think |
06:41:02 | leorize | narimiran: can you update the hash for fusion in Nim? |
06:41:29 | narimiran | leorize: oh, there's a hash? so that's why it is still failing? :) |
06:41:39 | leorize | yep :P |
06:41:47 | FromDiscord | <slymilano> thanks Rika |
06:42:12 | FromDiscord | <Yardanico> @slymilano well there's nim check |
06:42:29 | FromDiscord | <Yardanico> It'll report all warnings and hints just like the compiler |
06:42:32 | FromDiscord | <Yardanico> Without compiling |
06:42:43 | FromDiscord | <Rika> oh yeah that |
06:43:38 | FromDiscord | <Elegant Beef> Considering your dont write idiomatic nim code anyway slymilano what's that code smell 😄 |
06:49:10 | FromDiscord | <Yardanico> Damn I actually didn't think about that, although I already made my own way of single line procs https://forum.nim-lang.org/t/6607 |
06:53:06 | narimiran | leorize: done, and restarted the failing nightiles..... |
06:56:37 | leorize | restarted my nightlies as well :P |
07:03:21 | Zevv[m] | variriount: I know, but he just commited a nasty PR |
07:19:47 | * | Vladar quit (Remote host closed the connection) |
07:25:11 | narimiran | leorize: yay, another fail: filepermissions_examples1.nim(9, 6) Error: undeclared identifier: 'fpUserExec' |
07:26:00 | narimiran | runnable example needs "import os" |
07:28:21 | narimiran | fixed, bumped FusionStableCommit, restarted |
08:01:01 | Oddmonger | ok today i read again tutorial I |
08:01:11 | Oddmonger | and i take notes on traps |
08:01:35 | Yardanico | oh god my brain |
08:02:17 | Yardanico | my head was just.. working with other info, and it resolved "trap" to it's another unofficial internet slang meaning |
08:03:51 | FromDiscord | <Elegant Beef> lol yard, freud has an idea about that 😄 |
08:04:15 | Yardanico | nonono i was just browsing r/animemes |
08:04:22 | Yardanico | it was a little happy accident |
08:05:51 | FromDiscord | <Rika> :EyesShaking: |
08:06:49 | * | lritter quit (Ping timeout: 264 seconds) |
08:09:50 | Yardanico | Araq: with two leak fixes, the current RAM usage of asynchttpserver after ~450k requests is 100mb compared to 1500mb (nim from a month ago), both with orc |
08:09:58 | Yardanico | and the leak seems to be related to callbacks this time |
08:10:20 | Yardanico | but it doesn't leak a lot per-request |
08:10:45 | Yardanico | well, comparatively |
08:13:23 | narimiran | ah, another fusion fix, another problem discovered..... |
08:13:37 | * | oddp joined #nim |
08:22:11 | ForumUpdaterBot | New thread by Wiltzutm: Incomplete gamma function in Nim or it's 3rd party libraries, see https://forum.nim-lang.org/t/6608 |
08:22:34 | FromDiscord | <Varriount> naeimiran: The bugfix conga |
08:25:40 | * | Cthalupa quit (Ping timeout: 256 seconds) |
08:30:21 | Yardanico | naemiran :D |
08:31:47 | FromDiscord | <Rika> ~~naenaemiran~~ |
08:33:33 | narimiran | * naemean |
08:33:39 | Yardanico | mean nae |
08:36:03 | FromDiscord | <kodkuce> hmm can i post formated code with `` |
08:36:06 | Yardanico | yes |
08:36:10 | Yardanico | but with ``` |
08:36:26 | FromDiscord | <kodkuce> sent a code paste, see https://play.nim-lang.org/#ix=2sv6 |
08:36:28 | Yardanico | well yes it might crash |
08:36:32 | Yardanico | nimsuggest has crashes |
08:36:37 | Yardanico | and nimlsp uses nimsuggest |
08:36:54 | Yardanico | for a good bug report you should try to minimize the source code file which created this crash :) |
08:37:04 | Yardanico | so it doesn't depend on any imports at all, and roughly <100 loc :P |
08:37:20 | FromDiscord | <kodkuce> ye, so to do that would need what |
08:37:26 | FromDiscord | <kodkuce> to delete half code |
08:42:34 | Yardanico | added two more examples to https://github.com/nim-lang/Nim/wiki/Nim-features-you-didn't-know-you-needed XD |
08:43:17 | Yardanico | feel free to add if you have any |
08:43:24 | Yardanico | just some unusual, less-known nim features |
08:43:41 | Yardanico | is named argument overloading documented by the way? |
08:43:49 | FromDiscord | <Clyybber> nope, should add that |
08:43:52 | Yardanico | XD |
08:44:03 | FromDiscord | <Clyybber> it doesn't have tests too |
08:44:13 | Yardanico | but it works :P |
08:44:19 | FromDiscord | <Clyybber> but nimgame2 tests it :p |
08:45:35 | narimiran | Yardanico: oh, range type exampes! i had no idea that worked! :) |
08:45:43 | Yardanico | neither did I really |
08:45:53 | Yardanico | found it on some github project which had "port: 1 .. 65535" in object field definition |
08:46:04 | superbia1 | when is walrus operator coming to nim |
08:46:11 | Yardanico | superbia1: you can implement it yourself |
08:46:15 | Yardanico | with a single line template |
08:46:29 | Yardanico | see https://github.com/Yardanico/nimpylib/blob/master/src/pylib.nim#L177 |
08:46:53 | Yardanico | although it behaves a bit differently |
08:47:28 | superbia1 | yea |
08:47:54 | Yardanico | but for most cases it can work the same as the python walrus |
08:47:59 | Yardanico | but I don't think we'll get that as a built-in :) |
08:48:07 | Yardanico | because as I showed it's trivial to implement with a template |
08:51:37 | narimiran | if anybody has some extra time, can you do a sanity check for me? clone https://github.com/nim-lang/fusion and try to run `nim doc src/fusion/htmlparser/xmltree.nim` |
08:51:44 | Yardanico | sure |
08:51:58 | Yardanico | fails |
08:52:07 | narimiran | on my end, it behaves differently than the stdlib version |
08:52:09 | Yardanico | at the <firstTag> thing |
08:52:13 | narimiran | yep |
08:52:15 | Yardanico | narimiran: well yeah I think it has some changes |
08:52:26 | narimiran | yeah, it does have, i'm now comparing |
08:52:27 | Yardanico | ping @bung87 :P |
08:52:37 | * | Cthalupa joined #nim |
08:53:51 | narimiran | probably this line: `if n.len == 0 and n.fTag in SingleTags:` |
08:55:16 | narimiran | yep, change it to `if n.len == 0:` (like in the stdlib) and it passes |
08:56:01 | FromDiscord | <kodkuce> what are this observable stores warnings, exmaple observable stores to ':envP.frame5' |
08:56:07 | * | nikita` joined #nim |
08:56:08 | Yardanico | ignore them for now |
08:56:23 | Yardanico | basically they mean that you're assigning the result even if the code can raise an exception |
08:56:46 | Yardanico | but the warning will be improved or fully removed, so don't worry |
08:58:16 | FromDiscord | <kodkuce> ok ty 🙂 |
08:59:16 | narimiran | @bung87, Yardanico i reverted the changes, now it seems to work as intended |
08:59:54 | * | aurelius quit (Remote host closed the connection) |
09:01:29 | * | aurelius joined #nim |
09:08:06 | * | Vladar joined #nim |
09:12:24 | FromGitter | <alehander92> oii! |
09:12:28 | FromGitter | <alehander92> time for rfc |
09:12:45 | Yardanico | which one? |
09:13:03 | FromGitter | <alehander92> the enum/variant flow typing one |
09:13:13 | FromGitter | <alehander92> can someone help be debug my streaming tho |
09:13:24 | FromGitter | <alehander92> i still haven't solved this nvenc issue |
09:13:36 | Yardanico | i haven't used hardware encoders in a long time :) |
09:13:40 | Yardanico | 3700X does the job :D |
09:14:12 | FromGitter | <alehander92> oiii |
09:14:23 | FromGitter | <alehander92> my laptop gets too hot |
09:14:48 | FromGitter | <alehander92> no problem! |
09:16:49 | FromDiscord | <Clyybber> alehander92: What nvenc issue? |
09:20:57 | FromGitter | <alehander92> it doesn't work |
09:21:31 | FromGitter | <alehander92> generic error in an external library |
09:21:45 | * | waleee-cl joined #nim |
09:22:22 | FromGitter | <alehander92> not a big deal, i have to debug it |
09:22:24 | FromGitter | <alehander92> a bit lazy |
09:24:24 | ForumUpdaterBot | New thread by Jasonfi: Authenticating a user in a REST webservice, see https://forum.nim-lang.org/t/6609 |
09:28:39 | Araq | offtopic but funny: https://www.industrialempathy.com/img/remote/ZCBwPv-640w.jpg |
09:30:03 | FromDiscord | <Clyybber> a classic :D |
09:30:31 | FromGitter | <bung87> narimiran Yardanico am awake now |
09:30:56 | * | TsT joined #nim |
09:30:59 | TsT | :D |
09:31:05 | FromDiscord | <Clyybber> Araq: We either need to attach scopes to gensymmed symbols, or put gensymmed symbols actually in the scope (I mean they still can't be accessed normally) |
09:31:15 | FromDiscord | <Clyybber> Because otherwise gensymmed forward decls can't work |
09:31:44 | * | nerthus left #nim ("Leaving") |
09:31:54 | Araq | as I said |
09:32:12 | Araq | I'd rather see the effort spend on eliminating forward decls |
09:32:40 | Araq | then you still cannot gensym forward decls but nobody cares as forward decls are not required anymore |
09:32:51 | FromDiscord | <Clyybber> Yeah |
09:32:52 | Araq | in fact, comparing proc signatures is unsound |
09:33:06 | FromDiscord | <Clyybber> why? |
09:33:14 | Araq | because of default values |
09:33:26 | FromDiscord | <Clyybber> hmm |
09:33:35 | Araq | they can be arbitrary 'static' expressions |
09:33:54 | FromDiscord | <Clyybber> yeah |
09:33:58 | Araq | which you have to evaluate before you can compare them. ok, maybe it's not unsound |
09:34:01 | Araq | but it's bad |
09:34:08 | FromDiscord | <Clyybber> bad yeah, but not wrong :p |
09:34:39 | FromDiscord | <Clyybber> in general though, is there something that would make it a bad idea to put gensymmed symbols in the scope? |
09:34:50 | FromDiscord | <Clyybber> I mean they have the `gensym suffix anyways |
09:34:55 | FromDiscord | <Clyybber> so you can't access them |
09:35:31 | Araq | maybe it won't hurt |
09:35:44 | Araq | but I'm not sure |
09:36:07 | FromDiscord | <Clyybber> ok, I'll try and see if the CIs spout anything at me |
09:38:52 | FromDiscord | <Clyybber> Araq: Kinda related, should we add a test for name based overloading? |
09:39:01 | FromGitter | <bung87> narimiran I see the commit, I might add more test for that , it's really intend to check if single tag |
09:39:09 | FromDiscord | <Clyybber> Its used in the wild already (nimgame2) and we don't have a test for it yet |
09:39:22 | Araq | huh I remember writing a test for it |
09:39:25 | narimiran | @bung87 it already worked okay, from what i can tell |
09:39:29 | Araq | did you check tests/overload ? |
09:39:43 | narimiran | and with your changes, lots of runnable examples were failing |
09:40:36 | FromDiscord | <Clyybber> Araq: Ah, I missed it |
09:40:46 | Yardanico | it's not really documented nonetheless :P |
09:46:08 | FromDiscord | <Clyybber> oh, ugh. Looks like all of the above is not needed |
09:46:22 | FromDiscord | <Clyybber> get ready for the 4th incarnation of gensym |
09:46:32 | * | TsT left #nim (#nim) |
09:48:07 | FromDiscord | <Clyybber> Araq: Do we already have a good way of getting a unique number out of a template instantiation? |
09:48:34 | FromDiscord | <mratsim> var compTimeRNG {.compileTime.} = initRand(1337) |
09:48:52 | FromGitter | <bung87> narimiran ok, it solve some issues , let me check more conditions as in that time I debuging htmlparser |
09:48:54 | FromDiscord | <Clyybber> you are kidding, but thats exactly what I'm doing rn |
09:49:08 | FromDiscord | <Clyybber> @mratsim or maybe you are not kidding, but I'm talking *in* the compiler :p |
09:49:11 | FromDiscord | <mratsim> Great minds think alike 😉 |
09:49:43 | FromDiscord | <mratsim> I'm not kidding: https://github.com/numforge/laser/blob/master/laser/openmp.nim#L13-L25 |
09:50:50 | FromDiscord | <Clyybber> I mean it won't prevent you from collisions will it? |
09:51:34 | FromDiscord | <mratsim> I'm okay with a 2^64 space |
09:51:48 | FromDiscord | <mratsim> with the birthday paradox it's 2^-32 chance of collision |
09:52:30 | FromDiscord | <mratsim> If I have a collision it's probably when the lightning strikes me as I win the loto |
09:52:51 | FromDiscord | <mratsim> just after we learned that we fixed global warming |
09:52:55 | FromDiscord | <Clyybber> putting it in the compiler feels like bullying the unlucky |
09:53:07 | FromDiscord | <Clyybber> holy shit |
09:53:10 | FromDiscord | <mratsim> Embrace probabilities |
09:53:26 | FromDiscord | <Clyybber> just while talking about chances something made boom |
09:53:38 | FromDiscord | <Clyybber> sounded like a bomb or something lol |
09:53:59 | FromDiscord | <Clyybber> probably something that fell of a crane |
09:55:17 | Yardanico | "0x1337DEADBEEF" nice constant lol |
09:55:42 | * | hoijui quit (Ping timeout: 260 seconds) |
09:57:18 | FromDiscord | <dom96> It's the holy constant |
10:01:16 | Yardanico | " ctx.gensymHash = rand(0..int.high) #TODO: Wtf" |
10:02:03 | FromDiscord | <Clyybber> :p |
10:03:55 | * | maier quit (Ping timeout: 246 seconds) |
10:04:04 | FromDiscord | <lqdev> @mratsim if i want to implement a simd vector math library using laser, is there anything i should keep in mind wrt CPU compatibility? |
10:05:32 | * | hoijui joined #nim |
10:05:44 | FromDiscord | <mratsim> Laser is more of a research repo, before productionizing stuff. I wasn't the one to add it to nimble |
10:06:45 | FromDiscord | <mratsim> for CPU compat, separate the various SMID support in different files so that you can use different {.localPassC:"-mavx".} or {.localPassC:"-mavx2".} flags |
10:07:48 | FromDiscord | <mratsim> Not sure exaclty what you want to provide but if you want to go fast the easiest would be to wrap SLEEF. THough I know some routines are slower than what I did in Laser (for example exponentiation) |
10:08:02 | FromDiscord | <mratsim> https://sleef.org/ |
10:08:14 | FromDiscord | <lqdev> makes sense, but for distributing binaries, should i stick to a particular extension? |
10:09:13 | FromDiscord | <mratsim> SSE2 is implied for x86-64. |
10:09:54 | FromDiscord | <mratsim> otherwise, people using it would likely use runtime CPU detection |
10:10:12 | FromDiscord | <mratsim> but runtime CPU detection only makes sense at the algorithm level |
10:10:55 | FromDiscord | <mratsim> you don't choose at runtime the implementation of "add" the overhead would be to big, but you do that at the matrix addition level |
10:11:15 | FromDiscord | <lqdev> i see |
10:11:27 | * | hoijui quit (Ping timeout: 260 seconds) |
10:11:36 | FromDiscord | <lqdev> so calling procs from variables is slower than calling them directly? |
10:11:59 | FromDiscord | <mratsim> I don't get what you mean |
10:13:11 | FromDiscord | <lqdev> well, i'd implement that runtine CPU detection to use a few variables which store the procs, and then call the procs stored in those variables in the public interface |
10:14:10 | FromDiscord | <mratsim> what I mean is, count 1 cycle for an "if branch", and 1 cycle for vector addition, whether on 4 elements (SSE) or 8 elements (AVX).↵↵If you want to add 8 elements, you test for SSE or AVX + proces you get 3 or 2 cycles↵If you always use SSE you get 2 cycles. |
10:16:08 | FromDiscord | <mratsim> What you want to do is called function multiversioning |
10:16:35 | FromDiscord | <mratsim> But you only want to do that at a higher level as well |
10:18:05 | FromDiscord | <mratsim> a function in a variable cannot be inlined, this means pushing and poping registers before the function call.↵But when you want SIMD you are usually in an algorithm that needs to get the data as fast as possible in the proper memory locationto benefits from SIMD.↵Moving data around (due to function call) will likely be a problem. |
10:18:23 | FromDiscord | <lqdev> alright |
10:18:34 | FromDiscord | <lqdev> didn't consider inlining |
10:18:49 | FromDiscord | <lqdev> thanks for the advice! |
10:19:45 | FromDiscord | <mratsim> See: https://github.com/nim-lang/Nim/issues/9514 |
10:19:49 | disbot | ➥ [Perf] Max/min are not inline and slow (7x slower than memory-bound implementation) ; snippet at 12https://play.nim-lang.org/#ix=2svy |
10:20:40 | FromDiscord | <mratsim> You have assembly with push mov / max / pop ret |
10:22:34 | * | abm joined #nim |
10:23:13 | FromDiscord | <mratsim> If you want to do more SIMD, my advice is to find an algorithm you want to implement and optimize (could be numerical computing, could be graphics). Implement it in plain Nim, and then start moving parts to SIMD |
10:23:49 | FromDiscord | <Clyybber> Zevv: You should be able to change the T: untyped to T: type at least |
10:24:03 | FromDiscord | <mratsim> There are some in laser/benchmarks (fp_reduction_latency / exponentiation) but there are plenty of other stuff like color conversion for example |
10:24:16 | FromDiscord | <mratsim> what about T: typedesc? |
10:24:35 | FromDiscord | <Clyybber> its the same |
10:24:42 | FromDiscord | <mratsim> Akshually* |
10:24:43 | FromDiscord | <Clyybber> but type is fancier |
10:24:49 | FromDiscord | <Clyybber> no akshually |
10:24:55 | FromDiscord | <Clyybber> that bug has long been fixed :D |
10:25:04 | FromDiscord | <mratsim> there are some cases when one compiles but not the other |
10:25:06 | FromDiscord | <mratsim> oh |
10:25:24 | FromDiscord | <Clyybber> oh, well I mean. I fixed the one bug that I was aware of that differentiated the two |
10:25:41 | FromDiscord | <Clyybber> but there may be some other unreported ones |
10:28:07 | FromDiscord | <mratsim> I have so many semchecks bugs uncovered in my library when trying to do something :/ takes so much time to report |
10:29:55 | FromDiscord | <Clyybber> Yeah, its hard to get right. But every bug/issue helps |
10:30:00 | FromDiscord | <Clyybber> Araq: ping |
10:32:39 | FromDiscord | <Clyybber> bung87: Regarding the unittest issue, maybe the best way to fix this is to make check raise a custom UnitTestCheckFailedException or something like that |
10:33:09 | FromDiscord | <mratsim> one of the recent ones I got was an var/alias bug: |
10:34:29 | FromDiscord | <mratsim> sent a long message, see http://ix.io/2svE |
10:37:51 | FromDiscord | <kodkuce> any specific reason i cant create an constant header, cuz plan to use json responses for all endpoints ? it says its an invalid type↵```↵const rheader = newHttpHeaders([("Content-Type","application/json")])↵``` |
10:38:48 | FromDiscord | <kodkuce> oh dumb question rith, constants are know at compile time right? for this i should use let |
10:40:22 | FromDiscord | <dom96> yes, but you should be able to do: `const header = {"Content-Type": "application/json"}` |
10:42:31 | * | aurelius quit (Remote host closed the connection) |
10:42:35 | FromDiscord | <Vindaar> @mratsim are you aware of https://github.com/mratsim/Arraymancer/pull/464 ? |
10:42:39 | disbot | ➥ Allow independent imports of all submodules ; snippet at 12https://play.nim-lang.org/#ix=2svJ |
10:47:20 | * | maier joined #nim |
10:49:04 | FromGitter | <bung87> Clyybber for the PR's imporvement , maybe get result bool status from checkpoints or another seq |
10:49:24 | * | aurelius joined #nim |
10:50:41 | FromGitter | <bung87> `check` can place to everywhere that `test` doesn't know |
10:52:07 | FromDiscord | <Clyybber> yeah, exactly |
10:52:20 | FromDiscord | <mratsim> @Vindaar No, I try to diligently check my github notifications but it's seems like I missed that one |
10:52:28 | FromDiscord | <Clyybber> bung87: thats why I think using exceptions (yes as controlflow :P) here would be appropriate |
10:52:42 | FromDiscord | <mratsim> vade retro, you are not welcome here |
10:53:11 | FromDiscord | <Clyybber> lol |
10:53:38 | FromGitter | <bung87> Clyybber so how to handle the exception from top level check? |
10:54:37 | FromDiscord | <Vindaar> @mratsim no worries, hence the ping 🙂 |
10:57:19 | FromDiscord | <mratsim> I'm subscribed to many many Status lib but plenty other libs I want to keep track of and somehow Github doesn't highlight PR on your own libraries :/ |
10:57:45 | FromDiscord | <mratsim> The worse is Github Actions that spams notifications |
10:58:26 | FromDiscord | <Clyybber> bung87: try except |
10:58:41 | FromDiscord | <dom96> GitHub notifications are terrible |
10:59:15 | FromDiscord | <Vindaar> I always just check on the LHS of the notification screen whether there's new activity in any of my repos |
11:00:30 | FromDiscord | <Vindaar> I guess if one is subscribed to more than 30 or so active repos even that doesn't really work well though, since those might not even be on the first page? |
11:01:54 | FromGitter | <bung87> that's users try except, I mean top level check raise UnitTestCheckFailedException how that would be handled |
11:02:52 | FromDiscord | <Clyybber> oh, hmm. |
11:03:00 | FromDiscord | <Clyybber> yeah that can't work |
11:03:30 | FromDiscord | <mratsim> The old notification system was better. This ones feels like an email inbox |
11:04:15 | FromDiscord | <Vindaar> a _modern gmail like_ inbox (read, horrible inbox) |
11:07:23 | * | nature joined #nim |
11:07:28 | FromGitter | <alehander92> try hey.me |
11:07:41 | FromGitter | <alehander92> hey.com ! |
11:07:46 | FromGitter | <bung87> might change checkpoints store .msg .status as a obj, like testament does |
11:07:52 | FromGitter | <alehander92> it's by the rails guys, but it does seem useful |
11:07:56 | FromGitter | <alehander92> but it's paid after the free trial |
11:08:07 | FromGitter | <alehander92> so i'll probably not sure it more |
11:09:46 | nature | Hi, recently got into vim and it really is everything I wanted in a language, I love it so far. Now I am gonna start my first "serious" project in nim (I want to do a really simple SSG) and I was wondering if anyone has experience coding in Nim with Vim ? |
11:10:10 | narimiran | nature: use neovim, there's a great nim plugin for it |
11:10:26 | narimiran | https://github.com/alaviss/nim.nvim |
11:11:07 | nature | thx, is autocompletion available ? |
11:11:13 | narimiran | it is |
11:11:31 | nature | I am using coc.vim when I dev in js, python etc... |
11:12:27 | nature | narimiran ooooh I already had that repo open in my browser :) |
11:13:07 | nature | Are you using it ? Cause I also found this: https://github.com/PMunch/nimlsp but I am not familiar with LSP |
11:13:09 | narimiran | nature: btw, you can ping the author of the plugin here, he goes by the name: leorize |
11:13:53 | narimiran | yes, i'm using nim.nvim together with asyncomplete, and it works great for me |
11:14:09 | narimiran | i've never used coc.vim, so i cannot comment on that |
11:14:44 | narimiran | and i never used any of the LSP stuff, so no help there from me either, sorry |
11:15:03 | nature | coc.vim brings the vscode autocomplete, plugins etc.. in Vim, pretty nice but I sometimes feel in might be bloated ^^' |
11:16:04 | nature | narimiran: And what do you think of https://github.com/zah/nim.vim ? |
11:16:17 | narimiran | nature: IIRC, it is outdated |
11:16:32 | narimiran | IMO, look no further than nim.nvim |
11:16:41 | nature | okay :D |
11:16:45 | nature | Thanks! |
11:17:35 | nature | and you complement it with prabirshrestha/asyncomplete.vim ? |
11:17:53 | FromDiscord | <Rika> Are you using vim or neovim |
11:18:26 | nature | neovim |
11:18:49 | ForumUpdaterBot | New thread by Euant: Improving BSD support - NetBSD, see https://forum.nim-lang.org/t/6610 |
11:22:03 | FromDiscord | <flywind> Can int in Nim be treated as pointer when I interface with C? |
11:22:04 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/issues/12327 |
11:22:04 | disbot | ➥ Winlean definition issues |
11:23:22 | narimiran | nature: yes, i use asyncomplete with it |
11:25:20 | nature | okok thank you :) Looking into it some more now |
11:27:13 | * | krux02 joined #nim |
11:35:32 | * | dulsi_ joined #nim |
11:38:04 | * | dulsi quit (Ping timeout: 246 seconds) |
11:47:53 | * | oddp quit (Quit: quit) |
11:49:06 | Zevv[m] | disruptek: morning reading https://github.com/disruptek/cps/issues/27 |
11:49:08 | disbot | ➥ Getting rid of reallocs ; snippet at 12https://play.nim-lang.org/#ix=2svX |
11:58:03 | * | Vladar quit (Remote host closed the connection) |
11:58:20 | * | Vladar joined #nim |
12:01:06 | * | dulsi_ is now known as dulsi |
12:05:15 | FromGitter | <alehander92> ok |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:15 | FromGitter | <alehander92> so `A{B, C}` vs `A => kind in {B,C} ` vs `A @ B, C` |
12:06:40 | * | supakeen joined #nim |
12:06:53 | FromGitter | <alehander92> what looks best for variants: i'll continue with my spec later, but wanted to ask new ppl about the syntax |
12:09:50 | * | Senketsu joined #nim |
12:11:34 | * | rockcavera joined #nim |
12:23:19 | * | oddp joined #nim |
12:25:13 | * | oddp quit (Client Quit) |
12:30:41 | FromDiscord | <mratsim> the first |
12:33:27 | * | hoijui joined #nim |
12:35:11 | FromGitter | <alehander92> thanks |
12:35:12 | * | theelous3 joined #nim |
12:37:16 | FromDiscord | <lqdev> yeah the first one definitely |
12:37:34 | FromDiscord | <lqdev> the last one could introduce an ambiguity to the parser |
12:38:31 | FromDiscord | <lqdev> you could extend the first one to something like `A{kind: B, C}` for specifying a field name explicitly. or maybe `A.kind{B, C}` |
12:38:58 | * | sentreen quit (Ping timeout: 246 seconds) |
12:41:58 | * | vicfred joined #nim |
12:43:37 | * | sentreen joined #nim |
12:44:05 | Zevv[m] | alehander92: what ya cookin |
12:44:34 | FromGitter | <bung87> narimiran `htmlparser.nim` under test doesn't run actually |
12:44:55 | narimiran | what do you mean? |
12:45:38 | FromGitter | <bung87> dont know why nimble doesn't run as it name same as `htmlparser.nim` |
12:46:41 | FromGitter | <bung87> see https://github.com/bung87/fusion/runs/918881830 |
12:46:52 | FromGitter | <alehander92> lqdev good idea |
12:47:01 | FromGitter | <alehander92> i like the A.kind.. |
12:47:33 | FromGitter | <alehander92> zevv later: variant `kind` annotations |
13:02:00 | * | bung joined #nim |
13:04:53 | FromGitter | <bung87> narimiran it breaking now, nimble doesn't run `htmlparser.nim` test, just because the test file same as libname ? |
13:06:38 | * | nikita` quit (Quit: leaving) |
13:23:57 | * | aurelius quit () |
13:39:22 | livcd | How is it going y'all? |
13:41:34 | * | arecacea1 quit (Remote host closed the connection) |
13:42:26 | * | arecacea1 joined #nim |
13:43:27 | FromDiscord | <kodkuce> magic |
13:46:29 | nature | narimiran: Thanks, I managed to setup asyncomplete with nim.nvim, pretty neat! :D |
13:50:58 | FromGitter | <bung87> narimiran I created a fix for that see https://github.com/bung87/fusion/commit/382e86d18c99cdb04934550f052d57b54f68c37c |
13:51:01 | * | FromDiscord quit (Remote host closed the connection) |
13:51:18 | * | FromDiscord joined #nim |
13:52:32 | FromGitter | <bung87> there's one problem am not sure, `proc add*(result: var string` I change its runnableExamples it add isolated text which just ignored by browser , not sure how to handle this |
13:59:59 | * | nerdrat[m] left #nim ("User left") |
14:05:14 | Zevv[m] | alehander92: variant kind annotations. That sounds like something I'd like to have! |
14:07:55 | alehander92 | i am learning cmake now zevv |
14:08:16 | alehander92 | first cmake later chocolate |
14:13:01 | * | altarrel joined #nim |
14:16:44 | narimiran | @bung87 yeah, this fixes the tests, but i'm not sure it is the right way to go |
14:18:56 | * | MarderIII joined #nim |
14:24:11 | FromGitter | <bung87> it's now fails on all windows test, haven't figure out what cause , currentlly it work behavior like browser, accpet valid invalid html, and produce html that browser can handle for whatever html specification. |
14:25:10 | FromGitter | <bung87> that's the behavior like popular html parser in other languages |
14:26:48 | Zevv[m] | alehander92: do I know you? why are you talking to me? |
14:26:51 | * | hoijui quit (Quit: Leaving) |
14:26:52 | Zevv[m] | like, really, cmake?! |
14:27:14 | FromGitter | <bung87> lol |
14:27:16 | Zevv[m] | friends don't let friends learn cmake |
14:28:23 | alehander92 | why? i have no idea what i am doing part of the time in this c++/c land |
14:29:01 | alehander92 | what do hipsters use |
14:29:01 | FromDiscord | <mratsim> CMake is a DSL, it's not C/C++ |
14:29:08 | FromDiscord | <mratsim> Ninja/Meson |
14:29:24 | alehander92 | yes, i am talking about building files: i usually see cmake in c/c++ land |
14:29:28 | FromDiscord | <mratsim> includes a Z3 SMT solver :p |
14:29:56 | alehander92 | but doesn't cmake generate ninja files as a possible backend |
14:31:28 | alehander92 | the thing is : cmake seems to be popular. so it's useful to know some stuff about it even if another solution is more modern |
14:32:38 | alehander92 | for non-nim stuff i'd prefer just using rust and cargo , but the point is to dabble into the jungle :D |
14:37:12 | * | Vladar quit (Quit: Leaving) |
15:01:27 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
15:04:17 | * | NimBot joined #nim |
15:10:42 | * | waleee-cl joined #nim |
15:11:50 | * | Vladar joined #nim |
15:12:50 | disruptek | we have a test for name-based overloading iirc. |
15:12:56 | * | mbuchel quit (Quit: WeeChat 2.8) |
15:13:10 | disruptek | pretty sure i raised an issue and someone added a test and docs. |
15:15:45 | * | sputny joined #nim |
15:24:34 | * | solitudesf quit (Remote host closed the connection) |
15:25:41 | * | MarderIII quit (Quit: Leaving) |
15:26:37 | * | maier quit (Ping timeout: 264 seconds) |
15:30:29 | * | solitudesf joined #nim |
15:33:23 | FromDiscord | <ProperFellow> Hi there! New to Nim, and playing around with making a performant CRUD (using Prologue). I want to make db queries async using a connection pool, but I'm having a hell of a time finding documentation (or being sure I'm using the right packages). I've looked at Gatabase. Am I looking in the right spot? |
15:33:50 | disruptek | there are simple db connectors in the stdlib. |
15:33:52 | disruptek | which database? |
15:34:52 | Zevv[m] | are these async tho |
15:36:08 | disruptek | juancarlospaco's gatabase is async? |
15:36:26 | Zevv[m] | I have no clue. I don't database |
15:37:08 | disruptek | i don't see `async` on the README. |
15:38:18 | Zevv[m] | disruptek: I love your exceptions but I hate them |
15:38:33 | disruptek | i know. |
15:38:50 | disruptek | i know you would rather impl exceptions using continuations. |
15:39:00 | Zevv[m] | nah, it's not about that |
15:39:05 | Zevv[m] | but now you always put that stuff in |
15:39:22 | disruptek | yeah, they can be gated. |
15:39:36 | Zevv[m] | cna we put them in as a transformation of a try: catch: in the original? |
15:39:41 | Zevv[m] | or doesn't that map |
15:40:36 | Zevv[m] | but man, you're on a roll |
15:40:58 | disruptek | they can be remapped, but if you catch inside your continuation, i'm not sure you're doing it right. |
15:41:19 | Zevv[m] | yeah I see. But now I have no choice |
15:41:27 | disruptek | the idea is that we give you a semantic that doesn't exist otherwise. it's lives in the dark place between the trampoline and the runtime. |
15:41:32 | Zevv[m] | why can't I just catch in my trampoline? |
15:41:45 | disruptek | that's what cpsTrace does. |
15:42:10 | Zevv[m] | but my default transformation now is full of 'excepts' in each proc |
15:42:19 | disruptek | true. |
15:42:34 | disruptek | but it re-raises them, right? |
15:42:46 | Zevv[m] | yeah but you're forcing this in |
15:42:59 | disruptek | true, but it should be very efficient under arc. |
15:43:04 | Zevv[m] | I want my cps iterator to run as fast as nim closure iterators |
15:43:08 | disruptek | but again, we can gate it. |
15:43:23 | Zevv[m] | what do you solve by catching it here instead of just letting it go? |
15:43:24 | disruptek | it can be a pragma on the cps proc. |
15:43:42 | disruptek | the idea is that continuations can continue and collect errors. |
15:43:58 | disruptek | also you can change the behavior on the exit. |
15:44:13 | Zevv[m] | hm ok, Im starting to see |
15:44:26 | Zevv[m] | but I'm not sure if this should be default behaviour |
15:44:36 | disruptek | but again, we can gate it. |
15:44:41 | Zevv[m] | right |
15:47:17 | disruptek | `let x = yield foo()` can be a thing. it seems explicit and yield will be useless outside iterators, which we are useless inside. |
15:47:27 | disruptek | so it kinda works out. |
15:48:02 | disruptek | also, it kinda says "magic control flow here." |
15:48:30 | Zevv[m] | fair enough. |
15:48:57 | FromDiscord | <ProperFellow> Sorry catching up. Using postgres. The db connectors in stdlib are not async. Gatabase offers pooling - and seems to offer async according to one of the meme images. There's no real documentation. |
15:49:11 | FromDiscord | <Rika> gatabase is very new |
15:49:13 | Zevv[m] | The other thing I ran into yesterday - I'd like to have some data around during my traversal over the continuations. But where would I store such a thing. Is that in #26 as well? |
15:49:18 | disruptek | jc is pretty active, though, so you won't have trouble getting support. |
15:49:23 | Zevv[m] | I guess there is becasue you put your exceptions somewhere |
15:49:54 | FromDiscord | <ProperFellow> So reach out to jc directly? |
15:50:11 | disruptek | you could create an issue; i think he'd like to hear from you. |
15:50:24 | disruptek | Zevv[m]: you can store it in local scope like anything else, right? |
15:50:45 | Zevv[m] | no, it's not for the cps functions, it's for the evq/pump implementation |
15:51:01 | disruptek | what are we talking about? |
15:51:09 | disruptek | i store "stack frames" in the trampoline. |
15:51:16 | FromDiscord | <ProperFellow> Will do 🙂 |
15:51:34 | Zevv[m] | disruptek: yeah, but that's internal to the cps/environment coed |
15:51:36 | FromDiscord | <ProperFellow> Building anything db related is admirable stuff 🙂 |
15:51:38 | disruptek | jc probably has a good handle on the domain. |
15:52:03 | disruptek | Zevv[m]: how do you figure? |
15:52:31 | FromDiscord | <ProperFellow> Actually nailing this down could lead to a better techempower benchmarks showing - the nim frameworks currently don't show up in anything db related. |
15:52:57 | Zevv[m] | disruptek: get back to you later, the familiy is hangry |
15:53:01 | disruptek | kk |
15:58:24 | FromDiscord | <dom96> ProperFellow: getting a highly performant async db implementation to win these benchmark will not be easy 🙂 |
15:58:30 | FromDiscord | <dom96> (edit) 'benchmark' => 'benchmarks' |
16:04:21 | FromGitter | <bung87> have time take a look at ? https://github.com/nim-lang/Nim/pull/15070 |
16:04:22 | disbot | ➥ avoid #8231, bitwise move to mul,div |
16:08:21 | FromGitter | <Lecale> If you were asked, is there anything Nim can do that Python cannot, how would you answer (to the compliance team) |
16:09:04 | * | Vladar quit (Quit: Leaving) |
16:10:26 | disruptek | i dunno if we have a compliance team, but the answer is the same as "is there anything c can do that python cannot?" |
16:11:22 | FromGitter | <bung87> almost x faster than python ? |
16:12:08 | FromGitter | <Lecale> compliance do not give a flying doodah about speed |
16:13:30 | FromDiscord | <Rika> easier C interop? |
16:13:48 | ForumUpdaterBot | New thread by Serge: "||" operator ? : Is there a corresponding operator for iterables ?, see https://forum.nim-lang.org/t/6611 |
16:14:31 | FromGitter | <bung87> python also pretty easy in that field |
16:14:32 | FromDiscord | <lqdev> @Lecale actual real static typing. |
16:14:52 | FromDiscord | <lqdev> without the need for external tools to analyze my code for me. |
16:15:21 | FromDiscord | <lqdev> it also has AST-based macros, which can greatly simplify boilerplate-heavy code. |
16:20:00 | FromGitter | <Lecale> I like your answer disruptek |
16:20:28 | FromDiscord | <mratsim> you can't do multithreading in Python 😛 |
16:20:43 | FromDiscord | <lqdev> well you can |
16:20:47 | FromDiscord | <lqdev> but the GIL slows everything down |
16:20:58 | FromDiscord | <mratsim> you can do multiprocessing but not multithreading |
16:21:40 | FromDiscord | <mratsim> but as Python, Nim, C are all turing complete, they are all equivalent to an imaginary tape |
16:22:04 | FromDiscord | <mratsim> the differenc eis how easy to achieve your goal (safety, speed, time to market, hiring, maintenance) |
16:22:59 | FromDiscord | <mratsim> Nim scores well on Safety, speed, maitnenance, very low on hiring, and time-to-market is a mixed bag (depends on the library ecosystem) |
16:23:51 | FromDiscord | <mratsim> Python scores well on Time to market and Hiring, but scores bad on the rest |
16:24:49 | FromDiscord | <mratsim> C on speed, hiring, mixed bag on maintenance, safety and time to market is the same as Nim probably |
16:25:04 | FromDiscord | <mratsim> and you can create your own goals as well |
16:29:03 | * | Vladar joined #nim |
16:32:41 | FromDiscord | <Varriount> @lqdev Multithreading in Python is only useful if you're doing IO or using C extensions. |
16:33:52 | FromDiscord | <ProperFellow> sent a code paste, see https://play.nim-lang.org/#ix=2sxc |
16:33:52 | FromDiscord | <Varriount> IO routines (which are implemented in C) can release the GIL while waiting for IO to complete. Same with some C extensions. |
16:34:08 | FromDiscord | <ProperFellow> (edit) 'https://play.nim-lang.org/#ix=2sxc' => 'https://play.nim-lang.org/#ix=2sxd' |
16:34:21 | FromDiscord | <ProperFellow> Looks like the nim compiler is crashing because there's a global variable in jester? |
16:35:01 | FromDiscord | <Varriount> @ProperFellow What does your code look like? Sounds like something was passed to a Jester macro that the macro didn't understand. |
16:35:25 | FromDiscord | <ProperFellow> sent a code paste, see https://play.nim-lang.org/#ix=2sxe |
16:36:01 | FromDiscord | <ProperFellow> Maybe I shouldn't be using the DSL? |
16:37:31 | FromDiscord | <Varriount> Hm, what happens if you put the code in /tasks into a procedure, and call it instead? |
16:40:50 | Zevv[m] | so disruptek |
16:40:56 | Zevv[m] | with all this untypdness |
16:41:19 | Zevv[m] | do you see during .cps. if a call goes to something with a pragma? |
16:41:48 | disruptek | what? |
16:41:50 | Zevv[m] | ie can you distiguish a normal call vs a cps call vs a cpsPrim call with only the ident getting called? |
16:42:00 | disruptek | i doubt it. |
16:42:24 | FromDiscord | <lqdev> so you guys want to turn untyped to typed? |
16:42:24 | Zevv[m] | yeah thats what I was afraid of. too bad that is |
16:42:25 | FromDiscord | <lqdev> prepare to summon demons in the process |
16:42:32 | Zevv[m] | we just summon mratsim |
16:42:50 | * | endragor quit (Remote host closed the connection) |
16:42:56 | * | sputny quit (Remote host closed the connection) |
16:43:02 | FromDiscord | <ProperFellow> Oooh, will try that @Varriount |
16:43:30 | * | endragor joined #nim |
16:43:49 | FromDiscord | <ProperFellow> {.error: "Await only available within .async".} |
16:43:51 | FromDiscord | <ProperFellow> That did it. |
16:44:17 | FromDiscord | <ProperFellow> I wonder why DSL's are such a thing in the first place - noticed them in other spots for Nim. |
16:44:18 | disruptek | Zevv[m]: you have to be able to `let x: int = yield foo()` when `proc foo(): string`. this is what we're achieving... |
16:44:27 | FromDiscord | <lqdev> not sure what your specifics are, but the way *I* turn untyped to typed is from the first macro i return a call to another macro that takes typed as its params instead |
16:44:46 | Zevv[m] | disruptek: so where does the return value of yield come from |
16:44:47 | disruptek | yeah, this is a thing. but we're hoping to not go there. |
16:45:00 | FromDiscord | <lqdev> then prepare to write your own type checker. |
16:45:06 | Zevv[m] | because foo returns a string and you get x: int |
16:45:14 | disruptek | no, i don't need types anymore. |
16:45:15 | Zevv[m] | if this is going to be the quality of your work |
16:45:25 | Zevv[m] | where we're going we don't need types! |
16:47:13 | disruptek | the problem right now is that we are pass-by-copy for symbols in the env and we would need to rewrite the symbols to make them pass-by-ref. |
16:47:28 | disruptek | rror: attempt to redefine: 'a5' |
16:48:12 | * | endragor quit (Ping timeout: 265 seconds) |
16:49:03 | FromGitter | <alehander92> guys i realized i need to just not redefine classes in my `.cpp` |
16:49:14 | FromGitter | <alehander92> i havent even gotten to cmake problems! |
16:49:31 | FromGitter | <alehander92> nim no headers :( |
16:49:49 | FromDiscord | <lqdev> headers are such a pita when working with C/C++ |
16:50:32 | FromDiscord | <ProperFellow> ``` let rows = await getAllRows(db, sql"SELECT * FROM tasks ORDER BY priority asc", @[])↵ var results: seq[TodoTask] = @[]↵ for row in rows:↵ results.add(TodoTask(id: parseInt(row[0]), text: row[1], priority: parseInt(row[2])))``` |
16:50:36 | FromDiscord | <ProperFellow> I think I'm doing this wrong. |
16:50:42 | FromDiscord | <ProperFellow> It's complaining row[0] is a char. |
16:51:03 | FromDiscord | <ProperFellow> But it should be getting rows of [int, string, int]. |
16:51:17 | FromDiscord | <ProperFellow> Is there something like "dir" in python to inspect what's coming back with rows? |
16:51:44 | Zevv[m] | so how do I run this 'deep' of yours. Now I get call to undeclared `ex0=` when running my minimal stuff |
16:51:47 | FromDiscord | <Rika> Can't you just echo the type of row |
16:51:57 | disruptek | Zevv[m]: do a pull, for kickoffs. |
16:52:07 | Zevv[m] | done |
16:52:18 | disruptek | the problem right now is that we are pass-by-copy for symbols in the env and we would need to rewrite the symbols to make them pass-by-ref. |
16:52:28 | Zevv[m] | right |
16:52:30 | disruptek | at least, that's my working theory. |
16:52:43 | disruptek | that a5 clashes with a5 although they are both gensym'd. |
16:52:55 | Zevv[m] | just as I described in #27 |
16:55:47 | Zevv[m] | that sounds like the other problem I made this workaround for |
16:56:05 | Zevv[m] | 37f0063262cdc173f13a6b4871e410343a4dc775 |
16:57:50 | FromDiscord | <Kiloneie> Oh man making a video on Objects is quite a deal xD... comparison to tuples, inheritances, pointers lol... |
16:58:29 | Zevv[m] | well, what about skipping all that for part 1 |
16:58:37 | Zevv[m] | just concentrate on the basics |
16:58:50 | FromDiscord | <Kiloneie> might split it on part 1 and 2... |
16:58:52 | Zevv[m] | you can probably spend a whole video on inhertance |
16:58:54 | * | superbia2 joined #nim |
16:59:00 | Zevv[m] | and pointers are not special for objects, |
16:59:22 | FromDiscord | <Kiloneie> yeh but accessing values of reference objects is a pointer thing. |
16:59:36 | disruptek | nah. |
17:01:18 | FromDiscord | <Kiloneie> Im thinking part 1 is Pointers and Objects(normal little objects and comparison to tuples, why and how), then part 2 is referencing/inheritance |
17:01:25 | * | superbia1 quit (Ping timeout: 256 seconds) |
17:01:25 | FromDiscord | <IanIAnIAN> Just copy every regurgitated argument ever made on Medium and put them in intersecting loops until the viewers head explodes like in Scanner (or they go do something else) |
17:01:36 | FromDiscord | <Rika> You can have a pointer to a primitive though? |
17:02:02 | FromDiscord | <Kiloneie> ehm oO |
17:03:40 | Zevv[m] | disruptek: how is that nah. you have clashes while they are gensymed |
17:03:43 | Zevv[m] | that was exactly my problem |
17:03:56 | Zevv[m] | im pretty sure this can be the same thing |
17:04:08 | disruptek | i was talking about obj rerefs. 😉 |
17:04:30 | FromDiscord | <Rika> reref? |
17:04:36 | disruptek | deref |
17:07:18 | FromDiscord | <Kiloneie> Derail |
17:10:27 | FromDiscord | <Kiloneie> Everytime im "finally got objects covered, now just record the video", i find more stuff it connects to and needs explaining... im not making 3 parts for this... 2 is more than enough D:... |
17:13:53 | FromDiscord | <Kiloneie> Pretty sure it's gonna be easier to make a video on Macros than this. Templates especially, so easy. |
17:16:28 | Zevv[m] | what is your always-working-reference program for cps disruptek, because I'm not sure how to use this now in 'deep' |
17:16:43 | disruptek | that would be a nice feature, huh? |
17:16:54 | Zevv[m] | it would |
17:17:10 | Zevv[m] | I don't even understand how to bootstrap my initial cps call now |
17:17:23 | disruptek | to make it work we need a fn() that we generate for each continuation type. |
17:17:32 | Zevv[m] | right |
17:17:46 | disruptek | else the trampoline doesn't know how to work. |
17:17:55 | Zevv[m] | for the initial call from the normal world into the abyss called CPS |
17:18:30 | Zevv[m] | the first step through the looking glass |
17:18:31 | FromDiscord | <lqdev> @Kiloneie trust me, *no* |
17:19:05 | FromDiscord | <Kiloneie> Okay sure D:... still Templates are easy though :P. |
17:19:14 | disruptek | you should probably merge your {.cps: Cont.} thing and i'll rebase. |
17:19:19 | FromDiscord | <lqdev> templates yeah |
17:19:20 | FromDiscord | <lqdev> macros no |
17:19:28 | Zevv[m] | disruptek: cmin up |
17:19:37 | disruptek | i need to make some calls and stuff and then i will put in fn(). |
17:19:42 | FromDiscord | <ProperFellow> How do you unwrap a future in Nim? |
17:19:45 | Zevv[m] | merged |
17:20:13 | FromDiscord | <lqdev> @ProperFellow either `waitFor` or `await` |
17:20:17 | FromDiscord | <lqdev> depends on the context |
17:20:20 | FromDiscord | <ProperFellow> Hmmm |
17:20:21 | Zevv[m] | disruptek: sure you're not taking too big steps |
17:20:31 | Zevv[m] | you're doing five things in one go |
17:20:32 | FromDiscord | <lqdev> you use `waitFor` outside of async procs, and `await` in async procs |
17:20:48 | FromDiscord | <ProperFellow> Using await still isn't quite working for me. |
17:20:56 | Zevv[m] | leave all that exception handling out for now, for example |
17:21:04 | FromDiscord | <ProperFellow> ``` let rows: seq[Row] = await getAllRows(db, sql"SELECT * FROM tasks ORDER BY priority asc", @[])↵ var results: seq[TodoTask] = @[]↵ for row in rows:↵ results.add(TodoTask(id: parseInt(row[0]), text: row[1], priority: parseInt(row[2])))``` |
17:21:11 | disruptek | it's already behind --define:cpsExcept |
17:21:12 | FromDiscord | <ProperFellow> It's erroring out |
17:21:24 | Zevv[m] | ok, so now we just focus on moving one block of memory around |
17:21:31 | FromDiscord | <ProperFellow> ```~/.nimble/pkgs/jester-0.4.3/jester.nim(551, 13) Error: type mismatch: got <FutureBase, int literal(0), CallbackAction>↵``` |
17:21:33 | Zevv[m] | your current brute-force approach is fine for now I guess |
17:21:39 | Zevv[m] | my proposal is just optimization |
17:22:19 | * | maier joined #nim |
17:22:34 | Zevv[m] | I hope you appreciate my approach of making minimal, viable use cases of different things built on CPS, instead of going in async IO with bells and whistles up to my elbow |
17:22:44 | disruptek | i do. |
17:22:52 | Zevv[m] | cool |
17:23:14 | disruptek | it's starting to be more interesting as we expand what we're capable of. |
17:23:21 | Zevv[m] | right |
17:23:22 | disruptek | i don't care about web-servers anymore. 😉 |
17:23:27 | Zevv[m] | but I need some hooks to hang stuff |
17:23:35 | disruptek | there are many more hooks now. |
17:23:41 | disruptek | named continue, for example. |
17:23:44 | Zevv[m] | for example, my silly 'goto' - I need a place to store these 'jump labels' |
17:23:50 | Zevv[m] | no I need to make them global |
17:24:11 | disruptek | you can `punch`. |
17:24:17 | Zevv[m] | you're not inventing your own control flow inside transformad cps procs, are you |
17:24:18 | Zevv[m] | don't you dare |
17:24:25 | disruptek | why not? |
17:24:28 | Zevv[m] | please don't go there yet |
17:24:33 | Zevv[m] | just translate nim |
17:24:34 | Zevv[m] | not nim++ |
17:24:47 | Zevv[m] | it confuses the hell out of everbody except you |
17:25:18 | Zevv[m] | I know you are so tempted |
17:25:21 | Zevv[m] | but you must resist |
17:25:30 | Zevv[m] | you must learn to use these powers first |
17:25:35 | Zevv[m] | you must be strong |
17:25:46 | Zevv[m] | just sit on you friggin hands and type |
17:25:53 | disruptek | kinky. |
17:26:34 | Zevv[m] | how must anyone learn how this stuff works if what you type inside a cps proc is no longer nim? |
17:26:55 | disruptek | these are extensions. that's what nim is all about. |
17:27:01 | Zevv[m] | too soon |
17:27:18 | disruptek | there's nothing creepy going on here (yet). |
17:27:28 | Zevv[m] | like, let's say, named continues |
17:27:38 | Zevv[m] | also not a teeny little tiny bit of creepy things? |
17:27:50 | * | maier quit (Ping timeout: 265 seconds) |
17:28:13 | disruptek | i can't remember if we have named continue but i think we don't. 🙄 |
17:28:34 | Zevv[m] | I can't tell anymore :) |
17:28:36 | disruptek | omg it's getting typed right now. |
17:28:40 | disruptek | i cannot help myself. |
17:28:59 | Zevv[m] | I just told yo so. Sit on your hands and type |
17:29:04 | Zevv[m] | so there it is - it's getting typed |
17:31:34 | Zevv[m] | so, youre going to rebase and merge all of deep, are you |
17:31:46 | disruptek | of course. |
17:31:57 | FromDiscord | <Clyybber> hi |
17:32:04 | FromDiscord | <Clyybber> we don't have named continue |
17:32:09 | FromDiscord | <Clyybber> it wouldn't make sense |
17:32:20 | disruptek | shhh |
17:32:21 | Zevv[m] | please help me out |
17:32:24 | Zevv[m] | he's on the loos |
17:32:26 | Zevv[m] | e |
17:32:38 | Zevv[m] | if I hold him you can smack him in the face, and we take turns |
17:33:57 | FromDiscord | <Clyybber> ok hold him tight |
17:34:09 | Zevv[m] | I bet it's no use |
17:34:12 | FromDiscord | <Clyybber> I knew he was going to put weird shit in cps |
17:34:16 | FromDiscord | <Clyybber> while else |
17:34:23 | disruptek | lol |
17:34:25 | FromDiscord | <Clyybber> what are you smoking :p |
17:34:49 | disruptek | while else is awesome. |
17:35:01 | FromDiscord | <Clyybber> Araq: Can you look at https://github.com/nim-lang/Nim/pull/15091 |
17:35:02 | disbot | ➥ Fix forward declaration issues in template/macro context |
17:35:16 | Zevv[m] | hehe |
17:38:11 | * | Kaivo quit (Ping timeout: 240 seconds) |
17:38:19 | * | Kaivo joined #nim |
17:41:34 | * | theelous3 quit (Ping timeout: 256 seconds) |
17:47:16 | Zevv[m] | disruptek: instead of rewriting all the code to use stuff from your env |
17:47:26 | Zevv[m] | you should generate a tiny template for each var |
17:47:32 | Zevv[m] | template i = env.i |
17:47:37 | Zevv[m] | and put those on top |
17:47:55 | Zevv[m] | that'll make your code easier to read, and you don't need to keep track of what you need to rewrite |
17:52:54 | * | Senketsu quit (Read error: Connection reset by peer) |
17:59:07 | disruptek | what does that do in a `var i: int = 3` statement? |
17:59:31 | Zevv[m] | no, other way around. IT's the localRetrievels |
17:59:42 | disruptek | oh, hmm. |
17:59:52 | Zevv[m] | instead of making 'var i = env_ths(locals_that).i` |
17:59:58 | disruptek | seems kinda reasonable. |
17:59:59 | Zevv[m] | it does `template i = env_ths(locals_that).i` |
18:00:29 | Zevv[m] | so you don't have to go through all of the code finding all the i's |
18:00:36 | Zevv[m] | let nim do the work for you |
18:00:43 | disruptek | yeah, we'll try it. |
18:01:02 | Zevv[m] | My 'with' macro was once complicated like that, then PMunch came along and did just that |
18:01:14 | Zevv[m] | and I felt kind of stupid for not thinking of it |
18:02:29 | Zevv[m] | it works |
18:03:00 | Zevv[m] | oh fuck |
18:03:04 | Zevv[m] | I pushed to master instaed of to a branch |
18:03:16 | Zevv[m] | want me to fix that or is that ok |
18:03:21 | Zevv[m] | it's trivial |
18:03:24 | disruptek | i don't care. |
18:03:57 | Zevv[m] | only downside is that the 'repr' of the translated proc now looks like shit because nim adds tons of whitespace and newlines around nnkTemplDefs |
18:04:01 | Zevv[m] | but it works |
18:08:42 | * | kungtotte quit (Read error: Connection reset by peer) |
18:09:27 | * | kungtotte joined #nim |
18:10:27 | Zevv[m] | you just don't care, do you |
18:16:36 | disruptek | not so much. |
18:17:02 | FromGitter | <alehander92> so do we have |
18:17:07 | FromDiscord | <Clyybber> yes |
18:17:29 | FromGitter | <alehander92> <3 |
18:17:52 | FromDiscord | <Clyybber> that too |
18:17:55 | FromDiscord | <Clyybber> <3 |
18:18:13 | * | Ven`` joined #nim |
18:18:30 | disruptek | so 3 and 16 are fixed, right? or are we just working around them? |
18:18:59 | FromGitter | <awr1> @mratsim Hey I have a small thought regarding Weave: could in the initialization function for Weave we get an option to add in a function that could gets executed on all threads on startup w/o work stealing? |
18:19:38 | FromDiscord | <Clyybber> disruptek: the ICE part of 3 will be fixed with my Nim PR |
18:19:45 | FromDiscord | <Clyybber> but that one is waiting for Araq to reply |
18:20:01 | Zevv[m] | #3 is not fixe |
18:20:06 | FromGitter | <awr1> The reason I ask is so that it might be possible to set the FPU state for all threads to denormal-at-zero |
18:20:27 | Zevv[m] | #3 workaround is 37f0063262cdc173f13a6b4871e410343a4dc775 |
18:20:39 | Zevv[m] | gensym seems to f**k up |
18:20:44 | * | Jesin quit (Quit: Leaving) |
18:21:27 | FromGitter | <awr1> *denormal-to-zero |
18:23:31 | Zevv[m] | why was stuff always put into a block: btw? |
18:23:48 | disruptek | so you can shadow locals or proc params. |
18:23:59 | * | bung quit (Quit: Lost terminal) |
18:24:01 | Zevv[m] | hmm did I not break that with the templatization |
18:24:14 | disruptek | no, but we may be able to remove the block: |
18:24:35 | disruptek | also, as #20 is in you can do your `cps Cont:` feature. |
18:27:30 | Zevv[m] | my what |
18:28:07 | Zevv[m] | I'm a bit hesistant to do things now since deep seems to channenge all my truths |
18:29:49 | * | endragor joined #nim |
18:29:53 | * | abm quit (Quit: Leaving) |
18:31:41 | disruptek | heh |
18:32:16 | disruptek | lemme fix fn and then we'll merge it and see where we're at. |
18:33:57 | leorize | narimiran: we should probably run docgen on fusion too, if there's any way to just run docgen for the whole project :P |
18:35:07 | * | Senketsu joined #nim |
18:38:11 | * | endragor quit (Ping timeout: 240 seconds) |
18:41:03 | * | Jesin joined #nim |
18:46:16 | narimiran | ok :) |
18:48:22 | ForumUpdaterBot | New thread by Digitalcraftsman: How to ensure that all attributes of an object are explicitly set during creation?, see https://forum.nim-lang.org/t/6612 |
18:54:51 | * | apahl quit (Ping timeout: 272 seconds) |
18:55:18 | * | apahl joined #nim |
19:00:13 | * | Senketsu quit (Read error: Connection reset by peer) |
19:01:28 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=2sxV |
19:11:33 | nature | Are there any simple example on using nimscript to produce a statically linked binary ? |
19:12:27 | nature | I found https://github.com/kaushalmodi/hello_musl but it's a hug config.nims that downloads and compiles some libraries too |
19:14:06 | * | Senketsu joined #nim |
19:15:47 | disruptek | Zevv[m]: it's back to the a5 situation, now. so, that's good. |
19:15:51 | * | FromDiscord quit (Remote host closed the connection) |
19:16:05 | * | FromDiscord joined #nim |
19:18:31 | FromDiscord | <Clyybber> Araq: ping |
19:21:26 | nature | found one here in case anybody was interested too: https://scripter.co/nim-deploying-static-binaries/#config-dot-nims |
19:23:10 | * | maier joined #nim |
19:24:44 | Zevv[m] | disruptek: thats the same bug, told you three times |
19:24:59 | Zevv[m] | its gensym messing up |
19:25:01 | disruptek | eh maybe. |
19:25:20 | disruptek | anyway, we have to not insert a c: Cont = nil if it's not present. |
19:25:46 | Zevv[m] | ok, you need to take it slow |
19:26:07 | Zevv[m] | this is to do the first cps call from non-cps code, right |
19:26:13 | disruptek | right. |
19:26:20 | Zevv[m] | so this is about the alloc of the env |
19:26:25 | Zevv[m] | the constructor, so to say |
19:26:42 | disruptek | it's about you wanting to do foo(it: MyIter) {.cps: MyIter.} |
19:27:03 | Zevv[m] | well, do i want that |
19:27:12 | FromGitter | <alehander92> do i want that |
19:27:12 | Zevv[m] | i think i want to do foo() |
19:27:12 | disruptek | yeah, you can have it. |
19:27:21 | FromGitter | <alehander92> why MyIter twice |
19:27:44 | FromGitter | <alehander92> cant `cps` infer it from the function ast |
19:28:05 | * | Zevv[m] quit (Quit: Lost terminal) |
19:28:07 | * | maier quit (Ping timeout: 246 seconds) |
19:28:16 | * | Zevv joined #nim |
19:28:24 | Zevv | sucky irssi |
19:28:27 | * | dzamo quit (Quit: dzamo) |
19:29:34 | FromDiscord | <Clyybber> I think we should either go foo() {.cps: MyIter.} |
19:29:47 | FromDiscord | <Clyybber> (edit) 'either' => 'nothing' |
19:29:51 | FromDiscord | <Clyybber> s/nothing |
19:30:00 | FromDiscord | <Clyybber> dammit discord |
19:30:25 | FromDiscord | <Clyybber> but doesn't it make sense to still have a raw version of the cps macro? |
19:30:39 | disruptek | dunno what you mean. |
19:30:41 | disruptek | raw? |
19:30:43 | Zevv | ok stop |
19:30:57 | FromDiscord | <Clyybber> one that doesn't automagically introduce these args |
19:31:22 | FromDiscord | <Clyybber> one where you still have to write foo(it: MyIter): MyIter {.cpsRaw} |
19:31:34 | Zevv | step away for a sec |
19:31:36 | disruptek | you can do that now. |
19:31:57 | disruptek | foo(it: Cont) {.cps: Cont.} means the same thing. |
19:32:25 | disruptek | it just lets you access `it` from inside the continuation, anywhere. |
19:32:32 | Zevv | There's a number of different things happening. I might make another little writeup because makin the other one today helped me think. But we have |
19:32:43 | Zevv | 1) the initial call/instantation from nim to the first cps |
19:33:02 | Zevv | that one returns something magic that you can send to a trampoline or an event queue |
19:33:13 | Zevv | this should be simple and user friendly and hide shit |
19:33:14 | Zevv | right? |
19:33:30 | disruptek | well, it's a little more subtle. |
19:33:46 | Zevv | so I want to make an interator instance. I want to do makeCounter(0, 10) |
19:33:47 | disruptek | you want a way to deref the result of that continuation, which we're calling `yield foo()`. |
19:34:07 | disruptek | and we want a way to NOT deref it, which i think is `continue foo()`. |
19:34:30 | disruptek | you can of course do things like `spawn foo()`. |
19:34:36 | disruptek | or whatever primitive you want. |
19:34:49 | Zevv | yeah but you keep thinking in terms of your frigging eventqueue |
19:34:51 | Zevv | burn that |
19:35:08 | disruptek | fine, but `continue` still needs to be a thing. |
19:35:12 | FromDiscord | <Clyybber> when we start to use continue X we may never make it a typed macro |
19:35:14 | disruptek | because `discard` is a thing. |
19:35:15 | Zevv | what is 'continute' |
19:35:29 | disruptek | continue is a single bounce on the trampoline. |
19:35:30 | Zevv | 'continue'. What is it. where does it live, waht does it eat and what does it poop |
19:35:39 | disruptek | it's in cps context only. |
19:35:42 | Zevv | Ok, I don't want CPS to make 'continue' |
19:35:49 | Zevv | Your continue is not my continue |
19:35:55 | FromDiscord | <Clyybber> what actually is preventing us from making it typed? |
19:35:58 | FromDiscord | <Clyybber> the arg |
19:36:32 | Zevv | or maybe only if continue is no more then a template doing `a = a.fn(a)` |
19:36:37 | Zevv | because that's all continue is |
19:36:38 | Zevv | right |
19:36:39 | Zevv | ? |
19:37:11 | disruptek | i think so. |
19:37:39 | Zevv | Ok, we have 2 kinds of "users". The end user does not want to know *any* of this shit. They want to do async io or iterators, and not be bothered |
19:37:46 | Zevv | the other users are the people implementing stuff with CPS |
19:37:52 | Zevv | they need to know the details, and have power |
19:38:06 | Zevv | they are smart enough to bounce that thing |
19:38:23 | Zevv | so for user #1 we need to be able to hide all the gory details. |
19:38:44 | Zevv | but for user #2, the people who implement .cpsMagic. things, we need to provide hooks and mechanics |
19:39:20 | Zevv | so .cps. procs hide everything. The look like a normal proc, and might have hidden stuff going in or out. |
19:39:36 | Zevv | the .cpsMagic. procs are explicit, and I think they should totally honest about what is going in and out |
19:39:40 | Zevv | because you want to touch that stuff |
19:39:55 | Zevv | if you are implementing your event queue or whatever |
19:40:20 | Zevv | does that make any sense? |
19:40:21 | FromGitter | <alehander92> `next` |
19:40:23 | FromGitter | <alehander92> make it next |
19:40:26 | FromGitter | <alehander92> like next tick |
19:41:01 | FromGitter | <alehander92> like ruby, they call `continue` `next` |
19:41:08 | Zevv | look at my little iterator: https://github.com/disruptek/cps/blob/master/stash/iterator.nim |
19:41:22 | Zevv | The 'end user' stuff is at the bottom. You make an iterator like 'var i = counter(3, 7)' |
19:41:25 | Zevv | i is your iterator |
19:41:27 | Zevv | no special stuff whatsoever |
19:41:56 | Zevv | just one simple plain honest nim function call |
19:42:24 | Zevv | that function signature matches the one of the `proc counter(...)` which is a .cps. proc |
19:42:28 | Zevv | that is pretty great |
19:42:32 | Zevv | no surprises there |
19:49:18 | disruptek | surprise, ICE |
19:49:30 | Zevv | baby |
19:49:33 | disruptek | wizard needs food. |
19:50:17 | FromDiscord | <Clyybber> disruptek: tell me abotu the ICE |
19:50:24 | FromDiscord | <Clyybber> is it "proc still forwarded"? |
19:51:44 | disruptek | aieee all my vars look like templates. |
19:52:11 | FromDiscord | <Clyybber> I *need* to know your ICE |
19:52:30 | disruptek | try building tock.nim on deep |
19:52:59 | disruptek | it's environment misses. |
19:53:09 | FromDiscord | <Clyybber> ahlrigt |
19:53:09 | nature | Is there a builtin ternery operator in nim ? |
19:53:14 | FromDiscord | <Clyybber> nope |
19:53:24 | FromDiscord | <Clyybber> we have if expressions though |
19:53:30 | disruptek | let x = if foo: 1 else: 2 |
19:53:50 | nature | okok that's what I was looking for, thaks :) |
19:53:53 | nature | thanks |
19:54:03 | * | theelous3 joined #nim |
19:54:37 | disruptek | cps has while: else: expressions. |
19:56:34 | nature | is something like `let x = (if foo: 's' else: '') & 'tring'` legal ? |
19:57:00 | nature | or is there a better way to do it ? |
19:57:39 | disruptek | we use " to delimit strings. |
19:58:39 | nature | oh yes... I am still new to Nim sorry. |
19:58:55 | FromDiscord | <Clyybber> other than that its legal yes |
20:04:21 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
20:04:50 | disruptek | there's a lot to like about deep. except that it doesn't work. |
20:05:04 | * | sendell quit (Ping timeout: 244 seconds) |
20:05:04 | * | oneark quit (Ping timeout: 244 seconds) |
20:05:05 | * | leorize[m] quit (Ping timeout: 244 seconds) |
20:05:34 | * | rridley[m] quit (Ping timeout: 244 seconds) |
20:05:36 | * | GitterIntegratio quit (Ping timeout: 244 seconds) |
20:05:37 | * | sendell joined #nim |
20:05:56 | * | pbb joined #nim |
20:06:56 | * | leorize[m] joined #nim |
20:07:13 | * | oneark joined #nim |
20:11:56 | FromDiscord | <Shucks> Is `rand` randomizing at compile time not runtime? ```import random↵echo rand(-10..20)``` this returns everytime the same number |
20:15:08 | leorize | you need to initialize the random number generator fisrt |
20:15:10 | leorize | first* |
20:15:15 | leorize | call `randomize()` |
20:16:13 | FromDiscord | <Shucks> oh |
20:21:43 | disruptek | Zevv: your templates... |
20:21:51 | disruptek | they don't work. 😢 |
20:22:08 | * | rridley[m] joined #nim |
20:23:19 | FromDiscord | <ProperFellow> I'm trying to read an image and write it to a file. In Python it's super simple, I grab the content (string) and just write it out to the file using `wb`. Kind of lost on how to do this using nim's standard lib. |
20:23:58 | disruptek | https://nim-by-example.github.io/files/ |
20:24:39 | FromDiscord | <ProperFellow> That just covered text files. |
20:24:51 | disruptek | is there a difference? |
20:25:04 | FromDiscord | <ProperFellow> Between a binary file and text files? |
20:25:05 | FromDiscord | <ProperFellow> Yes. |
20:25:12 | disruptek | what is it? |
20:25:18 | FromDiscord | <ProperFellow> I can see if treating it as a string will work. Perhaps Nim glosses over that. |
20:25:55 | FromDiscord | <lqdev> it's a little bit dodgy but you can cast a string to a `seq[uint8]` as their binary representations are nearly identical |
20:26:14 | FromDiscord | <lqdev> the only difference is that strings have a NUL terminator |
20:26:30 | FromDiscord | <ProperFellow> Hmmmm |
20:26:54 | FromDiscord | <lqdev> well, to be safe you can always just copy the memory over to a new seq. |
20:27:20 | FromDiscord | <lqdev> ```nim↵var theSeq: seq[uint8]↵copyMem(theSeq[0].addr, yourString[0].unsafeAddr, yourString.len)↵``` |
20:27:24 | FromDiscord | <lqdev> ah whoops |
20:27:27 | Zevv | disruptek: they do for me |
20:27:30 | Zevv | whats the problem |
20:27:37 | FromDiscord | <lqdev> it has to be `var theSeq = newSeq[uint8](yourString.len)` |
20:27:44 | FromDiscord | <lqdev> otherwise it'll write out of bounds |
20:29:14 | FromDiscord | <ProperFellow> Yeah getting out of bounds now (Error: unhandled exception: index -1 not in 0 .. 4 [IndexError]) - not the clearest error - sysFatal. |
20:29:16 | Zevv | if its broken revert it, it was ment to go in a branch but i messed that up |
20:30:01 | FromDiscord | <lqdev> @ProperFellow look at the stacktrace, it should tell you more about where the error happened |
20:30:36 | disruptek | the problem is with the new env. |
20:31:15 | Zevv | oh but that was not there when i made that, so its not my fault not my fault |
20:31:28 | Zevv | plausibe deniability |
20:31:31 | disruptek | no, it's not you. |
20:33:10 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:33:33 | FromDiscord | <ProperFellow> Ah I'm trying to get the last element of an array. |
20:33:42 | FromDiscord | <ProperFellow> I don't see documentation on how to find it hahahaha. |
20:35:11 | FromDiscord | <lqdev> you use `BackwardsIndex`. you can create one using `^`, eg. `mySeq[^1]` gets the last elemtn |
20:35:14 | FromDiscord | <lqdev> (edit) 'elemtn' => 'element' |
20:35:18 | FromDiscord | <ProperFellow> Ah! |
20:35:23 | FromDiscord | <ProperFellow> Is this documented anywhere? |
20:35:40 | disruptek | !last lqdev |
20:35:40 | disbot | lqdev spoke in 12#nim 25 seconds ago 12https://irclogs.nim-lang.org/28-07-2020.html#20:35:14 |
20:35:45 | FromDiscord | <lqdev> https://nim-lang.org/docs/system.html#%5E.t%2Cint |
20:36:01 | disruptek | my link is better. |
20:36:01 | FromDiscord | <aachh> damn |
20:36:08 | FromDiscord | <aachh> i was about to send this |
20:36:08 | FromDiscord | <aachh> you were faster :( |
20:36:52 | FromDiscord | <ProperFellow> Nice - that all works. |
20:37:06 | FromDiscord | <ProperFellow> Ah gotcha. |
20:37:06 | FromDiscord | <lqdev> @ProperFellow Nim uses a separate type for this to not have to burden the runtime with checking negative indices. the compiler does the work of resolving a separate overload of `[]` |
20:37:24 | FromDiscord | <ProperFellow> That's impressive. |
20:37:39 | FromDiscord | <ProperFellow> I'm really enjoying Nim - but the documentation doesn't feel super newbie friendly. |
20:37:46 | FromDiscord | <lqdev> yeah it could use a bit of work |
20:37:46 | FromDiscord | <aachh> for me it actually feels really nice |
20:37:47 | FromDiscord | <aachh> xD |
20:37:49 | FromDiscord | <ProperFellow> As far as navigating around - or helpful examples. |
20:38:01 | FromDiscord | <aachh> i think im the only person that likes it |
20:38:01 | FromDiscord | <ProperFellow> Hahahaha |
20:38:05 | FromDiscord | <aachh> it's exhaustive |
20:38:15 | FromDiscord | <lqdev> i just use ctrl+f proc <name> |
20:38:17 | FromDiscord | <aachh> that's the only thing i need in documentation |
20:38:19 | FromDiscord | <aachh> yeah, that too |
20:40:10 | shashlick | does `nim e` ignore -d:xyz on the command line? |
20:40:18 | shashlick | when defined(xyz) doesn't work |
20:42:39 | * | NimBot joined #nim |
20:50:11 | Zevv | so. |
20:50:44 | shashlick | it works in the simple case but not when the `when defined()` is passed into a template |
20:54:34 | FromGitter | <iffy> @leorize: I'm waiting on the user to confirm if it's fixed, but it sure seems like leaking fd was my problem |
20:56:27 | FromGitter | <iffy> Do `gorge` and friends not work on Windows? This program: `static: echo "cd: " & gorge("cd")` emits only `cd: ` when compiling. |
20:57:20 | FromGitter | <iffy> Version 1.0.6 |
20:57:46 | Zevv | you good disruptek? |
20:59:58 | FromDiscord | <lqdev> @iffy I'm pretty sure `cd` doesn't output anything |
21:00:14 | FromGitter | <iffy> On Windows it prints out the current directory |
21:00:28 | FromDiscord | <lqdev> huh |
21:01:07 | FromGitter | <iffy> `static: echo "foo: " & gorge("echo foo")` likewise only prints out `foo: ` |
21:01:41 | * | lritter joined #nim |
21:02:06 | * | Vladar quit (Quit: Leaving) |
21:03:13 | shashlick | need some template help |
21:03:15 | FromGitter | <iffy> Same behavior in 1.2.4 |
21:03:31 | * | Senketsu quit (Ping timeout: 256 seconds) |
21:05:33 | * | audiofile joined #nim |
21:06:12 | * | narimiran quit (Ping timeout: 256 seconds) |
21:09:15 | FromGitter | <iffy> Okay, if I instead do `gorge("cmd /c cd")` it works |
21:17:37 | * | dulsi_ joined #nim |
21:19:45 | * | dulsi quit (Ping timeout: 240 seconds) |
21:24:02 | * | maier joined #nim |
21:28:59 | * | maier quit (Ping timeout: 240 seconds) |
21:38:51 | audiofile | I like this community |
21:43:05 | * | solitudesf quit (Ping timeout: 240 seconds) |
21:43:16 | FromDiscord | <aachh> Yeah, me too |
21:47:39 | FromDiscord | <Elegant Beef> We clearly havent met 😄 |
21:51:05 | leorize | @iffy that bug regarding asyncstdin might be fixed on devel now |
22:02:55 | * | disruptek yawns. |
22:03:28 | disruptek | scopes come, scopes go. only the wizard remains. |
22:04:09 | FromDiscord | <Avatarfighter> What is up everyone |
22:07:55 | disruptek | it's time to kick ass and chew bubblegum. |
22:07:59 | disruptek | and i'm all outta gum. |
22:08:55 | FromDiscord | <Avatarfighter> oh so ur working on devel today disruptek 😛 |
22:14:44 | * | arecacea1 quit (Remote host closed the connection) |
22:15:37 | * | arecacea1 joined #nim |
22:16:25 | disruptek | i'm tryin' to take over the world. |
22:16:33 | disruptek | same as any other sunday evening. |
22:27:41 | audiofile | hey now |
22:27:44 | audiofile | that's my plan >:( |
22:27:54 | audiofile | we can't have two people trying to take over the world at the same time |
22:28:11 | audiofile | Elegant Beef hullo! |
22:28:12 | disruptek | i had hoped it wouldn't come to this. |
22:28:19 | audiofile | it is a mexican standoff huh |
22:28:38 | * | audiofile takes disruptek out with a chipotle burrito |
22:29:57 | * | nature quit (Ping timeout: 260 seconds) |
22:32:23 | shashlick | object variants are more painful than they are worth |
22:32:29 | shashlick | if you have shared fields, that's it |
23:01:27 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
23:05:18 | * | krux02_ joined #nim |
23:07:50 | * | Trustable joined #nim |
23:07:52 | * | krux02 quit (Ping timeout: 260 seconds) |
23:18:09 | * | thomasross joined #nim |
23:18:27 | disruptek | that's how i feel about twins in bed. |
23:20:05 | FromDiscord | <Yardanico> Huh |
23:24:17 | * | dulsi_ is now known as dulsi |
23:24:58 | * | maier joined #nim |
23:25:57 | * | altarrel quit (Quit: Konversation terminated!) |
23:26:48 | * | altarrel joined #nim |
23:30:08 | * | maier quit (Ping timeout: 256 seconds) |