00:14:12 | * | azed joined #nim |
00:20:04 | * | krux02 quit (Remote host closed the connection) |
00:24:50 | * | azed quit (Quit: WeeChat 2.7) |
00:25:54 | * | my_dude quit (Quit: ZZZzzz…) |
00:38:02 | FromDiscord_ | <Simula> is there a reason that nobody overloads `new` as a constructor for their ref objects? |
00:39:08 | FromDiscord_ | <Simula> like, `proc new(t: typedesc[MyRefObject]) = something` |
00:41:00 | FromGitter | <kristianmandrup> Finally got Nim to generate Javascript with ES modules import working :) |
00:42:37 | FromDiscord_ | <slymilano> noice! |
00:44:56 | FromDiscord_ | <exelotl> @Simula huh that's quite a nice idiom |
00:45:28 | FromDiscord_ | <Simula> yeah i used to use it, but i stopped because nobody else used it and i was worried there was a really good reason not to |
00:45:40 | FromDiscord_ | <Simula> but the more i look into it, the less reason i see not to use it :P |
00:46:23 | * | dwdv quit (Quit: quit) |
00:47:23 | FromDiscord_ | <exelotl> like this? https://play.nim-lang.org/#ix=2cx2 |
00:48:12 | FromDiscord_ | <Simula> yeah, exactly! |
00:57:15 | FromDiscord_ | <exelotl> I had a look and the generated C code is identical to if you'd done newFoo() |
00:57:50 | * | hax-scramper quit (Remote host closed the connection) |
00:58:23 | * | hax-scramper joined #nim |
00:59:27 | FromGitter | <deech> Does nimble support a "dry-run"? I would like to see the sequence of `nim` commands that nimble will run for a given task. |
00:59:28 | FromDiscord_ | <exelotl> maybe it's not done because passing a typedesc argument solely for the purpose of overloading disambiguation feels like a bit of a hack and isn't very beginner friendly |
01:04:33 | * | filcuc quit (Ping timeout: 272 seconds) |
01:19:24 | * | freddy92 quit (Quit: Client Disconnecting) |
01:19:54 | FromDiscord_ | <exelotl> @Simula https://play.nim-lang.org/#ix=2cxe |
01:20:06 | FromDiscord_ | <exelotl> made a cheeky macro |
01:20:56 | FromDiscord_ | <Simula> it never ceases to amaze me what you can do with macros |
01:22:12 | FromDiscord_ | <exelotl> yeah they're pretty special x) |
01:22:53 | FromDiscord_ | <exelotl> not sure if this is the best way to implement such a feature but I'm pretty happy with it as a 20 minute proof of concept |
01:23:52 | FromDiscord_ | <exelotl> like maybe something that takes an `init` and generates a corresponding `new` would be more appropriate instead |
01:38:11 | FromDiscord_ | <Simula> i wish there were a book out there that taught how to think in terms of macros |
01:57:34 | FromDiscord_ | <exelotl> Nim in Action did it for me :) |
02:05:48 | * | Hideki_ joined #nim |
02:10:11 | * | Hideki_ quit (Ping timeout: 260 seconds) |
02:11:41 | * | chemist69 quit (Ping timeout: 272 seconds) |
02:13:19 | * | chemist69 joined #nim |
02:16:43 | * | dadada quit (Ping timeout: 260 seconds) |
02:17:52 | * | oprypin quit (Remote host closed the connection) |
02:18:59 | * | oprypin joined #nim |
02:21:09 | * | dadada joined #nim |
02:21:34 | * | dadada is now known as Guest7113 |
02:25:59 | * | Guest7113 quit (Ping timeout: 265 seconds) |
02:36:07 | * | dadada_ joined #nim |
02:45:26 | * | moduledge joined #nim |
02:48:49 | disruptek | nimble won't install nimph because... Missing directory /home/travis/build/disruptek/nimph/src/docs. Continue? [y/N] |
02:49:14 | disruptek | i dunno what this means... should my docs directory be inside the src? |
02:49:30 | disruptek | my tests are failing as a result. |
02:49:38 | * | dadada_ quit (Ping timeout: 240 seconds) |
02:51:14 | * | dadada_ joined #nim |
03:05:15 | * | dadada_ quit (Ping timeout: 260 seconds) |
03:06:10 | * | dadada joined #nim |
03:06:35 | * | dadada is now known as Guest56533 |
03:06:45 | disruptek | what should we change about the stream, leorize? |
03:09:08 | leorize | have you fixed the mic issue? |
03:09:23 | leorize | I got my twitch account working now :) |
03:09:32 | disruptek | ah, nice. |
03:09:36 | disruptek | what's the mic issue? |
03:10:14 | * | my_dude joined #nim |
03:11:30 | leorize | only got sound on left ear? |
03:11:51 | disruptek | that was fixed /before/ the last stream, afaik. |
03:12:21 | leorize | then I guess it's fine |
03:12:57 | disruptek | how is the font size? |
03:13:09 | leorize | should be ok now |
03:13:33 | disruptek | it would suck if i couldn't do 2-up 80-col. |
03:14:58 | leorize | I thought you have a 4k screen? |
03:15:25 | disruptek | i do. i can make the font a lot smaller, but that doesn't buy you anything, right? |
03:15:45 | * | my_dude quit (Quit: ZZZzzz…) |
03:15:54 | leorize | well I guess there are compromises to be made when you stream |
03:16:05 | disruptek | no; this is how i code. |
03:16:48 | disruptek | i still don't understand why i can't consume more cpu to get a higher framerate, though. |
03:18:47 | leorize | do you have a decent gpu? |
03:18:55 | leorize | then you can just use that thing encoder |
03:19:06 | disruptek | i'm probably not using nvenc because i'm on nouveau. |
03:19:20 | leorize | get amd :) |
03:19:40 | disruptek | next time, probably. |
03:19:48 | * | Guest56533 quit (Ping timeout: 258 seconds) |
03:19:49 | leorize | you can't get intel quicksync on linux so... you're out of options, really |
03:20:20 | * | my_dude joined #nim |
03:21:07 | * | dadada_ joined #nim |
03:21:30 | disruptek | i swore i would never buy amd again after their driver experiences from the old days. |
03:21:43 | disruptek | now, nvidia drivers in linux are forcing me the other way. |
03:22:09 | leorize | if you don't do windows then amd is quite decent |
03:22:26 | leorize | otherwise I heard that their windows driver is also terrible |
03:23:15 | * | muffindrake quit (Ping timeout: 272 seconds) |
03:23:22 | disruptek | yeah, that's the problem. |
03:23:42 | leorize | well I don't have any problem, though I'm using last-gen hardware |
03:23:46 | disruptek | i've only been on linux for a year. i was on mac for about 10 years before then. |
03:23:59 | disruptek | what's last-gen? |
03:24:11 | leorize | rx580 |
03:25:21 | * | muffindrake joined #nim |
03:25:22 | disruptek | i just can't believe my cpu can't muscle a few more frames. |
03:25:42 | disruptek | i mean, shit.. 8fps at 2% utilization and you're telling me i can't add a few more? |
03:26:48 | leorize | search for a guide online I guess |
03:27:14 | disruptek | yeah, i need an 11-year-old kid. |
03:35:04 | * | dadada_ quit (Ping timeout: 255 seconds) |
03:41:01 | * | dadada_ joined #nim |
03:48:06 | * | ptdel quit (Ping timeout: 240 seconds) |
03:49:42 | * | dadada_ quit (Ping timeout: 258 seconds) |
03:51:09 | * | dadada_ joined #nim |
04:05:04 | * | dadada_ quit (Ping timeout: 265 seconds) |
04:06:08 | * | dadada joined #nim |
04:06:33 | * | dadada is now known as Guest74340 |
04:10:45 | * | my_dude quit (Ping timeout: 272 seconds) |
04:19:55 | * | Guest74340 quit (Ping timeout: 260 seconds) |
04:21:06 | * | dadada_ joined #nim |
04:26:26 | * | nsf joined #nim |
04:34:56 | * | dadada_ quit (Ping timeout: 258 seconds) |
04:36:14 | * | dadada_ joined #nim |
04:41:42 | * | Tanger quit (Remote host closed the connection) |
04:48:11 | * | Tanger joined #nim |
04:50:15 | * | dadada_ quit (Ping timeout: 260 seconds) |
04:51:07 | * | dadada_ joined #nim |
05:05:04 | * | dadada_ quit (Ping timeout: 255 seconds) |
05:06:10 | * | dadada joined #nim |
05:06:35 | * | dadada is now known as Guest85106 |
05:19:47 | * | Guest85106 quit (Ping timeout: 258 seconds) |
05:21:12 | * | dadada_ joined #nim |
05:35:00 | * | dadada_ quit (Ping timeout: 272 seconds) |
05:36:11 | * | dadada_ joined #nim |
05:48:40 | moduledge | Hey folks, I need some advice on a project I'm trying, in order to relearn Nim again. I'm wondering what's the best way for Nim to access the acpi features of a Linux system? I'm trying to write a very simple cli app that suspends my monitors as a good warm up exercise and as a tinker toy to mess around with. :) |
05:49:01 | * | NimBot joined #nim |
05:50:04 | * | dadada_ quit (Ping timeout: 258 seconds) |
05:51:09 | * | dadada_ joined #nim |
05:51:43 | FromDiscord_ | <Elegant Beef> easiest way would probably to use the os/osproc and exec it |
05:57:32 | moduledge | Well, for me it's gotta be a bit more challenging than that. I want to be able to get under the hood and use Linux syscalls or whatever to implement an xset like tool, as an example :) |
06:05:00 | * | dadada_ quit (Ping timeout: 252 seconds) |
06:06:05 | * | dadada joined #nim |
06:06:30 | * | dadada is now known as Guest54229 |
06:07:32 | * | Hideki_ joined #nim |
06:09:38 | * | dddddd quit (Ping timeout: 240 seconds) |
06:11:38 | * | Hideki_ quit (Ping timeout: 240 seconds) |
06:16:46 | leorize | moduledge: it's all in /sys |
06:17:30 | leorize | the linux kernel userspace interface is mostly rooted in special file systems rather than syscalls like most other OS |
06:18:04 | leorize | there's also /proc/acpi |
06:19:16 | leorize | for suspending your monitor, it'd be more of communicating with your X server or wayland compositor than tackling the device directly |
06:20:02 | * | Guest54229 quit (Ping timeout: 240 seconds) |
06:21:09 | moduledge | Gotcha. I also see why Elegant Beef suggested using processes earlier. Thank you both. |
06:21:11 | * | dadada_ joined #nim |
06:25:22 | * | Hideki_ joined #nim |
06:27:11 | moduledge | leorize: quick question, for communicating with the Xserver, could I use the net module? |
06:28:57 | leorize | it does support unix sockets, so yes |
06:29:01 | leorize | g'luck though |
06:29:23 | leorize | everyone do it via X libraries nowadays |
06:29:39 | moduledge | oh yeah, xlib and xcb exist... I'm dumb |
06:30:13 | moduledge | Thanks again. I got a project now :) |
06:30:26 | leorize | you're welcome :) |
06:31:28 | * | hax-scramper quit (Ping timeout: 255 seconds) |
06:34:32 | * | narimiran joined #nim |
06:35:18 | * | dadada_ quit (Ping timeout: 258 seconds) |
06:36:14 | * | dadada_ joined #nim |
06:45:26 | narimiran | the results of nim survey were posted on HN: https://news.ycombinator.com/item?id=22399416 - feel free to share your experiences there and/or answer some of the comments |
06:47:42 | * | hax-scramper joined #nim |
06:50:11 | * | dadada_ quit (Ping timeout: 260 seconds) |
06:51:14 | * | dadada_ joined #nim |
06:58:07 | leorize | disruptek: so I cave in and decided to switch to the bundled nim installation approach (same as the windows version), and nimph is finally building without any patches whatsoever |
07:01:52 | * | LER0ever quit (Remote host closed the connection) |
07:05:07 | * | dadada_ quit (Ping timeout: 260 seconds) |
07:06:07 | * | dadada joined #nim |
07:06:10 | * | LER0ever joined #nim |
07:06:32 | * | dadada is now known as Guest88100 |
07:08:24 | leorize | disruptek: I can't even have jester as a dep with nimph |
07:09:09 | leorize | so yea, that's gonna be my deal breaker in adopting nimph |
07:12:40 | FromDiscord_ | <Rika> The blackrock dude has an interesting point |
07:13:40 | livcd | Which one? |
07:13:43 | leorize | we have a bunch of libraries for this |
07:13:46 | leorize | !repo cligen |
07:13:47 | disbot | https://github.com/c-blake/cligen -- 9cligen: 11Nim library to infer/generate command-line-interfaces 15 157⭐ 11🍴 7& 1 more... |
07:13:54 | leorize | !repo argparse |
07:13:54 | * | Hideki_ quit (Remote host closed the connection) |
07:13:55 | disbot | https://github.com/iffy/nim-argparse -- 9nim-argparse: 11Argument parsing for Nim 15 31⭐ 3🍴 7& 1 more... |
07:14:15 | leorize | I found them to have fairly decent user experience |
07:14:38 | * | Hideki_ joined #nim |
07:16:20 | FromDiscord_ | <Rika> I mean the compile to c one I think |
07:17:19 | leorize | I still don't see why compiling to C is a problem... |
07:17:23 | FromDiscord_ | <Rika> Though I like the idea of "why not both" rather than "let's just use asm and extend to c" |
07:17:34 | FromDiscord_ | <Rika> Hmm |
07:17:39 | leorize | asm is hell to produce |
07:17:42 | FromDiscord_ | <Rika> Now that you mentioned it |
07:17:55 | FromDiscord_ | <Rika> No clue what asm production would change vs c production |
07:18:18 | leorize | the only problem we have with C is that we can't encode custom debugging data |
07:18:32 | leorize | that's the gap where llvm can fill in |
07:18:50 | FromDiscord_ | <Rika> Custom debug data for stuff like gdb or so? |
07:18:55 | leorize | yea |
07:19:07 | * | Hideki_ quit (Ping timeout: 260 seconds) |
07:19:49 | * | neceve joined #nim |
07:19:52 | leorize | language wise, producing C or asm or llvm or whatever doesn't make any difference |
07:20:07 | * | Guest88100 quit (Ping timeout: 272 seconds) |
07:20:49 | leorize | I can never understand the "it generates C so it has all the evil in C" |
07:21:08 | * | dadada_ joined #nim |
07:22:00 | FromDiscord_ | <Rika> How would I debug a program that shows a "stopped responding" on control c but not on exception |
07:22:28 | FromDiscord_ | <Elegant Beef> transpiling scares people, atleast from the people i've talked to, they'd prefer it to go straight to asm |
07:22:36 | leorize | @Rika: your debugger would be able to attach to and stop the program, no? |
07:23:09 | FromDiscord_ | <Rika> ~~I'm not using one, got used to not using one from python~~ |
07:23:13 | FromDiscord_ | <Rika> I'll use one then |
07:23:50 | leorize | nim-gdb is a nice plugin for gdb, included with your nim distribution :) |
07:24:05 | Tanger | ipdb from python sure does spoil you, haha |
07:24:08 | FromDiscord_ | <Rika> It's windows though |
07:24:22 | leorize | who said you can't have gdb on windows :) |
07:24:24 | FromDiscord_ | <Rika> I don't know if there's gdb |
07:24:45 | FromDiscord_ | <Rika> Mm, mingw has one |
07:25:01 | leorize | there's even a video tutorial for using gdb with vscode on windows for debugging Nim |
07:25:34 | leorize | @Elegant Beef: tell them that it compiles to LLVM IR if you pass the right flags :) |
07:25:58 | leorize | and that it does so by default on osx :p |
07:26:38 | FromDiscord_ | <Elegant Beef> yea but who develops on mac |
07:26:46 | * | Hideki_ joined #nim |
07:26:55 | leorize | 4raq, dom |
07:27:24 | FromDiscord_ | <Elegant Beef> jokes |
07:28:03 | * | Hideki_ quit (Remote host closed the connection) |
07:28:39 | FromDiscord_ | <Elegant Beef> Yea i was joking, but yea my big thing is i dont do development outside of a game engine pretty much ever, so i lack a compelling usage |
07:28:47 | * | Hideki_ joined #nim |
07:29:00 | leorize | use it for everything :D |
07:29:28 | FromDiscord_ | <Elegant Beef> Well I plan on using it for everything outside of unity |
07:29:38 | FromDiscord_ | <Elegant Beef> but i dont do development outside of unity much |
07:31:31 | FromDiscord_ | <Elegant Beef> so unless someone gets a nim to C# converter, I wont use nim much 😄 |
07:31:44 | * | Hideki_ quit (Remote host closed the connection) |
07:31:45 | leorize | I'm pretty sure unity can do js |
07:31:51 | FromDiscord_ | <Elegant Beef> nope |
07:32:01 | * | Hideki_ joined #nim |
07:32:13 | FromDiscord_ | <Elegant Beef> Not anymore, it's been unsupported for a while now |
07:32:19 | FromDiscord_ | <Elegant Beef> Think it finally got removed |
07:32:28 | leorize | sad then :p |
07:32:28 | FromDiscord_ | <Elegant Beef> It also wasnt pure js it was a custom version |
07:32:57 | FromDiscord_ | <Elegant Beef> like it had strong type in it so it'd be `var type : name` iirc |
07:33:16 | * | Hideki_ quit (Remote host closed the connection) |
07:34:17 | * | Hideki_ joined #nim |
07:34:55 | * | dadada_ quit (Ping timeout: 255 seconds) |
07:36:12 | * | dadada_ joined #nim |
07:36:15 | FromDiscord_ | <Rika> LMAO |
07:37:00 | * | Hideki_ quit (Remote host closed the connection) |
07:37:15 | * | Hideki_ joined #nim |
07:40:43 | FromDiscord_ | <Rika> Is it easy to debug async with nimgdb and gdb |
07:40:54 | leorize | it's never easy to debug async, sadly |
07:46:27 | FromDiscord_ | <Rika> *screams* |
07:46:58 | FromDiscord_ | <Elegant Beef> just dont async |
07:46:59 | FromDiscord_ | <Elegant Beef> Duh |
07:47:51 | * | marmotini_ joined #nim |
07:50:18 | * | dadada_ quit (Ping timeout: 265 seconds) |
07:51:11 | * | dadada_ joined #nim |
07:53:39 | * | dadada_ quit (Read error: Connection reset by peer) |
07:54:49 | FromGitter | <alehander92> hmm |
07:54:59 | FromGitter | <alehander92> do you want async next/step ? rika |
07:56:10 | * | dadada joined #nim |
07:56:35 | * | dadada is now known as Guest30196 |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:00:46 | * | azed joined #nim |
08:04:57 | * | gmpreussner joined #nim |
08:05:00 | * | Guest30196 quit (Ping timeout: 258 seconds) |
08:06:15 | * | dadada_ joined #nim |
08:10:23 | * | LER0ever quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:10:56 | * | LER0ever joined #nim |
08:13:23 | * | azed quit (Quit: WeeChat 2.7) |
08:16:15 | * | Hideki_ quit (Remote host closed the connection) |
08:17:05 | * | Hideki_ joined #nim |
08:19:22 | Zevv | oi, Nim on HN frontpage again \o/ |
08:19:38 | * | dadada_ quit (Ping timeout: 240 seconds) |
08:21:13 | * | dadada_ joined #nim |
08:21:22 | * | letto joined #nim |
08:21:24 | * | Hideki_ quit (Ping timeout: 252 seconds) |
08:22:40 | vegai | kinda seminegative :/ |
08:22:49 | * | letto_ quit (Ping timeout: 272 seconds) |
08:29:30 | FromDiscord_ | <Rika> Alehander92 i just wanna know what the hell is causing my program to hang on Ctrl c |
08:31:09 | FromGitter | <alehander92> well, you can still run it under a debugger : if it blocks/hangs it shouldn't be hard to see where maybe |
08:33:09 | FromDiscord_ | <Rika> Hang as in the "program has stopped responding" kinda hang |
08:33:16 | FromGitter | <alehander92> if you use linux, you can record your run under https://github.com/mozilla/rr/ and rerun it with gdb interface which might make it easier to catch ctrl+c kind of stuff |
08:33:47 | FromGitter | <alehander92> well, exactly: sometimes that means it's looping somewhere/waiting for something else idle-y |
08:34:46 | * | dadada_ quit (Ping timeout: 240 seconds) |
08:36:07 | * | dadada_ joined #nim |
08:36:22 | FromDiscord_ | <Rika> It's on windows |
08:41:31 | * | solitudesf joined #nim |
08:46:24 | * | hax-scramper quit (Ping timeout: 258 seconds) |
08:47:00 | * | hax-scramper joined #nim |
08:50:04 | * | dadada_ quit (Ping timeout: 255 seconds) |
08:50:15 | * | clemens3 joined #nim |
08:51:08 | * | dadada_ joined #nim |
08:55:43 | clemens3 | nim seems to not rely on a nim compiler, unlike go and crystal.. so i am giving it a try!! wish me luck:) |
08:56:13 | FromDiscord_ | <Rika> clemens3, what do you mean? |
08:56:18 | clemens3 | .. or rust.. |
08:56:57 | clemens3 | maybe i am wrong.. but the first thing the crystal home page tells you, if you want to compile that language yourself, you need a binary crystal compiler |
08:57:06 | clemens3 | rustc btw the same.. |
08:57:08 | FromDiscord_ | <Rika> huh? nim uses a compiler |
08:57:20 | clemens3 | FromDiscord_: gcc or nim? |
08:57:21 | * | Hideki_ joined #nim |
08:57:35 | FromDiscord_ | <Rika> nim compiles to c then uses gcc to compile that to a binary |
08:57:51 | clemens3 | i mean to compile the nim compiler itself? |
08:58:01 | FromDiscord_ | <Rika> ah |
08:58:04 | clemens3 | I want to try out nim and first compile nim from source.. |
08:58:04 | FromDiscord_ | <Rika> koch |
08:58:09 | FromDiscord_ | <Rika> dunno what that uses though |
08:58:20 | clemens3 | so far my assumption is gcc.. |
08:58:21 | FromDiscord_ | <Rika> but afaik it doesnt depend on itself? |
08:58:33 | * | LER0ever quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:58:38 | clemens3 | yes, which is a big plus!!! |
08:58:53 | clemens3 | even java now needs a preinstalled java.. |
08:58:57 | FromDiscord_ | <Elegant Beef> doesnt choosenim compile from source? |
08:59:08 | FromDiscord_ | <Rika> it does for linux |
08:59:09 | clemens3 | earlier java versions not |
08:59:12 | FromDiscord_ | <Rika> not windows i dont think so |
08:59:14 | FromDiscord_ | <Elegant Beef> ah |
08:59:23 | clemens3 | ah, windows doesnt count |
08:59:29 | FromDiscord_ | <Elegant Beef> I recall seeing C stuff so i assumed it did |
08:59:31 | FromDiscord_ | <Rika> haha, of course not |
09:05:03 | * | dadada_ quit (Ping timeout: 260 seconds) |
09:06:12 | * | dadada joined #nim |
09:06:36 | * | dadada is now known as Guest41247 |
09:15:09 | * | Hideki_ quit (Ping timeout: 258 seconds) |
09:17:46 | FromGitter | <Varriount> Nim was first bootstrapped using Pascal |
09:18:46 | FromGitter | <Varriount> Now, technically, you could have the compiler run on Node (if enough low-level stuff was fixed) |
09:19:46 | * | Guest41247 quit (Ping timeout: 255 seconds) |
09:21:12 | * | dadada_ joined #nim |
09:21:16 | FromGitter | <alehander92> clemens3 yes i think you should be able to use only gcc |
09:21:24 | FromGitter | <alehander92> if you build a version from csources |
09:21:53 | FromGitter | <alehander92> but for non-prebuild c sources generally you need a nim compiler |
09:22:17 | FromGitter | <alehander92> but i still think its easier than llvm |
09:22:37 | FromGitter | <alehander92> on the other hand llvm has other +es , so its a trade-off as usual probably |
09:27:16 | * | floppydh joined #nim |
09:36:03 | * | zahary joined #nim |
09:38:02 | FromGitter | <alehander92> i want to defend a bit the nilable types from the survey, i think "nilability compile time checking" is a better name, as its an important class of bugs to be catched: having non-nilable types might be just a small part of such a feature |
09:38:56 | FromGitter | <alehander92> but i also like incremental compilation a lot, cant wait to see it |
09:39:16 | FromGitter | <alehander92> is it currently functional for small examples? |
09:39:44 | FromDiscord_ | <Elegant Beef> yes i understand what you're saying completely |
09:40:09 | FromDiscord_ | <Rika> are you being sarcastic |
09:40:12 | FromDiscord_ | <Rika> cant tell |
09:40:26 | FromDiscord_ | <Elegant Beef> Me? Im being serious right now |
09:40:50 | FromDiscord_ | <Rika> sorry its really hard to tell online |
09:41:03 | FromDiscord_ | <Elegant Beef> yea i know poes law and all |
09:42:06 | FromDiscord_ | <Elegant Beef> Now to be serious i was joking |
09:42:50 | FromDiscord_ | <Elegant Beef> `nilability compile time checking` is all i dont get |
09:43:01 | FromDiscord_ | <Elegant Beef> Unless we're talking about nullable data types |
09:43:16 | FromDiscord_ | <Rika> that i dont get either |
09:44:29 | FromDiscord_ | <Elegant Beef> glad im not alone |
09:45:50 | FromDiscord_ | <Rika> oh i see what's making my program crash on ctrl+c |
09:45:58 | FromDiscord_ | <Rika> can controlc hooks be closures? |
09:46:19 | FromDiscord_ | <Elegant Beef> I mean ctrl+c is stop the current process in linux, so idk 😄 |
09:48:05 | FromGitter | <Varriount> Rika: I think so |
09:48:51 | FromDiscord_ | <Rika> when i use a variable from the outer scope it crashes tho, hmm |
09:50:23 | FromGitter | <Varriount> Can you post a link to the code? |
09:50:58 | * | Hideki_ joined #nim |
09:51:12 | FromGitter | <Varriount> Alas, I have not yet mastered the art of astral projection |
09:51:17 | FromDiscord_ | <Rika> uh not exactly, it's a discordnim bot |
09:51:39 | FromDiscord_ | <Rika> i think the "basic bot" example in the discordnim library exhibits the same issue |
09:52:53 | FromDiscord_ | <Rika> https://github.com/Krognol/discordnim/blob/master/examples/basic_bot.nim here if you still need a link ofc |
09:54:16 | lqdev[m] | @Rika no, ^c hooks are not closures |
09:57:46 | FromDiscord_ | <Rika> knew it, wonder how i should implement how krognol did with this then |
09:59:49 | * | rokups joined #nim |
10:00:09 | FromGitter | <alehander92> elegant beef sorry, i am talking about the segfaults from "a.b => ops a is nil" thing |
10:00:32 | FromGitter | <alehander92> with stuff like ref objects |
10:01:15 | FromDiscord_ | <Elegant Beef> coming from C# it's pretty standard to do `a?.b()` or `if(a != nil)` |
10:01:26 | FromDiscord_ | <Elegant Beef> so idk |
10:01:39 | FromGitter | <alehander92> exactly, and c# already has this |
10:01:51 | FromGitter | <alehander92> it can enforce that you need to if a != nil |
10:02:48 | FromDiscord_ | <Elegant Beef> I dont know what "this" is |
10:03:16 | FromDiscord_ | <Elegant Beef> Sorry |
10:03:33 | FromGitter | <alehander92> yeah, so c# can tell you |
10:04:50 | FromGitter | <alehander92> something like "hey friend, you can't dereference a with a.b here, because its possibly null" |
10:05:00 | FromDiscord_ | <Elegant Beef> ah null reference exception |
10:05:05 | FromGitter | <alehander92> no! |
10:05:10 | FromGitter | <alehander92> the exception is on runtime |
10:05:24 | FromGitter | <alehander92> but the point is that the compiler can detect that this might happen earlier |
10:05:30 | FromDiscord_ | <Elegant Beef> ah ok |
10:05:37 | FromGitter | <alehander92> so it can show this error on compile time |
10:05:41 | FromDiscord_ | <Elegant Beef> so more intelligent hinting for possible null refs |
10:05:46 | FromGitter | <alehander92> yes |
10:06:10 | FromGitter | <alehander92> its a small thing, but useful |
10:06:37 | FromDiscord_ | <Elegant Beef> Yea, but after using C# for so long it's second nature to ensure it's not null 😄 |
10:06:53 | * | Hideki_ quit (Remote host closed the connection) |
10:06:57 | Araq | C# got not-null checking as well |
10:07:08 | Araq | I haven't used it, but on paper it looked good |
10:07:30 | Araq | and they have to tackle exactly the same problems as we do (arrays are hard etc) |
10:07:36 | * | Hideki_ joined #nim |
10:09:46 | Araq | Ormin is taking off, great stuff |
10:10:02 | FromGitter | <Varriount> Araq: What are your thoughts on using libbacktrace for faster stack traces? |
10:10:24 | Araq | in other words, it found an enthusiastic new contributor / core developer. |
10:10:54 | Araq | Varriount: we'll probably do it |
10:11:17 | Araq | in the past we had patches for this already, but it never worked as well as our own stack traces |
10:11:27 | Araq | still it's nice to have a no-cost variant for -d:release |
10:12:16 | * | Hideki_ quit (Ping timeout: 258 seconds) |
10:12:18 | FromGitter | <Varriount> Any idea on what underlying mechanism it uses? I took a brief look at the source code, but didn't get too far |
10:14:23 | * | Hideki_ joined #nim |
10:15:07 | Araq | it uses the debug information and the current stack/frame pointer |
10:15:23 | Araq | basically asm level stuff |
10:15:30 | * | Hideki_ quit (Remote host closed the connection) |
10:16:30 | * | Hideki_ joined #nim |
10:20:51 | * | Hideki_ quit (Ping timeout: 240 seconds) |
10:22:27 | FromGitter | <Varriount> Ah. Debug information to store instruction pointer->line info mapping data? |
10:24:03 | * | lritter joined #nim |
10:24:37 | Araq | well it's not the instruction pointer, it's the stack pointer, but yah |
10:31:47 | * | zahary quit (Quit: Leaving.) |
10:32:06 | * | zahary joined #nim |
10:32:36 | * | zahary quit (Client Quit) |
10:41:48 | * | Romanson joined #nim |
10:47:38 | * | marmotini_ quit (Remote host closed the connection) |
10:48:10 | * | marmotini_ joined #nim |
10:52:31 | * | marmotini_ quit (Ping timeout: 258 seconds) |
10:55:53 | * | Hideki_ joined #nim |
11:01:45 | lqdev[m] | is a StringTableRef faster than a Table[string, string]? |
11:13:49 | * | Hideki_ quit (Ping timeout: 272 seconds) |
11:15:37 | Araq | I don't know, probably not |
11:15:56 | Araq | it mostly exists for case insensitive keys |
11:28:14 | dadada_ | Araq: hey, at the risk of being annoying, because I mentioned it multiple times here already, https://totallywearingpants.com/posts/nim-language-highlights/ , this is written in just the right way for beginners or midly interested people, it definitely belongs into the learn page of the website. Under tutorials probably. |
11:28:30 | dadada_ | s/midly/mildly |
11:28:38 | * | dadada_ is now known as dadada |
11:28:39 | Araq | don't tell me, tell narimiran |
11:29:01 | narimiran | don't tell narimiran, make a PR |
11:31:16 | Araq | lol |
11:33:30 | * | zahary joined #nim |
11:39:21 | * | abm joined #nim |
11:48:26 | FromDiscord_ | <exelotl> Would be nice to have some docs for ormin, right now I'm leaning towards Norm because it's a lot clearer how it works and where to start |
11:48:53 | FromGitter | <timotheecour> @Varriount ⏎ ⏎ > Araq: What are your thoughts on using libbacktrace for faster stack traces? ⏎ ⏎ we already have option for that since #12922; one benefit is allows zero cost stacktrace (with caveat of, with -d:release, not having frames for inlined procs, of course) [https://gitter.im/nim-lang/Nim?at=5e53b8251be0ff01d5a63061] |
11:48:55 | disbot | https://github.com/nim-lang/Nim/pull/12922 -- 6generic stack trace overriding mechanism |
12:17:26 | * | zyklon quit (Ping timeout: 240 seconds) |
12:21:42 | * | uvegbot joined #nim |
12:37:35 | * | kungtotte quit (Read error: Connection reset by peer) |
12:38:45 | * | kungtotte joined #nim |
12:50:16 | * | Hideki_ joined #nim |
13:15:06 | * | fanta1 joined #nim |
13:18:40 | FromDiscord_ | <mratsim> Note that it brought a 4x to 5x improvement on compilation and runtime: https://github.com/status-im/nim-beacon-chain/pull/745#issuecomment-588360225 |
13:18:41 | disbot | ➥ lightweight stack traces |
13:26:32 | FromDiscord_ | <clyybber> disruptek: Oh your testutils part of status now? |
13:31:42 | * | marmotini_ joined #nim |
13:35:14 | * | nsf quit (Quit: WeeChat 2.7) |
13:37:53 | stefantalpalaru | The nim-beacon-chain compilation is about 25% faster and the test suite runtime is more than 2 times faster, with nim-libbacktrace. |
13:38:33 | stefantalpalaru | Do note that we were already using --opt:speed, so we already had -O3 enabled in our debug builds. |
13:39:11 | FromGitter | <alehander92> huh, why the compilation speedup |
13:40:10 | FromGitter | <alehander92> was it all the nimfr_ ? |
13:40:22 | stefantalpalaru | I don't know exactly, but I do see two possible sources: extra code gets enabled by -d:debug and extra code gets inserted by the default stack trace mechanism, to keep track of frames. |
13:40:48 | FromDiscord_ | <clyybber> Interesting |
13:41:21 | * | Romanson quit (Quit: Connection closed for inactivity) |
13:42:00 | FromDiscord_ | <clyybber> Araq: Can we make define `[]` for openarrays as an alias for the toOpenArray slicing? |
13:42:51 | Araq | somehow we should be able to do that |
13:42:57 | Araq | but more importantly |
13:43:13 | Araq | can we change evaluation order to 'right to left' for everything constistently? |
13:43:26 | Araq | do we know cases where left-to-right works better? |
13:44:01 | Araq | because I don't, it's slightly more intuitive but that's all |
13:44:51 | Araq | right-to-left also tends to produce better asm code iirc |
13:46:41 | * | Hideki_ quit (Remote host closed the connection) |
13:47:27 | * | Hideki_ joined #nim |
13:52:19 | * | Hideki_ quit (Ping timeout: 265 seconds) |
13:53:41 | dadada | Araq: does this imply syntax changes? |
13:53:54 | Araq | nope |
13:54:19 | Araq | it would be a change in the spec though |
13:54:47 | dadada | could there be different evalutation results due to it? |
13:54:52 | dadada | evaluation |
13:54:55 | Araq | yes |
13:55:09 | Araq | but only edge cases are effected |
13:55:18 | dadada | okay, well, I'd need some examples first to form an opinion |
13:56:18 | dadada | or to really see how it would affect my reading of code |
13:56:36 | * | dddddd joined #nim |
13:57:39 | SyrupThinker | iter is an interator returning 1.., subtract(iter(), iter()) would return -1 for ltr and 1 for rtl |
13:57:55 | dadada | I asked yesterday, is there any possibility that a macro could be aware of the context its used in? a proc, a for loop, a for loop inside a proc, in the last line/statement/expression of a proc |
13:57:57 | SyrupThinker | Thats a minimal example if I understand correctly |
14:00:07 | * | Hideki_ joined #nim |
14:01:30 | Araq | yes, SyrupThinker is correct |
14:01:39 | * | tane joined #nim |
14:02:05 | Araq | dadada: no, by design a macro can only look at what was passed to it |
14:02:17 | FromDiscord_ | <mratsim> that might break the new chain/with macro? |
14:02:22 | Araq | and it cannot go up in the parse tree |
14:02:29 | FromDiscord_ | <mratsim> the order of evaluation |
14:02:48 | Araq | mratsim: well the order of evaluation is only in effect after macro translations etc |
14:03:11 | Araq | it's mostly '=' and runtime calls |
14:03:22 | Araq | the macro system isn't affected |
14:05:12 | dadada | Araq: what exactly are you trying to achieve here besides simplifying code and possibly optimizations |
14:05:33 | Araq | make Zevv's convoluted code "Just work" |
14:07:24 | dadada | which code specifically? |
14:07:50 | dadada | sry, I'm not following this closely enough perhaps |
14:11:12 | FromDiscord_ | <mratsim> was there an article about Arraymancer? I got like +30 stars in 6 hours |
14:11:13 | dadada | Araq: it wouldn't change anything about these chained function calls being called ltr, though? https://play.nim-lang.org/#ix=2czh |
14:13:14 | * | Hideki_ quit (Remote host closed the connection) |
14:13:55 | * | Hideki_ joined #nim |
14:15:19 | Araq | dadada, no, that's the "inside out" rule |
14:15:30 | Araq | or "innermost call gets evaluated first" |
14:15:38 | Araq | it's not affected |
14:16:34 | Araq | anyhow Zevv's code is tab[key].id = grows(tab) |
14:16:47 | FromGitter | <Vindaar> @dadada: LPT: if Araq talks about some new feature / optimization etc. and you wonder how it affects you from a user perspective, the answer is almost certainly "don't worry" ;) |
14:17:08 | Araq | which causes a memory safety bug with Nim's left-to-right evaluation rules |
14:17:11 | zedeus | @mratsim it's mentioned in the top comment here https://news.ycombinator.com/item?id=22399416 |
14:18:45 | * | Hideki_ quit (Ping timeout: 272 seconds) |
14:22:00 | FromDiscord_ | <clyybber> Araq: I think LTR is the way to go generally |
14:22:13 | FromDiscord_ | <clyybber> But sink should be evaluated first |
14:23:17 | * | Hideki_ joined #nim |
14:23:44 | Araq | not "last"? |
14:23:55 | Araq | you want it to be the last read if possible, no? |
14:24:26 | FromDiscord_ | <clyybber> Hmm, but sink parameters are going to be stored /somewhere/ |
14:24:28 | FromDiscord_ | <clyybber> most of the time |
14:24:51 | FromDiscord_ | <clyybber> so we evaluate them before all others so that the thing that they are gonna be stored in is evaluated later |
14:25:05 | FromDiscord_ | <clyybber> so that we can modify s in s.add b() in b |
14:25:17 | FromDiscord_ | <clyybber> without breaking stuff |
14:26:57 | FromDiscord_ | <clyybber> it may be a bit untransparent for the user though, since sink can also be injected automatically |
14:27:18 | FromDiscord_ | <clyybber> but this is the best idea I have come up with so far |
14:28:05 | * | Hideki_ quit (Ping timeout: 265 seconds) |
14:30:08 | Araq | too much magic, right-to-left works for 'add' anyway |
14:30:19 | dadada | Araq: you made it sound like you want to make everything rtl, but there's just so much based around the paradigm of reading, for example statement 1; statement 2; would you want statement 2 to be evaluated first? I'm sure this is again something like the inside-out rule, but you made it sound like RTL would be better for everything... LTR is much less intuitive, although I definitely see why it's attractive |
14:30:25 | dadada | in the case of Zevv's code. Maybe there could just be a rule around assignments that their lhs is evaluated last? ... |
14:31:12 | Araq | yeah but then assignments would be special |
14:31:31 | dadada | they are already!? :-) |
14:31:37 | Araq | yet the evaluation rules would work better for sequence.add too |
14:31:37 | FromDiscord_ | <clyybber> I'm not sure we even need rtl for add too |
14:31:45 | FromDiscord_ | <clyybber> dadada: No |
14:32:10 | FromDiscord_ | <clyybber> Araq: Maybe special casing `=` suffices, as `=` is used in add itself |
14:32:31 | dadada | clyybber: what were you noing? |
14:32:42 | FromDiscord_ | <clyybber> that assignments are already special |
14:33:09 | FromDiscord_ | <mratsim> even if you mention that Nim is evaluated right to left, a paragraph that says "this also applies to assignments" would be needed |
14:33:48 | dadada | clyybber: only because we discussed them this week already, the whole they're not real equations debate |
14:34:04 | FromDiscord_ | <clyybber> k |
14:35:06 | Araq | mratsim: but 'a = b' is turned into `=`(a, b) for custom assignment operators |
14:35:21 | Araq | so any inconsistency around assignments would be quite bad |
14:35:33 | FromDiscord_ | <mratsim> so once again the solution is {.rightToLeft.} pragma 😉 |
14:35:35 | Zevv | hm it's not about assignments, is it? It is about anything that will change any state |
14:35:37 | Araq | the fact that I still have one more sentence in the spec is not relevant |
14:36:20 | Araq | well I keep looking for advantages for left-to-right, so far I found none |
14:37:17 | Araq | every codegen-like pass needs to special case nnkCallKinds with a 'countdown' traversal |
14:37:29 | Araq | that's quite a downside |
14:38:35 | FromDiscord_ | <clyybber> advantage for left to right is that its more in line with what you expect |
14:38:36 | FromDiscord_ | <clyybber> normally |
14:38:59 | FromDiscord_ | <mratsim> I read left to right |
14:39:03 | dadada | me too |
14:39:25 | dadada | but I see Zevv's need, as well |
14:39:26 | FromDiscord_ | <mratsim> I prefer foo().bar().baz() instead of baz(bar(foo())) |
14:39:31 | Araq | it's a pretty weak argument, normally the order is irrelevant and depending on it is bad, subtle code |
14:39:31 | FromDiscord_ | <clyybber> hmm |
14:39:57 | FromDiscord_ | <clyybber> maybe we should add a rule that expressions with a side effect are evaluated in a first pass |
14:39:58 | Araq | before v1 in Nim it was unspecified, few noticed |
14:40:06 | FromDiscord_ | <clyybber> and then those with no side effects |
14:40:22 | FromDiscord_ | <clyybber> it shouldn't change behaviour much |
14:40:23 | FromDiscord_ | <mratsim> but you can lie about side-effects |
14:40:25 | Araq | mratsim: again, the wrong example |
14:40:27 | FromDiscord_ | <clyybber> but it should solve the problem |
14:40:46 | Zevv | can this case be detected and yield a compile time error? |
14:40:51 | Araq | the example is f(a, b) # b before a or a before b |
14:41:19 | FromDiscord_ | <mratsim> yes I know, but my example is related to reading/writing left to right |
14:41:27 | FromDiscord_ | <clyybber> @mratsim once you start lying about sideeffects you are on your own |
14:41:28 | FromDiscord_ | <mratsim> not about an example where the order is actually significant |
14:41:44 | Araq | Zevv, yeah and we'll do that but then your code needs an explicit temporary to make the compiler happy |
14:41:57 | Zevv | fair enough |
14:42:07 | Araq | but I suppose it's the best solution, the compiler then enforces a more readable version |
14:42:09 | FromDiscord_ | <mratsim> if you wrap a C library and forgot to add {.sideeffect.} you are most likely lying about sideeffect |
14:42:20 | dadada | f( makeDir(), makeFileInDir() ) # works with ltr (because the dir exists), doesn't work with rtl becaue the file-in-dir is created at a time where the dir wasn't created yet, hopefully I understood the whole topic correctly, admittedly I constructed this example, but I think this goes against a lot of expectations |
14:42:37 | Araq | dadada, that nails it |
14:42:51 | FromDiscord_ | <clyybber> @mratsim Yes but the idea here was that it doesn't matter. Everything be evaluated LTR just the expressions with a sideeffect first |
14:42:55 | FromDiscord_ | <clyybber> Araq: WDYT? |
14:43:17 | Araq | clyybber: too complex, will only bite you a bit later |
14:43:25 | FromDiscord_ | <mratsim> yes agree, too complex |
14:44:00 | FromDiscord_ | <clyybber> But it *cant* bite you |
14:44:11 | FromDiscord_ | <clyybber> since those noSideEffect procs don't rely on the order |
14:44:13 | FromDiscord_ | <mratsim> it's similar to choosing copy sematics vs reference semantics vs copy-on-write. It's easier for people to know what to expect with either of the first 2, rather than the last one |
14:44:14 | Araq | ha :-) |
14:44:37 | FromDiscord_ | <clyybber> And the sideffect once will still be evaluated LTR |
14:44:41 | Araq | mratsim: I still like COW fwiw |
14:44:46 | FromDiscord_ | <clyybber> same as the noSideEffect ones |
14:45:16 | Araq | "the evaluation order depends on the side effect system" |
14:45:30 | Araq | is not something I want to ever see in the spec |
14:45:31 | FromDiscord_ | <clyybber> It doesn't even need to be documented |
14:45:44 | FromDiscord_ | <clyybber> since it doesn't change the behaviour for the user |
14:46:01 | FromDiscord_ | <clyybber> except for allowing this usage |
14:46:35 | Araq | sorry but you won't convince me on that |
14:47:28 | FromDiscord_ | <clyybber> Araq: But only expressions with a sideeffect rely on the order? Are you with me on that? |
14:47:36 | Araq | and in Zevv's example the RHS doesn't have sideEffects either |
14:47:59 | Araq | no, I'm not with you on that |
14:48:07 | Araq | it's not about side effects |
14:48:09 | FromDiscord_ | <clyybber> huh |
14:48:18 | FromDiscord_ | <clyybber> but return123 does have a sideeffect? |
14:48:35 | FromDiscord_ | <clyybber> it modifies table[l] ? |
14:48:41 | dadada | it's the other way around actually... proc/funcs rely on what happened BEFORE they were called |
14:49:11 | dadada | f( makeDir(), makeFileInDir() ) <- here I would never expect makeFileInDir() to be the first one that is called |
14:49:47 | FromDiscord_ | <clyybber> dadada: Yes, but you won't notice unless makeDir and makeFileInDir are procs with a sideeffect |
14:49:50 | FromDiscord_ | <clyybber> that was my point |
14:50:56 | * | drewr quit (Quit: ERC (IRC client for Emacs 26.3)) |
14:51:11 | FromDiscord_ | <clyybber> Araq: Am I wrong about return123 having a sideeffect? |
14:51:45 | FromDiscord_ | <clyybber> I thought modifiying an "upvalue" counts as sideeffect |
14:51:53 | Araq | well it doesn't touch a global |
14:52:06 | Araq | so according to Nim it doesn't have a "side effect" |
14:52:21 | FromDiscord_ | <clyybber> Oh |
14:52:33 | Araq | it's a tough nut :P |
14:52:41 | FromDiscord_ | <clyybber> We almost cracked it |
14:52:48 | * | couven92 joined #nim |
14:52:57 | FromDiscord_ | <clyybber> we just gotta introduce a stricter side effect |
14:53:03 | FromDiscord_ | <clyybber> that is used to crack this nut |
14:53:33 | FromDiscord_ | <clyybber> which is like sideeffect but also tracks *every* access to upvalues |
14:53:43 | FromDiscord_ | <clyybber> and then we have enough information to solve this |
14:54:56 | Araq | yes but now you're thinking about how to detect and prevent it at compile-time. changing the eval order is about "making it work" |
14:55:21 | FromDiscord_ | <clyybber> yeah, but we can change the eval order behind the back |
14:55:39 | FromDiscord_ | <clyybber> since table[0].id doesnt have a sideeffect |
14:55:46 | FromDiscord_ | <clyybber> but return123() does |
14:55:53 | FromDiscord_ | <clyybber> (with the extended notion of sideeffect) |
14:55:59 | FromDiscord_ | <clyybber> we would evaluate return123() |
14:56:01 | FromDiscord_ | <clyybber> firts |
14:56:08 | FromDiscord_ | <clyybber> first and then table[0].id |
14:56:13 | FromDiscord_ | <clyybber> so the problem would be solved |
14:56:57 | Araq | node.add node[^1] |
14:57:00 | FromDiscord_ | <clyybber> problem is this falls apart when table[0].id does have a sideeffect. But we should make it error in that case via borrow checker rules |
14:57:11 | * | Hideki_ joined #nim |
14:57:13 | FromDiscord_ | <clyybber> Araq: No sideeffects here? |
14:57:18 | FromDiscord_ | <clyybber> so normal LTR |
14:57:31 | Araq | it's broken under LTR |
14:57:50 | FromDiscord_ | <clyybber> huh? It just duplicates the last element |
14:57:53 | FromDiscord_ | <clyybber> doesn't it? |
14:58:15 | Araq | hmm I got the example wrong, one sec |
15:00:12 | Araq | but it was close to 'node.add node' |
15:00:21 | Araq | so 'node' is the last read, we nil it out |
15:00:26 | Araq | and then 'add' crashes |
15:00:37 | FromDiscord_ | <clyybber> huh? |
15:00:44 | FromDiscord_ | <clyybber> but node is not the last read |
15:00:50 | FromDiscord_ | <clyybber> node[^1] is |
15:00:59 | Araq | but it was close to 'node.add node' |
15:01:09 | Araq | forget the indexing |
15:01:35 | FromDiscord_ | <clyybber> but even node.add node is not broken |
15:02:00 | FromDiscord_ | <clyybber> it simply duplicates node's elements |
15:02:03 | Araq | well I had a failing test case about it |
15:02:11 | FromDiscord_ | <clyybber> we fixed it I think |
15:02:15 | FromDiscord_ | <clyybber> it was an dfa issue |
15:02:32 | FromDiscord_ | <clyybber> i think *you* fixed it |
15:02:51 | Araq | I think I haven't |
15:03:16 | Araq | but the point is that it's about "disjoint" graphs, not about "side effects" |
15:03:44 | dadada | Araq: newGuiLayout(newSpacer(), newBox("#id23"), newText("#id23", "Some Text inside the formerly created with #id23"), newSpacer()) ... in this example the GUI elements are connected over a object system (for example QObject or gobject introspection, or could be something like a dom) ... the text would expect the box with the right id to be there due to LTR ... yes, I'm definitely reaching a little, but I |
15:03:50 | dadada | think I've seen or created code like this before, it's not totally outlandish |
15:04:29 | Araq | if g() and h() operate on disjoint data *or* only read from the data then the evaluation order doesn't matter in f(g(), h()) |
15:04:47 | FromDiscord_ | <clyybber> Araq: Yeah, thats what I was on to. sideeffects are maybe a bit too "course" |
15:04:52 | FromDiscord_ | <clyybber> coarse |
15:05:15 | Araq | basically ParaSail's rules |
15:05:34 | Araq | which then runs g() and h() in parallel |
15:06:47 | FromDiscord_ | <clyybber> So we need to implement write tracking right? |
15:08:01 | Araq | nah, you only need some borrow checker that complains about .closure calls |
15:08:14 | Araq | assuming that .closures are from hell and mess with your state |
15:08:41 | FromDiscord_ | <clyybber> Araq: Ok, but I thought we wanted Zevvs example to just work (TM)? |
15:09:51 | Araq | only if we want to pay the price for RTL evaluations everywhere. Else detecting it is good enough. |
15:09:59 | * | Hideki_ quit (Ping timeout: 260 seconds) |
15:16:41 | FromDiscord_ | <clyybber> Hmm, ok. |
15:17:13 | FromDiscord_ | <clyybber> I agree now, have found a few examples where my idea woudn't really work out |
15:18:57 | FromDiscord_ | <clyybber> Araq: For detecting it we still have to do track what reads/writes what though. Unless you want to forbid all closure calls in args :p |
15:20:16 | Zevv | is this problem in any way unique to Nim? |
15:26:33 | dadada | ok, I've this totally different idea, that probably nobody will like, but here it is, create a special keyword/macro/function for when you want somthing to be absolutely evaluated before everything else, ie. I suppose Zevv wants the grow funtion to be evaluated first so prepone(grows(tab)), there could also be the opposite postpone(grows(tab)) that would ensure the grows procedure is the last one evaluated... |
15:26:39 | dadada | this would allow programmers to manually define execution order (hopefully needed sparsely) and it would matter lesser weather everything else is LTR or RTL ... although this of course complicates the compiler as well |
15:27:11 | dadada | s/matter lesser/matter less |
15:27:13 | dadada | wether |
15:27:37 | dadada | whether ^^ |
15:28:51 | FromDiscord_ | <mratsim> as long as people don't say "I have 2 calls with prio/precedence/prepone but one should be evaluated even before the other" 😉 |
15:30:55 | dadada | mratsim: the assumption is that this would be an absolute edge case worth splitting code into more lines |
15:37:44 | * | Kaivo quit (Quit: kernel update) |
15:39:30 | FromDiscord_ | <mratsim> yes for sure |
15:39:38 | * | Kaivo joined #nim |
15:39:40 | FromGitter | <rishavs> How should I forward declare a proc in one module and define it in another? Currently doing so is throwing this error; ⏎ `implementation of 'data.mainScene_init() [declared in c:\Users\risharan\Documents\GitHub\rayni\src\data.nim(13, 6)]' expected` |
15:44:18 | FromGitter | <alehander92> with include maybe |
15:44:24 | FromGitter | <alehander92> but otherwise i dont think its supported |
15:46:14 | * | ptdel joined #nim |
15:46:51 | * | ptdel quit (Remote host closed the connection) |
15:46:53 | FromGitter | <rishavs> thats a good idea. Structuring my code in Nim is harder than I expected |
15:48:00 | Araq | well if you have a dependency tree, it works out |
15:48:43 | Araq | if you don't, Nim doesn't really help you out. in this case curse me personally for it and pretend your deps are "really not cyclic" (even though they are) |
15:49:14 | * | ptdel joined #nim |
15:49:34 | FromGitter | <rishavs> my trees always end up being circular :( ⏎ Though this is because I am not very knowledgeable about coding. |
15:49:55 | Araq | don't worry, here is one workaround: |
15:49:56 | FromGitter | <alehander92> i think its a simple/good decision , i imagine it helps with stuff like IC |
15:50:20 | Araq | var theProc: proc () {.nimcall.} # to be set by the implementor |
15:51:01 | Araq | it's a fake dynamic call, the Nim compiler internally does the same in a couple of places |
15:51:23 | Araq | it's a hacky workaround, but it does work |
15:51:32 | FromGitter | <rishavs> Thanks. gonna give it a try :D |
15:56:03 | * | jxy quit (Quit: leaving) |
15:56:12 | FromGitter | <Varriount> Araq: Aside from changing the spec and consistency, is there any particular problem with changing only `=` operators to evaluate left-to-right? |
15:56:49 | * | nsf joined #nim |
15:57:11 | FromGitter | <Varriount> Do other languages special-case this? |
15:59:22 | Araq | some do, some don't |
16:06:01 | disruptek | what's shakin', nimions? |
16:07:42 | * | marmotini_ quit (Remote host closed the connection) |
16:08:14 | * | marmotini_ joined #nim |
16:08:29 | Zevv | Trying to assign something to something else |
16:11:39 | * | natrys joined #nim |
16:11:55 | disruptek | uh oh. |
16:13:13 | Zevv | myTable[key] = somethingThatMakesMyTableGrow() |
16:14:42 | lqdev[m] | how can I get the directory where my app can store data, eg. `C:\Users\user\AppData` on Windows and `~/.local/share` on Linux? is there a builtin for that, or do I have to implement it myself? |
16:14:51 | * | marmotini_ quit (Ping timeout: 240 seconds) |
16:15:54 | Araq | os.getConfigDir |
16:16:21 | lqdev[m] | that's for `~/.config` on Linux, I need `~/.local/share |
16:17:05 | disruptek | Zevv: why did you have to write that? |
16:17:13 | disruptek | how very inconsiderate of your. |
16:17:15 | Araq | well we don't have it then but ~ is so full of junk in reality that you might as well use it |
16:17:15 | disruptek | you, too. |
16:17:28 | lqdev[m] | basically I need a place where I can store plugins and various user data. |
16:17:36 | lqdev[m] | so I suppose `~/.myapp` would do? |
16:17:50 | disruptek | please no. |
16:17:57 | dadada | lqdev[m]: better to use .config/myapp than .myapp |
16:18:20 | lqdev[m] | dadada: but I need a folder for user projects, not configuration |
16:18:37 | Araq | ~/.local/share/app makes sense |
16:18:50 | disruptek | ^ |
16:18:54 | lqdev[m] | I'll roll with my own proc, then |
16:19:02 | Araq | it seems to suit the rest of the setup, everything is stored in a most annoying location |
16:19:07 | dadada | lqdev[m]: chrome and other applications store loads of data their anyway, ... nothing is worse than using $HOME/.foobar directly ... either use XDG_DATA_DIR from the environment, or simply when linux .local/share/myapp |
16:19:11 | disruptek | would be nice to pr it, as we need this for nimterop shared-libs, too. |
16:19:27 | dadada | s/their/there |
16:19:46 | disruptek | i guess today we parallelize testutils. |
16:19:52 | lqdev[m] | dadada: right, I'll go with that |
16:20:06 | dadada | disruptek: nimble needs to move away from $HOME/.nimble as well |
16:20:16 | disruptek | i'm not the guy to talk to about that. |
16:22:12 | FromDiscord_ | <clyybber> lqdev[m]: For user projects let the user decide |
16:22:17 | Zevv | disruptek: I never wrote that. I just created the issue for someone else who came on #nim asking why this funny thing was happening |
16:22:21 | FromDiscord_ | <clyybber> I mean you are gonna have a dialog anyways |
16:22:40 | disruptek | Zevv: don't try to deny it. no one codes of behalf of "a friend." |
16:22:42 | FromDiscord_ | <clyybber> disruptek: Hey, did you move your repo to status? |
16:22:57 | disruptek | yeah, it was status code that i pulled out of chonicles. |
16:23:04 | Araq | what's wrong with $HOME/.app? it's the standard, $HOME is not for you, $HOME is for apps, for yourself you can use $HOME/projects and never look inside $HOME. It's what I do on every OS. |
16:23:59 | tane | Araq, free desktop, XDG_HOME.. etc, use .local/share, .cache and .config |
16:23:59 | disruptek | $HOME is not for me? |
16:24:01 | solitudesf | $HOME is for me |
16:24:10 | FromDiscord_ | <clyybber> letting the user decide is just best |
16:24:23 | FromDiscord_ | <clyybber> its also what most other daws do |
16:24:24 | Araq | tane, theory vs practice |
16:24:39 | Araq | in practice $HOME is full of .dotjunk |
16:24:53 | tane | and this legitimates doing the same? |
16:25:04 | Araq | yeah as it's beyond repair. |
16:25:12 | FromGitter | <alehander92> lqdev[m]: $XDG_DATA_HOME i think |
16:25:19 | solitudesf | analogy for windows would be apps creating folder on desktop or root of C: |
16:25:29 | tane | ocaml 4.10's breaking change is moving .ocamlinit to .config, so people are actually tryin to salvage :) |
16:25:32 | disruptek | araq was making sense and then he took a puff. |
16:25:43 | Araq | exactly, C: is not for you, it's never clean, don't look inside |
16:25:44 | FromDiscord_ | <clyybber> Na na na na na, don't use any XDG stuff, just let me decide where I want to save or load a project from |
16:25:47 | FromGitter | <alehander92> but the point was to not put stuff in $HOME if you dont want it |
16:26:17 | FromGitter | <alehander92> and XDG lets you decide that indeed |
16:26:31 | FromDiscord_ | <clyybber> alehander92: This is about projects though |
16:26:33 | FromDiscord_ | <clyybber> like one song |
16:26:39 | FromDiscord_ | <clyybber> not about global configs |
16:26:51 | FromDiscord_ | <clyybber> for which XDG_CONFIG_HOME should be used, I agree |
16:26:59 | FromDiscord_ | <clyybber> and also not about global data |
16:27:30 | FromGitter | <alehander92> hm, i see |
16:27:38 | dadada | lqdev[m]: there are configs in .local/share and data in .config/ there's really no consistency... you could as well use os.getConfigDir ... although the spec is pretty clear https://www.freedesktop.org/software/systemd/man/file-hierarchy.html |
16:27:53 | FromDiscord_ | <clyybber> use .config |
16:28:05 | FromDiscord_ | <clyybber> for configuration |
16:28:28 | FromGitter | <alehander92> which reminds me i should also use XDG for some stuff |
16:28:40 | Araq | XDG doesn't care for the poor souls like me who would never use dots though |
16:28:51 | FromDiscord_ | <clyybber> never use dots? |
16:29:01 | Araq | or maybe it does hmmm |
16:29:18 | Zevv | Araq is the hardcore explicity kind of guy. His .vimrc is just called vimrc. |
16:29:19 | FromDiscord_ | <clyybber> Araq: You can just set your XDG_CONFIG_HOME to $HOME/config if you like |
16:29:30 | FromDiscord_ | <clyybber> noones stopping you |
16:29:40 | disruptek | duh. |
16:29:41 | FromDiscord_ | <clyybber> other than for stupid programs that hardcode .config |
16:29:54 | FromGitter | <alehander92> thank you |
16:30:18 | disruptek | https://www.twitch.tv/disruptek |
16:30:20 | Araq | clyybber: yeah, I misread, it works |
16:31:08 | Araq | ok I'm sold, XDG works |
16:31:26 | FromGitter | <alehander92> yeah i was hardcoding it, time to fix it at least somewhere |
16:31:55 | Araq | still puzzling we need a flat key-value store to handle the mess the "hierarchy" got us into |
16:32:04 | Araq | but whatever, back to work |
16:47:05 | * | marmotini_ joined #nim |
16:47:39 | * | jxy joined #nim |
16:50:28 | * | solitudesf quit (Remote host closed the connection) |
16:53:03 | * | Trustable joined #nim |
16:56:21 | WilhelmVonWeiner | "we need" |
16:56:44 | WilhelmVonWeiner | need is a strong word |
16:58:28 | lqdev[m] | could anyone help me with the `dynlib` module? I have a C library (https://github.com/liquid600pgm/nadio/blob/master/plugins/test/main.c), passing it through `nm` yields all symbols including `nadPluginGetName` etc. however, when I `loadLib` the .so, and use `symAddr` to retrieve `nadGetPluginName` from the .so (https://github.com/liquid600pgm/nadio/blob/master/src/nadio/plugins.nim#L23), I get `nil`, with `dlerror` returning |
16:58:28 | lqdev[m] | the message `/home/daknus/Coding/Nim/nadio/src/nadio/nadio: undefined symbol: nadPluginGetName`. |
16:58:30 | dadada | is there an implementation of OOP class hierarchies for Nim that's considered best/farthest ahead compared to others? |
16:58:52 | lqdev[m] | `nadGetPluginName` is defined by the `NadioPluginMetadata` macro |
17:06:41 | * | Hideki_ joined #nim |
17:10:51 | * | Hideki_ quit (Ping timeout: 240 seconds) |
17:22:18 | leorize | disruptek: I broke nimph... |
17:22:58 | disruptek | you have twitch. |
17:23:00 | disruptek | you can chat on stream. |
17:23:02 | disruptek | now. |
17:30:43 | * | clemens3 quit (Ping timeout: 255 seconds) |
17:35:00 | FromDiscord_ | <clyybber> with free latency |
17:42:34 | * | floppydh quit (Quit: WeeChat 2.7) |
17:45:13 | * | dadada quit (Ping timeout: 272 seconds) |
17:51:18 | * | dadada joined #nim |
17:51:42 | * | dadada is now known as Guest5151 |
17:52:55 | * | shadowbane quit (Quit: Konversation terminated!) |
17:54:19 | * | shadowbane joined #nim |
18:01:57 | * | Guest5151 is now known as dadada |
18:16:12 | * | zahary1 joined #nim |
18:19:29 | * | rokups quit (Quit: Connection closed for inactivity) |
18:21:17 | * | moduledge quit (Quit: Konversation terminated!) |
18:22:06 | FromGitter | <deech> Is there any way to see a "dry run" of a nimble command? eg. I'd like to see a list of `nim` compilation commands when running `nimble install`. |
18:22:25 | * | NimBot joined #nim |
18:22:45 | disruptek | there's an option to output the cmd-line in the compiler. |
18:27:45 | FromGitter | <rishavs> quick question, in my code I am using empty returns a lot. like this; ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ is this an ok design choice or should I try to return something anyway (like discardable bools?) [https://gitter.im/nim-lang/Nim?at=5e5415a19aeef6523216ea05] |
18:28:13 | disruptek | it's fine, but try to use `result` instead of `return`. |
18:30:46 | shashlick | Writing code with multiple returns is easier but then harder to follow later |
18:31:11 | shashlick | Ideally a single return at the bottom of the proc though it does make code harder to write |
18:31:54 | FromGitter | <rishavs> I am using return more as a break to get out of the recursive procs |
18:33:22 | FromDiscord_ | <Recruit_main70007> What is that function returning? |
18:34:02 | disruptek | you write it once, you read it many. |
18:34:09 | disruptek | it doesn't matter if it's hard to write. |
18:34:13 | disruptek | make it easy to read. |
18:34:52 | FromDiscord_ | <Recruit_main70007> Oh, I think I understand, so it’s like when you do |
18:34:52 | FromDiscord_ | <Recruit_main70007> int main(){ |
18:34:52 | FromDiscord_ | <Recruit_main70007> } |
18:34:53 | FromDiscord_ | <Recruit_main70007> void say_hi(){ |
18:34:53 | FromDiscord_ | <Recruit_main70007> } |
18:35:23 | FromDiscord_ | <Recruit_main70007> I hope that’s not enough code to get it into a pastebin :p |
18:36:55 | FromGitter | <Varriount> Araq: For what it's worth, a surprising number of programs do support XDG environment variables |
18:37:08 | leorize | not nimble |
18:37:20 | FromGitter | <Varriount> Gasp! |
18:37:25 | FromGitter | <rishavs> Thanks disruptek. Something to keep in mind |
18:37:43 | FromGitter | <Varriount> Leorize: This situation should be remedied |
18:38:36 | leorize | yea, I need that to get nimble into haiku :P |
18:38:47 | FromGitter | <NOP0> Could anyone give me a link or short explanation what is gc:arc? I'm googling in vain 😀 thanks |
18:38:56 | leorize | ~arc |
18:38:56 | disbot | arc: 11a new memory manager for Nim; see https://forum.nim-lang.org/t/5734 |
18:39:09 | Zevv | NOP0: arc does reference counting instaed of garbage collection |
18:39:20 | * | couven92 quit (Read error: Connection reset by peer) |
18:39:46 | * | couven92 joined #nim |
18:40:03 | FromGitter | <Varriount> (though one might argue that reference counting is a form of garbage collection) |
18:41:25 | FromDiscord_ | <clyybber> but deterministic |
18:42:37 | FromGitter | <NOP0> Thanks! How is this related to newruntime, and what is newruntime? |
18:42:53 | leorize | newruntime is an old idea now |
18:42:58 | leorize | it's no longer relevant :) |
18:43:10 | FromDiscord_ | <clyybber> leorize: Eh |
18:43:16 | leorize | arc is the evolution from newruntime afaict |
18:44:15 | * | filcuc joined #nim |
18:44:30 | FromDiscord_ | <clyybber> leorize: In a way yeah, but newruntime is more like a superset of arc. Its arc + owned |
18:44:58 | FromDiscord_ | <clyybber> The ideas of newruntime are useful though |
18:45:12 | FromDiscord_ | <clyybber> and will probably get incorporated into arc in some way |
18:45:24 | FromDiscord_ | <clyybber> Especially useful for sending stuff across threads |
18:46:24 | leorize | yea but the entire owned pointer idea kinda die off when benchmarks said it doesn't make any noticable difference from just arc |
18:47:28 | FromGitter | <NOP0> Ok, guess this is cutting edge, not anything to worry about for casual nim user I guess. Does gc arc mean anything for hard real time guarantees wrt gc? |
18:47:54 | FromDiscord_ | <clyybber> Yeah |
18:48:06 | leorize | I think it's in the plan, though hard real time is well... kinda hardcore :P |
18:48:09 | FromDiscord_ | <clyybber> It is a hard realtime guarantee basically |
18:48:14 | FromDiscord_ | <clyybber> I mean |
18:48:22 | leorize | soft real time is a much better guarantee |
18:48:23 | FromDiscord_ | <clyybber> its always either decRef |
18:48:27 | FromDiscord_ | <clyybber> or destroy |
18:50:07 | leorize | not entirely sure if that means you get hard real time |
18:50:30 | Araq | it does |
18:50:51 | leorize | ah ok |
18:51:14 | Araq | there are plenty of myths around refcounting ;-) |
18:51:39 | Araq | but I've yet to see a definition of "hard realtime" that rules out reference counting |
18:51:45 | leorize | Araq: can you look at #13201? |
18:51:46 | disbot | https://github.com/nim-lang/Nim/pull/13201 -- 3Make file descriptors from stdlib non-inheritable by default |
18:51:51 | leorize | is there anything left to be done? |
18:52:09 | FromGitter | <NOP0> Thanks! |
18:52:32 | Araq | leorize, the setInheritable is a bit supoptimal as it means "omg another syscall" |
18:52:41 | Araq | can we add flags to file/socket creation? |
18:54:33 | leorize | socket creation already got a flag |
18:54:42 | leorize | file creation then I'm not so sure |
18:55:43 | leorize | since the inherited file will share the same exact file description: if you advance the file position in one process the other will have their file position changed too |
18:56:27 | leorize | so in my experience most people would clone the descriptor manually with dup() to make sure that's not the case |
18:57:25 | leorize | not for sockets though, which is why I gave them a flag |
18:58:50 | Araq | well you wrote setInheritable for FileHandle, so it's a thing |
19:00:02 | FromDiscord_ | <Rika> what are the disadvantages of marking a proc {.inline.} |
19:00:50 | Araq | leorize, but ok |
19:00:54 | FromGitter | <alehander92> i'd guess code bloat/a bit harder to debugg sometimes |
19:01:13 | * | jjido joined #nim |
19:01:38 | Araq | Rika: as a rule of thumb, if you need to ask, don't use .inline and instead enable linktime optimizations |
19:02:33 | FromDiscord_ | <Rika> no, its because i'm considering removing the {.inline.}s inside a library its inconsistent with other procs |
19:02:39 | FromDiscord_ | <Rika> how would i enable LTO |
19:05:53 | Araq | --passC="-flto" not sure |
19:07:21 | FromGitter | <sheerluck> @Rika --passC="-O3 -flto=9" |
19:12:27 | Araq | leorize, another aspect: do you think this is the last file creation flag we will need? because if not we better model as a set[NewEnum] |
19:16:57 | * | zahary2 joined #nim |
19:18:49 | FromGitter | <alehander92> guys |
19:19:18 | FromDiscord_ | <clyybber> yo? |
19:19:37 | * | zahary1 quit (Ping timeout: 255 seconds) |
19:19:51 | FromGitter | <alehander92> what do you think of literate programming? as more in knuth style |
19:20:10 | FromDiscord_ | <Rika> oh literate programming |
19:20:15 | FromDiscord_ | <clyybber> Eh, I don't particularily love it when a single loc takes up a whole window |
19:20:16 | FromDiscord_ | <Rika> sounded interesting |
19:20:23 | FromGitter | <alehander92> not only text code, but more like interleaved text + code |
19:20:30 | FromDiscord_ | <clyybber> I'd rather have a seperate internal documentation |
19:20:37 | FromDiscord_ | <clyybber> so that I can have them side by side |
19:20:54 | FromGitter | <alehander92> i like one web site which does that, i think it was for javascript doc/libs |
19:20:58 | FromGitter | <alehander92> but i forgot its name |
19:21:20 | FromGitter | <alehander92> i dont really like separate docs except a bigger readme+maybe tutorials |
19:27:39 | FromGitter | <alehander92> probably just writing good docstrings + comment blocks in strategic places is good enough for now tho |
19:27:49 | * | dadada quit (Ping timeout: 272 seconds) |
19:33:31 | FromDiscord_ | <Rika> huh, i'm getting SIGSEGV from this line (i think?) when using discordnim https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/asyncnet.nim#L229 |
19:36:19 | leorize | Araq: we definitely should model a set[FileFlags] |
19:36:26 | * | dadada joined #nim |
19:36:51 | * | dadada is now known as Guest7161 |
19:36:58 | leorize | having fmRead, fmReadWrite, fmWrite is not really nimish |
19:37:31 | * | nsf quit (Quit: WeeChat 2.7) |
19:38:20 | FromDiscord_ | <Rika> wouldnt the issue then be that some flags arent compatible with each other? |
19:40:35 | leorize | it's not like we can't detect that |
19:41:07 | FromDiscord_ | <Rika> would it confuse beginners? |
19:41:47 | leorize | as if fmReadWrite is not confusing :p |
19:41:54 | leorize | but it wouldn't confuse anyone, really |
19:42:17 | leorize | it makes perfect sense when you can't have a set like {ffRead, ffTruncate} for example |
19:42:56 | FromGitter | <Varriount> Unless ffTruncate implies ffWrite |
19:43:41 | leorize | Nim's set model don't support that kind of implications |
19:49:04 | FromDiscord_ | <Rika> who said its the set model that would cause the implication |
19:49:38 | * | Guest7161 quit (Ping timeout: 240 seconds) |
19:51:20 | * | dadada_ joined #nim |
20:00:23 | * | couven92 quit (Read error: Connection reset by peer) |
20:00:49 | * | couven92 joined #nim |
20:02:22 | * | couven92 quit (Read error: Connection reset by peer) |
20:02:48 | * | couven92 joined #nim |
20:05:11 | * | dadada_ quit (Ping timeout: 272 seconds) |
20:06:18 | * | dadada_ joined #nim |
20:19:41 | * | dadada_ quit (Ping timeout: 252 seconds) |
20:20:46 | FromDiscord_ | <slymilano> Could one create an Elixir Phoenix like framework for Nim? Any attempts so far? |
20:20:58 | FromDiscord_ | <slymilano> I’m interested in making one |
20:21:22 | * | dadada joined #nim |
20:21:46 | * | dadada is now known as Guest59848 |
20:22:33 | FromDiscord_ | <clyybber> sure |
20:22:36 | FromDiscord_ | <clyybber> go ahead |
20:22:42 | FromDiscord_ | <Elegant Beef> leorize i will attest that fmReadWrite clearing didnt make anysense to me for a good few minutes, im used to that openning and appending, it doesnt indicated clearing in the name |
20:23:12 | FromDiscord_ | <Elegant Beef> fmReadWrite should be fmReadWriteClear, and fmReadWriteExisting should be fmReadWrite |
20:23:26 | FromDiscord_ | <Elegant Beef> or flags |
20:23:27 | FromDiscord_ | <Elegant Beef> 😄 |
20:23:45 | leorize | too late to change that now, I'll put in a flag system once I start working on a new io.nim |
20:24:26 | FromDiscord_ | <Elegant Beef> Oh i know it's too late, just backing up your "it's confusing" |
20:26:44 | FromDiscord_ | <Elegant Beef> also can i pettion for flags[enum], i'd never think a set[enums] is flags until i read the tutorial part that says it |
20:27:24 | leorize | nah, set[T] is the much better name |
20:27:28 | leorize | it can do more than just flags |
20:29:09 | FromDiscord_ | <Elegant Beef> huh? |
20:30:49 | FromDiscord_ | <Rika> how would you implement a flags[enum]? |
20:31:12 | FromDiscord_ | <Rika> basically he said that set[T] has more uses than flags[enum] |
20:31:23 | FromDiscord_ | <Rika> or flags[T] tho idk how that would look |
20:31:28 | FromDiscord_ | <Elegant Beef> the same way as the set but remove the {a,b}, so it's more akin to just bit flags |
20:32:00 | FromDiscord_ | <Elegant Beef> I'd say more do it to be visibly explict |
20:33:02 | FromDiscord_ | <Rika> sounds like an unnecessary change for helping beginners |
20:33:17 | FromDiscord_ | <Rika> how would bitflags look? |
20:34:46 | * | Guest59848 quit (Ping timeout: 255 seconds) |
20:34:56 | FromDiscord_ | <Elegant Beef> would look mostly the same, just be more explict |
20:35:17 | FromDiscord_ | <Elegant Beef> instead of {a,b} i'd say a & b |
20:35:41 | FromDiscord_ | <Rika> looks more confusing if youd ask me |
20:35:56 | FromDiscord_ | <Elegant Beef> so `fmFlag = read & write & clear` |
20:36:12 | * | dadada_ joined #nim |
20:36:13 | FromDiscord_ | <Rika> it would need to look like "ffRead" still |
20:36:18 | FromDiscord_ | <Rika> you're adding a symbol |
20:36:18 | FromDiscord_ | <Elegant Beef> i know |
20:37:00 | FromDiscord_ | <Elegant Beef> To be fair i was joking and dont care that much |
20:37:01 | leorize | Elegant Beef: that kind of `&` is C :P |
20:37:19 | FromDiscord_ | <Elegant Beef> Well blame my C# roots 😛 |
20:39:21 | * | zahary2 quit (Quit: Leaving.) |
20:39:39 | * | zahary1 joined #nim |
20:40:07 | * | zahary1 quit (Client Quit) |
20:43:00 | * | zahary1 joined #nim |
20:43:26 | * | fanta1 quit (Quit: fanta1) |
20:45:14 | * | narimiran quit (Ping timeout: 240 seconds) |
20:45:49 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:45:51 | * | zahary1 quit (Client Quit) |
20:46:07 | * | zahary1 joined #nim |
20:46:38 | * | zahary1 quit (Client Quit) |
20:50:11 | * | dadada_ quit (Ping timeout: 260 seconds) |
20:51:16 | * | dadada_ joined #nim |
20:54:02 | lqdev[m] | why does the stdlib use RTLD_NOW for loading DLLs instead of RTLD_LAZY? |
20:54:06 | lqdev[m] | namely the dynlib module |
20:54:58 | leorize | security reasons :P |
20:55:06 | leorize | but to be fair, it's just faster in the long run |
21:01:52 | lqdev[m] | leorize: what security reasons? |
21:02:24 | lqdev[m] | it causes issues when loading libs with undefined symbols (which are only defined during the program's runtime) |
21:05:05 | * | dadada_ quit (Ping timeout: 258 seconds) |
21:06:14 | * | dadada_ joined #nim |
21:06:36 | leorize | wdym by "only defined during the program's runtime"? |
21:08:21 | * | Hideki_ joined #nim |
21:09:34 | lqdev[m] | I have a dynlib which uses an extern declaration from a header file, but does not link to my main program which actually implements the function. the symbol for the extern function remains undefined when loading using RTLD_NOW and ultimately results in my desired function's symbol not being found by `dlsym` |
21:09:56 | leorize | lqdev[m]: it was there since the beginning, but here's the benefit of RTLD_NOW: it allows RELRO hardening to mark sections as read-only as soon as possible |
21:10:32 | leorize | lqdev[m]: do you export the symbol? |
21:11:00 | leorize | if you don't then the library you load won't be able to open it |
21:11:41 | lqdev[m] | leorize: yes |
21:11:49 | lqdev[m] | of course I do |
21:11:52 | leorize | did you put {.dynlib.} on it? |
21:11:56 | * | letto quit (Quit: Konversation terminated!) |
21:12:08 | lqdev[m] | which one, the one exported from the app or the lib? |
21:12:11 | leorize | both |
21:12:35 | leorize | you need one for the app so the dynamic linker exposes that symbol to the loaded library |
21:12:38 | lqdev[m] | ah, I didn't put one on the sym exported from the app |
21:12:45 | * | Hideki_ quit (Ping timeout: 258 seconds) |
21:12:52 | lqdev[m] | the lib is written in C so idk how I'd do that |
21:12:54 | leorize | and you need one for the lib so the dynamic linker can load it from the lib |
21:13:29 | leorize | then it's probably already supported |
21:13:43 | * | letto joined #nim |
21:14:35 | lqdev[m] | yeah `readelf` reports that the symbol is global and its visibility is normal, and it loads fine with RTLD_LAZY |
21:15:00 | leorize | well it's lazy :P |
21:15:12 | leorize | it won't attempt to resolve until you use it |
21:15:33 | lqdev[m] | but putting exportc, dynlib onto my app's procs doesn't work, the symbol still stays unresolved when attempting to find it |
21:15:52 | leorize | that's strange |
21:16:19 | leorize | according to dlopen whatever symbol that's already global will be available for the loaded lib to relocate against |
21:18:39 | lqdev[m] | this is my C API https://github.com/liquid600pgm/nadio/blob/master/src/nadio/plugins/c_api.nim |
21:19:03 | lqdev[m] | and this is how I load my procs https://github.com/liquid600pgm/nadio/blob/master/src/nadio/plugins.nim#L17 |
21:19:19 | * | neceve quit (Ping timeout: 255 seconds) |
21:19:38 | * | dadada_ quit (Ping timeout: 240 seconds) |
21:21:15 | leorize | can you verify that the symbol is exported from your binary? |
21:21:21 | * | dadada joined #nim |
21:21:45 | * | dadada is now known as Guest94794 |
21:22:55 | lqdev[m] | yeah, it's exported |
21:23:19 | * | hax-scramper quit (Read error: Connection reset by peer) |
21:23:44 | * | hax-scramper joined #nim |
21:25:25 | * | clyybber joined #nim |
21:30:20 | lqdev[m] | I may just use my own implementation of loadLib at this point, I'm too lazy and have too little knowledge to debug this |
21:32:57 | * | solitudesf joined #nim |
21:34:23 | * | letto_ joined #nim |
21:35:07 | * | Guest94794 quit (Ping timeout: 272 seconds) |
21:35:21 | * | letto quit (Ping timeout: 265 seconds) |
21:36:12 | * | dadada_ joined #nim |
21:36:54 | * | couven92 quit (Read error: Connection reset by peer) |
21:37:15 | * | couven92 joined #nim |
21:49:55 | * | dadada_ quit (Ping timeout: 260 seconds) |
21:51:16 | * | dadada_ joined #nim |
22:01:50 | * | marmotini_ quit (Remote host closed the connection) |
22:02:23 | * | marmotini_ joined #nim |
22:05:16 | * | dadada_ quit (Ping timeout: 258 seconds) |
22:05:33 | * | drewr joined #nim |
22:06:09 | * | tane quit (Quit: Leaving) |
22:06:17 | * | dadada_ joined #nim |
22:06:26 | * | marmotini_ quit (Ping timeout: 240 seconds) |
22:10:42 | * | Trustable quit (Remote host closed the connection) |
22:20:43 | * | dadada_ quit (Ping timeout: 272 seconds) |
22:21:18 | * | dadada joined #nim |
22:21:41 | * | dadada is now known as Guest62548 |
22:27:43 | * | solitudesf quit (Ping timeout: 255 seconds) |
22:31:36 | * | Hideki_ joined #nim |
22:32:50 | * | natrys quit (Ping timeout: 240 seconds) |
22:35:17 | * | Guest62548 quit (Ping timeout: 265 seconds) |
22:36:42 | * | dadada_ joined #nim |
22:50:29 | * | dadada_ quit (Ping timeout: 272 seconds) |
22:51:22 | * | dadada_ joined #nim |
22:51:45 | * | lritter quit (Ping timeout: 272 seconds) |
22:52:55 | * | clyybber quit (Ping timeout: 255 seconds) |
22:54:36 | * | clyybber joined #nim |
23:04:50 | * | dadada_ quit (Ping timeout: 240 seconds) |
23:06:18 | * | dadada_ joined #nim |
23:08:09 | * | filcuc quit (Ping timeout: 265 seconds) |
23:12:32 | * | filcuc joined #nim |
23:20:14 | * | dadada_ quit (Ping timeout: 265 seconds) |
23:21:15 | * | dadada joined #nim |
23:21:40 | * | dadada is now known as Guest49723 |
23:34:11 | * | Hideki_ quit (Ping timeout: 272 seconds) |
23:37:50 | * | couven92 quit (Read error: Connection reset by peer) |
23:38:18 | * | couven92 joined #nim |
23:47:55 | * | clyybber quit (Quit: WeeChat 2.7.1) |