00:04:17 | * | ofelas joined #nim |
00:13:21 | * | bung quit (Ping timeout: 265 seconds) |
00:22:35 | * | lritter quit (Quit: Leaving) |
00:26:03 | * | oddp quit (Ping timeout: 258 seconds) |
00:28:36 | * | bung joined #nim |
00:41:27 | FromDiscord | <codic> @Vindaar nah, that isn't what i want. it's really awesome though |
00:42:04 | FromDiscord | <codic> oh hey daylight! |
00:42:35 | FromDiscord | <codic> i need them all executed in one shell |
00:42:35 | Yardanico | @codic you can easily run shell commands with osproc lol |
00:42:40 | Yardanico | in the same one? |
00:42:43 | FromDiscord | <codic> yes |
00:42:45 | Yardanico | then start bash |
00:42:47 | Yardanico | and communicate with it |
00:42:49 | nisstyre | bash foo.sh |
00:42:50 | FromDiscord | <codic> so i can store stuff like environment variables |
00:42:56 | FromDiscord | <codic> wait |
00:43:07 | Yardanico | you can start a process and then communicate with it |
00:43:09 | FromDiscord | <codic> can i just add the input to a file and re evaluate it every time |
00:43:20 | FromDiscord | <codic> That'd be inefficent though↵How do i communicate with it? |
00:43:24 | FromDiscord | <codic> aka send it commands |
00:43:26 | Yardanico | why would it be inefficient? |
00:43:32 | nisstyre | you can use a pipe |
00:43:38 | Yardanico | didn't you want a "session" youself? |
00:44:45 | FromDiscord | <codic> i was saying re evaluating every time would be inefficent lol |
00:44:55 | FromDiscord | <codic> yeah, i wanna have it all in one session. how do i use a pipe? |
00:45:01 | FromDiscord | <codic> (i'm trying to implement a basic shell here) |
00:45:03 | nisstyre | you get a file descriptor, standard input |
00:45:05 | nisstyre | you write to it |
00:45:08 | nisstyre | bash evaluates it |
00:45:17 | nisstyre | that's how your shell works when you type stuff in it normally |
00:45:21 | nisstyre | so you do the same thing with nim |
00:45:22 | FromDiscord | <codic> could you show a quick example? |
00:51:13 | * | fredrikhr quit (Ping timeout: 264 seconds) |
00:53:07 | Yardanico | one sec |
00:53:47 | Yardanico | https://play.nim-lang.org/#ix=2qwC |
00:53:52 | Yardanico | of course you can wrap this in a more usable way |
00:54:26 | Yardanico | ah right, also add |
00:55:00 | Yardanico | https://play.nim-lang.org/#ix=2qwD |
00:55:07 | Yardanico | so it would search for the binary in PATH |
00:55:24 | Yardanico | of course instead of calling exit in bash you can just kill it |
00:55:37 | Yardanico | like "bash.kill()" |
00:58:16 | nisstyre | BTW the reason for the flush() is because it's line buffered |
00:58:27 | Yardanico | maybe there's a better way, idk, I've never really used startProcess before :) |
00:58:28 | nisstyre | I always forget to do that |
00:59:41 | nisstyre | because bash doesn't immediately evaluate everything you give it, you usually want to give it a complete line (i.e. command) |
01:00:39 | nisstyre | the tricky part of this is getting output in a useful structured way though |
01:00:48 | nisstyre | because say you execute a command that takes 20 seconds |
01:00:56 | nisstyre | you don't really know when it's finished |
01:01:10 | nisstyre | bash will set $? of course |
01:01:18 | nisstyre | but it's tricky to deal with that in this scenario |
01:02:05 | nisstyre | usually you just want to block until the command is finished |
01:20:03 | rayman22201 | is leorize or any Azure CI experts around to help me debug why my Async PR is failing? |
01:22:23 | * | endragor joined #nim |
01:31:15 | leorize | link please :) |
01:34:57 | rayman22201 | https://github.com/nim-lang/Nim/pull/14838 |
01:34:58 | disbot | ➥ Fix asyncdispatch drain behavior (#14820) |
01:35:21 | rayman22201 | https://dev.azure.com/nim-lang/Nim/_build/results?buildId=6468&view=logs&j=30931762-47c4-53b3-6a83-316eb5a6b9d7&t=b1c7d701-c448-5ecb-905d-689d8a5921e0&l=1446 |
01:35:41 | FromGitter | <YusufCakan> Hi, when i try to debug a file called test with "gdb-nim test" I get an error "nim-gdb: line 11: -f: command not found" |
01:36:01 | FromGitter | <YusufCakan> does anyone know what i should do. |
01:36:13 | leorize | rayman22201: your test is time sensitive |
01:36:51 | leorize | since mac vms have 4 vcores that's thrashed by testament, an iteration might have take more time than it should |
01:37:08 | leorize | maybe you should build some tolerance in? |
01:37:25 | rayman22201 | leorize: it's time dependent but not time sensitive. |
01:37:40 | leorize | like use getMonoTime() to verify that it take +/- 50ms? |
01:37:58 | leorize | yea, I used the wrong word :P |
01:39:06 | rayman22201 | I actually don't think it should matter. But now I need to think about what you are saying more closely :-P |
01:40:18 | leorize | well it also could be that we have a huge inefficiency somewhere that stalled the thing :P |
01:40:23 | leorize | your choice :P |
01:41:06 | * | krux02_ quit (Remote host closed the connection) |
01:41:28 | rayman22201 | I could also increase the timeouts so it's a much slower test. Less likely to be affected by an I/O stall. |
01:42:39 | leorize | you can add some code to gauge the time |
01:42:47 | leorize | std/monotimes is useful for this |
01:43:00 | leorize | should let you know how much time drifted |
01:43:21 | leorize | if it's too large then we will have to look closer |
01:43:57 | rayman22201 | I'm still not clear what exactly is happening. I purposefully am counting iterations and not explicit time for this exact reason. I know it's variable. But you are saying the ioselector missed an entire interval. |
01:44:56 | leorize | we don't know what could've been running in the background |
01:45:19 | leorize | some GC tests allocates over 4GB of RAM and might've stalled the thing due to swapping |
01:45:26 | * | ForumUpdaterBot quit (Remote host closed the connection) |
01:45:34 | * | ForumUpdaterBot joined #nim |
01:45:37 | rayman22201 | true, but I would expect it to respect the timeout and have more iterations in that case, not less... |
01:45:37 | leorize | though I don't think mac have the same swapping prob as with linux |
01:45:59 | rayman22201 | but maybe not? |
01:47:48 | leorize | maybe you can add a time debug print just to see how can one iteration was lost? |
01:48:02 | * | chemist69 quit (Ping timeout: 260 seconds) |
01:48:15 | rayman22201 | yeah. I'm tempted to do that |
01:48:24 | rayman22201 | makes for a messy PR but oh well |
01:50:06 | * | chemist69 joined #nim |
01:50:07 | rayman22201 | Does my concern make sense? I get that a slow VM might cause it to miss a deadline, but it looks like the OS is not respecting the timeout value, which is concerning to me... |
01:50:53 | leorize | iirc we run the tests on macOS 10.14 |
01:51:00 | leorize | so maybe a bug from then? |
01:51:23 | rayman22201 | the config shows 10.5 |
01:51:27 | Yardanico | wat |
01:51:33 | Yardanico | we certainly don't use that :) |
01:51:34 | leorize | debug prints then |
01:52:04 | rayman22201 | :-) aye aye capn! debugs away! |
02:05:43 | * | thomasross joined #nim |
02:32:15 | ForumUpdaterBot | New thread by Tibo: Benefit of the effect system?, see https://forum.nim-lang.org/t/6507 |
02:34:17 | FromDiscord | <Rika> moderated :ThonkDumb: |
02:36:27 | * | r4vi quit (Ping timeout: 272 seconds) |
02:37:36 | * | muffindrake quit (Ping timeout: 246 seconds) |
02:38:21 | * | r4vi joined #nim |
02:38:47 | * | surma quit (Ping timeout: 260 seconds) |
02:39:56 | * | muffindrake joined #nim |
02:40:22 | * | BlameTheRoomba quit (Quit: Default Quit Message) |
02:41:33 | FromDiscord | <Yardanico> New account |
02:41:57 | FromDiscord | <Yardanico> You can read the post in https://forum.nim-lang.org/posts.json?id=6507 XD |
02:42:37 | rayman22201 | lol. I add extra debug print statements to my test, and the problem goes away XD |
02:47:18 | * | surma joined #nim |
02:52:24 | FromDiscord | <Rika> its really hard to read the post like that |
02:53:27 | FromDiscord | <Rika> rayman22201: bugs are allergic to debugging, theyll come back once you remove debugging stuff 😛 |
02:59:19 | * | dddddd quit (Ping timeout: 244 seconds) |
03:12:21 | * | thomasross quit (Ping timeout: 256 seconds) |
03:19:38 | shashlick | @leorize - https://github.com/nimterop/nimterop/issues/234 any thoughts? |
03:19:39 | disbot | ➥ Leading underscores and exported fields |
03:53:38 | ForumUpdaterBot | New thread by Juancarlospaco: Connection-Pooling Compile-Time ORM, see https://forum.nim-lang.org/t/6508 |
03:54:37 | * | vicfred quit (Quit: Leaving) |
03:55:27 | FromDiscord | <Rika> cool |
03:56:13 | FromDiscord | <Rika> actually really cool, reading through it now |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:32 | * | marnix joined #nim |
04:06:43 | * | supakeen joined #nim |
04:15:22 | * | nsf joined #nim |
04:16:27 | * | NimBot joined #nim |
04:18:24 | * | narimiran joined #nim |
04:45:52 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:38:40 | * | fredrikhr joined #nim |
05:43:57 | * | marnix quit (Ping timeout: 265 seconds) |
05:45:42 | * | solitudesf joined #nim |
05:48:42 | * | chemist69 quit (Ping timeout: 246 seconds) |
05:49:08 | * | chemist69 joined #nim |
05:53:56 | * | opDispatch quit (Quit: Konversation terminated!) |
05:54:02 | * | narimiran quit (Ping timeout: 246 seconds) |
06:02:26 | * | marnix joined #nim |
06:23:28 | * | Tlanger is now known as loggerer___ |
06:25:36 | * | loggerer___ is now known as Tanger |
06:30:54 | * | fredrikhr quit (Ping timeout: 240 seconds) |
06:32:08 | * | PMunch joined #nim |
06:42:13 | * | Vladar joined #nim |
06:49:04 | PMunch | Turns out adding JSON output to the RST generator was trickier than I imagined.. |
06:49:33 | PMunch | Mostly because JSON, unlike HTML and Latex, requires strings to be enclosed in quotes. |
06:53:52 | * | narimiran joined #nim |
07:04:21 | PMunch | Just realised that pandoc has a JSON output, but it is beyond terrible |
07:04:49 | PMunch | Although it seems to have been spawned by the same issue |
07:06:27 | PMunch | It turns this: http://ix.io/2qxR/rst into this http://ix.io/2qxP/json |
07:08:58 | * | pietroppeter joined #nim |
07:18:41 | narimiran | new blog post: Ray tracing in Nim — https://nim-lang.org/blog/2020/06/30/ray-tracing-in-nim.html |
07:21:08 | ForumUpdaterBot | New thread by Miran: New blog post: Ray tracing in Nim, see https://forum.nim-lang.org/t/6509 |
07:34:09 | * | marnix quit (Ping timeout: 265 seconds) |
07:35:58 | PMunch | Oh wow, what is up with that GCC 10 OpenMP performance? @mratsim |
07:44:27 | PMunch | "[...] a fast VM that gives Nim the speed of Python at compile-time [...]" did you benchmark this? When I tried some simple stuff in NimScript it was about 0.5x the speed of Python |
07:45:11 | * | marnix joined #nim |
07:45:28 | FromDiscord | <Rika> TIL heisenbug |
07:45:29 | FromDiscord | <Rika> lol |
07:47:32 | * | marnix_ joined #nim |
07:48:17 | FromDiscord | <Elegant Beef> Pmunch i think that's more just saying "Runs like ass" than "Runs on par with python" |
07:51:14 | * | marnix quit (Ping timeout: 240 seconds) |
07:53:47 | * | chemist69 quit (Ping timeout: 260 seconds) |
07:53:53 | PMunch | Haha, the way it's worded seems to indicate that it's a good thing :P |
07:54:18 | FromDiscord | <Elegant Beef> idk your mileage my vary |
07:54:20 | * | chemist69 joined #nim |
07:54:21 | FromDiscord | <Elegant Beef> may* |
08:05:56 | ForumUpdaterBot | New thread by Tanguymario: Tables and Import, see https://forum.nim-lang.org/t/6510 |
08:10:10 | * | muffindrake quit (Quit: muffindrake) |
08:17:56 | * | muffindrake joined #nim |
08:18:56 | PMunch | Ugh this JSON output is a mess.. |
08:19:03 | PMunch | I need more coffee |
08:23:55 | FromDiscord | <Elegant Beef> The json data for the structured docs? |
08:25:10 | PMunch | Yeah, I'm trying to convert RST to JSON |
08:25:14 | FromDiscord | <mratsim> @PMunch, I'm just taking Araq's words |
08:25:30 | FromDiscord | <mratsim> I don't know what's up with GCC10 OpenMP |
08:26:32 | PMunch | @Elegant Beef, so that you can use `nim jsondoc` and then convert that output into whatever format you want |
08:26:54 | PMunch | @mratsim, ah I see |
08:27:51 | FromDiscord | <Elegant Beef> Interesting |
08:29:00 | PMunch | So you could for example convert it to Markdown, or to a different HTML representation, or to something completely different |
08:32:22 | * | Trustable joined #nim |
08:34:57 | * | FromDiscord quit (Remote host closed the connection) |
08:35:12 | * | FromDiscord joined #nim |
08:36:18 | FromDiscord | <Elegant Beef> Time to make a DSL for it in nim so i can convert it back into compileable code and repeat |
08:38:07 | PMunch | Huh? |
08:38:19 | PMunch | Oh, the FromDiscord bot was down for a second |
08:38:31 | * | watzon quit (Quit: killed) |
08:38:31 | * | k0mpjut0r quit (Quit: killed) |
08:38:31 | * | planetis[m] quit (Quit: killed) |
08:38:31 | * | unclechu quit (Quit: killed) |
08:38:32 | * | GitterIntegratio quit (Quit: killed) |
08:38:32 | * | BitPuffin quit (Quit: killed) |
08:38:32 | * | lnxw37d4 quit (Quit: killed) |
08:38:33 | * | sendell quit (Quit: killed) |
08:38:33 | * | neceve quit (Quit: killed) |
08:38:36 | * | dzamo[m] quit (Quit: killed) |
08:38:37 | * | oneark quit (Quit: killed) |
08:38:37 | * | ee7[m] quit (Quit: killed) |
08:38:37 | * | Zoom[m] quit (Quit: killed) |
08:38:37 | * | xicheng[m] quit (Quit: killed) |
08:38:37 | * | skrylar[m] quit (Quit: killed) |
08:38:41 | * | codic quit (Quit: killed) |
08:38:47 | * | MTRNord[m] quit (Quit: killed) |
08:41:40 | * | Trustable quit (Ping timeout: 246 seconds) |
08:51:15 | PMunch | Hmm, I'm starting to think this can't be done in a sane way without rewriting the entire RST generator.. |
08:52:46 | * | lnxw37d4 joined #nim |
08:53:40 | PMunch | The insane output that pandoc gives should be possible though |
08:54:08 | PMunch | Maybe the "right" thing to do here is let the rstgen module output the crazy output, then post-parse that in docgen.. |
08:54:39 | PMunch | Or in the "rstToJson" procedure in rstgen |
08:54:41 | FromDiscord | <mratsim> and posted to HN as well: https://www.reddit.com/r/programming/comments/hijj3c/ray_tracing_in_nim/fwghjn9/ |
08:54:45 | FromDiscord | <mratsim> Reddit* |
08:55:57 | FromDiscord | <Rika> interesting reddit username 😛 |
08:56:28 | FromDiscord | <mratsim> Well I had no idea what to call myself and I was in chapter 400 something of the manga :p |
08:57:31 | FromDiscord | <mratsim> I watched the movie in a flight to Japan, it's meh though :/ |
08:58:09 | FromDiscord | <Rika> ~~i dont know what series you're talking about~~ |
09:02:05 | FromDiscord | <mratsim> https://en.wikipedia.org/wiki/Kingdom_(manga) |
09:02:47 | FromDiscord | <Rika> looks old 🤔 |
09:09:38 | * | muffindrake quit (Quit: muffindrake) |
09:12:09 | * | Trustable joined #nim |
09:27:27 | * | GitterIntegratio joined #nim |
09:27:27 | * | MTRNord[m] joined #nim |
09:27:27 | * | BitPuffin joined #nim |
09:27:27 | * | unclechu joined #nim |
09:27:27 | * | sendell joined #nim |
09:27:27 | * | neceve joined #nim |
09:27:27 | * | codic joined #nim |
09:27:27 | * | nerdrat[m] joined #nim |
09:27:27 | * | watzon joined #nim |
09:27:28 | * | dzamo[m] joined #nim |
09:27:28 | * | planetis[m] joined #nim |
09:27:28 | * | k0mpjut0r joined #nim |
09:27:28 | * | oneark joined #nim |
09:27:33 | * | skrylar[m] joined #nim |
09:27:34 | * | Zoom[m] joined #nim |
09:27:34 | * | xicheng[m] joined #nim |
09:27:35 | * | ee7[m] joined #nim |
09:33:19 | * | oddp joined #nim |
09:49:33 | * | muffindrake joined #nim |
10:12:43 | * | haxscramper joined #nim |
10:21:29 | haxscramper | How I can generate documentation comments for `NimNode` when constructing using `newTree`? Comments added in `quote do` are visible in documentation but not in `astGenRepr`. In particular I want to add documentation for object field. |
10:32:12 | * | krux02 joined #nim |
10:36:37 | PMunch | Hmm, I think that's just a bug with astGenRepr not showing them |
10:37:10 | PMunch | nnkCommentStmt is the node type you need to create for them |
10:38:44 | PMunch | So newCommentStmtNode("This is my documentation comment") should create a comment node |
10:38:50 | PMunch | haxscramper ^ |
10:40:44 | haxscramper | If I want to add comment for a field where do I put it? It worked for `proc` (added as first statement in `stmtList` in the body). |
10:41:15 | haxscramper | *for specific field and object itself too |
10:45:29 | * | fredrikhr joined #nim |
10:48:23 | * | leorize quit (Ping timeout: 240 seconds) |
10:50:35 | * | leorize joined #nim |
10:55:36 | * | muffindrake quit (Quit: muffindrake) |
11:04:08 | krux02 | haxscramper, the comment for fields in put into a hidden member of the ast node that you can't access. |
11:04:16 | krux02 | sorry |
11:05:40 | PMunch | I guess parseStmt is the only way then? |
11:20:24 | * | nsf quit (Quit: WeeChat 2.8) |
11:21:28 | PMunch | haxscramper, krux02, an ugly hack to get around this: https://play.nim-lang.org/#ix=2qyK |
11:22:06 | PMunch | Should probably throw an assert(identDef.kind == nnkIdentDef) in at the top of the document procedure.. |
11:23:57 | krux02 | I think the best solution for Nim as a language would be to put the comment into an accessable membor of ident, and symbol, because only they can have comments attached to them. |
11:24:16 | PMunch | Basically it creates a dummy node with the comment set, and then it populates it with the children from the node you pass in. It's not pretty, but it works |
11:25:01 | krux02 | PMunch, yes it works, it is ugly. |
11:25:22 | PMunch | krux02, that comment seems to be attached to the nnkIdentDef node and not to the nnkIdent node |
11:25:40 | krux02 | yea, that is bad. |
11:25:41 | PMunch | As you can see I copy the ident with the name from the node that's passed in. |
11:26:02 | krux02 | the comments in the ast are really not designed well. |
11:26:08 | krux02 | They are very very sloppy |
11:26:16 | PMunch | I don't think nnkIdent even can have comments, can they? |
11:26:36 | krux02 | and it is hard to clean it up afterwards. And it will certainly break such hacks as you just proposed. |
11:26:55 | PMunch | Yeah I guess it was added this way to preserve backwards compatibility at some point |
11:26:57 | krux02 | PMunch, what I said was, nnkIdend should have a comment member. |
11:27:11 | krux02 | currently everything can have a comment attached to it. |
11:27:22 | PMunch | Ah, but then you could've documented both the field name and the integer could have a comment |
11:27:25 | krux02 | PNode (NimNode internally) has a comment member. |
11:27:37 | PMunch | It would be fine if IdentDef was the only thing that could have a comment |
11:28:07 | krux02 | but that member should not be there as it really increates the size of all nim nodes in the compiler but is rarely occupied with anything. |
11:28:18 | krux02 | PMunch, no |
11:28:23 | FromDiscord | <gokr> Howdy guys |
11:28:32 | PMunch | I guess a nice way would be to add a `comment=` proc that checks if the node is a valid kind and sets the hidden field |
11:28:36 | krux02 | I think about proc symbols |
11:28:48 | PMunch | Hi @gokr! |
11:29:11 | krux02 | PMunch, constants, templats, macros. |
11:29:35 | krux02 | everythin that you can document has one thing in common. It has a name. |
11:29:51 | PMunch | But not everything with a name can be documented |
11:30:02 | krux02 | example? |
11:30:09 | * | muffindrake joined #nim |
11:30:31 | krux02 | I don't think it would be had if everything with a name could be documented. |
11:30:35 | PMunch | Arguments? Proc level variables? Blocks? |
11:30:39 | krux02 | s/had/bad/ |
11:31:19 | krux02 | currently, every not, addition, subtractions, simple braces, can have a documentation node. |
11:31:22 | krux02 | I think that is worse. |
11:31:31 | PMunch | Oh yeah, I'm not saying it's better |
11:31:55 | PMunch | I'm just saying that everything with a name wouldn't be correct either |
11:32:20 | PMunch | If we are going to fix it, why not fix it properly |
11:32:21 | krux02 | I also don't think it would be bad if you could suddenly attach documentation comments (via macros) to arguments proc lovel variables, blocks etc. |
11:33:07 | FromDiscord | <gokr> Just wanted to share a small thing. So I had a chat with someone that was quite turned off about Nim after having had a bad initial experience on the Nim forum. I am not going into more detail, but that's a bit frustrating and after reading the thread I understand him. Just a general "heads up". |
11:33:13 | PMunch | Well it wouldn't be horrible to have that even in normal code |
11:33:20 | PMunch | Not quite sure how it would be rendered though |
11:33:58 | PMunch | @gokr, that's sad to hear. What kind of experience? |
11:34:36 | FromDiscord | <Rika> why wouldnt arguments be documentable? we have nestable/non-full-line comments dont we |
11:35:27 | FromDiscord | <gokr> Well, a sarcastic reply. Not a biggie, but the first thing to a beginner that probably was hesitant in posting in the first place - I would probably have felt "ok, fine, I am not welcome" too. |
11:36:09 | narimiran | somebody gives up on programming language because of a sarcastic comment on its forum?? |
11:36:16 | FromDiscord | <Rika> ~~who posted it~~ |
11:36:25 | PMunch | It's kinda hard to address that though.. |
11:36:38 | FromDiscord | <Rika> any language's gonna have some fuckers |
11:36:38 | krux02 | gokr: feel free to ask your question. You are welcome. I am just a grumpy old programmer. But still willing to help if I can. Makes me feel less grumpy. |
11:36:39 | PMunch | I guess a "First post" flair might be useful |
11:36:54 | FromDiscord | <Rika> krux02: its not them, its their friend who had the issue |
11:37:18 | krux02 | ok |
11:37:20 | FromDiscord | <Rika> PMunch: or at least some indicator, yeah |
11:37:34 | FromDiscord | <gokr> @krux02 I am a fairly long time Nimmer, but haven't been super active granted. |
11:37:39 | PMunch | I mean people can still be assholes, but at least then it is clear to everyone that they are an asshole to completely new users :P |
11:38:11 | PMunch | Maybe we should have a "Grumpy asshole" flair as well :P At least then you know it's not personal |
11:38:34 | FromDiscord | <gokr> It was just an observation, and... I don't know, for some odd reason we (the Nim people) tend to have had a fair share of these things. |
11:38:36 | FromDiscord | <Rika> then someone puts that tag on ar--- |
11:38:49 | FromDiscord | <Rika> *gets stabbed* |
11:39:04 | PMunch | @Rika, TBF he kinda deserves one, but so do I probably |
11:39:08 | krux02 | I am not an asshole to new users, that treatment is something you need to earn. |
11:39:14 | PMunch | At least until I get my morning coffee |
11:39:44 | krux02 | I like new users. They are generally very positive. I like that. |
11:39:55 | PMunch | Yeah, that's why a "New user"/"First post" flair might be nice. I can also be crass to people I know can take it |
11:39:55 | FromDiscord | <gokr> I tied explaining that "we are mostly good guys" etc and I hope I can get him/her to try again. |
11:40:53 | krux02 | you don't need ot convince him/her to come back. If it works better to not stay in here, it might be healthier. |
11:41:07 | haxscramper | About documentation of function parameters: I think it will be great to be able to document them. I mean - it is possible to put some kind of 'param `a1` affects that, param `a2` affects this' directly in the function body, but explicitly attaching notes to arguments will be much better. Parameters is the most important part of the function user really interacts with, so it would make sense to add some extra documentation capabilities |
11:41:07 | haxscramper | for them. |
11:41:09 | krux02 | Don't force people to do something they don't want. |
11:41:56 | FromDiscord | <Rika> haxscramper imagine something like `proc s(p: int ##[doc lol]##, ...)` LOL (i'm not serious)( |
11:41:58 | FromDiscord | <gokr> I know, sure. At the same time, our discussion about this was on an open channel - so who knows how many in that other community that felt "ok, that's the way it works in Nim, I am not going there"... |
11:42:14 | PMunch | I think the Nim community is super nice, but since we've been fairly small for a while we might appear a bit cold and harsh because we know each other fairly well |
11:42:25 | FromDiscord | <Rika> (also i am pretty sure nim already supports that) |
11:42:33 | krux02 | haxscramper, I would not go so far and say, it would be explicitly better to document parameter directly. Maybe it would even make things worse, because now it is ambiguous to users where they should put their documentation. |
11:42:55 | PMunch | Like if someone told me to "fuck off" I would take it as a joke and not as an insult, even though that meaning can't really be extrapolated from the words directly. |
11:43:06 | FromDiscord | <mratsim> Well we need a sidebar wih a FAQ because some things trigger the grumpy programmers: "Why indentation", "Why OOP/FP second citizen)" |
11:43:29 | FromDiscord | <mratsim> "imports are wrong" |
11:43:32 | FromDiscord | <mratsim> and so on |
11:43:38 | FromDiscord | <Rika> i dont feel like fp is a second citizen, maybe not first but it doesnt feel like a second citizen to me |
11:43:58 | FromDiscord | <mratsim> I've noticed some bad responses (for example drkameleon) |
11:44:10 | FromDiscord | <mratsim> thankfully it's not too often |
11:44:18 | haxscramper | Rika: Well, `##[notes]##` might not look that good, but putting parameters on their own lines might work. |
11:46:24 | FromDiscord | <Rika> haxscramper: but how would you address the comment usually being after the comma of the param 😛 |
11:46:53 | PMunch | Something like this (the documentation comments on the arguments) might work: https://play.nim-lang.org/#ix=2qyT |
11:46:57 | haxscramper | krux02: Although RST has description lists, they work pretty well. Just slightly annoying to type each parameter twice. And on top of that: I haven't seen a lot of people meticulously documenting each parameter. |
11:47:00 | PMunch | Still not sure it's a good idea though.. |
11:47:42 | PMunch | haxscramper, yeah if you look at tools like what Java/Android has it creates the doc comment automatically, but I think they are mostly left unpopulated.. |
11:47:55 | PMunch | It seldom makes sense to document arguments if you give them good names |
11:48:12 | PMunch | Having types works pretty well as well |
11:48:24 | FromDiscord | <exelotl> I previously used just ``` ## `foo` description of foo ``` which looks nice in comments but probably awful in the generated docs |
11:48:25 | haxscramper | Rika: oh, yeah I just forgot about this. This way it certainly looks like implementing it would be either too ugly or too hacky. |
11:48:37 | PMunch | Just reading `document(NimNode, static[string]): NimNode` you can probably already guess what this proc does |
11:48:42 | FromDiscord | <exelotl> but recently I've been using definition lists, which works out pretty well: https://exelotl.github.io/trick/trick/mmutil.html#makeSoundbank,string,string, |
11:49:03 | krux02 | haxscramper, I like the emacs covention of short documentation strings. Once sentence that contains each parameter like if it is a normal word. |
11:51:44 | * | vicfred joined #nim |
11:54:47 | * | ofelas quit (Ping timeout: 240 seconds) |
11:59:50 | PMunch | Documentation can have images?! https://juancarlospaco.github.io/nim-gatabase/ |
12:00:07 | PMunch | I guess it's obvious, just never thought about it before :P |
12:00:25 | FromDiscord | <Rika> prolly manually inserted |
12:00:33 | FromDiscord | <Rika> also ngl those images are really uh |
12:00:35 | FromDiscord | <Rika> cringy |
12:02:11 | PMunch | Haha, yeah they are something else |
12:03:31 | * | ofelas joined #nim |
12:03:49 | Yardanico | @Rika I'd have to agree with you on this one ;) |
12:04:34 | * | nerdrat[m] quit (Quit: Idle for 30+ days) |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:12 | FromDiscord | <mratsim> omg what'w with the cat |
12:06:38 | * | supakeen joined #nim |
12:28:21 | * | nikita` joined #nim |
12:37:25 | * | endragor_ joined #nim |
12:37:25 | * | endragor quit (Read error: Connection reset by peer) |
12:48:21 | FromDiscord | <Skaruts> apparently I found a way to crash the compiler: https://play.nim-lang.org/#ix=2qz3 |
12:48:25 | FromDiscord | <Skaruts> I have no idea why |
12:48:32 | Yardanico | well I wouldn't be surprised :P |
12:48:43 | FromDiscord | <Skaruts> I'm using 1.2.2 |
12:49:13 | Yardanico | @Skaruts |
12:49:15 | Yardanico | on devel I get "/home/dian/Projects/prntsc-downloader/as.nim(10, 31) Error: template instantiation too nested" |
12:49:30 | Yardanico | and that's indeed true |
12:49:32 | FromDiscord | <Rika> not surprised |
12:49:34 | Yardanico | since you call has_clipping in itself |
12:49:36 | Yardanico | and it's a template |
12:49:37 | FromDiscord | <Rika> you're recursively calling it a lot |
12:49:40 | Yardanico | it's being expanded recursively |
12:50:05 | FromDiscord | <Skaruts> hmm... makes sense |
12:50:13 | FromDiscord | <Rika> a proc would work just fime |
12:50:17 | FromDiscord | <Rika> fine |
12:50:21 | FromDiscord | <Skaruts> yea a proc works |
12:50:22 | Yardanico | if you care about performance you can make a proc inline |
12:50:40 | FromDiscord | <Skaruts> using a pragma? |
12:50:44 | Yardanico | then nim will emit it in the same C file as the place it's being called from (duplicate that for every file) |
12:50:55 | Yardanico | so the C compiler will almost surely inline it |
12:51:04 | Yardanico | unless it thinks that this will make the perf worse |
12:51:05 | Yardanico | yeah, just a pragma |
12:51:11 | Yardanico | proc myproc(data: string) {.inline.} |
12:51:26 | FromDiscord | <Skaruts> I never knew what inline meant 😄 |
12:51:48 | Yardanico | it tries to trick the C compiler into inlining the proc :P |
12:51:50 | FromDiscord | <Skaruts> I'm not sure I need that though |
12:52:00 | FromDiscord | <Clyybber> can't inline general recursion |
12:52:02 | Yardanico | it's not 100% anyway, but it's pretty likely to be inlined |
12:52:04 | Yardanico | well yeah |
12:52:14 | FromDiscord | <Clyybber> even with "really_really_force_inline" |
12:52:26 | FromDiscord | <Rika> i read online that most compilers ignore manual inline annotations |
12:52:37 | FromDiscord | <Skaruts> by the way @Yardanico, what did you mean by devel? (or how did you get to the error?) |
12:52:50 | Yardanico | @Skaruts devel -> latest development version of nim compiler |
12:52:53 | Yardanico | I just get this error |
12:52:57 | FromDiscord | <Skaruts> ah ok |
12:53:04 | Yardanico | @Rika nim also copies the proc definition to every module it's called from |
12:53:06 | Yardanico | if it's inline |
12:53:09 | Yardanico | I guess that might help too |
12:53:29 | FromDiscord | <mratsim> Nim inline use "static inline" and I have yet to come with an example were the C compiler ignores it |
12:53:34 | FromDiscord | <Clyybber> @Rika They don't ignore it, but they can choose to say we are smarter than you |
12:54:01 | FromDiscord | <Clyybber> they certainly will ignore it in non-tail call recursion |
12:54:23 | FromDiscord | <mratsim> well you have no alternative |
12:54:41 | FromDiscord | <Rika> oh i see |
12:54:59 | FromDiscord | <Rika> well im pretty sure compilers are smarter than me in any case and time |
12:55:09 | Yardanico | although this inline can in rare cases come and bite you, e.g. the devel regression for inline :P |
12:55:33 | Yardanico | it's not a big deal though https://github.com/nim-lang/Nim/issues/14758 |
12:55:35 | disbot | ➥ C compiler error with inline and a proc field in an object ; snippet at 12https://play.nim-lang.org/#ix=2qz4 |
12:55:40 | Yardanico | since the workaround is quite easy |
13:00:49 | PMunch | Oh my, my JSON sanitizer worked on the first try |
13:01:02 | Zevv | I bet your json was already clean |
13:01:11 | PMunch | Hmm, I must've spent all my luck for today, gotta watch out so I don't kill myself.. |
13:01:18 | PMunch | Zevv, nah it was a mess |
13:01:28 | PMunch | That's why I wrote a sanitizer :P |
13:06:22 | FromDiscord | <Rika> does it save your sanity |
13:06:36 | Yardanico | does a hand sanitizer save your sanity |
13:06:43 | FromDiscord | <kodkuce> why i cant do this var playerSlots:seq[Player] = @[nil,nil,nil] ? |
13:06:50 | FromDiscord | <Rika> yardanico tis a joke |
13:06:55 | Yardanico | i am know |
13:07:00 | Yardanico | @kodkuce what is Player? |
13:07:11 | Yardanico | and anyway it's better to just do newSeq[Player](3) then |
13:07:20 | narimiran | this ^ |
13:07:22 | FromDiscord | <kodkuce> i want to have an array or a seq with 20 slots for players and when someslot is empty want to just null it |
13:07:33 | Yardanico | you can use nil if only if it's a "ref object" |
13:07:43 | FromDiscord | <kodkuce> it is |
13:07:44 | Yardanico | but yeah, just use newSeq as I said :) |
13:07:57 | FromDiscord | <kodkuce> sent a code paste, see https://play.nim-lang.org/#ix=2qz6 |
13:08:03 | FromDiscord | <kodkuce> oh sorry i frogot irc |
13:08:09 | Yardanico | its okay |
13:08:13 | Yardanico | we have a bot now |
13:08:37 | FromDiscord | <Rika> yardanico i think you're ignoring []s too hard since i see "newSeqPlayer" from your messages |
13:09:03 | Yardanico | `newSeq[Player](3)` |
13:09:23 | FromDiscord | <kodkuce> and it will all be instalized with nills? |
13:09:28 | Yardanico | yes |
13:09:39 | Yardanico | that means they won't be initialised at all |
13:09:45 | Yardanico | "nil" literally means "not initialised" |
13:09:59 | krux02 | nil means "not in list" |
13:10:16 | Yardanico | oh :P |
13:10:39 | krux02 | comes from lisp |
13:11:14 | FromDiscord | <Rika> nil means "now? initialize later" |
13:11:19 | FromDiscord | <Rika> lol |
13:11:31 | Yardanico | nil means "nah! it'll crash" |
13:11:44 | FromDiscord | <Rika> lmaooo |
13:13:24 | * | muffindrake quit (Quit: muffindrake) |
13:15:22 | FromDiscord | <Clyybber> lol, krux02 Yardanico, not sure if you are joking but nil is not an abbreviation |
13:15:43 | FromDiscord | <Rika> no that resolves to naa |
13:15:48 | FromDiscord | <Clyybber> lol |
13:15:51 | Yardanico | NIL IS NAA |
13:16:05 | FromDiscord | <Rika> nin |
13:16:38 | FromDiscord | <KingDarBoja> Nil is the future |
13:17:40 | * | waleee-cl joined #nim |
13:18:00 | FromDiscord | <Clyybber> my faith is nil |
13:18:27 | FromDiscord | <kodkuce> @treeform hmm why Error: expression 'close(ws)' has no type (or is ambiguous) i get whenwer i try to use ws.close() |
13:18:46 | FromDiscord | <Rika> maybe ws is the module name |
13:18:54 | FromDiscord | <kodkuce> it is |
13:19:00 | FromDiscord | <Rika> if it is, then itll try resolving that first |
13:19:02 | FromDiscord | <Rika> and end there |
13:19:09 | FromDiscord | <kodkuce> yep probbaly shound named this diffendt |
13:19:12 | FromDiscord | <Rika> yeah |
13:20:19 | FromDiscord | <kodkuce> sent a code paste, see https://play.nim-lang.org/#ix=2qzb |
13:20:46 | FromDiscord | <Rika> im assuming wss is another symbol defined in ws 😛 |
13:20:59 | FromDiscord | <Rika> because wss means something like https is to http |
13:21:12 | Yardanico | I don't really think so |
13:21:16 | Yardanico | maybe wss.close() doesn't need await |
13:21:18 | Yardanico | that's why it errors |
13:21:20 | FromDiscord | <Rika> i'm just assuming |
13:21:27 | Yardanico | how dare you to assume something in 2020 |
13:21:32 | FromDiscord | <Rika> true |
13:21:39 | FromDiscord | <Rika> all programs must now be eager |
13:26:45 | FromDiscord | <kodkuce> i tryed wdd too 🙂 , ye it dosent need await tough duno why when that is gracefull close it sends client its closing too i think |
13:27:46 | Yardanico | it handles the closing gracefully if you check the source |
13:27:49 | Yardanico | https://github.com/treeform/ws/blob/81007161ec8fd4bd61c3a6927025a9001f088b67/src/ws.nim#L434 |
13:28:04 | Yardanico | it actually sends the closing frame so it's fine |
13:28:39 | FromDiscord | <kodkuce> ye but when i send other stuff i do with await ws.send so i expected same for close |
13:28:56 | Yardanico | well I guess the reason is that ws.close might be used outside of async procedures |
13:29:03 | Yardanico | e.g. in error handlers or something |
13:30:56 | PMunch | Hmm, okay I should be safe, it didn't work 100% |
13:31:04 | Yardanico | lol |
13:37:49 | FromDiscord | <treeform> @kodkuce Yeah made close not await exactly because of error handlers. Original it was await but it cased issues. |
13:49:19 | FromDiscord | <treeform> Is there a function I could "when" on in a template, that would tell me if a type is fully self contained and has no pointers or refs and is contagious in memory ... So it's safe to memcopy? |
13:49:58 | FromDiscord | <Clyybber> I don't think so. But you could easily write one yourself |
13:56:47 | * | leorize quit (Quit: WeeChat 2.8) |
14:00:03 | * | lritter joined #nim |
14:07:39 | FromDiscord | <MapleSyrup|TagMeIfReply> what are some good gui libs? |
14:07:54 | FromDiscord | <MapleSyrup|TagMeIfReply> need something for windows too |
14:11:23 | * | Vladar quit (Remote host closed the connection) |
14:11:49 | * | Senny joined #nim |
14:11:54 | * | lbart quit (Ping timeout: 240 seconds) |
14:13:57 | * | PMunch quit (Quit: Leaving) |
14:20:43 | nisstyre | GTK |
14:23:08 | nisstyre | actually apparently Qt has better windows support so use that |
14:23:26 | FromDiscord | <Rika> worse nim sopport tho |
14:23:28 | FromDiscord | <Rika> su* |
14:23:43 | FromDiscord | <mratsim> QML seems to work |
14:24:24 | FromDiscord | <mratsim> ah we don't have Windows build yet: https://github.com/status-im/nim-status-client/releases |
14:24:54 | FromDiscord | <Rika> CPP tho :thonk: |
14:25:45 | FromDiscord | <mratsim> well, it's better than what we had before: Go+Electron+ReactNative+Javascript |
14:26:29 | * | nsf joined #nim |
14:30:46 | FromDiscord | <Rika> oof |
14:43:36 | disruptek | rika: compilers are smarter than you in any case? |
14:43:48 | disruptek | i dunno... https://play.nim-lang.org/#ix=2qwm |
14:53:39 | FromDiscord | <MapleSyrup|TagMeIfReply> hmm, yeah I think I'll give Qt a shot then |
14:53:43 | FromDiscord | <MapleSyrup|TagMeIfReply> thanks yall |
14:56:25 | FromDiscord | <Shucks> Could I reach that without the proc? https://play.nim-lang.org/#ix=2qzH |
14:57:53 | FromDiscord | <Rika> disruptek: i dont get it |
14:58:00 | FromDiscord | <Rika> its working as intended |
14:58:59 | FromDiscord | <Rika> @Shucks wdym |
15:00:53 | FromDiscord | <Shucks> oring all varargs. If theres some better way instead of using a whole proc again ;p |
15:01:16 | FromDiscord | <Shucks> like some fancy unpack and oring it at one line |
15:03:10 | FromDiscord | <Rika> make it a template |
15:14:16 | * | nsf quit (Quit: WeeChat 2.8) |
15:18:49 | FromDiscord | <Shucks> Well im reading the manual over and over again and I still don't get the benefit of using a template or macro. I know the fact that I can manipulate operators with templates and I'm able to use blocks on templates/macros. Thats it for now lol |
15:19:39 | FromDiscord | <Rika> templates dont have a stack cost technically |
15:19:59 | FromDiscord | <Yardanico> With macros you can transform any valid (syntax wise) Nim code into anything you want |
15:20:24 | FromDiscord | <Yardanico> You can emit AST for any Nim statement/expression etc |
15:21:02 | FromDiscord | <Clyybber> @Shucks templates are a bit like inlined procs |
15:21:08 | FromDiscord | <Yardanico> And of course you should use the least powerful construct :) |
15:21:23 | FromDiscord | <Clyybber> @Shucks But can do a bit more |
15:21:25 | FromDiscord | <Clyybber> for example |
15:21:57 | FromDiscord | <Clyybber> You can have a `template doSomething: untyped = echo a, b, c, d, e, f, g` |
15:22:00 | FromDiscord | <Clyybber> And use it like this: |
15:22:27 | FromDiscord | <Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2qzM |
15:22:37 | FromGitter | <ynfle> Any reason I keep getting `.choosenim/toolchains/nim-1.2.4/lib/pure/collections/sequtils.nim(780, 11) Error: internal error: environment misses: result\`gensym14015042`? I don't which LOC is causing it |
15:22:58 | FromDiscord | <Clyybber> ynfle: Are you using toSeq? |
15:23:04 | FromGitter | <ynfle> Yup |
15:23:11 | FromDiscord | <Clyybber> Look at generic instantiation of toSeq |
15:23:22 | FromDiscord | <Clyybber> (edit) 'Look at ... generic' => 'Look attemplate or' |
15:23:28 | FromGitter | <ynfle> Whith a `nimNode.childrenIterator`iterator |
15:24:05 | FromGitter | <ynfle> *`.children` |
15:38:02 | * | marnix_ quit (Ping timeout: 264 seconds) |
15:38:13 | FromDiscord | <Clyybber> ynfle: Do you have a snippet? |
15:38:47 | * | dddddd joined #nim |
15:44:15 | * | marnix joined #nim |
15:47:12 | FromDiscord | <Shucks> https://play.nim-lang.org/#ix=2qzS |
15:47:16 | FromDiscord | <Shucks> still confused lol |
15:48:00 | * | NimBot joined #nim |
15:48:39 | Yardanico | that's how it will look roughly (after a lot of processing done by the compiler) |
15:48:40 | Yardanico | https://play.nim-lang.org/#ix=2qzT |
15:49:32 | Yardanico | templates get fully inlined (that's why it's code substitution) |
15:49:39 | Yardanico | with a proc you're calling another procedure |
15:51:32 | FromDiscord | <Shucks> so its more like a optimizing thing than having a benefit on my end. On my end the code still looks cleaner with using a proc |
15:51:43 | Yardanico | well templates aren't mainly used for optimization |
15:51:45 | FromDiscord | <Shucks> since i got result there |
15:51:47 | Yardanico | they're used for template features :) |
15:52:21 | FromDiscord | <Shucks> oh heck. Some day. |
15:52:23 | FromDiscord | <Shucks> ;D |
15:52:28 | Yardanico | one simple example from my old snippet |
15:52:29 | Yardanico | https://gist.github.com/Yardanico/0bcf50c05b71ae8990529ea0913ac068 |
15:52:48 | * | muffindrake joined #nim |
15:52:50 | Yardanico | it's a template which makes templates which call the log procedure with the appropriate log level |
15:53:27 | Yardanico | and then you can use it like |
15:53:38 | Yardanico | logInfo(a = 1, "hello", b = 3.0) |
15:54:39 | Yardanico | although that version seems to be a little broken, I have a newer one |
15:54:50 | Yardanico | https://github.com/Yardanico/nickel/blob/master/src/log.nim this one |
15:55:03 | FromDiscord | <Shucks> thats cool. So if every template usage gets inlined wouldn't that result in a lot more c code at the end. |
15:55:14 | Yardanico | well yes, but templates aren't used for optimization as I said |
15:55:22 | Yardanico | well they can be |
15:55:26 | Yardanico | but that's not their main use case :P |
15:57:25 | Yardanico | another example of templates - https://github.com/def-/nimes/blob/master/src/nes/cpu.nim |
15:57:42 | Yardanico | to avoid repetition |
15:58:37 | FromDiscord | <Shucks> I see |
15:59:25 | FromDiscord | <Shucks> Thank you. I guess its a bit clearer now. I guess on my example there it's still better to use a usual proc. At some day I will be able to actually see when a template/macro makes sense in my code ;D |
16:00:05 | FromDiscord | <Shucks> Im still on that dll injection wrapper btw |
16:01:10 | FromGitter | <ynfle> @Clyybber , https://play.nim-lang.org/#ix=2qzX |
16:01:41 | * | haxscramper quit (Remote host closed the connection) |
16:04:26 | FromDiscord | <TheCrappyCoder> youtube.com/watch?v=ypNegFmdjts |
16:07:38 | FromDiscord | <Yardanico> ? |
16:07:45 | FromDiscord | <Yardanico> @TheCrappyCoder we have <#371759607934353448> |
16:08:08 | FromDiscord | <TheCrappyCoder> oh sorry I missed it |
16:13:27 | * | Senny quit (Ping timeout: 260 seconds) |
16:19:07 | FromDiscord | <kodkuce> so i can nil only ref objects |
16:19:16 | FromDiscord | <kodkuce> that sux i am used to niling 🙂 |
16:28:27 | * | marnix quit (Ping timeout: 240 seconds) |
16:39:30 | FromDiscord | <exelotl> > *templates aren't used for optimization* https://media.discordapp.net/attachments/371759389889003532/727563974266191872/dd0.png |
16:39:39 | Yardanico | I meant that's not their main use imo :P |
16:43:07 | FromDiscord | <exelotl> that's fair |
16:48:50 | FromDiscord | <Rika> @kodkuce look into options module and just `none T` everything i guess? |
17:02:55 | FromGitter | <ynfle> `Error: '*' expected ⏎ lineinfos.nim(254) raiseRecoverableError ⏎ Error: unhandled exception: '*' expected [ERecoverableError]`. What is this error from `nim doc`? ` ## Ident | Postfix(*, Ident) (proc name)` This is the line that it throws the error on |
17:03:07 | Yardanico | what nim version? |
17:03:29 | Yardanico | ah yeah it still exists in the compiler |
17:03:34 | Yardanico | show more code so we can help :P |
17:05:17 | FromGitter | <ynfle> 1) 2.4 |
17:06:28 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=2qAe |
17:09:49 | solitudesf | you need to escape `\*` |
17:13:34 | FromGitter | <ynfle> 👍 |
17:23:49 | disruptek | you think we should formalize case ... elsif in the spec? |
17:24:04 | FromDiscord | <Rika> ? |
17:24:25 | disruptek | i would say it's a little creepy because order matters. you say it's "working as intended." |
17:26:26 | * | abm joined #nim |
17:55:12 | * | ofelas quit (Ping timeout: 260 seconds) |
17:56:09 | * | Senny joined #nim |
18:04:13 | * | ofelas joined #nim |
18:06:15 | disruptek | the key to exotic dancing is to picture the audience naked. |
18:07:42 | * | kenran joined #nim |
18:10:16 | * | bung_ joined #nim |
18:13:31 | * | bung quit (Ping timeout: 260 seconds) |
18:21:06 | * | haxscramper joined #nim |
18:22:53 | FromDiscord | <Clyybber> whats creepy? |
18:22:57 | FromDiscord | <Clyybber> case .. elif? |
18:23:00 | Yardanico | yes |
18:23:10 | FromDiscord | <Clyybber> how is it creepy? |
18:23:33 | FromDiscord | <Clyybber> order matters for ever if |
18:23:39 | FromDiscord | <Clyybber> (edit) 'ever' => '' |
18:23:41 | Yardanico | well, see |
18:24:07 | Yardanico | https://play.nim-lang.org/#ix=2qAq |
18:24:14 | * | sentreen quit (Ping timeout: 265 seconds) |
18:24:15 | Yardanico | maybe it's just not documented that you can use "case" with "elif" |
18:24:35 | Yardanico | and indeed it's not documented :P |
18:24:42 | Yardanico | nothing about elif in https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement |
18:24:59 | FromDiscord | <Clyybber> guess it can be documented |
18:25:27 | haxscramper | Does `nim doc` support foonotes? I'm writing `[1]_` in text and then `.. [1] Some text` below. And footnote text is not visible in the documentation at all. |
18:25:37 | Yardanico | ah well, case expression has elif documented |
18:25:37 | Yardanico | https://nim-lang.org/docs/manual.html#statements-and-expressions-case-expression |
18:25:41 | Yardanico | it shows in example |
18:26:03 | * | vsantana joined #nim |
18:26:20 | FromDiscord | <Clyybber> its also formalized in the grammar |
18:26:24 | Yardanico | btw, how can I use strformat to format 6 strings of different len to always be centered with same width? |
18:26:43 | Yardanico | with {str:^7} they're not always centered because they're of different length |
18:28:21 | * | sentreen joined #nim |
18:29:08 | Yardanico | well seems like it's mostly fine |
18:31:18 | Yardanico | https://play.nim-lang.org/#ix=2qAx |
18:31:22 | Yardanico | e.g. see how NOTICE sticks out a bit here |
18:31:35 | Yardanico | https://play.nim-lang.org/#ix=2qAy |
18:31:48 | Yardanico | lol sorry I meant https://play.nim-lang.org/#ix=2qAz |
18:32:33 | FromDiscord | <Clyybber> what do you expect? |
18:32:56 | FromDiscord | <Clyybber> it can't be completely centered |
18:32:59 | Yardanico | NOTICE to start at the same letter as INFO :P |
18:33:10 | * | vicfred quit (Ping timeout: 246 seconds) |
18:33:13 | FromDiscord | <Clyybber> but why would it? |
18:33:29 | FromDiscord | <Clyybber> it wouldn't be *more* consistent |
18:33:50 | FromDiscord | <Clyybber> if it can't be perfectly centered it gets moved half a character to the left |
18:34:02 | FromDiscord | <Clyybber> thats the consistent behaviour accross all cases |
18:34:33 | FromDiscord | <Clyybber> afaict what you want is that it conditionally moves them half a character right or left when it can't perfectly center them so that their starting points are aligned? |
18:34:42 | Yardanico | yeah I guess so |
18:34:52 | Yardanico | but it's not a big deal |
18:35:52 | FromDiscord | <Clyybber> would be a bit of a niche case to provide something builtin for |
18:35:57 | Yardanico | yeah of course |
18:36:09 | Yardanico | I was just asking how could i do not, not "why it's not in strformat" :P |
18:36:11 | Yardanico | do it* |
18:36:34 | FromDiscord | <Clyybber> oh, heh, manually of course :D |
18:38:20 | FromDiscord | <KingDarBoja> I feel a Big pain after seeing the result |
18:38:27 | FromDiscord | <KingDarBoja> Not centered x.x |
18:39:18 | FromDiscord | <KingDarBoja> https://media.discordapp.net/attachments/371759389889003532/727594124227641364/IMG-20200627-WA0058.jpg |
18:40:37 | FromDiscord | <Clyybber> lol |
18:40:45 | FromDiscord | <Clyybber> weird german but ok |
18:41:34 | * | sentreen quit (Ping timeout: 240 seconds) |
18:41:59 | FromDiscord | <KingDarBoja> I lost the emoji I had for these moment :) |
18:45:08 | * | sentreen joined #nim |
18:45:36 | * | wontruefree[m] joined #nim |
18:49:37 | * | sentreen quit (Ping timeout: 246 seconds) |
18:50:06 | disruptek | sure; i'll start using case/elif everywhere and we can see what works and what needs fixing. 👍 |
18:51:14 | Yardanico | why though |
18:51:30 | Yardanico | you might as well use converters, term rewriting templates, source code filters and concepts too |
18:51:31 | Yardanico | all at once |
18:51:46 | Yardanico | s/templates/macros |
18:52:00 | * | sentreen joined #nim |
18:53:38 | FromDiscord | <lqdev> i use concepts. |
18:53:44 | Yardanico | well it's okay to use them :P |
18:53:56 | FromDiscord | <lqdev> converters, too. |
18:53:59 | Yardanico | i mean all obscure features at once |
18:54:07 | FromDiscord | <lqdev> case elif seems weird lol |
18:59:50 | FromDiscord | <Clyybber> what? |
18:59:51 | FromDiscord | <Clyybber> lol |
18:59:59 | FromDiscord | <Clyybber> case elif is not broken. Its really simple |
19:00:36 | FromDiscord | <Clyybber> there won't be anything that needs fixing; fingers crossed |
19:01:09 | disruptek | sure, sure. |
19:10:35 | FromDiscord | <Clyybber> disruptek: Lol, a test relied on this broken behaviour |
19:10:53 | FromDiscord | <Clyybber> accidently though, I think I may have found a regression |
19:11:36 | disruptek | what broken behavior? |
19:12:30 | FromDiscord | <Clyybber> disruptek: The method call syntax one |
19:13:28 | disruptek | not surprising; it's been a "feature" for a long time afaik. |
19:19:09 | FromDiscord | <Clyybber> Araq: ping |
19:29:00 | ForumUpdaterBot | New thread by Snej: Multithreaded await, see https://forum.nim-lang.org/t/6511 |
19:30:55 | disruptek | shouldn't `(var i = 0); (var i = 0)` fail? |
19:31:25 | Yardanico | why? |
19:31:37 | Yardanico | ah well it does fail :P |
19:32:46 | FromDiscord | <Clyybber> disruptek: Yeah it does |
19:33:15 | disruptek | should it not? |
19:33:26 | FromDiscord | <Clyybber> perhaps it should |
19:33:27 | disruptek | i would expect it to fail. |
19:33:31 | FromDiscord | <Clyybber> yeah |
19:33:47 | FromDiscord | <Clyybber> but in templates its not supposed to? |
19:34:05 | FromDiscord | <Clyybber> I say: Either it should fail in all cases or in none |
19:34:08 | disruptek | i thought () enables multiline substitution but not scope. |
19:35:10 | disruptek | it's essentially a statement list, right? |
19:35:15 | FromDiscord | <Clyybber> Yeah |
19:35:32 | disruptek | what's the argument for it to succeed? |
19:35:51 | FromDiscord | <Clyybber> I guess that it looks like scopes? |
19:36:37 | disruptek | i think we need it scope-free more than we need it to look scopeful. |
19:36:52 | FromDiscord | <Clyybber> not sure. scopeful is way nicer for arc |
19:36:57 | FromDiscord | <Clyybber> but would be a breaking change |
19:37:04 | Yardanico | when we get the scoped PR merged? :P |
19:37:12 | disruptek | there are other ways to create scopes... |
19:37:43 | FromDiscord | <Clyybber> disruptek: Yes there are, but be aware that `echo (var i = 0;i) \necho i` also works |
19:38:05 | FromDiscord | <Clyybber> which is not what arc expects btw |
19:38:09 | disruptek | as it should; it's not a scope. |
19:39:00 | FromDiscord | <Clyybber> oh, actually arc doesn't care much |
19:39:20 | FromDiscord | <Clyybber> but I'm not sure its the best behaviour |
19:39:25 | disruptek | we've talked about introducing a 1st-class scope node into the ast. |
19:40:52 | disruptek | it's a naive idea i had, anyway. it hasn't been vetted by science. 😁 |
19:43:45 | FromDiscord | <Clyybber> ok, so non-scoped it is. |
19:44:19 | FromDiscord | <Clyybber> I guess its best |
19:44:45 | * | a_b_m joined #nim |
19:47:01 | * | abm quit (Ping timeout: 246 seconds) |
20:02:14 | * | Jesin quit (Quit: Leaving) |
20:12:02 | * | dsrw joined #nim |
20:13:12 | * | dsrw quit (Client Quit) |
20:14:55 | FromGitter | <ynfle> What's the difference Call string and Call ie. `echo"Hello"` & `echo "Hello"`? |
20:15:33 | * | Guest94576 joined #nim |
20:17:36 | * | Jesin joined #nim |
20:17:43 | * | Guest94576 quit (Client Quit) |
20:18:02 | FromDiscord | <Elegant Beef> In that case i think they're identical as the compiler realizes `"` cannot be apart of a signature, but if you were to do that with an int the former version wouldnt compile |
20:18:05 | * | kenran quit (Quit: leaving) |
20:18:56 | shashlick | can you add a search path with a pragma |
20:19:10 | shashlick | like `{.path: "xyz".}` |
20:19:43 | FromDiscord | <Shucks> How does the compile pragma work? I mean could I pass a cpp file to the compile pragma and still compile my nim code with `nim c`? |
20:20:34 | shashlick | yes it will know what to do |
20:20:53 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma |
20:21:02 | FromDiscord | <Elegant Beef> Says what it does right there |
20:21:18 | FromDiscord | <Shucks> Thats magic isnt it |
20:21:19 | FromDiscord | <Shucks> ;p |
20:21:31 | FromDiscord | <Elegant Beef> Nah abusing the fact nim goes to C/C++ 😛 |
20:22:28 | FromDiscord | <Shucks> So just to make it clear. I could write a cpp function, use the compile pragma, wrap it in nim and still be able to call it even compiled with `nim c` |
20:22:33 | FromDiscord | <Elegant Beef> What's real magic is what impbox did for getting stb_vorbis in his framework↵https://github.com/ftsf/nico/blob/master/nico/stb_vorbis.nim#L29 |
20:23:32 | FromDiscord | <mratsim> @Shucks Yes, and you can replace Make/CMake with {.compile.} https://github.com/numforge/agent-smith/blob/master/third_party/ale_build.nim |
20:23:37 | FromDiscord | <Elegant Beef> I have no clue about that, i imagine so |
20:23:43 | FromDiscord | <Elegant Beef> Well there you go |
20:24:09 | FromDiscord | <mratsim> and here is wrapping it: https://github.com/numforge/agent-smith/blob/master/third_party/ale_wrap.nim |
20:24:46 | FromDiscord | <mratsim> but nim c will not work because you need to use C++ name mangling to call the functions so you need to compile with cpp |
20:24:54 | FromDiscord | <mratsim> unless you use the C FFI of the C++ library |
20:25:36 | FromDiscord | <Shucks> aye, thats what I was wondering |
20:25:44 | FromDiscord | <exelotl> "you can replace Make/CMake with {.compile.}" +1 to this, I'm doing it in my game and it works great :) |
20:26:01 | FromGitter | <ynfle> @Elegant Beef, so why here https://nim-lang.org/docs/manual.html#statements-and-expressions-case-expression is it `animal.endsWith"whale"` |
20:28:35 | FromDiscord | <Elegant Beef> cause it doesnt matter in the case of a string |
20:28:40 | FromDiscord | <Elegant Beef> `"` cannot be an identifier |
20:31:00 | FromDiscord | <Elegant Beef> that is intepreted as↵`endsWith(animal, "whale")` ↵as far as i know |
20:31:28 | FromGitter | <ynfle> So `fmt"hello, {name}"` is the same as `fmt("hello {name")` |
20:31:44 | * | tane joined #nim |
20:32:40 | * | cyraxjoe quit (Ping timeout: 256 seconds) |
20:33:08 | * | cyraxjoe joined #nim |
20:33:15 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax |
20:33:31 | FromDiscord | <Elegant Beef> Wait im in the wrong section |
20:33:32 | FromDiscord | <Elegant Beef> 😄 |
20:34:31 | FromDiscord | <Elegant Beef> But yes that's how the UFCS converts a.b() becomes b(a) |
20:34:59 | FromDiscord | <Elegant Beef> UFCS replaces the need for member procs by making all procs usable as member or "static" |
20:35:40 | FromDiscord | <Shucks> Isnt nep1 covering stuff like that. It should do it ;D |
20:36:15 | FromDiscord | <Shucks> im just catching myself everytime mixing stuff up |
20:36:27 | FromDiscord | <Shucks> And im doing really weird stuff like `"config.json".write_file((% s).` |
20:36:47 | * | chemist69 quit (Ping timeout: 240 seconds) |
20:37:15 | FromDiscord | <Elegant Beef> Nep1 seems mostly just as a convention guideline, so just do whatever you like unless publishing to nimble or the like |
20:37:25 | FromDiscord | <Shucks> or `var myvar = int32 5` in the next line im using `var myvar = 5.int32` |
20:37:55 | * | chemist69 joined #nim |
20:39:29 | FromDiscord | <Elegant Beef> I mean it should be consistant inside the single code base |
20:39:43 | FromDiscord | <Elegant Beef> but i typically would do `var myvar:int32 = 5` |
20:48:37 | * | haxscramper quit (Remote host closed the connection) |
20:50:33 | * | kungtotte quit (Read error: Connection reset by peer) |
20:50:59 | * | kungtotte joined #nim |
20:53:41 | * | BlameTheRoomba joined #nim |
20:54:47 | * | ofelas quit (Ping timeout: 240 seconds) |
20:56:00 | * | vicfred joined #nim |
20:57:44 | FromDiscord | <Solitude> `var myvar = 5'i32` |
20:58:38 | disruptek | you're making me grumpy. |
20:58:52 | disruptek | i need the asshole avatar. |
21:03:27 | * | ofelas joined #nim |
21:08:09 | FromDiscord | <Elegant Beef> Disruptek show me on this anatomically inaccurate doll where the bad man touched you |
21:08:45 | disruptek | 2nd week off my meds is always the worst. |
21:09:18 | FromDiscord | <Elegant Beef> Even worse when you're near me |
21:09:39 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
21:11:35 | * | marnix_ joined #nim |
21:13:54 | * | narimiran quit (Ping timeout: 240 seconds) |
21:14:34 | * | jholland__ quit (Ping timeout: 258 seconds) |
21:14:37 | * | Hotbees quit (Read error: Connection reset by peer) |
21:14:48 | * | Hotbees joined #nim |
21:15:05 | * | euantor quit (Read error: Connection reset by peer) |
21:15:19 | * | euantor joined #nim |
21:15:27 | * | jholland__ joined #nim |
21:16:31 | * | MightyJoe joined #nim |
21:17:42 | * | cyraxjoe quit (Ping timeout: 260 seconds) |
21:20:17 | * | marnix__ joined #nim |
21:24:14 | * | marnix_ quit (Ping timeout: 256 seconds) |
21:26:12 | * | a_b_m quit (Quit: Leaving) |
21:28:09 | * | waleee-cl joined #nim |
21:34:28 | * | solitudesf quit (Ping timeout: 246 seconds) |
21:38:03 | * | thomasross joined #nim |
21:45:50 | * | vsantana quit (Quit: leaving) |
21:54:59 | * | tane quit (Quit: Leaving) |
21:57:52 | * | marnix__ quit (Ping timeout: 265 seconds) |
22:06:12 | * | lritter quit (Quit: Leaving) |
22:08:18 | * | nikita` quit (Quit: leaving) |
22:14:16 | Zoom[m] | Hm, something's up with the Matrix bridge. I'm getting all messages doubled. |
22:14:35 | disruptek | like what? |
22:14:36 | disruptek | like what? |
22:14:56 | disruptek | send a screenshot. |
22:14:56 | disruptek | send a screenshot. |
22:15:19 | FromDiscord | <Elegant Beef> lol |
22:17:31 | Zoom[m] | Huh, the last "lol" is actually not doubled. Strange |
22:17:39 | disruptek | weird. |
22:17:39 | disruptek | weird. |
22:17:50 | disruptek | weird. |
22:17:56 | disruptek | weird. |
22:18:06 | disruptek | where's my screenshot? |
22:18:06 | disruptek | where's my screenshot? |
22:18:07 | disruptek | where's my screenshot? |
22:18:07 | disruptek | where's my screenshot? |
22:18:15 | FromDiscord | <Yardanico> stop disruptek |
22:18:16 | FromDiscord | <Elegant Beef> Disruptek, i think you need those meds |
22:18:30 | FromDiscord | <Yardanico> @Zoom congrats, you've been trolled on IRC :) |
22:18:41 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/727649329145184408/Screenshot_2020-07-01-01-18-32-870_com.discord.jpg |
22:19:19 | Zoom[m] | I see what's DIsruptek been doing, this goes on for a couple of days now |
22:19:27 | disruptek | beep beep i'm a bot. |
22:19:27 | disruptek | beep beep i'm a bot. |
22:19:49 | FromDiscord | <Yardanico> Disruptek did you do too much C# again |
22:20:46 | FromDiscord | <Elegant Beef> Few too many attibutes |
22:20:51 | FromDiscord | <Elegant Beef> (edit) 'attibutes' => 'attributes' |
22:24:47 | * | ofelas quit (Ping timeout: 240 seconds) |
22:32:10 | ForumUpdaterBot | New thread by ZadaZorg: GetFileSize async and sync, see https://forum.nim-lang.org/t/6512 |
22:33:23 | * | ofelas joined #nim |
22:49:22 | * | BlameTheRoomba quit (Ping timeout: 246 seconds) |
22:54:53 | * | Trustable quit (Remote host closed the connection) |
23:06:25 | FromDiscord | <Clyybber> @Yardanico Spot on analysis |
23:06:49 | FromDiscord | <Yardanico> @Clyybber btw, found another arc codegen bug with inline iterators 😄 |
23:06:55 | FromDiscord | <Clyybber> nice \oo/ |
23:06:57 | FromDiscord | <Clyybber> :D |
23:07:02 | disruptek | nice tits. |
23:08:02 | FromDiscord | <Clyybber> okbr |
23:08:36 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/14864 |
23:08:38 | disbot | ➥ [ARC] C compiler error with inline iterators and imports ; snippet at 12https://play.nim-lang.org/#ix=2qBN |
23:09:47 | * | ofelas quit (Ping timeout: 240 seconds) |
23:22:53 | * | ofelas joined #nim |
23:26:45 | FromDiscord | <Technisha Circuit> Can someone give me a link to the telegram community for nim? |
23:27:23 | Yardanico | yes, but it's not connected to the bridges so it's less active :) |
23:27:27 | Yardanico | https://t.me/nim_lang |
23:27:34 | FromDiscord | <Technisha Circuit> Thanks |
23:28:02 | FromDiscord | <KingDarBoja> I love u new avatar |
23:28:26 | Yardanico | whose? |
23:28:57 | FromDiscord | <Technisha Circuit> Thanks |
23:29:02 | FromDiscord | <Technisha Circuit> :p |
23:29:15 | FromDiscord | <Technisha Circuit> Gacha Club came out so i remade it |
23:30:36 | * | thomasross quit (Remote host closed the connection) |
23:31:01 | * | thomasross joined #nim |
23:32:27 | * | ofelas quit (Ping timeout: 240 seconds) |
23:34:29 | FromDiscord | <KingDarBoja> Technisha one 😄 |
23:35:03 | FromDiscord | <KingDarBoja> That's certainly something Rika would like too |
23:36:22 | * | krux02_ joined #nim |
23:39:22 | * | krux02 quit (Ping timeout: 260 seconds) |
23:43:23 | * | ofelas joined #nim |
23:49:08 | * | ofelas quit (Ping timeout: 244 seconds) |
23:51:58 | * | ofelas joined #nim |
23:56:47 | * | ofelas quit (Ping timeout: 240 seconds) |