00:02:02 | * | dddddd quit (Remote host closed the connection) |
00:11:38 | traviss | I am trying to use https://github.com/JustinRyanH/nimflecs which depends on c2nim and nimgen with windows and nim 0.20. `nimble setup` fails saying gcc is an unknown command. However, I have configured nim to use clang by supplying cc=clang and clang.path=... in nim.cfg. Anyone have any idea whats going on here? Here is the output: https://pastebin.com/yWZDRF7v |
00:41:02 | FromGitter | <JasperJenkins> I don't believe nimgen uses nim.cfg to select the preprocessor. It looks like you have to set the CC/CPP env var for nimgen. |
00:42:22 | traviss | oh, thank you. i'll look into how to do that. |
00:44:24 | shashlick_ | You can set it on your local env with a set command |
00:45:24 | shashlick_ | Or you can set it in the nimgen cfg file |
00:45:31 | shashlick_ | c_compiler="$CC" |
00:45:32 | shashlick_ | cpp_compiler="${CPP}-arm" |
00:46:16 | shashlick_ | Unfortunately Nim doesn't tell us what the current compiler is configured to |
00:46:22 | * | lestus joined #nim |
00:46:39 | * | lestus left #nim (#nim) |
00:58:14 | traviss | ok well using c_compiler="$cc" in nimflecs.cfg and `set cc=F:\Users\Travis\AppData\Local\LLVM-8\bin\clang` got past that error. But now i'm getting this one: `Error: unhandled exception: assignment to discriminant changes object branch; compile with -d:nimOldCaseObjects for a transition period [FieldError]` |
00:59:13 | traviss | which is coming from this command: `cmd /c "c2nim --stdcall --header:headerflecs --out:nimflecs/flecs.nim temp-flecs.nim.c"` |
00:59:45 | traviss | does that mean i need to pass -d:nimOldCaseObjects to c2nim? |
01:01:06 | * | theelous3_ joined #nim |
01:03:48 | shashlick_ | Looks like you have a broken version of c2nim |
01:04:14 | shashlick_ | Do you have older versions of Nim installed |
01:04:17 | shashlick_ | Choosenim? |
01:05:22 | traviss | i re-installed today a binary download of 0.20 and ran finish. I couldn't get choosenim to work. |
01:06:19 | traviss | I previously had built nim from source but that was a little annoying |
01:06:52 | traviss | just having to stash my config changes when i wanted to pull latest master. |
01:08:18 | traviss | i reinstalled c2nim and nimgen with nimble uninstall after reinstalling nim. |
01:08:37 | shashlick_ | You need to pass -d:nimOldCaseObjects to c2nim at compile time |
01:08:42 | shashlick_ | Here's a suggestion |
01:08:48 | shashlick_ | Uninstall c2nim |
01:08:54 | shashlick_ | And then nimble install c2nim |
01:09:14 | shashlick_ | Basically nimgen pulled an older version of c2nim |
01:09:17 | shashlick_ | Due to another bug |
01:09:30 | traviss | oh i see. will do. |
01:09:35 | shashlick_ | Will be easier than getting an older Nim installed |
01:10:55 | traviss | it seems to have installed the same version of c2nim which was uninstalled: 0.9.14. |
01:12:05 | FromGitter | <JasperJenkins> maybe `nimble install c2nim@#head`? |
01:13:10 | shashlick_ | That is the latest looks like |
01:13:55 | FromGitter | <JasperJenkins> I didn't bump the version when I added `-d:nimOldCaseObjects` :-/ |
01:14:24 | traviss | that seems to have worked, but now its still showing an error: `nimflecs\temp-flecs.nim.c(58, 7) Error: expected ';'` |
01:15:26 | traviss | I noticed this in the output when installing c2nim: Verifying dependencies for [email protected] |
01:15:40 | shashlick_ | @JasperJenkins - have you done c2nim PR's? |
01:15:56 | traviss | Even though I'm on 0.20 |
01:17:04 | FromGitter | <JasperJenkins> Just the one. |
01:18:47 | * | synshroud quit (Quit: ZNC 1.7.4 - https://znc.in) |
01:41:19 | traviss | i was able to complete nimble setup by switching from clang to gcc with `set cc=path\to\gcc`. i see the output `Generating nimflecs/flecs.nim |
01:41:19 | traviss | Processing nimflecs/flecs.nim |
01:41:19 | traviss | Appending keys for wildcard *.nim` but I don't see any flecs.nim file. shouldn't that file have been generated? sorry i'm still new to c2nim. |
01:52:10 | traviss | nvm... i'm a dumb and forgot to `nimble install` |
02:45:15 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:45:40 | * | laaron joined #nim |
02:49:54 | * | rockcavera joined #nim |
03:03:09 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:21:31 | * | vlad1777d__ quit (Ping timeout: 246 seconds) |
03:30:54 | traviss | can anyone recommend an entity component system to use with nim for a game? i think i'm giving up on building flecs for now. i want to use it along with the framework nico: https://github.com/ftsf/nico |
03:44:01 | * | theelous3_ quit (Ping timeout: 248 seconds) |
03:45:01 | FromDiscord_ | <Samantac8cd> 18+ Dirty Photos For Guys Only 👉 https://viewc.site/QYHhZv?tx=x1 |
03:45:48 | * | theelous3 quit (Read error: Connection reset by peer) |
04:13:36 | * | traviss quit (Quit: Leaving) |
04:14:23 | FromGitter | <zacharycarter> is there any way to prepend items to a sequence? |
04:14:35 | shashlick_ | Deque |
04:15:15 | shashlick_ | Nimgen flecs not working? |
04:15:32 | FromGitter | <zacharycarter> thanks |
04:18:46 | FromGitter | <zacharycarter> shashlick_: is there an easy way to spread a sequence? would I use apply or something if I wanted to prepend all items in a sequence to my dequeue? |
04:22:50 | FromGitter | <zacharycarter> I'll just do it the verbose way for now |
04:26:09 | * | oculux quit (Ping timeout: 248 seconds) |
04:30:48 | * | oculux joined #nim |
04:34:24 | * | nsf joined #nim |
05:37:24 | FromGitter | <zacharycarter> traviss: do you really need an ECS? |
05:40:24 | * | vlad1777d__ joined #nim |
05:43:25 | * | dwdv joined #nim |
05:43:35 | * | ertp07 quit (Ping timeout: 250 seconds) |
05:43:47 | * | ertp07 joined #nim |
06:04:34 | * | solitudesf joined #nim |
06:09:50 | * | narimiran_ joined #nim |
06:11:10 | * | ertp07 quit (Ping timeout: 252 seconds) |
06:14:24 | * | ertp07 joined #nim |
06:21:57 | * | brakmic joined #nim |
06:27:26 | * | brakmic_ joined #nim |
06:30:03 | * | brakmic quit (Ping timeout: 245 seconds) |
06:30:05 | * | brakmic__ joined #nim |
06:31:42 | * | brakmic_ quit (Ping timeout: 258 seconds) |
06:32:41 | * | purebadger joined #nim |
06:35:17 | * | purebadger quit (Client Quit) |
06:36:48 | * | PMunch joined #nim |
06:39:16 | * | purebadger joined #nim |
06:39:34 | * | purebadger quit (Client Quit) |
06:43:00 | * | purebadger joined #nim |
06:51:56 | * | narimiran_ is now known as narimiran |
06:54:54 | * | krux02 joined #nim |
06:55:28 | * | ertp07 quit (Ping timeout: 258 seconds) |
06:57:05 | * | ertp07 joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:35 | * | gmpreussner joined #nim |
07:05:22 | * | ertp07 quit (Ping timeout: 244 seconds) |
07:13:23 | * | ertp07 joined #nim |
07:34:31 | FromDiscord_ | <djazz> Ugh, we got a spambot on the discord side. Samantac8cd#6006 |
07:38:04 | * | solitudesf quit (Ping timeout: 246 seconds) |
07:54:53 | * | couven92 joined #nim |
07:57:19 | * | ertp07 quit (Ping timeout: 246 seconds) |
07:57:51 | * | ertp07 joined #nim |
07:58:13 | * | ertp07 quit (Read error: Connection reset by peer) |
07:58:35 | * | ertp07 joined #nim |
08:01:01 | FromGitter | <mratsim> @narimiran who can update the sponsors page? https://forum.nim-lang.org/t/4939 |
08:01:31 | narimiran | i think Araq should have the exact numbers, and then i could update it |
08:02:35 | * | ertp07 quit (Read error: Connection reset by peer) |
08:05:14 | * | ertp07 joined #nim |
08:07:40 | Zevv | thanks for the ptr pull mratsim |
08:12:19 | FromGitter | <mratsim> btw I updated the post @narimiran : https://github.com/nim-lang/needed-libraries/issues/77 |
08:12:45 | FromGitter | <mratsim> @Zevv, you're welcome, I didn't do much |
08:13:25 | * | Sencatsu joined #nim |
08:15:39 | * | hoijui joined #nim |
08:16:18 | * | Senketsu_ quit (Ping timeout: 245 seconds) |
08:18:18 | FromGitter | <mratsim> @Araq: do you have an example of this: https://github.com/nim-lang/Nim/commit/d37c4e44d3243acd91ffd91515e8a1807c979bad#diff-4f776abc4638b87f4340e44e09871c2aR208 ⏎ ⏎ Couldn't that prevent graph data structure represent as pointers? |
08:19:11 | * | floppydh joined #nim |
08:24:25 | * | solitudesf joined #nim |
08:24:26 | FromGitter | <gogolxdong> There is some issue of toJson of karax/jjson, it cast literal boolean value to 0 or 1, and in some scenes , fields requires boolean value literally. ⏎ ⏎ ```var c = %*{"a": true} ⏎ echo cast[JsonNode](true).toJson ⏎ echo c.toJson``` [https://gitter.im/nim-lang/Nim?at=5d19c33a490abf627a53ed0b] |
08:26:04 | FromGitter | <arnetheduck> lol @mratsim we absolutely *need* a library for `QUantum Expression and Lattice Field Theory`, much more so than something as pedestrian as a the tree collection in the std lib :) |
08:29:16 | narimiran | @mratsim nice update, i'm glad to see the progress therer! |
08:39:01 | Araq | what's a "tree collection"? |
08:39:05 | Araq | SortedTable? |
08:40:23 | FromGitter | <arnetheduck> yeah |
08:40:35 | FromGitter | <mratsim> @arnetheduck we all need a Higgs-Boson :p |
08:41:56 | * | Vladar joined #nim |
08:49:37 | * | ertp07 quit (Ping timeout: 248 seconds) |
08:54:25 | * | ertp07 joined #nim |
09:04:05 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
09:04:22 | * | tjmac joined #nim |
09:05:26 | * | laaron joined #nim |
09:16:20 | * | purebadger quit (Quit: WeeChat 2.5) |
09:16:49 | * | purebadger joined #nim |
09:46:17 | * | abm joined #nim |
09:49:33 | Araq | er, why was https://github.com/nim-lang/Nim/pull/11626 red and now it's green? |
09:52:17 | FromGitter | <alehander42> how to check if i am compiled with threads:on |
09:52:21 | FromGitter | <alehander42> hasThreadSupport ? |
09:54:15 | Araq | when compileOption("threads") |
09:54:17 | Araq | iirc |
09:54:38 | narimiran | Araq: it was red because one travis test timed out. so i restarted just that test and now it is green |
09:54:39 | FromGitter | <alehander42> yep |
09:54:42 | FromGitter | <alehander42> thanks |
09:55:07 | * | laaron quit (Remote host closed the connection) |
09:56:09 | * | laaron joined #nim |
10:11:58 | * | ertp07 quit (Ping timeout: 272 seconds) |
10:19:31 | * | ertp07 joined #nim |
10:20:54 | * | ertp07 quit (Read error: Connection reset by peer) |
10:22:01 | * | ertp07 joined #nim |
10:28:27 | FromGitter | <alehander42> https://paste.ofcode.org/34MQZ95vkEAuMU7VSr2aMZD |
10:28:34 | FromGitter | <alehander42> how stupid is this |
10:29:01 | FromGitter | <alehander42> i mean i have some code that uses big array-s and assumes the index is always in bounds |
10:29:09 | FromGitter | <alehander42> and i wanted to lazily convert it to seq-s |
10:29:21 | FromGitter | <alehander42> without adding manually bound checks and resizes |
10:29:32 | leorize | my bigger question is why are you using `cast` everywhere? |
10:32:17 | FromGitter | <alehander42> well, i can borrow? |
10:32:22 | FromGitter | <alehander42> i guess thats what you mean |
10:32:32 | FromGitter | <alehander42> but i cant borrow [] and []= because i override them |
10:33:17 | Araq | you should use type conversions, not 'cast' |
10:34:48 | * | ertp07 quit (Read error: Connection reset by peer) |
10:36:18 | FromGitter | <alehander42> hm |
10:37:02 | FromGitter | <alehander42> ok almost works |
10:37:07 | * | ertp07 joined #nim |
10:37:25 | FromGitter | <alehander42> https://paste.ofcode.org/SgDrK99PcfXcmtuehe6LVY |
10:37:30 | * | ertp07 quit (Read error: Connection reset by peer) |
10:37:50 | * | ertp07 joined #nim |
10:37:53 | FromGitter | <alehander42> this works but why do i need to `a = SeqTranslator(a2)` |
10:37:56 | FromGitter | <alehander42> in []= |
10:38:23 | FromGitter | <alehander42> i mean i see that i need to `var a = ..` to "borrow" []= from seq |
10:38:48 | FromGitter | <alehander42> because i cant type convert (or cast to ) var seq directly |
10:38:53 | leorize | that introduces a copy |
10:38:57 | FromGitter | <alehander42> yes |
10:39:03 | FromGitter | <alehander42> and i want to not introduce it |
10:39:12 | leorize | also you don't need backticks for borrowing len and/or setLen |
10:39:28 | FromGitter | <alehander42> oh right |
10:39:39 | FromGitter | <alehander42> forgive me |
10:40:07 | FromGitter | <alehander42> but i cant see how to borrow []= from seq[char] and renaming it so i can use it the override without confusion |
10:40:16 | FromGitter | <alehander42> the other option is to directly access `.data` |
10:40:17 | leorize | you can just map the normal `[]` for seq to a proc |
10:40:43 | leorize | wait |
10:42:15 | FromGitter | <alehander42> ok so this is good idea |
10:42:21 | FromGitter | <alehander42> but i guess it still introduces a copy |
10:42:59 | FromGitter | <alehander42> i think i should be able to say nim "hey this is actually var seq[char], just accept it and call []= on it" |
10:43:09 | FromGitter | <alehander42> without two type conversions |
10:43:22 | leorize | here's a hacky way: https://play.nim-lang.org/#ix=1Nps |
10:43:44 | FromGitter | <alehander42> something like proc setKey(a: var SeqTranslator, b: int, c: char) {.borrow: "[]=".} |
10:44:09 | FromGitter | <alehander42> ah nice thats how you get data with |
10:44:11 | FromGitter | <alehander42> yeah |
10:44:42 | * | purebadger quit (Ping timeout: 258 seconds) |
10:47:34 | * | purebadger joined #nim |
10:47:54 | * | stefanos82 joined #nim |
10:49:08 | leorize | alehander42: apparently this also works: https://play.nim-lang.org/#ix=1Npu |
10:51:30 | FromGitter | <alehander42> huh |
10:51:39 | FromGitter | <alehander42> i think i tried something like that |
10:52:30 | * | purebadger quit (Ping timeout: 272 seconds) |
10:52:39 | FromGitter | <alehander42> hiih |
10:53:06 | FromGitter | <alehander42> so if a is var seqchar () actually converts it to var seq[char] |
10:53:08 | FromGitter | <alehander42> in a way |
10:53:32 | FromGitter | <alehander42> so yeah it works |
10:53:44 | FromGitter | <alehander42> if a is var SeqT... * |
10:55:46 | * | purebadger joined #nim |
10:56:05 | lqdev[m] | how can you set the C compiler to be used by Nim? |
10:56:20 | Araq | --cc:vcc / gcc / clang |
10:56:24 | lqdev[m] | ah, --gcc.exe |
10:57:49 | FromGitter | <alehander42> i wondered if anybody tried to do a x86 asm compiler |
10:57:55 | FromGitter | <alehander42> for the nim backend for fun |
10:58:16 | Araq | dom96 did |
10:58:30 | FromGitter | <alehander42> iirc nim generates relatively simple stuff on this level (and similar to three address code?) |
10:58:33 | FromGitter | <alehander42> ohh good |
10:58:37 | FromGitter | <alehander42> is it open source |
11:03:16 | * | abm quit (Read error: Connection reset by peer) |
11:04:50 | * | clyybber joined #nim |
11:05:55 | Araq | wow that --newruntime is full of bugs |
11:06:27 | Araq | tsimpleclosure.nim(44, 11) Error: '=' is not available for type <owned proc (){.gcsafe, locks: 0.}>; requires a copy because it's not the last read of 'say' |
11:06:53 | Araq | that's true but 'say' doesn't have an environment so it doesn't matter |
11:10:03 | * | abm joined #nim |
11:10:59 | clyybber | I can't figure out that double free bug :/ |
11:12:52 | Araq | clyybber, we should do some pair-programming |
11:16:56 | Araq | or you stream and I'm in the chat shouting at you |
11:19:00 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
11:19:32 | * | laaron joined #nim |
11:22:41 | * | ertp07 quit (Ping timeout: 248 seconds) |
11:26:09 | * | dddddd joined #nim |
11:27:35 | * | ertp07 joined #nim |
11:38:22 | * | tjmac quit (Ping timeout: 258 seconds) |
11:40:00 | clyybber | Araq: Oh yeah we could do that |
11:55:53 | FromGitter | <rokups> you guys do pair programming via vscode-live-share and stream it so we can shout at you both from chat |
11:57:25 | clyybber | does this work: https://www.twitch.tv/clyybber ? |
11:58:19 | FromGitter | <rokups> it does, but quality sucks |
11:58:24 | clyybber | ah fuck |
11:58:38 | clyybber | well, thats the max my connection allows I guess |
11:58:44 | FromGitter | <rokups> says 628p (source) under quality setting |
11:59:04 | clyybber | oof |
11:59:13 | clyybber | do you see firefox or irc window? |
11:59:30 | FromGitter | <rokups> firefox, some .rst open |
11:59:39 | clyybber | ok thank you |
11:59:57 | FromGitter | <rokups> reading text is possible, but half the time its brain auto-correcting text because it can be hardly seen |
12:01:03 | narimiran | the quality is ok |
12:01:14 | clyybber | mmh, that sux, especially since my terminal font is kinda small |
12:01:42 | narimiran | clyybber: for streaming/recording, increasing font-size is a must |
12:02:01 | * | Snircle joined #nim |
12:02:07 | clyybber | yep, i see. gotta get rid of that bitmap font |
12:02:27 | narimiran | it takes some practice to have less information than usual on the screen, but your viewers will be very thankful |
12:03:03 | narimiran | oh, now i see your terminal and it is unreadable as it is/was |
12:03:22 | narimiran | i think you can use ctrl+shift+= to increase font size |
12:04:01 | clyybber | im using alacritty and I dont think it supports it. |
12:05:32 | narimiran | ok, lets see if a different font improves readability.... |
12:07:06 | narimiran | yep, this is readable |
12:07:15 | clyybber | nice |
12:07:35 | clyybber | well, guess I'll wait for araq |
12:07:52 | clyybber | also I think twitch chat has a fuckload of delay right? |
12:08:09 | solitudesf | ~5 seconds |
12:08:27 | FromGitter | <alehander42> still cant see the letters |
12:08:31 | narimiran | don't know, but there is a delay between twitch stream and stuff written here (when you show your IRC client) |
12:08:38 | * | lf-araujo joined #nim |
12:08:51 | FromGitter | <alehander42> but i can see them in the tiled window |
12:08:57 | Araq | I can hear no sound |
12:09:08 | FromGitter | <alehander42> is there sound |
12:09:12 | narimiran | no sound here also |
12:09:19 | FromGitter | <alehander42> what is clippy wat |
12:09:27 | narimiran | that's kakoune editor |
12:09:32 | FromGitter | <alehander42> wow |
12:09:56 | clyybber | my mic is shite |
12:10:12 | narimiran | for me it is really nice to see all the different editors used in nim videos/streams |
12:10:33 | narimiran | from what i can recall, so far we had vs code, emacs, neovim, kakoune, kate |
12:10:36 | clyybber | I guess the sound is crap? |
12:10:45 | FromGitter | <alehander42> there is no sound |
12:10:49 | Araq | there is no sound and the font is unreadable |
12:11:00 | Araq | and if you're on Linux, use |
12:11:03 | Araq | -d:useMalloc |
12:11:07 | FromGitter | <alehander42> oh yeah |
12:11:10 | Araq | and run it through valgrind |
12:11:12 | clyybber | I do |
12:11:13 | narimiran | that's his IRC font. in his terminal, the font is okayish |
12:11:25 | narimiran | now there's a sound, but lots of static hissing/noise |
12:11:25 | FromGitter | <alehander42> good sound now |
12:11:36 | Araq | yay sound |
12:11:53 | FromGitter | <rokups> there is bit of static though |
12:11:55 | FromGitter | <alehander42> i think the sounds was ok |
12:11:58 | * | lritter joined #nim |
12:12:05 | narimiran | "sound test" heard loud and almost clear :) |
12:13:10 | * | jfoutaise quit (Ping timeout: 246 seconds) |
12:13:19 | FromGitter | <alehander42> no sound again |
12:14:13 | clyybber | ok nice |
12:14:17 | clyybber | sound should be back |
12:14:48 | narimiran | it is back now |
12:14:51 | clyybber | unfortunately my screen is 16:10 |
12:15:37 | narimiran | you lucky guy! |
12:15:49 | narimiran | if only there were more 16:10 monitor nowadays.... |
12:18:55 | FromGitter | <rokups> isnt 16:9/16:10 a standard nowdays? |
12:20:21 | narimiran | 16:9 is. although it looks like minor difference, 16:10 gives you some nice extra vertical space (e.g. 1920x1200 vs 1920x1080) |
12:22:04 | FromGitter | <rokups> 120 pixels.. i guess thats something |
12:29:47 | leorize | I'm using a 10px sized font, so that's > 10 extra lines of code on screen :) |
12:33:36 | * | hoijui quit (Ping timeout: 252 seconds) |
12:33:58 | Araq | bbl |
12:37:21 | clyybber | leorize: scientifica? |
12:37:26 | Calinou | on the other hand, 16:10 is worse for most games |
12:37:34 | clyybber | except for space engineers |
12:37:38 | Calinou | it's not *just* upsides :P |
12:37:53 | Calinou | people are quick to call 16:9 a downgrade, but it's a steep upgrade for most use cases, which is why it happened |
12:38:08 | Calinou | now, it probably means you should adjust your desktop layout if you still use two bars like in GNOME 2 :) |
12:38:38 | clyybber | no bars master race |
12:38:43 | * | ertp07 quit (Ping timeout: 250 seconds) |
12:39:00 | FromGitter | <rokups> i had ultra-wide monitor at one point. so much horizontal space, can fit so many windows, right? turns out im happier with something that has a standard resolution |
12:39:13 | Calinou | well, the issue with ultrawide is that many games don't support it :( |
12:39:33 | narimiran | i currently have 21:9, which is nice when you have only one monitor |
12:39:45 | narimiran | but i don't play games.... |
12:40:05 | FromGitter | <rokups> games ran fine. idk maybe there was one that i had to suffer black bars. but still... with many things i came to a conclusion that path of least resistence is using what most people are using |
12:40:33 | FromGitter | <rokups> same with spaces, light kde breeze theme, monitors and cmake... :D |
12:40:49 | Calinou | heh, I use Breeze Dark and it works pretty well overall |
12:41:02 | Calinou | the main issue are forms in Firefox on some websites |
12:41:53 | FromGitter | <rokups> see, this is exactly the thing why i said "fuck it" |
12:42:07 | FromGitter | <rokups> no point in spending energy fighting these issues.. |
12:42:53 | FromDiscord_ | <Samantac8cd> 💋 18+ Dirty Photos For Guys Only - https://nakedphotos.club/QYHhZv |
12:43:29 | Calinou | websites can fix it, so can userstyles |
12:43:47 | Calinou | (on the other hand, Chromium doesn't suffer this issue, last time I checked) |
12:43:54 | FromGitter | <rokups> nonono... this is so wrong. websites should not have to fix stuff for my PC |
12:44:05 | Calinou | Firefox is visibily not going to fix it, so websites will have to :P |
12:44:13 | Calinou | visibly* |
12:44:19 | narimiran | there is even nim issue about that :D |
12:46:02 | Calinou | there is also https://addons.mozilla.org/en-US/firefox/addon/fix-dark-theme-input-boxes/ |
12:46:43 | FromGitter | <rokups> tbh i have no idea why would a browser inherit styles from OS to begin with |
12:46:49 | FromGitter | <rokups> this is so wrong |
12:46:51 | Calinou | #JustFirefoxThings |
12:47:47 | FromDiscord_ | <Samantac8cd> 😍 18+ Dirty Photos For Guys Only 👉 https://privatepage.vip/QYHhZv |
12:48:57 | * | ertp07 joined #nim |
12:49:27 | FromGitter | <rokups> what if i want dirty photos for girls. what kind of sexist garbage is this |
12:52:42 | clyybber | Araq: Well, looks like that didn't fix it. |
12:52:49 | clyybber | Even if it *should* |
12:53:05 | clyybber | still 7 allocs, 9 frees; segfault |
12:57:33 | * | hoijui joined #nim |
13:00:08 | PMunch | Hmm, anyone knows who wrote pakku? |
13:02:07 | clyybber | the pacman wrapper? |
13:04:32 | leorize | clyybber: I use Iosevka |
13:05:43 | FromGitter | <rokups> pacman wrapper? btw i use archlinux :trollface: |
13:05:55 | leorize | firefox was designed to be a kind of "electron" iirc |
13:06:23 | FromGitter | <rokups> well it still is. all ff UI is written in html/js |
13:06:45 | leorize | they're moving away from that |
13:07:00 | leorize | firefox used to be an application on the mozilla platform |
13:07:05 | Calinou | I ran ./koch doc locally, what does this do? It seems to try uploading stuff via Travis CI |
13:07:07 | leorize | now the platform is firefox |
13:07:17 | Calinou | @rokups https://github.com/nim-lang/Nim/pull/11632 :P |
13:08:15 | leorize | add "-moz-appearance: none" to the box as well |
13:09:25 | leorize | that should get rid of any additional styling that firefox can apply |
13:10:55 | Calinou | there doesn't seem to be a visible difference here, but I'll do it to be sure |
13:11:27 | PMunch | clyybber, yes |
13:11:53 | PMunch | rokups, I use Arch as well |
13:25:38 | xace | PMunch: no but what did you have in mind in regards to pakku? I find it really lacking and annoying, but i still use it... |
13:26:42 | PMunch | I was just going to ask if it could put a bell character when it shows a prompt |
13:27:04 | PMunch | So many times I have a terminal in the background running some upgrade just for it to stop when it asks me a question which I don't notice |
13:27:34 | PMunch | But my terminals are set up to show up as important if they have a bell character in them (and I have a bell character in my PS1) |
13:28:41 | leorize | anyone here use musl libc exclusively? |
13:29:17 | xace | PMunch: I see... It feels like someone has written a hook somewhere else to deal with that sort of thing |
13:31:07 | xace | leorize: i reckon you could find such people over at suckless |
13:32:19 | clyybber | leorize: I tried to, but ultimately failed |
13:32:39 | leorize | I'm actually running gentoo/musl atm |
13:34:14 | leorize | for some reason the stdout here buffers until `\n`, which means if you emit any control character it would stay in the buffer until `\n` appears |
13:34:37 | leorize | which kinda broke most tui applications here (sans ncurses-based) |
13:35:00 | leorize | not sure if it's my terminal emulator (alacritty) or the libc :/ |
13:35:42 | clyybber | that sounds really bad |
13:35:47 | clyybber | I dont think its alacritty |
13:35:50 | clyybber | using it here |
13:35:55 | * | ertp07 quit (Ping timeout: 250 seconds) |
13:35:59 | clyybber | what tui doesnt work? |
13:36:19 | leorize | nimble init |
13:36:30 | leorize | stdout.write(': '); stdin.readLine |
13:36:42 | leorize | which will read the line before printing ": " to stdout |
13:37:50 | leorize | my "fix" for this is to insert stdout.flushFile before any input |
13:38:36 | leorize | but it's not really pleasant to patch every tui application out there that doesn't do so |
13:39:12 | leorize | esp when the devs probably can't reproduce it on their machines |
13:49:23 | clyybber | -g3 is a godsend for valgrind |
13:50:08 | * | lf-araujo_ joined #nim |
13:51:48 | * | lf-araujo quit (Quit: lf-araujo) |
13:51:49 | * | lf-araujo_ is now known as lf-araujo |
13:53:28 | FromDiscord_ | <Samantac8cd> 18+ Dirty Photos For Guys Only - https://nakedphotos.club/QYHhZv |
13:54:59 | solitudesf | musl nimble is broken here too |
13:56:07 | leorize | here's my fix: http://ix.io/1Nq0 |
13:56:13 | leorize | not sure if I should upstream this |
13:57:47 | solitudesf | is there some other cli that is broken for you? |
14:00:48 | leorize | any handwritten cli with the pattern of print("input: "); readline |
14:01:10 | * | ertp07 joined #nim |
14:01:15 | leorize | most of the cli apps I use are ncurses-based, and they seem to be fine with this |
14:05:33 | lf-araujo | I have the following object: https://i.imgur.com/QVo181H.png |
14:05:58 | lf-araujo | How do I make the first one date, be initialize as a date format? |
14:06:08 | lf-araujo | What is the proper date type on Nim? |
14:06:17 | leorize | times.DateTime |
14:06:22 | lf-araujo | amazing, thanks |
14:09:43 | lf-araujo | I know the format it is in, is it possible/recommended to initialize it with a format. Or this is something to do during the manipulation of the data? |
14:10:13 | disruptek | leorize: any tricks to gentoo/musl? i was trying to use it for a docker image in my nvlm->klee pipeline but i ran into some kind of build problem and decided it wasn't worth the effort. |
14:10:16 | FromGitter | <mratsim> you mean, choose how it's converted/printed to string? |
14:10:55 | disruptek | lf-araujo: yes, you can parse dates. see the docs. |
14:11:01 | * | nsf quit (Quit: WeeChat 2.4) |
14:11:15 | leorize | disruptek: when something broke, look for the same software in void linux or alpine linux |
14:11:23 | leorize | they'll probably have patches for those |
14:11:45 | leorize | also llvm 8 or higher is recommended with musl |
14:12:05 | disruptek | are you running it under a full wayland env? chrome? or...? |
14:12:21 | leorize | i3 + ff |
14:12:37 | leorize | and flatpak for electron apps / gog games |
14:12:40 | disruptek | kk, thanks, maybe i will try it again. |
14:26:49 | noonien | how do i turn off a specific warning? |
14:27:05 | noonien | for example Uninit, --warningUninit:off does not seem to work |
14:27:16 | leorize | `--warning[Uninit]:off` |
14:27:26 | noonien | well, actually, it says it's an invalid option |
14:27:27 | noonien | oh ok |
14:32:31 | * | PMunch quit (Remote host closed the connection) |
14:41:13 | * | ertp07 quit (Ping timeout: 258 seconds) |
14:41:51 | * | ertp07 joined #nim |
14:42:58 | leorize | noonien: you can annotate variables / procs with `{.used.}` pragma to suppress Uninit warnings |
14:43:56 | noonien | hmm, what? |
14:44:07 | noonien | does it? doesn't make much sense |
14:45:50 | leorize | oh, sorry, misread the warning :p |
14:46:37 | noonien | this is the code that produces the warning: http://ix.io/1NlG |
14:46:44 | noonien | compiled with --verbosity:3 |
14:47:17 | leorize | result.len might be better than sizeof |
14:48:18 | noonien | oh yeah, my bad |
14:48:40 | leorize | interesting, have you filed a bug? |
14:48:50 | leorize | bug report* |
14:49:01 | noonien | well, i asked here yesterday as well |
14:49:09 | noonien | because i'm unsure if its a bug |
14:49:50 | * | lf-araujo quit (Quit: lf-araujo) |
14:49:59 | * | lf-araujo joined #nim |
14:51:38 | noonien | i mean, perhaps i don't assign the entire array |
14:52:06 | noonien | would result have a zero value? or will it be uninitialized? |
14:55:42 | leorize | yea, result is initialized by default |
14:55:50 | leorize | unless you annotate the proc with `{.noinit.}` |
15:04:52 | noonien | hmmm |
15:05:05 | noonien | what does noinit do |
15:05:13 | noonien | does it just not memset to 0? |
15:05:43 | leorize | yea |
15:06:07 | noonien | ah, cool, so in this case, i can optimize using that |
15:06:31 | leorize | the compiler got some optimization on that and can infer {.noinit.} iirc |
15:06:37 | leorize | probably @mratsim can comment on that |
15:07:12 | noonien | i see, i wonder why i get that warning though |
15:07:26 | noonien | i'm guessint it makes sense when it's a reference type |
15:07:41 | FromGitter | <mratsim> yes noInit avoids memset, it can be applied to function (so the result is not zero init) or variables |
15:07:50 | noonien | but in the case of an array, which is not a reference type, i don't think i should be getting it, so it might actually be a bug |
15:08:21 | leorize | I'd say that a warning that doesn't pop up on lower optimization level is a bug already |
15:08:48 | FromGitter | <mratsim> the "not initialized" part of the compiler is still in flux iirc. Personally I don't really take it into account |
15:09:09 | FromGitter | <mratsim> but yeah for an array of byte it's a bug |
15:10:53 | * | purebadger quit (Ping timeout: 245 seconds) |
15:13:21 | noonien | hmm, in the case of `proc foo(): array[10, byte] =` and i set all elements of the array |
15:13:38 | noonien | is {.noinit.} superfluous? |
15:17:10 | Zevv | ah sorry, went to bed yesterday |
15:17:42 | Zevv | I feel it might be a bug: warnings should come out at normal verbosity level as well, so if it was a real warning, youd see it without --verbosity:3 |
15:18:08 | Zevv | the fact that you only see it when you *do* set verbosity makes me suspect something is fishy |
15:18:38 | Zevv | you properly set all the elements of the result array, so the warning itself is wrong as well |
15:19:53 | Zevv | or if I'm just wrong, it could be that nim thinks the result *might* be unintialized because it can not prove your code, but this warning is muted at normal verbosity because nim knows it is jus ta suggestion |
15:20:19 | Zevv | I guess araq should be able to answer this from the top of his head |
15:23:38 | * | UNIcodeX joined #nim |
15:24:44 | * | UNIcodeX quit (Remote host closed the connection) |
15:27:01 | * | UNIcodeX joined #nim |
15:27:44 | * | clyybber quit (Quit: WeeChat 2.5) |
15:39:28 | FromDiscord_ | <Queena26d> 👅 🥰 18+ Dirty Photos For Guys Only 👉 https://nakedphotos.club/QYHhZv |
15:39:45 | FromGitter | <rokups> wee made websockets work with jester+websockets.nim. in the process found out that that `{.async.}` totally messes up error reporting |
15:44:11 | * | lf-araujo quit (Ping timeout: 250 seconds) |
15:47:00 | FromDiscord_ | <djazz> Another discord spambot :/ |
15:47:22 | leorize | who is the moderator for Nim's discord anw? |
15:47:56 | FromDiscord_ | <djazz> @treeform is online |
15:55:58 | * | jxy quit (Quit: leaving) |
15:57:06 | * | jxy joined #nim |
16:06:21 | FromDiscord_ | <treeform> I don't know how I got moderator status, but I banned the spam bots. |
16:11:18 | * | ertp07 quit (Read error: Connection reset by peer) |
16:12:42 | * | ertp07 joined #nim |
16:38:11 | disruptek | https://github.com/nim-lang/Nim/issues/11592 -- is there a semantic difference between type instantiation when it is (or conversely, is not) assigned to a variable? |
16:41:21 | * | jfoutaise joined #nim |
16:42:04 | disruptek | or is it more like a validation that we are better able to perform in that case? or an optimization whereby we can omit that validation on the other hand? or...? |
16:46:03 | * | floppydh quit (Quit: WeeChat 2.5) |
16:47:35 | * | jfoutaise quit (Remote host closed the connection) |
16:53:13 | * | clyybber joined #nim |
16:53:40 | * | shadowbane joined #nim |
16:55:11 | clyybber | lightning rods are a godsend |
16:55:42 | clyybber | also fuses |
17:05:07 | * | purebadger joined #nim |
17:06:38 | FromDiscord_ | <djazz> ⛈ |
17:07:39 | Zevv | doc/destructors.rst \o/ |
17:08:18 | * | jfoutaise joined #nim |
17:22:34 | * | laaron quit (Remote host closed the connection) |
17:27:01 | noonien | hmm, i think i've discovered a sigsegv in the gc |
17:27:15 | noonien | but i'm not sure how to reproduce it |
17:27:26 | Zevv | wait, I'm looking something up for you |
17:27:57 | * | xace quit (Ping timeout: 245 seconds) |
17:28:09 | Zevv | https://github.com/nim-lang/Nim/wiki/Hunting-crashes:-The-ultimate-guide |
17:28:42 | noonien | awesome, thanks! will read, try some poitners and come back |
17:29:10 | Zevv | not in the list, but try to compile your code with a debugging version of the compiler, if you know how to make that |
17:29:26 | Zevv | doing ./koch temp in the nim top level directory will build that for you |
17:30:11 | noonien | i tried --verbosity:3, and am getting a lot of GcUnsafe warnings, however, i'm not sure how valid they are |
17:31:13 | noonien | most of the code is async, and i've written concurrent code for quite a while now, i'm not saying i don't have a bug, but i'm unsure how it would trigger a sigsegv showing a stacktrace in the gc |
17:34:42 | * | lf-araujo joined #nim |
17:34:44 | Zevv | the unsafe GC warnings have been bothering me since day 1 on Nim, and after getting it explained a dozen times, I still do *not* understand why I get these |
17:34:55 | * | Kaivo joined #nim |
17:35:06 | Zevv | apart from that, running with a debug compiler is probably the first thing to try |
17:35:59 | noonien | hmm, my test suite triggers the bug reliable on each run, but with -d:release, it doesn't seem to trigger |
17:36:14 | * | xace joined #nim |
17:36:22 | noonien | both refc and markAndSweep bug, boehm doesn't work, i'm missing libgc |
17:36:39 | noonien | going to try the other flags |
17:38:14 | Zevv | can you share your code? |
17:38:34 | noonien | sadly i can't |
17:38:42 | noonien | that's why i'm trying to reproduce |
17:40:49 | noonien | both --d:useSysAssert and --d:useGcAssert trigger assertions, if both are used, GCASSERT is triggered first |
17:41:08 | noonien | i can share the stack trace if that helps |
17:41:21 | noonien | hmm, it seems to have something to do with sharedtables |
17:41:27 | * | hoijui quit (Ping timeout: 264 seconds) |
17:41:32 | * | ertp07 quit (Ping timeout: 268 seconds) |
17:41:33 | noonien | i'm getting the assertion in a `withKey` |
17:43:10 | Zevv | I don't see an assertion in withKey? what file:line? |
17:43:27 | * | lf-araujo quit (Ping timeout: 252 seconds) |
17:43:53 | noonien | no, withKey is just part of the stack trace, just a second, i'll post both |
17:44:25 | * | nsf joined #nim |
17:46:59 | noonien | here are the stack traces: http://ix.io/1NqZ |
17:47:50 | noonien | i'm using 2019-06-29-devel-3606e03 |
17:48:47 | * | ertp07 joined #nim |
17:50:17 | * | lf-araujo joined #nim |
17:50:27 | noonien | s/goo/foo |
17:51:24 | noonien | thing is, i managed to not get the SIGSEGV by just doing some echos, whici makes me thing this will be kinda hard to repro |
17:55:57 | * | clyybber quit (Quit: WeeChat 2.5) |
17:57:07 | * | sz0 joined #nim |
17:57:52 | * | ertp07 quit (Ping timeout: 258 seconds) |
18:00:46 | * | ertp07 joined #nim |
18:01:51 | * | clyybber joined #nim |
18:02:28 | * | xace quit (Ping timeout: 246 seconds) |
18:03:11 | * | xace joined #nim |
18:03:19 | Zevv | are you using unsafe things or shallowCopy? |
18:03:44 | * | purebadger quit (Ping timeout: 268 seconds) |
18:03:53 | Zevv | s/or/like/ |
18:04:00 | noonien | yes, i am using shallowCopy |
18:04:47 | Zevv | I ran into that once - there's something with shallowCopy and consts |
18:04:50 | Zevv | let me see if I can find something |
18:05:06 | Zevv | https://github.com/nim-lang/Nim/issues/4053 |
18:05:15 | Zevv | with apologies from Araq :/ |
18:05:44 | Zevv | "Be careful with the changed semantics though! There is a reason why the default assignment does a deep copy of sequences and strings." |
18:06:17 | noonien | https://github.com/JeffersonLab/serializetools/blob/master/serializetools/serializebin.nim#L37 |
18:06:34 | noonien | hmm, should i just "copy(" instead? |
18:06:41 | Zevv | `=` ? |
18:07:02 | noonien | oh, i'm dumb |
18:07:08 | noonien | heh, will give that a try |
18:07:27 | * | ertp07 quit (Ping timeout: 258 seconds) |
18:07:38 | Zevv | no sure what the intention was there |
18:08:55 | noonien | that did not appear to have been the issue, i don't think it matters in case of integers, in this case anyway |
18:10:06 | * | ertp07 joined #nim |
18:10:28 | Zevv | :( |
18:11:31 | Zevv | hard to file an issue if you don't have a minimal reprocuing snippet |
18:12:49 | * | xace quit (Ping timeout: 248 seconds) |
18:13:07 | noonien | yeah :( |
18:13:21 | noonien | will compiling a debug version of the compiler provide me with more helpful info? |
18:14:58 | * | xace joined #nim |
18:15:04 | Zevv | it might - something might trigger an assertion that is not enabled in a release version |
18:15:20 | Zevv | if it is a bug in the compiler this will provide essential info |
18:15:29 | noonien | oh, i see, i'll give that a try |
18:16:11 | noonien | the good thing is the sigsegv seems to trigger at about the same time every time |
18:17:34 | noonien | damn, it happens with a specific value in the test, if i change the value, it never segfaults, i guess i got pretty lucky to get it during tests |
18:23:01 | narimiran | anybody wants to create nim version? http://www.nicolas-hahn.com/python/go/rust/programming/2019/07/01/program-in-python-go-rust/ |
18:24:13 | noonien | narimiran: why don't you do it? looks easy enough, good oportunity to learn |
18:25:43 | * | narimiran time to put my newly-acquired hat.... :P |
18:25:56 | narimiran | noonien: i don't really have much free time currently |
18:28:37 | narimiran | ...but maybe there's somebody else here who would like to take this learning opportunity |
18:30:17 | noonien | i think the benchmark game would be a better place for benchmarks |
18:30:42 | noonien | https://benchmarksgame-team.pages.debian.net/benchmarksgame/ |
18:30:54 | narimiran | they don't accept any new languages |
18:31:09 | * | purebadger joined #nim |
18:31:12 | * | tiorock joined #nim |
18:31:12 | * | tiorock quit (Changing host) |
18:31:12 | * | tiorock joined #nim |
18:31:13 | * | rockcavera quit (Killed (card.freenode.net (Nickname regained by services))) |
18:31:13 | * | tiorock is now known as rockcavera |
18:31:19 | narimiran | and those were already implemented in nim, just as some other benchmarks out there (e.g. kostya) |
18:34:59 | * | lf-araujo quit (Remote host closed the connection) |
18:37:53 | noonien | TIL |
18:39:25 | Zevv | noonien: you ok with building a debug compiler? |
18:39:48 | noonien | yes, i've got nixos, it's just a matter of removing -d:release from the build script |
18:40:16 | Zevv | Build it and save a copy, it might come in handy later |
18:40:26 | Zevv | you don't want to use it by default, as it is much slower |
18:40:38 | narimiran | why not just `koch temp`? |
18:40:44 | noonien | https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/nim/default.nix |
18:40:55 | Zevv | noonien: he's not building nim from source I believe |
18:41:08 | noonien | i already had an overlay for having a different version, i just needed to patch the buildPhase |
18:41:09 | noonien | i am |
18:41:15 | noonien | well, nix is building it for me |
18:41:17 | Zevv | why not just `koch temp`? :) |
18:41:25 | * | lmariscal joined #nim |
18:41:56 | noonien | well, i prefer to use nix to build/package stuff, this way i can switch back and forth, or make any changes/patches i need |
18:42:11 | noonien | withoug having to keep track of binaries, paths, and such |
18:42:18 | narimiran | this way you would have both `nim` (release build) and `nim_temp` (debug build) |
18:42:53 | narimiran | ...at the same time, without modifying the build script |
18:43:13 | * | purebadger quit (Ping timeout: 248 seconds) |
18:43:18 | Zevv | you know you're on r/programming narimiran? |
18:43:19 | noonien | i'm not comfortable enough with nim to be making changes to the compiler, so i don't pllan to compile often |
18:43:32 | Zevv | oh you submitted that yourself :) |
18:43:40 | narimiran | Zevv: yeah, some guy miran1 submitted it :P |
18:43:41 | * | lmariscal quit (Client Quit) |
18:44:47 | Zevv | ah traffic deaths - that's something different isn't it |
18:45:03 | Zevv | today a new law was activated here: 95 euros fine for driving a bike with a phone in your hand |
18:45:17 | * | lmariscal joined #nim |
18:46:35 | narimiran | why not the round €100? :) |
18:46:47 | narimiran | Zevv: but my best articles are in croatian :P |
18:47:04 | Zevv | because of the hot weather: they let you keep 5 euros to buy yourself an icecream |
18:47:24 | narimiran | you can have an icecream in your hand while on a bike? |
18:47:37 | Zevv | that's a pretty good question |
18:52:24 | Araq | Zevv: var x = 0 &* 10 # create an array with 10 elements |
18:53:07 | clyybber | Araq: Hey, the same test case is causing another segfault, this time somewhere else |
18:53:23 | clyybber | It's in the destructor of a seq[string] |
18:53:32 | Araq | yeah, I know you hate it. :P but it makes sense for provably complete initializations |
18:54:19 | Araq | clyybber: gist what your transformation produced |
18:54:21 | noonien | hmm, i'm not getting a call depth limit reached in a debug build, while doing a debug build of the latest nightly release |
18:54:44 | clyybber | Araq: It's the same transformation I streamed earlier |
18:54:49 | noonien | s/not/now |
18:55:13 | clyybber | The first invalid read happens in the string destructor which gets called from the seq[string] destructor |
18:55:25 | clyybber | This I found out with valgrind+gdb |
18:58:34 | Araq | excuse me that I don't remember the produced code in detail |
18:58:45 | * | lmariscal quit (Quit: I'm out!) |
18:59:03 | clyybber | Araq: I'll have a gist ready in a minute, didn't expect you to :D |
18:59:05 | * | lmariscal joined #nim |
18:59:31 | FromGitter | <Varriount> Zevv: Whatcha up to? |
19:00:37 | Zevv | euh not much really, why? |
19:01:26 | * | Trustable joined #nim |
19:02:25 | clyybber | Araq: https://gist.github.com/Clyybber/afed2c3201619d58f50af25ec4bedef6 |
19:04:25 | FromDiscord_ | <demotomohiro> It seems there is no explanation about block expression in Nim manual. That means block expression is not officially supported or could be removed in future? |
19:05:54 | FromDiscord_ | <demotomohiro> But there is a sample code that use block expression in Nim manual. |
19:06:19 | Zevv | What exactly do you mean with 'block expression'? |
19:07:45 | clyybber | Zevv: Probably "something = block: ..." |
19:07:49 | FromDiscord_ | <demotomohiro> const foo = block: "bar" |
19:08:02 | FromDiscord_ | <demotomohiro> Something like this |
19:08:43 | FromDiscord_ | <demotomohiro> last expression under the block is the value of block expression. |
19:11:16 | * | lmariscal quit (Quit: I'm out!) |
19:11:35 | Zevv | Varriount: you? |
19:11:41 | FromDiscord_ | <demotomohiro> Just someone forget to write about block expression or it is not recommended thing? |
19:11:50 | * | lmariscal joined #nim |
19:11:57 | Zevv | I've never seen it before :) |
19:12:32 | clyybber | demotomohiro: I've never heard about them being not recommended, so I guess its an oversight |
19:12:47 | Zevv | I only use it as a statement, never as an expression |
19:14:29 | * | purebadger joined #nim |
19:14:34 | Zevv | stdlib never seems to use it as an expression either |
19:15:09 | * | lmariscal quit (Client Quit) |
19:15:27 | * | lmariscal joined #nim |
19:20:18 | * | jjido joined #nim |
19:24:32 | * | natrys joined #nim |
19:27:03 | FromDiscord_ | <demotomohiro> I found template that declare new constant initialized with strformat can be written simply with block expression. |
19:27:03 | FromDiscord_ | <demotomohiro> https://wandbox.org/permlink/l2NM9SV0WCYCVOoj |
19:28:11 | FromGitter | <zacharycarter> how can I get this to compile? https://gist.github.com/zacharycarter/4acb7eb22c69774451325fb2a64452bb |
19:28:12 | * | purebadger quit (Read error: Connection reset by peer) |
19:28:57 | FromGitter | <zacharycarter> do I just need to use a generic instead? |
19:29:32 | FromGitter | <zacharycarter> well a generic works so I'll go with that |
19:29:37 | * | purebadger joined #nim |
19:30:36 | Araq | clyybber: here is my guess |
19:30:49 | Araq | add(s, |
19:30:49 | Araq | `=`(:tmpD142113, a) |
19:30:49 | Araq | :tmpD142113) |
19:31:18 | Araq | doesn't empty the 'tmp' afterwards so it's destroyed at scope exit |
19:31:42 | Araq | but it's already part of 's' so when s's destructor runs you get a double-free |
19:32:18 | noonien | `bin/nim cc -r tools/niminst/niminst --var:version=0.20.99 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini` seems to fail, here is the complete build log: http://ix.io/1NrC |
19:32:31 | noonien | the recursion error is at the end |
19:32:48 | * | thelounge30 joined #nim |
19:33:45 | Zevv | noonien: that's your bug with a debug compiler? |
19:34:02 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:34:13 | Zevv | so there's a loop in your AST |
19:34:24 | noonien | heh, not yet, this is me trying to compile the latest nightly with debug |
19:34:47 | Araq | noonien: I think 'niminst' doesn't work with a debug build of the compiler |
19:34:56 | Araq | I mean, for nobody. |
19:35:11 | Araq | it's been this way since quite some time, nobody fixed it |
19:35:20 | clyybber | Araq: Yeah, I can confirm that with a few printf's |
19:35:36 | clyybber | but I wasn't too familiar with how the strings work internally |
19:35:40 | noonien | i see, i'm unsure what calls niminst, or what it does |
19:35:45 | clyybber | s/wasn't/am not |
19:35:52 | * | jjido joined #nim |
19:36:08 | * | jjido quit (Client Quit) |
19:36:21 | Zevv | noonien: I guess building nim the nim way would be easier here |
19:36:25 | clyybber | Araq: So whats the fix? It doesn't seem obvious to me |
19:36:27 | Zevv | do the ./koch temp instaed |
19:37:07 | FromDiscord_ | <demotomohiro> @zacharycarter, you can declare bars as seq[Foo] type by casting new(Bar) to Foo. |
19:37:07 | FromDiscord_ | <demotomohiro> https://wandbox.org/permlink/DnYAIS2QYllUQqhz |
19:37:14 | Araq | clyybber: you miscompile the builtin system.add |
19:37:26 | Araq | it doesn't communicate the 'wasMoved' idea |
19:37:37 | Araq | probably a ccgexprs.nim bug |
19:37:49 | FromGitter | <zacharycarter> demotomohiro: thanks - that's a good suggestion |
19:38:07 | Zevv | demotomohiro: Yeah, but I guess he was looking for a way to do a conversion like seq[Foo](bars) instead |
19:39:48 | * | jjido joined #nim |
19:40:15 | * | LeonardoMariscal left #nim ("User left") |
19:42:29 | Araq | https://davmac.wordpress.com/c99-errata/ the C spec makes no sense, confirmed. |
19:42:48 | * | lmariscal quit (Changing host) |
19:42:48 | * | lmariscal joined #nim |
19:43:52 | * | ehmry quit (Quit: leaving) |
19:44:10 | FromGitter | <arnetheduck> I'd say the users:issues ratio of `C` is pretty decent |
19:44:25 | * | thelounge30 quit (Quit: The Lounge - https://thelounge.chat) |
19:44:57 | Araq | you can say the same for JavaScript |
19:45:15 | Araq | what you're really saying here is that "life is good when you got no competition" |
19:45:20 | * | hoijui joined #nim |
19:45:45 | FromGitter | <arnetheduck> survivor bias? |
19:47:15 | Zevv | both darwinian languages |
19:47:32 | * | hoijui quit (Remote host closed the connection) |
19:47:41 | clyybber | Araq: Sorry I can't follow, so we need wasMoved again? |
19:50:58 | * | lf-araujo joined #nim |
19:54:20 | solitudesf | narimiran, reimplemented the diffimg thing in nim https://github.com/SolitudeSF/diffimg, sadly its ~30% slower than rust one, and im using my own image library, so i have no none to blame. but at least entire implementation is under 50 lines |
19:55:13 | * | purebadger quit (Ping timeout: 248 seconds) |
19:57:06 | Araq | clyybber: nope, proc add[T](x: seq[T]; y: sink T) needs to call =move internally |
19:57:43 | * | nsf quit (Quit: WeeChat 2.4) |
19:58:06 | Araq | and the 'y' needs to be passed byref |
19:58:34 | * | PMunch joined #nim |
19:58:49 | Araq | there is no 'wasMoved' in the spec. and if the spec is correct there must not be a wasMoved in your implementation either |
19:59:27 | clyybber | alright, so I change the signature of add |
19:59:39 | clyybber | and that will make it pass byref automatically |
19:59:50 | clyybber | as sink parameters are passed like that in the new spec |
20:00:25 | Araq | the signature of 'add' is already correct |
20:00:33 | clyybber | but there is no sink? |
20:00:48 | Araq | proc add*[T](x: var seq[T]; value: sink T) {.magic: "AppendSeqElem", noSideEffect.} |
20:01:24 | clyybber | oh, I was looking at the string version, sry |
20:01:32 | * | ehmry joined #nim |
20:02:03 | Araq | and if the signature were missing the 'sink' your transformation wouldn't introduce the copy... |
20:02:24 | Araq | as the tranformation doesn't special case mAppendSeqElem |
20:03:19 | Araq | instead of add(s, (tmp = f(); tmp)) you need |
20:03:31 | Araq | add(s, (tmp = f(); addr(tmp)) |
20:04:06 | Zevv | solitudesf: you're counting image loading time or only the getDiffRatio? |
20:05:19 | solitudesf | im timing built binary. and actually when im not outputting the image, but only getDiffRatio, my program is more than twice faster |
20:07:16 | Zevv | I guess you might be able to speed it up if you allow your code to get vectorized |
20:08:20 | solitudesf | if i was above 100iq i might woudve known how to do this |
20:08:45 | noonien | does anyone run nim code in production? and, have you encountered any big issues with the language? |
20:09:57 | PMunch | Yes, and no |
20:10:14 | PMunch | Since it compiles to binaries you're mostly fine for stuff that you have deployed |
20:10:34 | dom96 | noonien, have you used the forum? It's written 100% in Nim :) |
20:10:46 | dom96 | Been running smoothly for years |
20:11:01 | noonien | awesome! |
20:12:43 | noonien | i'm not asking if nim is a good language, it is, it's why i'm using it. but i've had a few issues i had to report, and i'm not really using it for that long. perhaps i'm going into uncharter territory |
20:13:10 | solitudesf | ha, i removed the saving from my and rust version and my version is 3 times faster |
20:13:16 | solitudesf | so the bottleneck is in stb_image |
20:14:55 | Araq | noonien: threading and async are still quite rough, even after all these years... I think it's simply hard |
20:15:38 | noonien | hehe, yeah, i've mostly been writing async networking code, i've not done any threading just yet though |
20:16:24 | noonien | oh, cool, i managed to get the debug version up, and now i get a traceback with the gc sigsegv, but it doesn't appear to be helpful |
20:16:49 | * | Trustable quit (Remote host closed the connection) |
20:17:38 | noonien | hmm, this time i'm getting the SIGSEGV in decRef, i remember the failing assert was in incRef |
20:18:03 | dom96 | Araq, s/quite/a little/ |
20:18:16 | dom96 | I disagree in general though. Async is one of the most tested parts of Nim |
20:18:35 | FromGitter | <Varriount> Zevv: Writing Python code |
20:18:44 | Araq | you fixed a leak only recently, dom96 |
20:18:58 | Araq | that was in there for who-knows-how-long |
20:19:40 | dom96 | Yes, but we've known about /a/ leak for a long time |
20:19:52 | dom96 | I'm becoming more and more confident that this is /the/ leak |
20:20:07 | dom96 | Are there other issues that we're aware of that have been as big as the async leak(s)? |
20:20:13 | FromGitter | <mratsim> is that the new /leet/ speak? |
20:20:52 | dom96 | It's poor man's italics |
20:21:32 | Araq | there also was a codegen bug that introduced leaks |
20:22:04 | Araq | mostly affecting async code, of course |
20:23:05 | Araq | the SSL wrapper also gives me nightmares |
20:24:57 | Zevv | Varriount: at least you're writing code. I've been doing nothing but plumbing the last few months, except for my spare time projects |
20:25:04 | noonien | here are the traces with the debug build: http://ix.io/1Ns5 |
20:25:09 | noonien | no changes that i can see |
20:25:15 | noonien | perhaps this is the async leak? hehe |
20:26:09 | Zevv | noonien: dang, that's a tough one. I can't think of anything else for now. I've seen it with the shallowCopy once, and that's about it |
20:26:10 | dom96 | do you have smallish code that you can share reproducing this? |
20:27:15 | noonien | sadly, no, even changing some values makes the bug not trigger anymore |
20:27:18 | * | brakmic joined #nim |
20:27:28 | noonien | is there more logging i can enable? gc traces? |
20:27:30 | lf-araujo | What should I use to cast a string into float? |
20:27:38 | * | brakmic__ quit (Read error: Connection reset by peer) |
20:28:06 | Araq | incRef interiorPtr is already quite telling |
20:28:14 | Araq | do you use shallowCopy()? |
20:28:21 | Zevv | he does :) |
20:28:30 | noonien | not anymore, i've taken that out |
20:28:35 | Zevv | noonien: all of them? |
20:28:43 | noonien | as far as i can tell, yes |
20:28:47 | noonien | let me sift thought the dependencies as well |
20:29:24 | Zevv | put an echo() in system.nim shallowCopy() proc |
20:29:27 | Zevv | you'll see it happen |
20:29:36 | noonien | oh, cool, just a second |
20:30:32 | noonien | `proc shallowCopy*[T](x: var T, y: T) {.noSideEffect, magic: "ShallowCopy".}` |
20:30:35 | Araq | Zevv: I don't think that works |
20:30:37 | noonien | does this still work? |
20:30:44 | Zevv | oh :/ |
20:31:03 | Zevv | ah it's magic, right |
20:32:18 | noonien | i'll just rename the original, create a new one, echo and call the original |
20:33:48 | noonien | heh, echo is not defined, nor is stdin or os |
20:34:10 | noonien | not assert |
20:36:00 | * | a_b_m joined #nim |
20:36:56 | lf-araujo | I am trying to create a small proc for terminal interaction, a simple readline, but it should return a float: |
20:37:04 | lf-araujo | https://i.imgur.com/vx0p1Ha.png |
20:37:13 | lf-araujo | but code like: |
20:37:51 | lf-araujo | https://i.imgur.com/AQ1OkVw.png |
20:38:12 | narimiran | lf-araujo: use https://nim-lang.github.io/Nim/strutils.html#parseFloat%2Cstring |
20:38:40 | lf-araujo | https://i.imgur.com/XXfeAGr.png |
20:39:03 | lf-araujo | narimiran: excellent, thanks |
20:39:17 | dom96 | noonien, emit some C code :) |
20:39:34 | * | PMunch quit (Remote host closed the connection) |
20:40:14 | * | abm quit (Ping timeout: 272 seconds) |
20:40:26 | noonien | hmm, it looks like shadow is indeed called |
20:40:32 | noonien | shallowCopy* |
20:40:42 | noonien | is there an easy way of printing stacktraces? |
20:43:11 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:45:39 | lqdev[m] | writeStackTrace() |
20:46:37 | noonien | yeah, i tried that, adding it in a function at the end of lib/system.nim, it's undeclared :( |
20:46:43 | noonien | even though i can find it in the file |
20:47:26 | lqdev[m] | strange |
20:47:41 | lqdev[m] | is nimpretty usable at this point in time? |
20:49:44 | * | narimiran quit (Ping timeout: 272 seconds) |
20:50:35 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:52:54 | lf-araujo | What is wrong with error handling in the excerpt: |
20:53:02 | lf-araujo | https://i.imgur.com/PbJQkCh.png |
20:53:25 | lf-araujo | It is giving me: Error: ':' or '=' expected, but got 'echo' |
20:53:42 | solitudesf | you declare return variable and dont specify the type |
20:53:52 | solitudesf | also you dont have to declare it explicitly, nim has implicit return variable |
20:55:01 | lf-araujo | solitudesf: thank you |
20:55:11 | solitudesf | *result variable |
20:56:18 | lqdev[m] | uh seems that nimsuggest didn't add nimpretty to my path |
20:56:33 | lqdev[m] | choosenim* |
20:56:33 | lqdev[m] | not nimsuggest |
21:00:05 | Araq | lqdev[m]: definitely usable. afaict. |
21:09:51 | noonien | hmm, is writeStackTrace magic? |
21:10:06 | noonien | i can't seem to find how stack traces are generated |
21:11:24 | * | Vladar quit (Remote host closed the connection) |
21:14:25 | * | stefanos82_ joined #nim |
21:15:31 | * | stefanos82_ quit (Client Quit) |
21:15:55 | * | stefanos82_ joined #nim |
21:16:01 | * | stefanos82_ quit (Remote host closed the connection) |
21:16:18 | * | stefanos82 quit (Ping timeout: 245 seconds) |
21:22:22 | noonien | is `raise` completely in the compiler? |
21:23:27 | Araq | no, but I doubt knowing about system/excpt.nim helps you much |
21:25:54 | noonien | ah, auxWriteStackTrace seems to get the stacktrace, cool |
21:29:37 | noonien | i'm still trying to determine where shallowCopy is being called, outside the stdlib, so i can make sure it's not me |
21:31:49 | * | solitudesf quit (Ping timeout: 244 seconds) |
21:38:20 | Zevv | quite the hunt |
21:39:14 | noonien | it's turtles all the way down |
21:44:09 | noonien | hah, lib/nintendoswitch |
21:44:16 | lqdev[m] | I'm so pedantic I don't even need nimpretty lol. just tried it on a few files and there aren't any differences |
21:45:20 | * | brakmic quit () |
21:45:41 | clyybber | Araq: Currently extracting a test case to see why 'y' isnt getting moved in add(x: var seq[T], y: sink T); but now getting =destroy operator not found for int |
21:48:57 | Araq | well |
21:49:04 | Araq | int has no =destroy |
21:49:58 | clyybber | yeah, is there some helper function in the compiler so I can make genDestroy skip those? |
21:50:10 | clyybber | those primitives? |
21:50:41 | Araq | just check if t.destroy.isNil |
21:50:53 | clyybber | thanks :) |
21:59:41 | noonien | can i disable catching SIGSEGV? |
21:59:59 | Araq | -d:noSignalHandler |
22:03:24 | * | dwdv quit (Quit: quit) |
22:04:57 | FromGitter | <juancarlospaco> `nim-0.20.0/lib/pure/strtabs.nim(301, 45) Error: undeclared identifier: 'getEnv'` blocks importing several modules into NimScript, but `getEnv` does exist on NimScript, same error for lots of modules on NimScript mode, I dunno maybe a workaround is possible. :) /cc @kaushalmodi |
22:07:07 | * | a_b_m quit (Read error: Connection reset by peer) |
22:11:04 | * | abm joined #nim |
22:13:55 | clyybber | gn8 |
22:13:58 | * | clyybber quit (Quit: WeeChat 2.5) |
22:23:52 | * | lf-araujo quit (Remote host closed the connection) |
22:24:10 | * | lf-araujo joined #nim |
22:34:15 | * | ertp07 quit (Ping timeout: 258 seconds) |
22:45:33 | * | lf-araujo quit (Remote host closed the connection) |
22:45:50 | * | lf-araujo joined #nim |
22:48:47 | * | natrys quit (Quit: natrys) |
22:53:05 | noonien | i've put my program into gdb, put a breakpoint on all shallowCopy calls, and let the program run until sigsegv |
22:53:28 | noonien | shallowCopy doesn't seem to be called directly nowhere outside the stdlib |
22:55:04 | noonien | interestigly, it mostly seems to happen when doing `await`, `asyncCheck`, an array slicing, and a StringStream.write(byte(something)) |
22:55:52 | noonien | i'll try to check if the awaits are just there because they're just in the stacktrace, because they eventually end up doing StringStream.write |
23:09:36 | * | krux02_ joined #nim |
23:12:39 | * | krux02 quit (Ping timeout: 264 seconds) |
23:19:44 | * | lf-araujo quit (Remote host closed the connection) |