00:01:30 | * | disbot quit (Remote host closed the connection) |
00:02:00 | * | disbot joined #nim |
00:02:26 | * | disbot quit (Remote host closed the connection) |
00:02:58 | * | disbot joined #nim |
00:04:50 | * | disbot quit (Remote host closed the connection) |
00:13:52 | * | disbot joined #nim |
00:37:32 | * | abm quit (Quit: Leaving) |
00:48:40 | * | Jjp137 quit (Quit: Leaving) |
00:49:34 | * | Jjp137 joined #nim |
01:07:29 | * | kevin joined #nim |
01:07:53 | * | kevin is now known as Guest28716 |
01:12:02 | * | theelous3 quit (Ping timeout: 240 seconds) |
01:12:14 | FromDiscord | <mratsim> Latest "blog post" on Picasso and multithreading: https://github.com/nim-lang/RFCs/issues/160#issuecomment-549199561 |
01:43:23 | * | theelous3_ joined #nim |
01:45:40 | * | exelotl quit (Ping timeout: 264 seconds) |
02:02:34 | * | kevin joined #nim |
02:02:35 | * | kevin is now known as Guest76029 |
02:03:04 | * | Guest28716 quit (Quit: leaving) |
02:04:21 | * | Guest76029 quit (Client Quit) |
02:05:41 | * | kevin- joined #nim |
02:07:28 | kevin- | 👑 |
02:12:04 | kevin- | hello |
02:14:56 | kevin- | is it Emacs nim-mode is best Nim's editor ? |
02:15:18 | FromDiscord | <Rika> Depends on what you want |
02:20:41 | kevin- | ok thanks, we have vscode also :D |
02:22:02 | kevin- | how can we grow up a nim user group at my country ? |
02:22:48 | kevin- | need to register with nim-lang.org first ? |
02:34:10 | yumaikas | So, I have a question: Is there a recommended way to do a single-threaded TUI that doesn't block on only keyboard input? |
02:36:12 | leorize | kevin-: I'd say nim.nvim gives you the best Nim experience :P |
02:36:25 | leorize | assuming that you are familiar with neovim |
02:36:51 | kevin- | thanks for your suggestion |
02:39:30 | * | rockcavera quit (Remote host closed the connection) |
02:40:18 | leorize | yumaikas: stdin can be asynchronous, if that's what you want |
02:42:14 | yumaikas | That *might* be what I want? Bascially, I'd kinda like to be able to have the ability to listen on stdin, as well being able to set timers |
02:43:25 | yumaikas | So that I can do stuff like animate timers for a TUI terminal game |
02:45:08 | leorize | sounds like that'd work |
02:46:03 | yumaikas | leorize: How would I wait on multiple async things at once? In go, I'd use select, but I'm not familiar with what I should be looking for in nim |
02:46:04 | * | kevin- quit (Remote host closed the connection) |
02:46:32 | leorize | just poll() |
02:46:44 | leorize | you can check if a Future has finished with the finished() proc |
02:46:50 | * | kevin joined #nim |
02:47:07 | * | kevin is now known as Guest29993 |
02:48:21 | leorize | so I guess something like: while true: (poll(); if fut1.finished: doSmt; if fut2.finished: doOtherThings) |
02:48:55 | * | Guest29993 is now known as kevin- |
02:49:04 | yumaikas | That actually sounds kinda interesting, tbh |
02:49:39 | yumaikas | So, this is all in asyncdispatch then |
02:49:57 | yumaikas | And it has timers.... |
02:51:05 | leorize | and if you don't need to do anything in-between the poll()s, you can do poll(-1) and it will wait until at least one future is finished before returning |
02:53:19 | yumaikas | Seems pretty legit. I suppose it probably doesn't work on JS targets (I know of other things, like requestAnimationFrame and timers to achieve something similar, just thinking atm) |
03:08:41 | * | lritter quit (Ping timeout: 265 seconds) |
03:09:06 | * | disbot quit (Remote host closed the connection) |
03:09:10 | * | lritter joined #nim |
03:12:23 | FromDiscord | <citycide> how would one go about debugging a compile error that occurs on something like a raspberry pi zero? |
03:12:45 | leorize | read the error message? |
03:12:46 | disruptek | very slowly. |
03:13:05 | FromDiscord | <Rika> leorize, best to assume the error message isnt helpful |
03:13:09 | * | disbot joined #nim |
03:13:12 | FromDiscord | <citycide> leorize: yeah that's obvious |
03:13:30 | leorize | well, what's the error then? |
03:13:35 | FromDiscord | <citycide> it's a value out of range error, but it's simple multiplication |
03:13:54 | FromDiscord | <citycide> error points here: |
03:13:54 | FromDiscord | <citycide> https://github.com/citycide/fugitive/blob/5e59a0b35ab457aa6fc19f79f88a1365d44acb12/src/fugitivepkg/common/humanize.nim#L9 |
03:13:58 | disruptek | ima guess the number isn't too small. |
03:14:19 | FromDiscord | <Rika> what's your days count |
03:14:23 | FromDiscord | <Rika> i mean years |
03:14:39 | FromDiscord | <citycide> it's essentially the number of seconds per year |
03:14:47 | leorize | !eval echo int32(365 * 24 * 60 * 60 * 60 * 1000) |
03:14:49 | NimBot | Compile failed: /usercode/in.nim(1, 11) Error: 1892160000000 can't be converted to int32 |
03:14:58 | leorize | ^ that might be your problem |
03:15:07 | leorize | I'm not familiar with rpi architecture though |
03:15:09 | disruptek | nailed it. |
03:15:48 | FromDiscord | <Rika> !eval echo int64(365 * 24 * 60 * 60 * 60 * 1000) |
03:15:50 | FromDiscord | <Rika> aww |
03:15:50 | NimBot | 1892160000000 |
03:15:55 | FromDiscord | <Rika> oh just slow |
03:16:28 | FromDiscord | <Rika> sometimes i forget what int64.high is |
03:16:35 | FromDiscord | <Rika> !eval echo int64.high |
03:16:37 | NimBot | 9223372036854775807 |
03:16:39 | disruptek | all real programmers know the number of seconds in a day by heart. |
03:17:23 | FromDiscord | <citycide> realer programmers know the milliseconds/day |
03:17:23 | FromDiscord | <Rika> wait, why is second = 1000? shouldnt that be millisecond? |
03:17:40 | FromDiscord | <citycide> I believe I'm actually tracking the ms per those units |
03:17:44 | FromDiscord | <citycide> it's been a while 🙂 |
03:17:51 | FromDiscord | <Rika> well you said seconds in a year |
03:17:52 | FromDiscord | <Rika> okay |
03:18:51 | leorize | citycide: you should probably switch to int64 explicitly if you want it to work on rpi zero |
03:19:30 | FromDiscord | <citycide> leorize: figured, but how can I test? |
03:19:54 | disruptek | it will take about a year. |
03:20:00 | leorize | the compiler should prevent this at compile time |
03:20:09 | disruptek | or, that. |
03:20:22 | leorize | so it's probably be a bug that it didn't |
03:21:34 | FromDiscord | <Rika> isnt `int` always whatever the os uses? so on a normal 64bit pc, it would be `int64`, correct (i dont know)? then the rpi might be 32bit, which might use `int32` for `int`s |
03:21:40 | FromDiscord | <Rika> if im not a dumbass |
03:22:01 | FromDiscord | <citycide> @Rika I'm trying to search for that right now, I thought the same thing |
03:22:09 | leorize | yes, but you can explicitly choose if int64 is used |
03:22:26 | FromDiscord | <Rika> yeah i know |
03:22:42 | leorize | constants have a special type of `int literal`, which can morph to int64 or int32, depending on the value |
03:22:45 | FromDiscord | <Rika> but rn he's looking for why it works on desktop pc but not rpi |
03:22:50 | FromDiscord | <Rika> ooh |
03:22:56 | FromDiscord | <Rika> ill be going now, have to do smth |
03:22:57 | leorize | since that const is huge, it should have been transformed to int64 :/ |
03:23:46 | FromDiscord | <citycide> hmm |
03:24:50 | leorize | citycide: what's the full stacktrace leading to the crash? |
03:25:25 | FromDiscord | <citycide> I'm going off the issue someone filed which doesn't have much more than I've given: |
03:25:25 | FromDiscord | <citycide> https://github.com/citycide/fugitive/issues/2 |
03:25:54 | FromDiscord | <citycide> I think that's all there is, given that the line in question is a `const` |
03:26:24 | leorize | having the reproduction steps would be useful |
03:26:44 | leorize | since the rpi zero is 32bit, you can test this with a 32bit nim compiler |
03:27:17 | * | lritter quit (Ping timeout: 240 seconds) |
03:27:24 | FromDiscord | <citycide> well luckily that's all choosenim can install on Windows, so let's give it a shot haha |
03:27:28 | FromDiscord | <citycide> will report back |
03:28:03 | leorize | last time I checked nim compiled a 64bit exe on windows :P |
03:28:58 | FromDiscord | <citycide> I think it's based on gcc being install already or not |
03:29:21 | FromDiscord | <citycide> https://github.com/dom96/choosenim/issues/128#issuecomment-514338375 |
03:32:46 | FromDiscord | <citycide> so this seems obvious now that an int64 can't be represented in a x32 environment, yeah? compiling with 32-bit nim results in the same error |
03:35:31 | leorize | int64 is available on 32bit nim fwiw |
03:35:54 | leorize | the problem is that the compiler didn't convert it correctly |
03:36:24 | leorize | you can try "fixing" it by adding u64 postfix to the `second` label |
03:36:27 | leorize | const* |
03:36:48 | leorize | but an overflow like that shouldn't happen during compile time |
03:36:48 | FromDiscord | <citycide> I'm not so sure. a simple file with only `echo int64.high` fails to compile with 32-bit nim |
03:37:53 | leorize | if int64 couldn't be used, the type wouldn't be there to begin with |
03:38:46 | FromDiscord | <Rika> that doesnt sound reasonable to me |
03:39:37 | disruptek | you can't handle the truth! |
03:43:16 | leorize | citycide: I've just tested and an int64.high does compile on my windows with 32bit nim |
03:44:09 | FromDiscord | <citycide> well then |
03:44:50 | leorize | looks like it's a problem with consts |
03:44:52 | FromDiscord | <citycide> are you able to check if that `const` section of units compiles? |
03:45:06 | leorize | it doesn't |
03:45:21 | leorize | you can fix that by postfixing `i64` to `second` |
03:45:46 | leorize | but this looks like a potential bug? |
03:48:43 | leorize | can you file an issue with that `const` section? |
03:53:51 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
03:54:14 | * | pbb joined #nim |
03:59:00 | * | dddddd quit (Remote host closed the connection) |
04:11:32 | shashlick | big update to the `local deps mode` proposal for nimble - https://gist.github.com/genotrance/ee2ce321a56c95df2d4bb7ce4bd6b5ab |
04:12:40 | disruptek | 🤔 |
04:13:49 | shashlick | better call this an RFC |
04:15:28 | FromDiscord | <citycide> leorize: sure |
04:16:25 | disruptek | shashlick: so `develop` defaults to localeps? |
04:17:00 | shashlick | only if the package is preconfigured that way |
04:17:05 | shashlick | else default behavior |
04:17:37 | disruptek | i guess that section is confusing; under Command-line behavior outside any Nimble project. |
04:19:35 | disruptek | do we have to check deps/* or deps/empty.txt in order is it enough to simply have that `deps` directory? i think that's confusing, too, unless it truly requires that the object exist in git. |
04:20:15 | shashlick | just that the directory exists for `local deps mode` but that section is how to make it persist |
04:20:24 | disruptek | okay. |
04:21:16 | disruptek | i think you should just make it clear that nimble looks for the directory. people understand the concept of adding it to vcs, but you don't need vcs to achieve localdeps. |
04:21:19 | shashlick | i think we are getting closer, let's see |
04:21:29 | shashlick | will do |
04:21:42 | shashlick | keep 'em coming, i'll clarify |
04:21:52 | disruptek | it's pretty good, i think. |
04:22:49 | disruptek | you've done a good job of touching on the major use-cases, too. |
04:26:34 | disruptek | what's involved in this change? |
04:27:41 | shashlick | it's not really too bad - basically detect dir and set nimbleDir |
04:27:53 | shashlick | add some messages to note mode |
04:27:53 | * | kevin- quit (Ping timeout: 276 seconds) |
04:28:10 | disruptek | so, just to make sure i've got this right, there's no way to `nimble install` binaries into a $prj/deps because nimble will complain, right? |
04:28:12 | shashlick | where there are exceptions, which are noted, detect and notify |
04:28:49 | shashlick | hmm - well, we could do that i guess, that will remove that exception as well |
04:28:54 | shashlick | but what's the point right |
04:29:10 | shashlick | nimble will build first anyway and the binary will be right there |
04:29:27 | disruptek | consistency and because if you don't use user deps, you might want install to do installish things. |
04:29:58 | disruptek | when i build some projects that have multiple binaries, they get built alongside their sources, which isn't necessarily their installation directory. |
04:30:57 | shashlick | how is install dir specified? |
04:31:48 | disruptek | what do you mean? |
04:33:00 | shashlick | well, how does nimble know that the binary is compiled in one place but placed elsewhere on install |
04:33:20 | shashlick | the way i understand it, nimble compiles wherever the binary is then links it into ~/.nimble/bin |
04:33:28 | shashlick | so the binary stays where it is |
04:33:42 | shashlick | or wherever it is configured to build via a nims or cfg |
04:33:59 | disruptek | that's fine. i didn't even realize they were just linked. |
04:34:10 | disruptek | i figured araq would never have gone for that. |
04:34:37 | disruptek | but that linking is an install-only step that is missing from local deps. |
04:34:46 | disruptek | may as well remove that exception and make it work the same. |
04:36:14 | shashlick | so we should copy the files as well? |
04:36:22 | disruptek | the point remains that i don't want to have to go spelunking in my trees in order to find my binaries. |
04:36:32 | disruptek | i happen to like symlinks. |
04:37:17 | disruptek | i'd just like to have them in deps/bin or whatever, if i do an install. |
04:37:23 | shashlick | then it makes for even fewer exceptions |
04:38:17 | disruptek | the word revert makes it sound like it changes the environment beyond the execution of the command. |
04:38:24 | disruptek | maybe it's just me. |
04:39:02 | shashlick | that's fair |
04:40:53 | disruptek | is there any reason to link the project into its own deps dir? |
04:41:56 | shashlick | should we omit the project files in nimble install |
04:42:05 | shashlick | and limit to binaries |
04:42:22 | shashlick | i don't see any reason for that or the link since these are only relevant for the project itself |
04:42:32 | shashlick | and its files are already there |
04:42:38 | shashlick | in fact, we could even run into issues |
04:42:53 | disruptek | i'm worried about whether the compiler will need them when that change goes through. |
04:43:07 | disruptek | ie. if we fix nimblePath. |
04:43:47 | shashlick | well but the compiler is going to compile that project with its deps in that folder |
04:44:09 | disruptek | so how does it get that path? |
04:44:09 | shashlick | it doesn't need the project in the deps folder confusing anything |
04:44:27 | disruptek | okay; if you're confident. |
04:45:05 | disruptek | then i don't think we need the project files; just binaries. |
04:45:13 | shashlick | actually, it might be a mess |
04:45:14 | disruptek | and those can just be linked into place. |
04:45:21 | shashlick | cause the binaries are linked from bin into pkgs/xyz |
04:45:44 | shashlick | so we will have to copy binaries but skip the project files |
04:45:58 | shashlick | unless we change the code altogether to link to the main project dir and not the pkgs/project |
04:46:45 | disruptek | less exceptions. |
04:48:05 | shashlick | let's see what others say |
04:48:10 | shashlick | i'll think more about it |
04:50:19 | * | nsf joined #nim |
04:52:28 | shashlick | okay gonna chill now, l8r |
04:52:34 | disruptek | night |
04:53:02 | shashlick | thanks for taking the time, always appreciated |
04:53:17 | disruptek | happy if i can help. |
04:56:28 | * | chemist69 quit (Ping timeout: 264 seconds) |
04:58:00 | * | chemist69 joined #nim |
05:22:12 | * | fishybird joined #nim |
05:22:40 | fishybird | hello, I'm new to nim! |
05:23:30 | fishybird | I'm trying to write an object and change it's values with a procedure and I'm having some trouble. Is this the right place to get help? |
05:30:19 | * | uu91 quit (Remote host closed the connection) |
05:30:49 | * | uu91 joined #nim |
05:43:37 | * | MightyJoe quit (Ping timeout: 240 seconds) |
05:46:01 | * | cyraxjoe joined #nim |
05:48:02 | * | theelous3_ quit (Ping timeout: 268 seconds) |
05:52:18 | * | kevin- joined #nim |
05:52:49 | * | kevin- quit (Remote host closed the connection) |
05:53:59 | * | kevin- joined #nim |
06:03:05 | * | kevin- quit (Remote host closed the connection) |
06:05:56 | * | kevin- joined #nim |
06:06:26 | * | narimiran joined #nim |
06:06:30 | kevin- | 👑️ |
06:06:49 | * | narimiran quit (Remote host closed the connection) |
06:07:27 | * | narimiran joined #nim |
06:07:39 | * | fishybird quit (Remote host closed the connection) |
06:08:09 | FromGitter | <Vindaar> @fishybird: Hey! It sure is the right place! |
06:09:59 | FromGitter | <Vindaar> if you want to change the values of an object you have to use a `var` argument in the proc. E.g. `proc set(x: var MyObj, val: float)` etc. Note that if the `MyObj` type is a `ref object` you can change it even if it's not given as `var` |
06:28:11 | * | kevin- left #nim ("Using Circe, the loveliest of all IRC clients") |
06:33:29 | Zevv | shashlick: the value of system global is that libraries can and will be shipped by linux distributions. `apt-get install nim-jester`. |
06:38:32 | Araq | is that really a thing? |
06:39:04 | leorize | yes, it's frequently used for python modules |
06:39:24 | Araq | but Python is different... |
06:39:34 | Araq | it doesn't produce binaries, for example. |
06:39:55 | leorize | in a way, you can say C libraries are distributed in the same way |
06:40:05 | leorize | just that they don't have a package manager |
06:40:21 | Araq | and why would I ever use 'apt-get install nim-jester'? it would be some random outdated version |
06:41:04 | Araq | hardly what I want for my Nim project |
06:41:44 | leorize | it works for C programmers so... :p |
06:41:54 | Araq | ha ha ha ha |
06:42:04 | leorize | one of the possible usage is for compiler-dependant stuff |
06:42:06 | Araq | ./configure is all I say |
06:43:42 | * | solitudesf joined #nim |
06:45:59 | Zevv | Araq: it is very common, the package maintainers take the responsibiltity to make sure libs and compiler versions match. usually |
06:46:13 | Zevv | and it works just fine. usually |
06:46:19 | GordonBGood | Araq: I see your recent PR's and raise you a new one: https://github.com/nim-lang/Nim/issues/12588 |
06:46:47 | Zevv | for python, perl, lua, and other languages. until you start mixing with the languages package manager, and all hell breaks loose. |
06:47:06 | Zevv | tehen you get abhorrations like pyenv or whtever its called |
06:47:42 | GordonBGood | I spent some time yesterday, and think I've narrowed it down to the injection of `=destroy` calls for seq where it isn't picking up that seqsv2 have their own custom "hooks" |
06:47:59 | GordonBGood | probably related to some legacy treatment for seq's |
06:48:23 | GordonBGood | I'd like to fix it myself, but I know you will know exactly where to look? |
06:49:17 | GordonBGood | The issue is pretty clear on where I think the problem is, but then I could be wrong ;) |
06:50:57 | Araq | # [ may custom "hooks" somehow disables the proper destruction of the inner object? |
06:51:24 | Araq | well yes, that's the design, the compiler cannot guess your destruction logic when you decided to customize it |
06:51:59 | GordonBGood | Araq: on TestObj, the custome hooks are mostly just to see if and when they are triggered, so not necessary to destroy the inner seq... |
06:52:20 | Araq | ok |
06:52:25 | GordonBGood | When I comment out the custom hooks - no mem leak; with the custom hook - mem leak |
06:53:04 | Araq | which ones? |
06:53:13 | Araq | this bug report is a mess, sorry to say it |
06:53:16 | Araq | TestObj = object |
06:53:16 | Araq | # big: MySeq[byte] # custom MySeq works; |
06:53:16 | Araq | big: seq[byte] # regular seq doesn't, even for seqsv2! |
06:53:27 | Araq | ^ is this the actual bug? |
06:53:34 | GordonBGood | As you can see in the issue code, I even created my own emulation of MySeq, and they work in the same situation, so it isn't related to objects in general, only seqsv2 |
06:53:42 | Araq | aha |
06:54:06 | Araq | if you report bugs, don't report the whatifs in the same code snippet |
06:54:20 | Araq | create multiple code snippets please |
06:54:27 | GordonBGood | The mess is related to trying to save you some time in not having to check some things I already checked... |
06:54:38 | GordonBGood | Ah, sorry, next time |
06:54:45 | Araq | I know but it doesn't help as much as you think ;-) |
06:55:10 | Araq | ok, so builtin =destroy for seqs is buggy |
06:55:25 | GordonBGood | No, I suppose not, but just trying to narrow it down in every way I could think of |
06:56:06 | GordonBGood | Just delete all the "MySeq" stuff; I'll do it now for you if you would like... |
06:56:27 | Araq | look at ccgexprs.nim, line 2025 |
06:56:39 | Araq | see if your code triggers this |
06:56:40 | GordonBGood | Yes, `=destroy` for seqs is buggy, but seemingly just in this one unique way |
06:58:06 | Araq | also the destructors we generated for 'ref' are buggy |
06:58:23 | Araq | right? they need to nil out the 'var ref T' parameter in the end |
07:01:25 | GordonBGood | I'm looking at ccgexprs.nim line 2025 and more exactly lines 2036-2041 treating seq's in the proc "genDestroy"; I'm guessing this is erroneously triggered; how do I trace this? |
07:01:52 | GordonBGood | The test code doesn't use any `ref`'s does it? |
07:02:34 | GordonBGood | new seqsv2 aren't ref's or ptr's on the outside |
07:03:03 | GordonBGood | And the test code uses an object "TestObj" to show the problem |
07:03:10 | Araq | sure |
07:03:58 | Araq | "how do I trace this?" add a 'writeStackTrace()' call and run 'koch temp' |
07:04:08 | GordonBGood | I haven't seen any problems with substituting our ref counted refs for legacy ref's in --gc:destructors, at least as yet |
07:04:48 | GordonBGood | Ok, proceeding with writeStackTrace and koch, give me a few |
07:06:58 | * | solitudesf quit (Ping timeout: 265 seconds) |
07:08:04 | Araq | I also want my '.cursor' pragma back... |
07:18:12 | GordonBGood | Araq: yes,. genDestroy is being called, and getting to the part for "tySequence" at line 2036; it is called from genMagicExpr |
07:19:20 | GordonBGood | which is called from "expr" |
07:26:07 | Araq | ok, well |
07:28:02 | GordonBGood | There are two potential places for the genMagicExpr call from expr, so I'm adding writeStackTrace to see which applies... |
07:29:17 | Araq | I'm not sure the bug is in this place |
07:30:19 | GordonBGood | Okay, it kind of makes sense that a destructor is being generated when it should be calling the custom one that already exists, but you are the man |
07:33:05 | GordonBGood | Too many "writeStackTrace()" calls, need to put a condition on calling, but don't know what condition to use |
07:40:48 | * | leorize quit (Ping timeout: 260 seconds) |
07:42:55 | * | leorize joined #nim |
07:54:20 | planetis[m] | hi guys, I released eminim v0.3 https://github.com/b3liever/eminim (a JSON unmarshaling macro). It now reuses generated 'load' procs for (ref) objects and the generated code size is smaller. |
07:55:19 | planetis[m] | krux02: good morning, do you thing from this state of the macro, graphs can be supported? |
07:55:20 | * | kevin- joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:00:21 | * | PMunch joined #nim |
08:02:20 | PMunch | Thanks to whoever gilded my latest article on Reddit :) |
08:03:39 | GordonBGood | Araq: if it helps, if just a direct seq is used (not inside an object with a custom `=destroy`) and even manually calling `=destroy` on it, there is no call to genDestroy and no memory leak |
08:04:38 | * | gmpreussner joined #nim |
08:06:33 | * | krux02 joined #nim |
08:15:07 | shashlick | @Zevv @leorize I've kept system globals aside since it's not just a global flag, it means nimble needs to be able to load from multiple nimble dirs. And that's a different design |
08:15:28 | shashlick | We can discuss that later |
08:16:42 | Zevv | sure, and the question also is if you even want to go there |
08:17:17 | shashlick | I'm kind of in the same mindset as @Araq |
08:17:46 | shashlick | Will be some random old version of stuff |
08:18:14 | shashlick | We barely have an up to date Nim let alone packages |
08:18:30 | shashlick | If someone wants to pick it up sure |
08:21:22 | * | ng0 joined #nim |
08:23:42 | shashlick | But if we did go for it, it would make most sense to have global deps and user deps coexist with user deps taking precedence |
08:23:55 | shashlick | Local deps however would be isolated |
08:25:09 | shashlick | In some sense, it feels like `-u | --user` is really better off being called `-g | --global` |
08:27:41 | shashlick | But ya, if you like the stability that the system package manager brings with the older combo of Nim and packages and don't want to mix in user deps chaos in, maybe it should be seen as a different type of isolation |
08:28:36 | shashlick | Was thinking we could repurpose -g but doesn't seem appropriate yet |
08:30:14 | Zevv | I think the Nim case is different though, regarding to distro-provided libs - there's no need for runtime or compile time libs, so distros can just ship nimble-built applications wihtout providing any dependencies, so I don't thing the system-wide global thing would really apply. Maybe we should involve the current debian nim package maintainer? |
08:30:24 | FromDiscord | <Lantos> guys generally in nim snake or camel case? |
08:30:47 | narimiran | camelCase |
08:37:55 | shashlick | I don't think we need to solve it now since the -u flag is still perhaps intuitive |
08:38:10 | shashlick | But ya, more eyes are better |
08:38:55 | Zevv | right |
08:39:06 | * | Vladar joined #nim |
08:40:35 | * | floppydh joined #nim |
08:43:33 | shashlick | Just linked the global issue as well to the gist so maybe those folks also contribute |
08:43:47 | shashlick | Both these issues are 4-5 years old though |
08:44:00 | shashlick | Wonder who of those folks are still active |
08:44:40 | shashlick | @Zevv @leorize any other feedback on this overall? Appreciate your insights and consensus as well |
08:45:53 | * | Guest6 joined #nim |
08:46:29 | * | Guest6 left #nim (#nim) |
08:47:41 | * | mofeng joined #nim |
08:52:43 | mofeng | hi |
08:53:14 | mofeng | Could I translate nim doc to other languages? |
08:56:26 | FromGitter | <gogolxdong> which language? |
08:57:38 | Zevv | shashlick: what is the consensus now on how to initialize local deps mode? Create directory manually? |
08:59:30 | mofeng | I could not find Chinese doc on the nim-lang.org |
09:00:42 | mofeng | Sorry, I find a site nim-cn.com |
09:00:52 | * | fredrik92 is now known as couven92 |
09:01:22 | * | nf_xp joined #nim |
09:02:31 | * | nf_xp quit (Remote host closed the connection) |
09:13:44 | * | mofeng quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
09:30:04 | * | tklohna joined #nim |
09:35:05 | * | letto quit (Quit: Konversation terminated!) |
09:36:33 | * | letto joined #nim |
09:44:30 | * | clyybber joined #nim |
10:08:41 | * | solitudesf joined #nim |
10:08:52 | PMunch | Hmm, cross-compiling with "nim c --cpu:amd64 --os:windows --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc offset.nim" yields sizeof(culong) as 4 |
10:21:00 | clyybber | Araq: Hey, are types bigger than int16 supposed to work as case discriminators in a variant object? |
10:22:50 | clyybber | I think not, but neither the spec or the error messages are clear. |
10:23:47 | Araq | I fixed the error message for Nim devel |
10:25:40 | * | lritter joined #nim |
10:27:35 | clyybber | Araq: I'm afraid not |
10:27:40 | clyybber | It doesn't trigger |
10:31:26 | Araq | the discs need to be inside a range like 0..0xffff or similar |
10:32:57 | Araq | ah the logic is still wrong |
10:33:08 | Araq | look at semtypes.nim line 641 for the idea |
10:35:04 | clyybber | I get the idea, not exactly what is wrong though. |
10:35:09 | leorize | PMunch: iirc sizeof is now handled by the compiler |
10:35:21 | leorize | if it mismatches gcc, then you might want to file a bug |
10:35:26 | clyybber | Araq: I'm also baffled by this https://github.com/nim-lang/Nim/blob/devel/compiler/semobjconstr.nim#L264 |
10:35:45 | clyybber | Because this error message at least seems to be redundant if your fix worked |
10:37:11 | clyybber | And it also only triggers for the selectedBrench != -1 case, which doesn't make sense |
10:37:12 | Araq | my fix needs 'if' instead of 'elif' :-) |
10:37:37 | Araq | I dunno about the line #L264, I didn't write it |
10:38:20 | clyybber | Oh, I wasn't aware. Ok. I'll fix it in my defaultfields PR then :) |
10:45:55 | FromGitter | <zacharycarter> so for cross-platform non-blocking UDP sockets, is the solution still to go with something like enet? |
10:46:22 | * | kevin- quit (Remote host closed the connection) |
10:47:51 | * | tklohna quit (Ping timeout: 265 seconds) |
10:48:41 | FromGitter | <alehander42> hm, do people use selenium directly from nim |
10:49:07 | FromGitter | <alehander42> i probably need to use the electron node-based on anyway, but still wondering if for other usecases nim drivers are ok |
11:10:38 | zedeus | dom made one, https://github.com/dom96/webdriver |
11:11:48 | FromGitter | <alehander42> yes, i wondered if it is used |
11:13:47 | narimiran | quick poll: how many of you (excluding Status employees) are still using some pre-1.0 version of Nim? (v0.20, v0.19, etc.) which version and why? |
11:28:49 | * | rockcavera joined #nim |
11:33:02 | PMunch | leorize, yeah I was more surprised that the data-type culong was only 4 bytes on Windows 64-bit |
11:34:58 | PMunch | narimiran, I've always been at or close to latest version. In my experience the changes are pretty simple to adapt for, and any performance hit with identical code is probably going to be fixed before that performance is needed anyways :) |
11:50:46 | narimiran | PMunch: i have a *feeling* a large majority of people who are around IRC/Gitter frequently are close to the latest, but i'd like to know if that really is the case or not |
11:52:46 | * | nif quit (Quit: ...) |
11:52:58 | * | nif_ joined #nim |
11:56:12 | FromDiscord | <Rika> heya, is there a version of nimltk that's updated for 1.0? |
11:56:25 | FromDiscord | <Rika> a different project, perhaps? |
11:56:41 | FromDiscord | <Rika> if none, what's the substitute for the seemingly deprecated `queues` module |
11:57:33 | Araq | narimiran, then don't ask on IRC, dude. :-) |
11:57:56 | Araq | Rika: heapqueue.nim ? |
11:58:22 | FromDiscord | <Rika> okay, thanks |
12:02:28 | * | dv^_^ quit (Ping timeout: 264 seconds) |
12:03:48 | * | dv^_^ joined #nim |
12:06:44 | clyybber | Araq: Having low(T) == 0 in your fix is also wrong I think. Because for int16 this isn't 0. But anyways I removed that in my defaultfields branch since it isnt needed. |
12:06:55 | clyybber | But the lengthOrd error triggers for int16 too |
12:07:01 | clyybber | For some reason.. |
12:07:03 | Araq | it's not wrong |
12:07:09 | Araq | low(T) == 0 is *required* |
12:07:18 | clyybber | Not with defaultfields at least. |
12:07:34 | Araq | the C backend simply assumes it as it generates lookup tables |
12:07:48 | Araq | and doesn't concern itself with the offset corrections |
12:08:14 | Araq | and even if it would, all the other code that uses RTTI doesn't do it either |
12:08:51 | clyybber | Hmm. Ok. |
12:09:01 | clyybber | But mustnt the size be less than 65536 ? |
12:09:16 | clyybber | Instead of 32768? |
12:09:26 | clyybber | sorry, the lengthOrd |
12:10:45 | clyybber | So 0x0000FFFF instead of 0x00007FFF |
12:10:52 | Araq | 32K is already too much, as I said |
12:11:07 | Araq | the compiler generates lookup tables that big |
12:11:20 | clyybber | Ah |
12:11:32 | clyybber | Thats why you have the low condition? |
12:11:36 | Araq | yes |
12:11:42 | clyybber | So we only support a half of int16 so to say |
12:12:04 | Araq | yeah and that's too big already |
12:16:20 | clyybber | And there is no way of lifting that restriction? |
12:17:05 | Araq | the new RTTI implementation doesn't have it |
12:17:25 | Araq | but it doesn't support everything that the old one does |
12:17:50 | Araq | RTTI is kinda obsolete in Nim ever since macros.getType arrived |
12:18:10 | FromDiscord | <mratsim> @Rika, contrary to what araq said the replacement to queues is not heapqueues but deques when you use them with just popFirst and addlast |
12:18:43 | FromDiscord | <Rika> well i just used a seq because i noticed it didnt use anything like such methods you mentioned |
12:20:12 | clyybber | Araq: To what lengths/size does the new RTTI support it? |
12:22:53 | Araq | clyybber, it produces case statements instead of lookup arrays |
12:23:40 | clyybber | Ah, nice. Is that faster or slower? |
12:31:49 | * | tklohna joined #nim |
12:32:04 | Araq | I don't know |
12:38:45 | * | nsf quit (Quit: WeeChat 2.6) |
12:58:16 | clyybber | Araq: So the conditions should have and not optTinyRTTI appended |
13:02:10 | * | sentreen_ quit (Ping timeout: 268 seconds) |
13:02:39 | * | sentreen_ joined #nim |
13:06:26 | * | Vladar quit (Quit: Leaving) |
13:14:51 | * | rockcavera quit (Remote host closed the connection) |
13:17:09 | * | Kaivo joined #nim |
13:18:17 | * | seerix quit (Ping timeout: 276 seconds) |
13:28:02 | FromGitter | <kaushalmodi> hello, I am stumbling at a basic Nim syntax problem.. is there a way to force-end a when clause? |
13:28:07 | FromGitter | <kaushalmodi> e.g. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc027660725f61e9c80c98e] |
13:28:40 | FromGitter | <kaushalmodi> above, I am trying to use when/else just to change the proc signature.. the rest of the proc docstring + body stays the exact same |
13:29:54 | FromGitter | <kaushalmodi> seems like I would need to copy-paste the whole proc docstring + body in the when and else clauses even if I want to change just the signature? |
13:30:07 | clyybber | Yeah, I think so. |
13:30:33 | clyybber | Araq: Why does tinyRtti not support embedded objects? |
13:30:54 | FromGitter | <alehander42> you might be able to define something like a template so you can seq[retZip(S, T)] |
13:31:01 | FromGitter | <alehander42> and redefine only retZip in when |
13:31:08 | FromGitter | <alehander42> but probably this has other issues |
13:31:21 | FromGitter | <kaushalmodi> oh, I can define a zipreturn type in when/else |
13:31:26 | FromGitter | <kaushalmodi> shouldn't need a template |
13:31:35 | FromGitter | <alehander42> well, you need S and T .. |
13:31:39 | FromGitter | <alehander42> but yeah |
13:31:42 | FromGitter | <alehander42> it can be just generic indeed |
13:31:46 | FromGitter | <kaushalmodi> right |
13:32:53 | FromGitter | <kaushalmodi> umm. but that will make the generated docs look quirky :/ |
13:33:27 | FromGitter | <kaushalmodi> reference to why I am doing this: https://github.com/nim-lang/Nim/pull/12575#issuecomment-549280698 |
13:37:36 | shashlick | @Zevv - make the directory or set it in the nimble file |
13:38:14 | Zevv | Hm why not pick just one? |
13:41:31 | Araq | clyybber, I think the frontend shouldn't be concerned with upcoming Nim backend improvments |
13:41:43 | Araq | so no 'optTinyRtti' for me |
13:42:06 | PMunch | kaushalmodi, you could just do it inline: https://play.nim-lang.org/#ix=20MM |
13:42:34 | shashlick | Mkdir can be for local only experimenting, without needing to check in |
13:42:54 | shashlick | .nimble is already the way to configure nimble |
13:43:15 | shashlick | You can check in the dir but it's probably not the cleanest way |
13:44:00 | shashlick | Just providing alternatives |
13:44:18 | PMunch | The problem is that the line within the zip procedure is not a complete statement as it ends with `=`. I guess you could call it a limitation of AST based meta-programming |
13:46:07 | FromGitter | <kaushalmodi> PMunch: OK, but the docs will look really ugly |
13:46:35 | FromGitter | <kaushalmodi> I was thinking of: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc02bbb6570b076740f71bf] |
13:46:45 | FromGitter | <kaushalmodi> looks a *tiny* bit better |
13:49:50 | narimiran | i would create `zipImpl` proc, and then have different `zip` procs (based on the version) call it |
13:50:08 | PMunch | kaushelmodi: http://ix.io/20MO/nim |
13:50:09 | disbot | https://play.nim-lang.org/#ix=20MO 😏 |
13:50:12 | narimiran | that way, i think, the docs would stay nice and tidy |
13:50:54 | narimiran | yes, something along the lines of what PMunch just did |
13:51:08 | PMunch | Not quite |
13:51:28 | PMunch | There's only one zip there, it just pases the return type into a template. But the docs look nice :) |
13:51:32 | narimiran | disruptek: is disbot your bot? what does it do, other than create duplicate links? :P |
13:51:43 | FromGitter | <alehander42> hm, sounds ok |
13:52:16 | PMunch | Problem with zipImpl is that you would have to duplicate the body of the proc |
13:52:30 | disruptek | nothing yet. |
13:52:55 | PMunch | narimiran, I was a tad confused there for a second, thought someone hade come up with the exact same solution as me and we had somehow ended up with the same ix.io link :) |
13:53:06 | disruptek | lol |
13:53:10 | narimiran | PMunch: same here |
13:53:26 | PMunch | Does it just grab any ix.io link? Or just ix.io/ID/nim? |
13:53:37 | narimiran | but it is not just copy/paste, it gives you playground link, which is kinda nice |
13:53:48 | narimiran | PMunch: i was about to ask exactly that |
13:54:04 | PMunch | Yeah that's what made me realise it was a bot |
13:54:13 | PMunch | (plus of course the nick when I read that) |
13:54:14 | disruptek | it will ignore something that's ix.io/foo/{not nim here} |
13:54:27 | * | rockcavera joined #nim |
13:54:33 | narimiran | http://ix.io/20MP |
13:54:34 | disbot | https://play.nim-lang.org/#ix=20MP 😏 |
13:54:36 | disruptek | but it rewrites links that lack a lang-specifier with the assumption that they are likely nim. |
13:54:41 | PMunch | Ah, so if I ix.io paste an error messoge it will create a playground link.. |
13:55:15 | PMunch | http://ix.io/20MQ |
13:55:16 | disbot | https://play.nim-lang.org/#ix=20MQ 😏 |
13:55:30 | PMunch | Not quite what I wanted to do.. |
13:55:49 | disruptek | it doesn't download the paste and try to determine if it's nim syntax. |
13:55:55 | disruptek | yet. 😁 |
13:57:12 | narimiran | btw, disruptek, links to source from devel docs should now be ok |
13:58:36 | disruptek | yeah, i saw that. thanks. |
14:04:26 | PMunch | Oooh, that would be a cool feature in the playground.. |
14:04:27 | PMunch | Hmm |
14:04:59 | PMunch | Click on a procedure to go to the docs |
14:06:11 | FromGitter | <kaushalmodi> PMunch: I think playground should create share links like https://ix.io/LINK/nim |
14:06:31 | PMunch | Why? |
14:06:41 | PMunch | Isn't it better to have them link back to the playground? |
14:06:41 | FromGitter | <kaushalmodi> that would also may be increase the popularity of nim when they see the links flying around on social media |
14:06:56 | FromGitter | <kaushalmodi> ok, not what I meant |
14:07:16 | FromGitter | <kaushalmodi> hmm, you are right, the share link pointing to Nim Playground is good/correct |
14:07:36 | FromGitter | <kaushalmodi> thinking of a way so that we see more of https://ix.io/LINK/nim than https://ix.io/LINK |
14:07:56 | FromGitter | <kaushalmodi> then the disbot should autocreate playground links only for https://ix.io/LINK/nim |
14:08:06 | PMunch | Where do you keep seeing ix.io/LINK? |
14:08:45 | FromGitter | <kaushalmodi> I see those in the IRC usually |
14:09:00 | FromGitter | <alehander42> i admit that maybe not exposing the ix.io links might be good |
14:09:16 | FromGitter | <alehander42> after all, the playground has functionality for making edits and sharing them |
14:09:52 | PMunch | Those might be from me :P I have a keyboard shortcut that copies my current selection to ix.io and puts the link in my clipboard |
14:11:33 | disruptek | btw, i have an ix paster in https://github.com/disruptek/xs which is pretty feature-complete on linux. if you want xclip and syntax-sensing, etc. |
14:15:41 | disruptek | narimiran: i see that add is omitted in sorta, but why? because it's not additive? |
14:17:52 | * | abm joined #nim |
14:19:24 | disruptek | maybe it should just error. |
14:20:33 | narimiran | disruptek: because it doesn't do what people expect and it just creates confusion |
14:22:18 | clyybber | Araq: What does not work with the new RTTI yet? (And why do embedded objects not work with it?) |
14:22:43 | Araq | as you noticed embedded objects do not work yet |
14:22:53 | Araq | but that's rather simple to fix, I think. |
14:24:23 | Araq | system.getTypeInfo doesn't work |
14:24:44 | Araq | nor the typeinfo module or anything that builds on it, marshal.nim |
14:25:02 | Araq | system.repr |
14:25:08 | Araq | system.deepCopy |
14:25:48 | disruptek | narimiran: does your table support duplicate keys? |
14:27:33 | narimiran | disruptek: no, i prefer my tables to be sane |
14:27:48 | Araq | pfff :P |
14:28:28 | disruptek | maybe you should add that to the readme by way of explanation. i still think an `add` proc that errors would be more friendly to consumers. |
14:30:39 | clyybber | disruptek: Btw, we now got clarification: As descriminators the only supported types are those that have low(T) == 0 and len(T) =< 7FFF |
14:30:55 | disruptek | wow. |
14:31:17 | clyybber | But with the new RTTI we can have anything |
14:31:45 | disruptek | good, 'cause 0 is kinda a wart. |
14:33:26 | Araq | but how is the new RTTI gonna support the old cruft |
14:33:36 | Araq | currently my answer is: not at all |
14:33:49 | Araq | but people love repr() ... :-/ |
14:35:25 | clyybber | Araq: Wouldn't it be possible to patch the old RTTI to at least support low != 0? |
14:35:54 | clyybber | Just `- lowOrd` before calculating the offsets?? |
14:37:08 | Araq | patch sysstr.nim, deepcopy.nim, channels.nim, typeinfo.nim |
14:37:14 | Araq | and maybe more |
14:37:22 | Araq | for this to work |
14:38:22 | Araq | I said it before, this whole "enums with holes" business is stupid, give the compiler freedom in the representation |
14:40:13 | * | rockcavera quit (Ping timeout: 268 seconds) |
14:41:19 | * | rockcavera joined #nim |
14:47:04 | FromGitter | <Varriount> Araq: repr could generate it's implementation at compile time? |
14:50:51 | * | dddddd joined #nim |
14:52:56 | Araq | it's not that easy, Nim has inheritance so you don't know the complete types at compile-time |
14:53:19 | Araq | so you have to generate methods I guess |
14:54:16 | FromGitter | <alehander42> dont forget we need some runtime info for debugging purposes |
14:54:44 | Araq | that's the debugger's problem, no? |
14:55:07 | Araq | but it's related |
14:55:26 | FromGitter | <alehander42> well, what i mean is e.g. the debugger needs some info sometimes to give better high level introspection |
14:55:36 | FromGitter | <alehander42> e.g. enum names etc |
14:56:28 | Araq | enum names are simple but how to you tell your debugger "oh, this blob over there has at offset 0 a type info structure decribing the type, the field names and their type etc etc" |
14:57:30 | FromGitter | <alehander42> well, at least gdb already can introspect directly into the c structure fields/types anyway |
14:57:42 | disruptek | it's really not about nim, it's about trying to represent external values without indirection. |
14:57:55 | FromGitter | <alehander42> i am talking about nim-specific things |
14:58:42 | disruptek | sorry, i was scrolled up. i was referring to the enums whine. |
14:58:48 | FromGitter | <alehander42> like variant fields for each discriminator, enum names etc : like, this is already working, just saying that its another application of rtti |
14:59:14 | Araq | alehander42: it's not Nim specific, C++ has the very same problem |
14:59:35 | FromGitter | <alehander42> and the typeinfo thing : your tooling like gdb scripts etc can just know where this typeinfo is saved |
14:59:39 | Araq | the world doesn't end with C where everybody is happy with void* and no debugging support for these. |
15:00:42 | FromGitter | <alehander42> i agree, just saying that i am talking about things where the typical c intro doesnt work |
15:01:10 | Araq | well I don't know the details of DWARF nor GDB so I cannot answer |
15:01:40 | FromGitter | <alehander42> which reminds me |
15:02:23 | * | Vladar joined #nim |
15:02:25 | Araq | but I don't want the solution to be: emit even more C code just so that my debugger can work |
15:02:36 | disruptek | clyybber: ah you fixed it; nice! 👏 |
15:02:40 | Araq | wrong level of abstraction |
15:02:42 | FromGitter | <alehander42> we worked on a bit crazy idea which can enable one to see the macro "expansion" stack of his code on runtime: e.g. in gdb or in a stacktrace |
15:02:57 | FromGitter | <alehander42> (and the expansions themselves) |
15:03:08 | FromGitter | <alehander42> would something like this have a chance to land upstream in a debug mode |
15:04:36 | Araq | I will never fight anything that improves the debugging experience but patching DWARF debug info directly should work out better in the long run |
15:05:11 | FromGitter | <alehander42> well, for this particular thing, i am not sure, because its kinda backend-independent |
15:05:18 | Araq | consider that envP_->foobar vs foobar cannot be captured by producing even more C code |
15:05:30 | * | GordonBGood quit (Ping timeout: 268 seconds) |
15:05:39 | FromGitter | <alehander42> so tying it to dwarf itself doesnt make sense to me (but it can just be a data structure saved in the binary ofc) |
15:06:02 | Araq | I don't care that foobar was captured inside a closure, I want my debugger to tell me its value |
15:06:03 | FromGitter | <alehander42> otherwise i agree about the C generation thing |
15:06:43 | Araq | preferably by hovering my mouse over foobar because it's 2019 and delphi could do that in 1990 |
15:06:53 | FromGitter | <alehander42> i actually think rtti shouldnt be needed for non-debugging code but maybe i am missing something |
15:08:06 | FromGitter | <alehander42> i am not sure about the envP-_->foobar vs foobar thing |
15:08:22 | FromGitter | <alehander42> thats actually easy to catch for the debugger, as it sees the c data structures anyway |
15:08:30 | FromGitter | <alehander42> but it can abstract over it of course |
15:10:17 | FromGitter | <alehander42> the macro expansion idea is more about seeing e.g. you're in "testTemplate > this test template line > checkTemlate > thisExpansionLine > e == 2" , not only the call stack |
15:10:40 | FromGitter | <alehander42> and to be able to see the original macro/template code and the expansions of it in the same time |
15:14:56 | Araq | not sure that belongs into a debugger and not into an IDE |
15:19:29 | clyybber | Araq: How is this supposed to work then? https://github.com/Clyybber/Nim/blob/patch-2/tests/objvariant/tfloatrangeobj.nim |
15:19:57 | Araq | clyybber, not at all, it's silly |
15:20:36 | * | floppydh quit (Quit: WeeChat 2.6) |
15:24:41 | clyybber | Araq: Not with the new RTTI :p |
15:25:10 | clyybber | Araq: Wouldn't it be more wise to use the case statement approach of the new RTTI for the old RTTI too? |
15:26:04 | Araq | I'd rather see the effort spend on --gc:destructors |
15:26:51 | Araq | we need to focus on the important things. |
15:27:12 | clyybber | Fine with that too, but then I don't understand why we don't release those improvements with --gc:destructors |
15:27:50 | clyybber | (referring to your previous statement, where you said you don't want the optTinyRtti condition) |
15:31:52 | clyybber | Because then I can test these cases. |
15:46:12 | * | PMunch quit (Quit: Leaving) |
15:56:16 | FromGitter | <AmberSaber> Can you provide documentation for language specifications in pdf format |
15:57:06 | FromGitter | <AmberSaber> Can you provide documentation for language specifications in pdf format |
16:06:17 | disruptek | narimiran: https://github.com/nim-lang/Nim/pull/12592 -- changelog? |
16:06:44 | narimiran | disruptek: you're right, changelog entry is needed for that |
16:10:01 | * | nsf joined #nim |
16:10:35 | FromGitter | <kaushalmodi> @PMunch: Thanks for that idea on `defZip` template; I have used that in my PR |
16:12:37 | leorize | @AmberSaber: go to https://nim-lang.org/docs/manual.html, then print the page to pdf |
16:13:07 | * | theelous3 joined #nim |
16:21:03 | narimiran | @yglukhov are you around? |
16:35:08 | * | leorize quit (Ping timeout: 260 seconds) |
16:37:00 | FromGitter | <yglukhov> narimiran: hey, whats up |
16:37:41 | * | leorize joined #nim |
16:37:53 | narimiran | i've seen you're the last one who merged some things in "fowlmouth/nake", so i was wondering if you could merge https://github.com/fowlmouth/nake/pull/70 |
16:38:20 | narimiran | we are testing "nake" as part of important_packages, and this is stopping one PR |
16:38:34 | FromGitter | <yglukhov> done |
16:38:37 | narimiran | thanks |
16:46:21 | shashlick | @narimiran what was the problem with adding nimterop to important packages? |
16:47:20 | narimiran | shashlick: i don't remember exactly, but probably something windows-related, maybe some C lib missing? |
16:56:09 | FromGitter | <kaushalmodi> shashlick: Today I faced a strange compilation issue with nimterop, but found a workaround |
16:56:28 | FromGitter | <kaushalmodi> a colleague uses Nim exclusively for work stuff so he does not have ~/.nimble dir |
16:57:35 | FromGitter | <kaushalmodi> when he compiled the nim wrapper containing the cImport statements, the error he got was something along the lines of "unable to find nimterop/plugin" |
16:58:01 | FromGitter | <kaushalmodi> for work, I have a separate --NimblePath which I pass to the nim binary |
16:58:32 | FromGitter | <kaushalmodi> so the command is `nim cpp --NimblePath:/local/nimble/ wrapper_containing_cimport.nim` |
16:58:57 | * | tklohna quit (Ping timeout: 246 seconds) |
16:59:45 | FromGitter | <kaushalmodi> the failure was caused by the nimterop/getters/loadPlugin proc |
16:59:57 | FromGitter | <kaushalmodi> .. by the nim exec that's run in another subprocess |
17:00:12 | FromGitter | <kaushalmodi> that nim process does not "see" the --NimblePath I passed originally |
17:00:46 | FromGitter | <kaushalmodi> so the workaround was: ⏎ ⏎ ```NIMBLE_DIR=/local/nimble/ nim cpp --NimblePath:/local/nimble/ ..``` [https://gitter.im/nim-lang/Nim?at=5dc0593ea9f0dc24852bc9d8] |
17:01:28 | FromGitter | <kaushalmodi> The `NIMBLE_DIR` env var is effective in passing the custom nimble dir path to the nim run in a subprocess inside `loadPlugin` |
17:01:43 | FromGitter | <kaushalmodi> shashlick: Hope all of the above makes sense |
17:02:40 | Araq | There's always a lighthouse. There's always a man. There's always a city. |
17:02:54 | Araq | so ... rubber duck time |
17:03:11 | Araq | --gc:destructors leaks memory for exceptions, so far, so bad |
17:03:39 | Araq | but also for 'nim cpp' the 'try except' statement doesn't work, what's up with that? |
17:04:05 | Araq | the produced C++ code looks ok |
17:05:34 | Araq | any ideas? |
17:11:21 | * | oculuxe joined #nim |
17:12:57 | * | oculux quit (Ping timeout: 240 seconds) |
17:14:49 | shashlick | @kaushalmodi ya I'm not sure how to get that info from Nim and propagate it to the child processes |
17:15:13 | * | NimBot joined #nim |
17:16:09 | FromGitter | <alehander42> Araq well some example is needed |
17:20:02 | shashlick | @Araq can we find out what flags were passed to Nim at compile time? |
17:26:00 | * | jwm2241 joined #nim |
17:27:15 | Araq | when compileOption() but only for some stuff |
17:34:50 | disruptek | Araq: cpp exceptions don't compile or they don't catch or they just segfault? |
17:34:57 | disruptek | https://github.com/nim-lang/Nim/issues/11081 🙄 |
17:35:35 | Araq | nothing like that, they misbehave |
17:35:47 | Araq | and the program does work without --gc:destructors |
17:35:56 | disruptek | control-flow misbehavior? |
17:35:57 | Araq | so it's not some reported bug :P |
17:36:13 | Araq | yeah, control-flow misbehaviour indeed |
17:36:29 | disruptek | ah, so it's a feature. 🤭 |
17:45:28 | FromGitter | <alehander42> well, is the c++ code misbehaving |
17:45:36 | FromGitter | <alehander42> or is nim generating weird c++ code |
17:45:40 | * | Trustable joined #nim |
17:45:55 | FromGitter | <alehander42> is the problem in the (correct c++) or in the (correct nim) camp |
17:46:00 | * | nsf quit (Quit: WeeChat 2.6) |
17:56:36 | Araq | note that the c backend doesn't work either, but it "only" leaks memory |
17:56:39 | Araq | so weird |
17:56:46 | Araq | in the meantime we got outplace: https://github.com/nim-lang/Nim/pull/12593 |
17:57:00 | Araq | Nim is awesome. |
17:58:26 | Araq | bbl |
17:59:58 | FromGitter | <kaushalmodi> shashlick: I have tried to summarize the issue in https://github.com/nimterop/nimterop/issues/151 |
18:00:43 | federico3 | is there a benefit in using outplace instead of doing a copy explicitely? |
18:05:36 | clyybber | Method like chaining I suppose. |
18:05:45 | clyybber | Not sure if that works in this implementation though. |
18:07:04 | shashlick | @kaushalmodi - thanks! |
18:12:47 | * | fredrik92 joined #nim |
18:13:14 | * | couven92 quit (Disconnected by services) |
18:13:18 | * | fredrik92 is now known as couven92 |
18:13:42 | * | fredrik92 joined #nim |
18:16:31 | FromDiscord | <mratsim> it probably need some arrow sugar `<<<<`(sort(x)) |
18:18:55 | FromGitter | <alehander42> is there an example |
18:18:57 | FromGitter | <alehander42> with index > 1 |
18:18:59 | clyybber | mratsim: I mean something like someVar.outplace(sort).echo |
18:21:10 | FromGitter | <alehander42> i'd maybe expect outplace to take a function and return something which can be called, but it probably requires a lambda |
18:21:11 | FromGitter | <alehander42> which is slow |
18:21:16 | FromGitter | <alehander42> so nice |
18:32:49 | * | clyybber quit (Ping timeout: 265 seconds) |
18:44:00 | FromDiscord | <itmuckel> Hey guys! Is "Nim in Action" outdated by now or is it still usable for version 1.0.2? |
18:44:25 | FromDiscord | <itmuckel> I'd like to read something more in-depth than the tutorial on the web page. 🙂 |
18:45:16 | narimiran | still usable |
18:45:46 | * | clyybber joined #nim |
18:47:14 | clyybber | Araq: https://github.com/nim-lang/Nim/pull/12591 is ready |
18:47:40 | * | clyybber quit (Client Quit) |
18:47:59 | FromDiscord | <itmuckel> Okay, then I'll give it a try. |
18:57:03 | FromDiscord | <kodkuce> choosenim works right? |
18:57:17 | disruptek | it works; whether it works right is open to interpretation. |
18:58:36 | FromDiscord | <kodkuce> 🙂 |
19:04:00 | blackbeard420 | does jester read the entire request body into memory or is there a way to stream the request body |
19:13:25 | * | solitudesf quit (Read error: Connection reset by peer) |
19:13:53 | * | solitudesf joined #nim |
19:15:31 | FromDiscord | <treeform> I don't know about jester, but with HTTP lib you can. |
19:15:41 | FromDiscord | <treeform> I use that for my websocket library. |
19:15:50 | FromDiscord | <treeform> You just need to get at the underlaying socket. |
19:16:03 | disruptek | httpclient exposes a stream interface. |
19:17:13 | FromDiscord | <mratsim> @itmuckel, nim in action code examples are part of Nim anti-regression suite |
19:17:37 | * | solitudesf quit (Client Quit) |
19:17:56 | * | solitudesf joined #nim |
19:19:15 | FromDiscord | <exelotl> Main difference is that strings/seqs/tables could be nil, back when Nim in action was written |
19:19:39 | FromGitter | <brentp> @mratsim, I've been using arraymancer to do PCA for dim-reduction and then a NN to assign unlabeled samples to a cluster: http://home.chpc.utah.edu/~u6000771/somalier-ancestry.html |
19:19:59 | FromGitter | <brentp> seems like openblas is much much faster than default. |
19:22:00 | * | nsf joined #nim |
19:22:06 | Araq | maybe it's CPU specific |
19:22:38 | FromDiscord | <mratsim> nice 🙂 |
19:22:47 | FromDiscord | <mratsim> faster than default what? |
19:22:50 | lmariscal | Anyone in here that is interested in vulkan that could give me feedback please? |
19:22:52 | lmariscal | https://github.com/nimgl/vulkan |
19:23:11 | FromDiscord | <mratsim> ping @krux02 ^ |
19:23:43 | FromDiscord | <mratsim> I'm interested in Vulkan but only Vulkan-Compute |
19:23:49 | FromDiscord | <mratsim> 😄 |
19:24:27 | FromDiscord | <mratsim> @brentp, if you were talking about the default blas, it's bacause the default blas on Linux distribution is just a reference triple for-loop implementation |
19:25:15 | FromDiscord | <mratsim> it's also not multithreaded AFAIK (though in the netlib organisation that manage BLAS they give an example on how to naively multithread matrix multiplication) |
19:26:08 | FromGitter | <brentp> really!? wow. didn't know that. |
19:27:10 | FromGitter | <brentp> just happend to try openblas, because that's what's on alpine where i build static binaries |
19:29:58 | * | nixfreak joined #nim |
19:30:43 | * | clyybber joined #nim |
19:31:29 | clyybber | lmariscal: Uh, I also have vulkan bindings :p |
19:32:11 | lmariscal | clyyber nimious/vulkan? |
19:32:42 | clyybber | Nope vulkanim |
19:32:48 | clyybber | clyybber/vulkanim |
19:33:35 | lmariscal | oh nice, it is more of an assignment I had in university than the bindings themselves |
19:33:41 | clyybber | I took a bit of a different approach with regards to loading vulkan procs at runtime |
19:34:07 | nixfreak | noobie tryingt to learn http://dpaste.com/2Y3BPWF |
19:34:20 | clyybber | lmariscal: Heh, I see you also made some glfw bindings |
19:34:22 | nixfreak | how do you do nested elif statements |
19:34:34 | clyybber | lmariscal: Which I also made :p |
19:34:39 | * | tklohna joined #nim |
19:34:47 | clyybber | Do you autogenerate them too? |
19:34:51 | lmariscal | clyybber imgui, opengl, glfw, vulkan and soon stb |
19:34:58 | lmariscal | clyybber yeah I made the generators |
19:35:16 | clyybber | Cool, I too autogenerate them, only reasonable way with vulkan |
19:35:22 | lmariscal | but I am aiming for an ecosystem than independent bindings |
19:36:04 | clyybber | I see |
19:36:58 | lmariscal | I liek your approach with macros to load at runtime |
19:39:26 | Araq | nixfreak: use indentation, read a tutorial |
19:41:03 | Araq | mratsim: hmm so the "reference triple for-loop implementation" is slow but if I do it in C but with 'restrict' C is "as fast as Fortran" |
19:41:11 | Araq | :P |
19:45:01 | * | GordonBGood joined #nim |
19:47:02 | clyybber | lmariscal: I'm implementing default field values and when thats done I won't need those sType things and you can get rid of your constructors :) |
19:48:21 | lmariscal | ohh, that sounds fancy, really would like to see |
19:50:54 | clyybber | Araq: Can you merge this: https://github.com/nim-lang/Nim/pull/12591 |
19:57:21 | Araq | done. |
19:58:16 | clyybber | Thanks :) |
20:06:01 | Araq | clyybber: I want .cursor back :-( |
20:06:49 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
20:07:07 | Araq | refcounting is incomplete without it and hacks with 'ptr' lose too much information in the long run |
20:07:08 | * | pbb joined #nim |
20:07:08 | * | pbb quit (Client Quit) |
20:07:23 | * | pbb joined #nim |
20:16:36 | * | nsf quit (Quit: WeeChat 2.6) |
20:17:32 | * | tklohna quit (Ping timeout: 276 seconds) |
20:26:37 | FromGitter | <mratsim> @Araq it's more like without restrict I can be as fast as fortran |
20:27:14 | FromGitter | <mratsim> You still need to work on the algorithm but you won't have to fight the compiler |
20:27:36 | clyybber | Araq: Oh in what context exactly? |
20:27:38 | FromGitter | <mratsim> *cough* genericReset |
20:28:05 | * | tklohna joined #nim |
20:28:35 | Araq | --gc:destructors doesn't have GenericReset |
20:28:43 | Araq | nor problems with 7MB sized stacks |
20:29:54 | Araq | nor thread local heaps, the future is pretty sweet |
20:29:59 | disruptek | 7mb oughta be enough for anyone. |
20:35:21 | Araq | also duplicated zeroMem calls should be optimized away by the C compiler... |
20:41:30 | FromGitter | <mratsim> Well we didn't know where to put the objects so we just used stack objects |
20:41:50 | FromGitter | <mratsim> Not my fault we have like 10x crypto signature that takes lot of space :p |
20:42:26 | clyybber | mratsim: You mean alloca'd ref objects? |
20:43:03 | Araq | no, they didn't use 'ref' and so it ended up on the stack |
20:43:30 | clyybber | Ah, and thats different now with --gc:destructors?? |
20:43:48 | Araq | no... |
20:44:12 | clyybber | Ah, good. |
20:44:24 | clyybber | I was getting worried we end up a java |
20:46:26 | * | paxis joined #nim |
20:48:16 | * | paxis quit (Max SendQ exceeded) |
20:49:10 | * | paxis joined #nim |
20:51:45 | * | GordonBGood_ joined #nim |
20:52:17 | * | GordonBGood quit (Ping timeout: 240 seconds) |
20:56:23 | * | clyybber quit (Read error: Connection reset by peer) |
20:56:29 | * | clyybber1 joined #nim |
20:59:51 | * | tklohna quit (Ping timeout: 252 seconds) |
21:03:46 | nixfreak | Is there a casting called strToInt ? |
21:03:52 | * | Trustable quit (Remote host closed the connection) |
21:04:22 | nixfreak | how would you convert string to int ? or how can I use readLine using int ? |
21:04:27 | FromGitter | <dawkot> Hi, sounds like a really dumb question but how do you get http header values in `asynchttpserver`? |
21:05:47 | FromGitter | <dawkot> nixfreak, there is `parseInt` in `strutils` |
21:05:51 | FromGitter | <kaushalmodi> nimfreak: See strutils.parseInt |
21:06:29 | FromGitter | <kaushalmodi> also see https://scripter.co/notes/nim/#representing-one-type-in-another |
21:06:38 | nixfreak | thanks |
21:11:16 | * | rayman22201 quit (Quit: Connection closed for inactivity) |
21:24:45 | * | narimiran quit (Ping timeout: 268 seconds) |
21:29:51 | * | Vladar quit (Quit: Leaving) |
21:38:04 | dom96 | hello all |
21:38:10 | clyybber1 | Heyo |
21:38:42 | * | clyybber1 quit (Quit: WeeChat 2.6) |
21:38:51 | * | clyybber joined #nim |
21:43:21 | * | couven92 quit (Read error: Connection reset by peer) |
21:43:44 | * | couven92 joined #nim |
21:50:37 | * | clyybber quit (Quit: WeeChat 2.6) |
21:56:19 | * | mincopy joined #nim |
21:56:54 | * | mincopy left #nim (#nim) |
22:00:22 | * | cyraxjoe quit (Read error: Connection reset by peer) |
22:01:13 | zedeus | sup |
22:02:15 | * | cyraxjoe joined #nim |
22:04:41 | * | cyraxjoe quit (Read error: Connection reset by peer) |
22:06:32 | * | cyraxjoe joined #nim |
22:17:21 | * | couven92 quit (Read error: Connection reset by peer) |
22:17:44 | * | couven92 joined #nim |
22:26:36 | nixfreak | Is this the only way to reverse a string ? https://nim-lang.org/docs/unicode.html#reversed%2Cstring |
22:26:54 | nixfreak | by asserting it ? |
22:28:16 | * | solitudesf quit (Ping timeout: 268 seconds) |
22:32:48 | FromDiscord | <kodkuce> nixfreak: i can check exercism and see my soltuon xD |
22:33:31 | FromGitter | <kaushalmodi> nixfreak: asserting does not reverse the string there |
22:33:41 | FromGitter | <kaushalmodi> It's .. asserting that the reversing happened |
22:34:13 | FromDiscord | <kodkuce> nixfreak: i just did a for loop to reverse it |
22:34:20 | FromDiscord | <kodkuce> probbaly not efficient |
22:34:33 | FromGitter | <kaushalmodi> In Nim docs, the special docstrings called runnableExamples serve the purpose of documentation and tests |
22:34:37 | FromGitter | <kaushalmodi> It's pretty awesome |
22:34:56 | * | leorize quit (Ping timeout: 260 seconds) |
22:35:25 | FromGitter | <kaushalmodi> To answer your question, you can do `let reversedStr = origStr.reversed()` |
22:36:53 | nixfreak | string.reversed() ? |
22:38:07 | FromGitter | <kaushalmodi> Yes, `stringVar.reversed` is the same as `reversed(stringVar)` |
22:39:24 | * | MightyJoe joined #nim |
22:39:49 | FromGitter | <kaushalmodi> I'd suggest going through *and trying out the examples* from https://narimiran.github.io/nim-basics/ |
22:40:24 | FromGitter | <kaushalmodi> And then https://nim-lang.github.io/Nim/tut1 |
22:40:26 | * | cyraxjoe quit (Ping timeout: 240 seconds) |
22:41:49 | nixfreak | ok thanks |
22:45:04 | * | cyraxjoe joined #nim |
22:46:16 | * | MightyJoe quit (Ping timeout: 240 seconds) |
22:49:09 | FromGitter | <mratsim> @brentp, I think it's index_select for https://github.com/mratsim/Arraymancer/issues/400. Will cook up some example |
22:49:27 | FromGitter | <mratsim> I really need a doc framework |
22:51:22 | FromGitter | <mratsim> https://github.com/mratsim/Arraymancer/blob/a555fae806c5f795d4f664ca1eefd945d413933b/src/tensor/shapeshifting.nim#L303 |
22:51:30 | FromGitter | <mratsim> Actually it might not be that |
22:51:58 | FromGitter | <mratsim> I probably need to add a masked indexing |
23:00:24 | * | nixfreak quit (Remote host closed the connection) |
23:05:47 | * | mwbrown quit (Excess Flood) |
23:06:08 | * | mwbrown joined #nim |
23:09:27 | * | letto quit (Quit: Konversation terminated!) |
23:10:21 | * | seni joined #nim |
23:11:08 | * | letto joined #nim |
23:13:54 | * | lritter quit (Ping timeout: 268 seconds) |
23:14:32 | * | leorize joined #nim |
23:48:22 | * | disbot quit (Remote host closed the connection) |
23:49:34 | * | disbot joined #nim |
23:53:12 | * | disbot quit (Remote host closed the connection) |
23:53:50 | * | disbot joined #nim |
23:55:05 | * | rayman22201 joined #nim |