00:20:04 | * | sagax joined #nim |
00:21:15 | * | krux02_ quit (Remote host closed the connection) |
00:33:20 | * | laaron joined #nim |
01:32:19 | * | laaron quit (Remote host closed the connection) |
01:32:40 | * | laaron joined #nim |
01:36:37 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
01:42:49 | * | theelous3_ quit (Quit: is outty) |
01:52:55 | * | theelous3_ joined #nim |
01:53:48 | * | theelous3 quit (Ping timeout: 272 seconds) |
01:56:36 | leorize | Araq: hard code the knowledge about /home? what does that mean? |
02:18:31 | leorize | narimiran: I think nim-lang.org should promote some useful nimble packages. Some of them provide features that a lot of people are asking for (sum types, pattern matching, etc.) and could be a good way to promote how flexible Nim can be |
02:18:53 | FromDiscord_ | <lmariscal> leorize, the issue is that we don't really have a package registry atm |
02:19:01 | leorize | we do |
02:19:04 | leorize | nimble.directory |
02:19:15 | FromDiscord_ | <lmariscal> sure, a json file |
02:19:25 | leorize | works well enough :p |
02:19:30 | FromDiscord_ | <lmariscal> nimble.directory is a mirror of that same json file |
02:19:50 | leorize | with search and docs, really useful :) |
02:20:36 | FromDiscord_ | <lmariscal> most of the modules I use don't work well with nimble.directory T_T |
02:20:46 | FromDiscord_ | <lmariscal> they never finish loading haha |
02:21:11 | leorize | federico3 would probably be interested in that :p |
02:21:31 | leorize | they're nimble.directory creator/maintainer |
02:22:44 | FromDiscord_ | <lmariscal> yeah, I should open an issue in the github repo |
02:45:02 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:46:33 | FromGitter | <matrixbot> `meff` does Nim have a libfuse wrapper? |
02:46:39 | * | laaron joined #nim |
02:49:09 | FromGitter | <matrixbot> `meff` I see https://github.com/akiradeveloper/nim-fuse but it looks like it hasn't been touched in years |
03:05:33 | leorize | meff: you should use the freenode bridge instead of gitter :p |
03:06:08 | FromGitter | <matrixbot> `meff` I'm actually using Matrix; surprised that it shows up as Gitter lol |
03:06:50 | leorize | join #freenode_#nim:matrix.org room instead :) |
03:08:07 | leorize | https://github.com/nimterop/nimterop should be able to wrap libfuse rather easily |
03:08:27 | * | meff[m] joined #nim |
03:09:03 | meff[m] | yeah I can totally wrap it myself, was just wondering if anyone had wrapped it already, but cool |
03:09:15 | meff[m] | also, does Nim have an established way of doing async yet? |
03:09:32 | * | theelous3_ quit (Remote host closed the connection) |
03:09:41 | meff[m] | I see this https://nim-lang.org/docs/asyncdispatch.html is this it? |
03:09:54 | leorize | yep |
03:09:55 | * | theelous3_ joined #nim |
03:10:07 | meff[m] | gotcha, thanks! |
03:22:07 | * | Voltist joined #nim |
03:23:53 | * | Voltist quit (Client Quit) |
03:24:24 | * | XFPlus joined #nim |
03:43:24 | * | fjellfras joined #nim |
03:44:51 | * | XFPlus quit (Remote host closed the connection) |
03:52:25 | * | fjellfras quit (Remote host closed the connection) |
04:16:15 | * | disruptek quit (Ping timeout: 258 seconds) |
04:20:18 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
04:20:19 | * | laaron joined #nim |
04:21:55 | * | dddddd quit (Remote host closed the connection) |
04:23:52 | * | nsf joined #nim |
04:41:46 | * | fjellfras joined #nim |
04:54:47 | * | disruptek joined #nim |
05:00:14 | * | narimiran joined #nim |
05:09:34 | * | Voltist joined #nim |
05:20:19 | leorize | narimiran: in case you missed https://irclogs.nim-lang.org/26-06-2019.html#02:18:31 |
05:21:12 | * | leorize quit (Quit: WeeChat 2.3) |
05:22:00 | narimiran | ok, where/how? under 'featured projects'? |
05:25:11 | * | fjellfras quit (Quit: Leaving) |
05:26:33 | Voltist | Nice of them to leave immediately after prompting a discussion |
05:31:09 | leorize[m] | not really :) |
05:32:09 | leorize[m] | narimiran: featured projects is a rather small space though |
05:32:26 | Voltist | Huh, odd. "leorize has left (Quit: WeeChat 2.3)". Anyway, I think the idea of adding featured projects is call. |
05:32:37 | Voltist | Cool* |
05:37:32 | * | Trustable joined #nim |
05:43:55 | leorize[m] | I have more than one handle, with [m] stands for mobile |
05:45:03 | Voltist | That's a great idea |
05:50:20 | leorize[m] | narimiran: maybe a dedicated page for featured projects? |
05:51:29 | Voltist | Yeah, linked in the navbar maybe |
05:51:57 | leorize[m] | a few lines to highlight their features should be fine enough |
05:54:13 | Voltist | Indeed |
05:55:27 | * | leorize joined #nim |
05:55:43 | FromGitter | <Varriount> Araq: How do var parameters interact with aliasing? For example, if a have a procedure `proc foo(sequence: var seq[string], str: var string)`, and `str` is an element of `sequence`, can memory be corrupted by modifying the sequence or string parameters? |
05:56:00 | FromGitter | <Varriount> (For example, if the sequence's length is set to 0) |
05:57:40 | leorize | there's only one way to find out :p |
05:59:10 | leorize | @Varriount: got out of bounds error |
06:00:36 | leorize | http://ix.io/1MOG |
06:04:55 | * | dwdv joined #nim |
06:06:18 | * | solitudesf joined #nim |
06:25:52 | rayman22201 | Haven't been able to write nim code, but I'm working on this while I wait for CI tests to complete at my job lol. Thoughts? @narimiran, @dom96 https://github.com/rayman22201/Nim/blob/async_tutorial/doc/tut4.rst |
06:26:58 | narimiran | rayman22201: yes yes yes! we need this! |
06:27:33 | * | jjido joined #nim |
06:28:29 | * | PMunch joined #nim |
06:30:22 | * | jjido quit (Client Quit) |
06:30:29 | Zevv | rayman22201: yess, great stuff! I started once but stalled. You want my draft? |
06:31:02 | rayman22201 | @Zevv, yeah sure. |
06:31:10 | Zevv | http://ix.io/1MOO |
06:31:28 | Zevv | it's only a few paragraphs but maybe it fits somewhere |
06:31:49 | rayman22201 | Cool. I'll take a look |
06:31:56 | Zevv | Hm I now see I never got to the async part even :) |
06:31:57 | Zevv | hehe |
06:32:59 | rayman22201 | lol |
06:33:39 | Zevv | my plan was to start bottom up: first berkeley socket basics, then futures, then the async macro |
06:33:53 | rayman22201 | Yeah. I am going in the opposite order. |
06:35:31 | rayman22201 | Reason being, most people probably just want to use existing async libraries. They generally don't need to implement their own. |
06:35:57 | rayman22201 | good example non the less. |
06:36:39 | rayman22201 | @narimiran. Yay. Thanks. hopefully I don't stall :-P |
06:36:45 | Zevv | I guess it also depends on reader knowledge&experience. If you've ever seen and used async somewhere, which is likely with js and all, it's probably better to start top down |
06:37:03 | Zevv | I stall a lot |
06:37:08 | Zevv | I probably just start too much |
06:38:28 | Araq | Varriount: there is a section about it in manual_experimental |
06:38:44 | Araq | "An "output parameter" is a parameter of type ``var T``, an input |
06:38:45 | Araq | parameter is any parameter that is not of type ``var``. |
06:38:47 | Araq | 1. Two output parameters should never be aliased." |
06:41:22 | * | solitudesf quit (Ping timeout: 252 seconds) |
06:41:45 | PMunch | Hmm, `resp` in Jester can take a json node and sets the Content-Type header, but not if you also pass it a HTTP code |
06:43:40 | * | Phhere joined #nim |
06:58:05 | lqdev[m] | leorize: [m] stands for matrix, not mobile |
06:59:47 | leorize | for my usage, it's mobile :p |
06:59:58 | leorize | also you can change that nick if you want |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:39 | * | krux02 joined #nim |
07:04:49 | * | gmpreussner joined #nim |
07:05:18 | Voltist | How would I get a seq of all the keys in a JSON object? |
07:05:37 | Voltist | It doesn't seem to be well documented, if at all |
07:10:23 | leorize | you can't, sadly |
07:10:39 | leorize | we would need a `keys` iterator for JsonNode then |
07:12:00 | FromGitter | <survivorm> @dom96 here? |
07:12:10 | Voltist | Would that be hard to implement, do you think? |
07:12:27 | leorize | not at all |
07:13:07 | Voltist | Well, this could be my first proper contribution to Nim then! |
07:14:05 | leorize | copy the pairs iterator then modify it to use OrderedTable `keys` iterator and you're set :p |
07:14:49 | Voltist | I'll have it done by the hour :] |
07:16:34 | Voltist | Well, then there is documentation... |
07:17:09 | leorize | pairs() documentation is one line |
07:17:54 | Voltist | Were is that found? |
07:18:47 | leorize | the json module |
07:18:50 | leorize | https://github.com/nim-lang/Nim/blob/devel/lib/pure/json.nim#L776 |
07:19:00 | Voltist | Thanks |
07:25:16 | Voltist | So would we want to the output to be a seq, or a tuple or what? |
07:25:58 | leorize | make the iterator output only strings |
07:26:12 | leorize | use the keys iterator of orderedtable directly |
07:26:26 | leorize | if anyone wanted a seq they can pass the iterator to sequtils.toSeq |
07:26:47 | Voltist | Yeah I guess so |
07:27:12 | leorize | you might want to read up on iterators in the manual :p |
07:27:53 | Voltist | I have just recently, but I suppose I just had a slip of the mind |
07:28:22 | Voltist | It's late here, and my brain must have been thinking in terms of procs not iterators |
07:29:15 | leorize | get some rest :) |
07:29:43 | Voltist | Eventually |
07:32:19 | vegai | did I understood correctly that current Nim doesn't have the concept of destructors? |
07:32:27 | vegai | and only newruntime will fix that? |
07:33:18 | leorize | Nim does have the concept of destructors |
07:33:21 | leorize | it's experimental |
07:33:50 | leorize | newruntime on the other hand is an another memory management system built on destructors |
07:40:05 | * | stefanos82 joined #nim |
07:40:27 | vegai | ok |
07:40:52 | Voltist | https://github.com/nim-lang/Nim/pull/11597 |
07:40:59 | * | Vladar joined #nim |
07:41:04 | Voltist | All done :] |
07:42:30 | livcd | this fmt"{interpolation}" works only with echo ? |
07:42:58 | livcd | what can I do in raise newException(UglyException,"Something ugly happened {here}?") |
07:43:22 | leorize | fmt"Something ugly happened {here}?" |
07:43:29 | leorize | the keyword is `fmt` |
07:44:42 | Zevv | I like `&` better |
07:45:56 | vegai | http://ix.io/1MPb/nim |
07:46:20 | vegai | this tells me "Error: signature for '=destroy' must be proc[T: object](x: var T)" |
07:46:28 | vegai | isn't it? :) this is on 0.20 |
07:47:29 | * | couven92 joined #nim |
07:47:45 | vegai | oh wait that's silly |
07:47:50 | vegai | it should've obviously been proc `=destroy`(x: var MyObj) = |
07:48:10 | vegai | asking stupid questions publically: almost guaranteed success |
07:48:30 | vegai | the error message was a bit wonky still |
07:48:47 | leorize | you shouldn't need {.experimental.} for destructors on 0.20 |
07:49:07 | vegai | yeah, that seems so |
07:49:19 | vegai | I took that from a year old forum post |
07:50:21 | vegai | so with the classic GC-based nim, that destructor gets called when the GC decides to do its magic |
07:51:12 | leorize | nope |
07:51:23 | leorize | well, only if it's a `ref` type |
07:51:25 | vegai | should I be worried that it might never get called? In my case, I'm thinking about building a DB pool, and that destructor would be responsible of freeing a db connection |
07:51:42 | leorize | Araq has changed the rules since |
07:51:45 | vegai | so it would be rather if calling the destructor is delayed |
07:52:01 | vegai | yeah, I tried to read the 2nd edition of destructors, but it's a bit concise |
07:52:51 | vegai | it would be rather bad* |
07:53:33 | vegai | I guess my tests should cover such cases anyway so |
07:54:12 | leorize | if you're not using a `ref object` (and probably shouldn't), then destructors can handle this with GC deterministicly |
08:03:04 | * | solitudesf joined #nim |
08:13:09 | livcd | leorize: ahh you are right /O thanks |
08:16:26 | vegai | leorize: hmm, if I'm handing out DB connections from a common pool to arbitrary threads, doesn't those have to be refs? |
08:18:00 | * | brakmic joined #nim |
08:18:05 | leorize | no, and in fact, they shouldn't be `refs` |
08:18:28 | leorize | unless boehm gc is used (which is kinda broken in 0.20 afaik), gc's memory is thread-local |
08:18:58 | Araq | hand out a 'distinct int' type that is an index into your seq |
08:19:11 | Araq | the distinct int type can have a destructor, problem solved |
08:20:39 | vegai | leorize: I'd be using allocShared, the pool would be shared memory between threads |
08:21:08 | vegai | Araq: ah, that sounds good |
08:21:11 | vegai | thanks |
08:21:14 | leorize | allocShared returns a ptr... |
08:21:17 | Zevv | What happened to the plan to make --threads:on the default? |
08:21:37 | vegai | leorize: doh. Yes. I shouldn't have been talking about references there |
08:21:37 | Araq | Zevv, blocked by an issue I have to look into |
08:21:42 | narimiran | Zevv: there are some problems on windows |
08:21:54 | Zevv | ah ok |
08:25:29 | * | dwdv quit (Quit: quit) |
08:27:44 | * | Voltist quit (Remote host closed the connection) |
08:28:24 | * | abm joined #nim |
08:30:33 | * | brakmic left #nim (#nim) |
08:33:38 | * | floppydh joined #nim |
08:48:10 | * | leorize quit (Quit: WeeChat 2.3) |
08:51:10 | * | theelous3_ quit (Ping timeout: 252 seconds) |
08:57:57 | * | fredrik92 joined #nim |
08:58:21 | * | couven92 quit (Disconnected by services) |
08:58:26 | * | fredrik92 is now known as couven92 |
08:58:47 | * | fredrik92 joined #nim |
08:59:00 | * | fredrik92 quit (Remote host closed the connection) |
09:07:33 | FromGitter | <mratsim> @krux02 I'm around |
09:11:58 | * | fredrik92 joined #nim |
09:12:21 | * | couven92 quit (Disconnected by services) |
09:12:27 | * | fredrik92 is now known as couven92 |
09:19:12 | krux02 | hi |
09:19:52 | krux02 | @mratsim: yesterday you mentioned something about by pr to change ``shr`` |
09:20:01 | krux02 | I would like to explain my reasoning |
09:20:23 | FromGitter | <mratsim> listening |
09:20:26 | krux02 | ok |
09:21:00 | krux02 | In C: (x >> y) is undefined behavior if y is negative or bigger than the amount of bits in x. |
09:21:35 | krux02 | undefined behavior really is undefined behavior, the program doesn't even need to be consistent about it's result. |
09:22:22 | krux02 | the test had something like (1'u64 shr 64) |
09:22:31 | krux02 | this was compiled to the >> in C |
09:22:45 | krux02 | and then the optimizer of c threw away the bitshift |
09:23:02 | krux02 | sorry I mean shl and << |
09:23:09 | FromGitter | <mratsim> yeah I figured |
09:23:32 | krux02 | the test was wrong in that respect |
09:24:00 | krux02 | what I changed is, I applied the bitmask to the right operand, so that the operation won't trigger undefined behavior anymore. |
09:24:42 | krux02 | this is btw also what other languages do like Java and if I remembor correctly C# as well. |
09:25:26 | FromGitter | <mratsim> Ok, I don't mind but I really need the same behaviour at runtime and compile-time |
09:26:25 | FromGitter | <mratsim> also I guess shl behaviour should be documented in the manual if defined behaviour is part of Nim specs |
09:27:41 | * | Voltist joined #nim |
09:31:36 | krux02 | yes the bitmasking is done identically at runtime and compiletime. |
09:32:10 | FromGitter | <mratsim> Ok well I've removed my request changes review |
09:32:11 | krux02 | good point the PR needs a proper update in the documentation as well |
09:37:39 | FromGitter | <alehander42> http://lists.llvm.org/pipermail/llvm-dev/2019-June/133308.html |
09:37:49 | FromGitter | <alehander42> google want to create their own libc and add it to llvm |
09:37:56 | FromGitter | <alehander42> interesting |
09:38:38 | FromGitter | <mratsim> > Second, corporate development teams are uniquely qualified to utterly ⏎ botch a libc, yet still push it into widespread use, and the cost is ⏎ painful compatibility hacks in all applications. Apple did this with ⏎ their fork of BSD libc code. Google has done it once already with ⏎ their fork of musl in Fuchsia -- a project which I contributed ... [https://gitter.im/nim-lang/Nim?at=5d133d1eddc34e0f13e78d58] |
09:40:06 | FromGitter | <mratsim> > So, in summary: ⏎ > ⏎ > Point 1 is why making a libc for real-world use is not to be taken ⏎ lightly. ⏎ > ... [https://gitter.im/nim-lang/Nim?at=5d133d76ddc34e0f13e790bd] |
09:41:05 | * | Voltist quit (Quit: Quit) |
09:41:51 | FromGitter | <alehander42> seems reasonable |
10:21:57 | * | dddddd joined #nim |
10:33:17 | Araq | I thought C was this mystical language without a runtime :P |
10:33:48 | Araq | secondly, it's silly, clang is a C implementation, of course it can target its own libc. |
10:34:01 | * | deech joined #nim |
10:34:20 | Araq | libc is not part of the OS kernel |
10:35:55 | FromDiscord_ | <Núkley> is that in response to me or somebody else? |
10:37:01 | Araq | to http://lists.llvm.org/pipermail/llvm-dev/2019-June/133308.html |
10:40:03 | FromDiscord_ | <Núkley> uh, ok? |
10:40:12 | FromDiscord_ | <Núkley> alittle confused |
10:40:41 | Araq | maybe my IRC client messed up |
10:40:48 | FromDiscord_ | <Núkley> i am just starting c++ and i was having trouble getting the compiler working correctly |
10:41:18 | * | deech quit (Ping timeout: 245 seconds) |
10:52:06 | FromDiscord_ | <Skaruts> A little question: |
10:52:32 | FromDiscord_ | <Skaruts> I defined two types -- `Rect = ref object of RootObj`, and `House = ref object of Rect` -- in two separate files -- `geometry.nim` and `house_gen.nim`. Rect has a `method intersects(self, other:Rect):bool` |
10:52:51 | FromDiscord_ | <Skaruts> When I create an instance of House in a third file which imports `house_gen.nim` it doesn't recognize the `intersects` method |
10:53:08 | FromDiscord_ | <Skaruts> ("error attempting to call undeclared routine") |
10:53:14 | narimiran | wild guess: missing export marker? (`*`) |
10:53:23 | FromDiscord_ | <Skaruts> yes |
10:54:07 | FromDiscord_ | <Skaruts> I was gonna ask if that's the prefered solution |
10:54:45 | FromDiscord_ | <Skaruts> the alternative would be to import geometry on all files that need access to the parent type's methods |
10:57:10 | FromGitter | <rokups> in order to use something you must mark it with `*` and you must import module that something is in |
10:57:14 | FromDiscord_ | <Skaruts> oh wait, I misunderstood you, no actually the export markers are all there, problem is that house_gen doesn't have "export geometry" in it (besides "import geometry") |
10:59:19 | FromDiscord_ | <Skaruts> I mean, I suppose that's what I should do? |
11:01:00 | FromDiscord_ | <Skaruts> actually it doesn't work that way |
11:01:08 | FromDiscord_ | <Skaruts> `map_gen\house_gen.nim(4, 8) Error: cannot export: ../geometry` |
11:01:57 | FromGitter | <alehander42> you can export |
11:02:38 | FromDiscord_ | <Skaruts> it's not letting me... |
11:02:43 | FromGitter | <rokups> is there `export geometry.*` syntax? docs only say it works for individual symbols |
11:03:27 | FromDiscord_ | <Skaruts> it works for full files, I'm using that elsewhere, but maybe not in this case, let me see |
11:03:53 | narimiran | how does your `export ...` line look like? |
11:04:08 | FromDiscord_ | <Skaruts> export ../geometry |
11:04:26 | narimiran | remove `../` |
11:04:35 | FromDiscord_ | <Skaruts> it's in the parent folder |
11:04:41 | narimiran | remove `../` |
11:05:01 | FromDiscord_ | <Skaruts> oh the export doesn't need that! |
11:05:10 | FromDiscord_ | <Skaruts> I see... |
11:05:14 | FromDiscord_ | <Skaruts> thanks |
11:05:25 | FromDiscord_ | <Skaruts> it all works now |
11:09:54 | FromGitter | <alehander42> :P |
11:10:05 | FromGitter | <alehander42> ops you can export modules |
11:11:24 | * | theelous3 joined #nim |
11:20:40 | FromGitter | <juancarlospaco> Hi |
11:24:05 | PMunch | Hmm, anyone knows how I can do closure capture in Karax? |
11:24:19 | PMunch | I loop over some items and want to set up a callback for each link |
11:24:47 | PMunch | But currently they all point to the last of the addresses |
11:30:11 | FromGitter | <alehander42> hi juan |
11:30:18 | FromGitter | <alehander42> ugh |
11:30:35 | FromGitter | <alehander42> i think its easiest to |
11:30:38 | FromGitter | <alehander42> create a new view |
11:30:41 | FromGitter | <alehander42> (function) |
11:30:47 | FromGitter | <alehander42> for each and set the callback there |
11:31:10 | FromGitter | <alehander42> thats what i do with my karax callback |
11:31:20 | * | lritter joined #nim |
11:31:21 | FromGitter | <alehander42> and collections iirc |
11:31:48 | FromDiscord_ | <djazz> Man, defer is awesome! |
11:32:06 | FromDiscord_ | <djazz> Simple cleanup! |
11:32:38 | FromGitter | <alehander42> if you dont forget to write one |
11:34:50 | * | crem quit (Ping timeout: 258 seconds) |
11:37:08 | * | crem joined #nim |
11:37:31 | livcd | querying windows registry is not part of the stdlib right ? I need to find a pkg for this |
11:48:22 | FromGitter | <mohamedmoussa89> Any ideas why this doesn't compile |
11:48:23 | FromGitter | <mohamedmoussa89> https://pastebin.com/raw/yp0gatVV |
11:49:06 | FromGitter | <mohamedmoussa89> I guess it has to match the A first before A.T? |
11:54:02 | livcd | ahhh finish.exe uses it. import registry it is |
11:59:40 | Araq | PMunch, system.closureScope |
12:01:37 | * | Phhere quit (Ping timeout: 258 seconds) |
12:01:57 | * | tjmac joined #nim |
12:02:24 | PMunch | That didn't work inside the Karax DSL |
12:02:41 | Araq | interesting |
12:02:51 | Araq | we might want to special-case that one then |
12:08:49 | FromGitter | <kindlychung> who do you parse a variable number of arguments with parseopt? |
12:09:13 | * | Vladar quit (Remote host closed the connection) |
12:15:58 | PMunch | Hmm, it seems that Karax simply removed the node entirely: http://ix.io/1MQ2 |
12:20:36 | * | theelous3_ joined #nim |
12:22:10 | * | Vladar joined #nim |
12:23:34 | livcd | btw weird problem |
12:23:40 | FromGitter | <rokups> can we make bindings for js libs same way we do for c/++? |
12:23:51 | Araq | rokups: yeah |
12:24:02 | Araq | for some definition of "same way" |
12:24:18 | FromGitter | <rokups> thats awesome. maybe someone will eventually make bindings for vuejs ^_^ |
12:24:19 | Araq | we even re-use the importc/importcpp names for it :-/ |
12:24:37 | Araq | that's offensive. |
12:24:52 | * | theelous3_ quit (Remote host closed the connection) |
12:25:13 | FromGitter | <rokups> really? i think thats lazy. other people doing the work so i dont have to is always an advantage in my book :D |
12:25:20 | * | theelous3_ joined #nim |
12:25:25 | Araq | <insert vue.js rant here> |
12:25:43 | Araq | I used it extensively before writing Karax |
12:26:16 | FromGitter | <alehander42> hm Araq what is closureScope |
12:26:39 | FromGitter | <alehander42> ahh i see |
12:27:54 | FromGitter | <rokups> Araq come on... this right here is the reason why nim after more than a decade is not v1.0. you are a mind-blowing engineer, but there is just one of you and you cant write software for every usecase in the world, make it good and maintain it after |
12:27:57 | * | theelous3_ quit (Remote host closed the connection) |
12:28:29 | Araq | true but I got paid to develop Karax and now it already exists |
12:28:44 | FromGitter | <alehander42> closureScope invokes a anonimous handler |
12:28:45 | Araq | I didn't get paid to make v1 back then |
12:28:53 | FromGitter | <alehander42> usually doesnt matter for the javascript backend tho |
12:28:57 | FromGitter | <alehander42> in perf |
12:29:36 | FromGitter | <rokups> ok karax's existence redeemed then :D |
12:30:27 | * | theelous3_ joined #nim |
12:31:12 | FromGitter | <deech> 2nd hand experience report: someone I met a conference moved away from Nim for their microcontroller project because the GC had issues cleaning up thread-local heaps in their async code. I have no further details. |
12:31:14 | FromGitter | <rokups> i hope to try it eventually too. now that function hooking with newruntime/destructors is very viable nim became very attractive to me for netsec developments. having frontend + agent + scripting all in the same language is *very* appealing |
12:31:23 | livcd | so my program ends with discard readline(stdin) -> when i open it in cmd and close the window of i get a this program has stopped working. This does not happen when I do the same with just discard readline(stdin) in the program |
12:31:54 | * | acidx quit (Ping timeout: 258 seconds) |
12:32:06 | livcd | why would this happen ? oO |
12:35:06 | Araq | deech: Thank you for the report. |
12:46:08 | * | theelous3_ quit (Ping timeout: 272 seconds) |
12:54:24 | * | acidx joined #nim |
12:59:16 | * | NimBot joined #nim |
13:00:21 | FromGitter | <kaushalmodi> We need a wiki page to list all the Nim playgrounds :) |
13:00:34 | FromGitter | <kaushalmodi> ^ https://github.com/nim-lang/Nim/issues/11599, https://nim.ide.judge0.com/ |
13:14:26 | * | rockcavera quit (Remote host closed the connection) |
13:17:25 | * | rockcavera joined #nim |
13:18:08 | * | laaron quit (Remote host closed the connection) |
13:21:20 | Araq | what do we do with https://github.com/nim-lang/Nim/pull/11485 ? |
13:21:25 | * | laaron joined #nim |
13:21:28 | Araq | merge it and then deprecate travis/appveyor? |
13:24:43 | * | nsf quit (Quit: WeeChat 2.4) |
13:26:19 | FromGitter | <rokups> microsoft offers all that for free too? |
13:31:19 | Araq | narimiran ? |
13:32:45 | narimiran | Araq: i/we need to enable azure first, see https://irclogs.nim-lang.org/21-06-2019.html#10:03:21 |
13:34:26 | Araq | ok |
13:46:14 | FromGitter | <mratsim> @deech but why were they relying on the GC for a microcontroller |
13:53:30 | Araq | becaues they could :P |
13:57:57 | noonien | is there documentation on concepts? i remember find it somewhere but i can't seem to anymore |
13:58:48 | narimiran | noonien: https://nim-lang.github.io/Nim/manual_experimental.html#concepts |
13:59:11 | noonien | ah, great, thanks! |
13:59:54 | FromGitter | <kaushalmodi> narimiran: should the theindex page index the experimental stuff too? |
14:00:10 | narimiran | i don't know |
14:00:37 | FromGitter | <kaushalmodi> At one point, that was *the* page to search for anything in Mind |
14:00:45 | FromGitter | <kaushalmodi> *Nim |
14:00:54 | FromGitter | <kaushalmodi> Funny how autocorrect works |
14:03:16 | FromGitter | <juancarlospaco> experimental_manual is on TheIndex. Not the individual contents of itself tho. |
14:05:35 | FromGitter | <mratsim> @PMunch: https://github.com/nim-lang/Nim/issues/11601 |
14:09:49 | * | gangstacat quit (Ping timeout: 252 seconds) |
14:17:14 | * | leorize joined #nim |
14:23:34 | * | seni joined #nim |
14:28:59 | * | gangstacat joined #nim |
14:32:12 | * | tjmac quit (Quit: -bye) |
14:53:15 | * | floppydh quit (Quit: WeeChat 2.5) |
14:57:11 | * | dwdv joined #nim |
15:05:47 | lqdev[m] | I'm getting this strange warning since 0.20.0: `Warning: method has lock level <unknown>, but another method has 0 [LockLevel]` |
15:05:52 | lqdev[m] | it appears when I use methods |
15:06:05 | lqdev[m] | anything I can do about it? |
15:07:57 | * | couven92 quit (Quit: Client disconnecting) |
15:09:36 | * | lf-araujo joined #nim |
15:14:20 | * | lf-araujo quit (Ping timeout: 252 seconds) |
15:19:12 | * | sz0 quit (Quit: Connection closed for inactivity) |
15:20:07 | vegai | lqdev[m]: here's some thread with similar problems from 4 years ago: https://forum.nim-lang.org/t/1394 |
15:24:43 | lqdev[m] | how can I do `--warning[LockLevel]:off` from NimScript? |
15:25:20 | lqdev[m] | I'm trying to do `switch("warning[LockLevel]", "off")`, but I get a warning telling me it isn't a valid command line option |
15:26:18 | * | Snircle joined #nim |
15:32:02 | FromDiscord_ | <djazz> `Error: Sorry, your platform (linux_arm) is not supported by choosenim.` 😦 |
15:34:44 | FromDiscord_ | <djazz> alright alright, I'll compile (Raspberry Pi btw) |
15:34:56 | FromDiscord_ | <djazz> nim 0.16.0 is in Raspbian repo |
15:38:49 | Araq | warning("LockLevel", off) |
15:41:52 | * | couven92 joined #nim |
15:49:29 | * | CcxWrk quit (Quit: ZNC 1.7.1 - https://znc.in) |
15:57:00 | federico3 | djazz: you can pull the Debian package instead |
15:57:18 | FromDiscord_ | <djazz> but i want 0.20.0 |
15:57:27 | FromDiscord_ | <djazz> upcoming debian buster has 0.19.4 |
15:57:46 | FromDiscord_ | <djazz> https://packages.debian.org/buster/nim |
15:58:10 | federico3 | djazz: https://packages.debian.org/sid/nim 0.20.0-2 from Sid |
16:13:00 | * | sagax quit (Ping timeout: 252 seconds) |
16:20:06 | PMunch | narimiran, yeah still waiting for sudo back.. And I've had a hackathon running at job, so been busy these past two days :P |
16:22:08 | FromGitter | <alehander42> hey did |
16:22:13 | FromGitter | <alehander42> you see the other playground |
16:22:34 | FromGitter | <alehander42> i'd really love to see the finished tours |
16:22:42 | FromGitter | <alehander42> we might even publish some on HN etc |
16:23:15 | * | sagax joined #nim |
16:28:56 | FromDiscord_ | <djazz> federico3: thanks, that worked 😃 |
16:31:28 | disruptek | narimiran: #11603 lol :+1: |
16:33:05 | narimiran | disruptek: :) |
16:44:34 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
16:48:30 | * | couven92 quit (Read error: Connection reset by peer) |
16:48:49 | * | laaron joined #nim |
16:52:17 | * | lritter quit (Ping timeout: 248 seconds) |
16:56:59 | narimiran | leorize: are you here maybe? |
17:01:03 | * | lritter joined #nim |
17:02:07 | FromGitter | <Varriount> Araq: Yes, but that situation isn't exactly aliasing. The string's data and the sequence's data don't overlap. |
17:02:22 | Araq | what do you mean? |
17:02:45 | leorize[m] | narimiran: yes? |
17:03:30 | FromGitter | <Varriount> Araq: The string's data is separate from the sequence's. Both blocks of data are located at different addresses. |
17:04:56 | Araq | well then there is no aliasing. I don't understand you. |
17:05:08 | Araq | aliasing and "overlapping" are one and the same. |
17:06:50 | narimiran | leorize[m]: PM sent |
17:07:22 | FromGitter | <Varriount> Araq: https://gist.github.com/Varriount/d58c689e5ed5e4235ba944506d149903 |
17:09:15 | Araq | (s, s[^1]) is overlapping |
17:11:40 | * | laaron quit (Remote host closed the connection) |
17:45:34 | * | nsf joined #nim |
17:47:34 | * | Trustable quit (Remote host closed the connection) |
17:48:44 | * | nif joined #nim |
17:49:48 | * | zestyr_ joined #nim |
17:50:53 | * | Jesin joined #nim |
17:53:45 | * | nif_ quit (Ping timeout: 258 seconds) |
17:53:45 | * | zestyr quit (Ping timeout: 258 seconds) |
17:53:45 | * | stefanos82 quit (Ping timeout: 258 seconds) |
17:55:26 | * | stefanos82 joined #nim |
17:55:42 | * | brakmic joined #nim |
17:56:32 | * | stefanos82 quit (Client Quit) |
17:56:49 | * | stefanos82 joined #nim |
18:03:05 | * | brakmic quit (Ping timeout: 258 seconds) |
18:36:19 | * | stefanos82 quit (Quit: Quitting for now...) |
18:44:25 | * | jjido joined #nim |
18:47:57 | * | narimiran_ joined #nim |
18:48:19 | * | narimiran quit (Ping timeout: 258 seconds) |
18:48:39 | shashlick_ | does onThreadDestruction() still work? I don't see it being called and i'm waiting for my threads to exit |
18:52:05 | * | sz0 joined #nim |
18:55:56 | FromDiscord_ | <Skaruts> can I make an object nil? |
18:56:43 | FromDiscord_ | <Skaruts> type Foo = ref object |
18:56:47 | FromDiscord_ | <Skaruts> proc `$`(f:Foo):string = "fooings" |
18:56:50 | FromDiscord_ | <Skaruts> var g:Foo = nil |
18:56:54 | FromDiscord_ | <Skaruts> echo g # >>> fooings |
18:57:30 | FromDiscord_ | <Skaruts> I'm having the confusings |
18:58:55 | * | narimiran_ is now known as narimiran |
18:59:23 | narimiran | 1. in future use some pasting site so we can easily paste your code. 2. what is confusing you? |
18:59:54 | FromDiscord_ | <Skaruts> the variable isn't nil though I assigned nil to it |
19:00:04 | Araq | it is nil. |
19:00:14 | narimiran | why do you think it is not nil? |
19:00:54 | FromDiscord_ | <Skaruts> because echo is calling it's type's `$` proc |
19:01:15 | FromGitter | <JasperJenkins> being nil doesn't effect something be called. try`$f.isNil` instead |
19:01:58 | Araq | shashlick_: it does work afaict. but how do you exit your threads? |
19:02:27 | FromDiscord_ | <Skaruts> ah yes, isNil returns true |
19:02:44 | FromDiscord_ | <Skaruts> didn't know about isNil() |
19:03:27 | * | Senketsu quit (Quit: WeeChat 2.5) |
19:03:31 | FromDiscord_ | <Skaruts> thanks |
19:03:43 | Araq | you can also use x == nil like in many other langs |
19:04:38 | * | Senketsu joined #nim |
19:04:54 | narimiran | ...but the original confusion comes from your `$` proc, which will print "fooings" regardless of nil-ness of `f` |
19:05:32 | FromDiscord_ | <Skaruts> how didn't I think of that... |
19:05:40 | FromDiscord_ | <Skaruts> facepalm |
19:08:07 | shashlick_ | never mind, i'm an idiot |
19:10:14 | FromDiscord_ | <Skaruts> is there any performance advantage between using "var" and "let"? |
19:10:37 | FromDiscord_ | <Skaruts> or does it benefit compile times? |
19:19:31 | Araq | 'let' can be faster but that's an implementation bug |
19:19:45 | Araq | 'let' is the better style though |
19:20:25 | zestyr_ | Araq: I've read a few times `isNil()` is faster, is this true? writing `not obj.isNil()` is uglier than `obj != nil` |
19:27:16 | Araq | it's not true |
19:27:55 | Araq | isNil produced smaller code for strings and seqs but for these 'nil' doesn't exist anymore :-) |
19:31:30 | * | krux02 quit (Remote host closed the connection) |
19:39:18 | FromGitter | <Varriount> I really like the fact that I don't have to explicitly initialize strings and sequences |
19:45:09 | * | elrood joined #nim |
19:48:04 | FromDiscord_ | <treeform> ^ I whish that was expanded to tables. |
19:57:39 | Araq | it was! |
19:57:45 | Araq | use 0.20 |
20:03:31 | WilhelmVonWeiner | The docs give a "page not found" error on Source for at least the io page |
20:03:35 | WilhelmVonWeiner | https://nim-lang.org/docs/io.html |
20:05:02 | Araq | again? :-/ |
20:05:28 | Araq | ah it's fixed on devel, I think |
20:08:16 | FromDiscord_ | <Skaruts> proc new_bsp_leaf*(x, y, w, h:int):BspLeaf = |
20:08:18 | FromDiscord_ | <Skaruts> result.x = x # <-- SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
20:08:31 | FromDiscord_ | <Skaruts> What could cause this? |
20:10:28 | solitudesf | if BspLeaf a ref type? |
20:10:40 | solitudesf | *is |
20:11:04 | solitudesf | i guess yes, you shoud call `new result` before assigning |
20:13:36 | * | nsf quit (Quit: WeeChat 2.4) |
20:16:01 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:20:15 | * | deech joined #nim |
20:20:51 | Zevv | isnt that something nim could figure out at compile time? its a common mistake |
20:21:32 | FromGitter | <deech> @mratsim Not sure why they're relying on GC for a microcontroller but it seems required if you're doing async. |
20:25:54 | Araq | yup |
20:26:20 | FromGitter | <kaushalmodi> is there a compile time equivalent of for loop? |
20:26:46 | FromGitter | <kaushalmodi> the `cImport` from nimterop requires a static string |
20:26:58 | FromGitter | <kaushalmodi> so was trying to do: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d13d512dbd46e037d85a99b] |
20:27:02 | FromGitter | <kaushalmodi> but that doesn't work |
20:27:43 | FromGitter | <kaushalmodi> ^ above `hFiles` is a `const` too |
20:27:57 | noonien | what type is a slice of a seq? |
20:28:05 | * | jjido joined #nim |
20:28:08 | FromGitter | <kaushalmodi> I basically need to derive one const array from another const array, loop through that at compile time and pass that to `cImport` |
20:28:18 | noonien | does it keep a reference to the data of the initial seq? or does it alloc and copy? |
20:28:40 | shashlick_ | @kaushalmodi - it's a bit of a challenge |
20:28:46 | Araq | it copies but toOpenArray doesn't, noonien |
20:29:30 | noonien | OH, nice |
20:29:42 | Araq | kaushalmodi: use a macro for that |
20:29:42 | noonien | so basically seqVar.toOpenArray(first, last) |
20:30:26 | FromGitter | <kaushalmodi> shashlick_: thought so :) |
20:30:40 | shashlick_ | why does it have to be a const - just use var right |
20:30:47 | FromGitter | <kaushalmodi> Araq: looks like I'll need to dig into macros eventually |
20:30:56 | FromGitter | <kaushalmodi> shashlick_: cimport requires static string |
20:31:03 | FromGitter | <kaushalmodi> so I thought I'd need to use const |
20:32:18 | FromGitter | <kaushalmodi> stashlick_: If I use let instead of const in that snippet, I get: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d13d652aacbfb5fb7d32139] |
20:33:29 | FromDiscord_ | <Skaruts> @solitudesf oh crap I forgot the call new result |
20:33:31 | FromDiscord_ | <Skaruts> thanks |
20:33:39 | FromDiscord_ | <Skaruts> I should get some sleep... |
20:35:39 | shashlick_ | @kaushalmodi - probably use a compiletime proc or macro - https://github.com/nimterop/nimterop/blob/master/nimterop/cimport.nim#L290 |
20:36:09 | shashlick_ | if you can run cSearchPath() return value can be used, it should be possible |
20:37:10 | shashlick_ | I had similar challenges in nimdeps - https://github.com/genotrance/nimdeps/blob/master/nimdeps.nim |
20:37:53 | FromGitter | <kaushalmodi> shashlick_: thanks! that might work |
20:41:03 | Araq | Zevv: the compiler could detect it but it's discouraged, use object constructors |
20:43:45 | Zevv | ok, but even if it is discouraged - would generating a compile time error indicating just that not be better then a runtime error? |
20:45:20 | shashlick_ | how do i copy a seq into shared memory? |
20:45:57 | shashlick_ | or even a string for that matter - is there a memcpy |
20:46:17 | shashlick_ | meh - copyMem |
20:46:26 | Zevv | copyMem |
20:46:28 | Zevv | right |
20:48:10 | Araq | be my guest |
20:48:18 | Araq | I can tell you how to implement it |
20:48:57 | Zevv | please do, I might give it a try |
20:49:23 | Zevv | I never got to doing compiler stuff, although I planned to |
20:49:59 | * | dwdv quit (Quit: quit) |
20:53:15 | Zevv | and now that I think properly about it, its not so esay of course. how to handle conditional stuff then? Generate a warning only saying "result *might* be uninitialized"? |
20:54:38 | noonien | is there anything in the stdlib for creating a stream out of an openArray? |
20:55:02 | * | narimiran quit (Ping timeout: 245 seconds) |
20:55:23 | Araq | noonien: there is only StringStream |
20:55:44 | noonien | i see, and i'm guessing there's no way to slice a string without an alloc |
20:55:47 | Araq | Zevv: it is easy because we have the infrastructure |
20:56:04 | Araq | but you're right, we would only detect a couple of simple cases |
20:56:27 | Araq | noonien: that's true but a dedicated Stream could do it easily |
20:56:48 | * | Vladar quit (Remote host closed the connection) |
20:57:15 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:57:39 | noonien | i'm unsure what to use for networking, i'm used to using seqs or arrays of bytes, and it's what some libraries use, but the stdlib seems to focus on strings, should i be switching to strings? |
20:58:13 | Zevv | noonien: you can stil take a pointer and a length from a string |
20:58:22 | Zevv | if you are willing to give up safety |
20:58:58 | Zevv | and there is something quite new doing some kind of sliceing, but I forgot what and Im currently traveling so cant lookup |
20:59:17 | Araq | toOpenArray, I told him |
20:59:18 | * | couven92 joined #nim |
20:59:43 | Araq | noonien: probably. |
21:00:32 | Zevv | ah right that one |
21:00:50 | shashlick_ | are string and seq stored sequentially in mem? |
21:00:53 | noonien | Araq, Zevv: thanks! |
21:00:59 | Araq | shashlick_: yes, always |
21:03:16 | shashlick_ | i'm thinking shared memory across threads - so am wondering if I can assume that the memory is safe to copy as is |
21:03:35 | shashlick_ | string, sure but for seq, seems like it could contain pointers to stuff elsewhere which wouldn't be shared |
21:03:36 | Zevv | not without a mutex, afaik |
21:05:20 | Zevv | no guarentees that both threads see the same thing if you don't lock. numa, caches, etc |
21:05:28 | * | stefanos82 joined #nim |
21:07:41 | shashlick_ | agree |
21:09:30 | Zevv | hm browsing through sharedstring I see just copyMems. Must be missing something |
21:09:48 | shashlick_ | where is that? |
21:10:15 | Zevv | lib/pure/collectios |
21:10:41 | * | brakmic joined #nim |
21:12:36 | shashlick_ | why am i reimplementing it? |
21:12:45 | shashlick_ | gosh i thought we only had sharedlist and sharedtables |
21:14:12 | Zevv | haha |
21:14:22 | Zevv | but then again, why does this work? |
21:14:37 | Araq | sharedstring was never finished |
21:14:56 | Araq | eventually I figured these things work better with destructors... |
21:18:59 | * | Kaivo quit (Quit: WeeChat 2.5) |
21:29:46 | * | couven92 quit (Read error: Connection reset by peer) |
21:31:22 | * | deech_ joined #nim |
21:36:14 | * | deech_ quit (Ping timeout: 272 seconds) |
21:36:50 | FromDiscord_ | <Skaruts> adding items to a sequence during a `for item in seq` loop gives an error? |
21:36:53 | * | elrood quit (Remote host closed the connection) |
21:37:47 | FromDiscord_ | <Skaruts> adding with seq.add(item) |
21:39:28 | Araq | like in most sane languages |
21:39:35 | FromDiscord_ | <Skaruts> lol |
21:40:24 | FromDiscord_ | <Skaruts> porting python code |
21:40:36 | * | solitudesf quit (Ping timeout: 268 seconds) |
21:40:50 | Araq | huh, I thought it errors in Python too |
21:41:08 | FromDiscord_ | <Skaruts> wait, actually no, I'm porting GDScript code |
21:41:32 | FromDiscord_ | <Skaruts> it's a handy feature though |
21:48:09 | FromDiscord_ | <Skaruts> if there a handy function to merge two sequences? Or I have to iterate and add? |
21:48:28 | lqdev[m] | there's `add` |
21:48:46 | FromDiscord_ | <Skaruts> can add take a sequence? |
21:48:54 | FromDiscord_ | <Skaruts> seq1.add(seq2) ? |
21:48:59 | lqdev[m] | yes |
21:49:03 | FromDiscord_ | <Skaruts> oh cool |
21:54:57 | * | brakmic quit () |
22:35:26 | * | deech quit (Ping timeout: 252 seconds) |
22:42:03 | * | deech joined #nim |
22:57:07 | * | PrimHelios_ quit (Ping timeout: 245 seconds) |
23:00:00 | * | abm quit (Ping timeout: 252 seconds) |
23:06:41 | * | deech quit (Ping timeout: 248 seconds) |
23:43:23 | * | deech joined #nim |