00:03:53 | * | platoff quit (Read error: Connection reset by peer) |
00:10:15 | * | a_b_m quit (Ping timeout: 264 seconds) |
00:21:56 | * | zachk quit (Quit: Leaving) |
00:40:49 | * | ftsf_ joined #nim |
01:27:17 | * | dddddd quit (Remote host closed the connection) |
01:44:16 | FromGitter | <yyyc514> can i defer type evaltion of a proc that’s templated? |
01:44:26 | FromGitter | <yyyc514> it seems to not like me using properties when it doesn’t know the object in advance |
01:44:33 | FromGitter | <yyyc514> is that simply not doable? |
01:54:13 | FromGitter | <yyyc514> ie: `proc optionsT (selected: string, list: openarray[T]) : string =` |
01:54:30 | FromGitter | <yyyc514> where the thing lists have in common is a certain field |
01:55:47 | FromGitter | <yyyc514> i couldn’t get the tempalte form to work etierh but it seems like it should |
02:05:04 | * | banc quit (Quit: ZNC - http://znc.in) |
02:11:53 | * | ftsf_ quit (Quit: Leaving) |
02:20:28 | * | banc joined #nim |
02:33:24 | * | endragor joined #nim |
02:39:23 | FromGitter | <yyyc514> hmmm what would prevent nim from pegging my cpu? it’s only hitting 100% and i’m loading the server… any thoughts? |
02:40:20 | * | darithorn joined #nim |
03:10:06 | * | dorelix quit (Remote host closed the connection) |
03:10:08 | FromGitter | <rayman22201> @yyyc514 you need concepts to do the options thing you are trying to do |
03:10:37 | FromGitter | <yyyc514> actually i got it working as is |
03:10:46 | FromGitter | <yyyc514> the problem was i wasn’t exposing the property on my object *blush* |
03:10:54 | FromGitter | <rayman22201> ah, well, that will do it. |
03:10:57 | FromGitter | <rayman22201> cool |
03:11:03 | FromGitter | <yyyc514> fix that and it ran perfect |
03:11:44 | FromGitter | <rayman22201> idk abou the cpu thing. I would need more information. |
03:19:53 | * | cavariux quit (Quit: Ping timeout (120 seconds)) |
03:27:33 | * | chemist69 quit (Ping timeout: 250 seconds) |
03:29:18 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:29:44 | * | chemist69 joined #nim |
03:38:44 | * | cavariux joined #nim |
03:57:45 | * | cavariux quit (Quit: Ping timeout (120 seconds)) |
03:58:12 | * | cavariux joined #nim |
03:58:38 | FromGitter | <yyyc514> you know wouldn’t it be cool to build your whole app into one binary? |
03:58:42 | FromGitter | <yyyc514> no static assets at all? :) |
03:58:50 | FromGitter | <yyyc514> [talking about web app] |
04:03:50 | FromGitter | <rayman22201> I can't find it atm, but somebody on the forum had a similar idea and discussed some ways to do exactly that actually. |
04:06:36 | FromGitter | <rayman22201> as far as a webapp goes. js lets you embed arbitrary data if you encode it as base64. It causes terrible size bloat, but you can do it lol. |
04:08:27 | * | cavariux quit (Ping timeout: 240 seconds) |
04:12:02 | * | cavariux joined #nim |
04:21:57 | * | crem quit (Ping timeout: 252 seconds) |
04:22:51 | * | stefanos82 joined #nim |
04:23:41 | * | crem joined #nim |
04:24:23 | FromGitter | <rayman22201> found it: https://github.com/genotrance/nimdeps It's for native though. not web apps. still pretty cool though |
04:29:52 | * | darithorn quit () |
04:50:53 | FromGitter | <bung87> where this idea come from ? I never need such a feature |
04:57:07 | * | cavariux quit (Ping timeout: 240 seconds) |
05:01:43 | * | cavariux joined #nim |
05:01:51 | * | xet7 quit (Ping timeout: 264 seconds) |
05:14:01 | * | xet7 joined #nim |
05:15:27 | * | kapil____ joined #nim |
05:23:40 | * | nsf joined #nim |
05:25:14 | shashlick | well the initial goal was to bundle DLLs into the EXE |
05:25:44 | shashlick | but that's not currently possible since the DLLs are loaded before I can do anything in nimdeps |
05:26:30 | shashlick | consider it a feature for people who want everything in one exe |
05:26:53 | shashlick | meanwhile, I think I got libgraphqlparser successfully wrapped |
05:35:31 | FromGitter | <bung87> but I never thought use some thing like that in web dev.. |
05:37:52 | shashlick | something like Fossil perhaps - http://www.fossil-scm.org/ |
05:38:02 | shashlick | or a wannabe py2exe/pyinstaller |
05:40:56 | FromGitter | <bung87> or maybe just want deliver bin file |
05:43:10 | FromGitter | <bung87> shashlick do you have ideas about vector and seq interop now? |
05:45:39 | shashlick | haven't looked at it as of yet 😞 |
05:46:19 | * | tiorock joined #nim |
05:46:19 | * | tiorock quit (Changing host) |
05:46:19 | * | tiorock joined #nim |
05:46:19 | * | rockcavera quit (Killed (kornbluth.freenode.net (Nickname regained by services))) |
05:46:19 | * | tiorock is now known as rockcavera |
05:46:53 | FromGitter | <bung87> ok, I was trying porting it to pure nim , but process not very well. |
05:47:06 | shashlick | i've taken a note now |
05:47:15 | shashlick | which wrapper were we working on? |
05:47:30 | FromGitter | <bung87> fasttext |
05:47:42 | shashlick | riit |
05:48:05 | * | FromDiscord_ joined #nim |
05:48:25 | * | gmpreussner_ joined #nim |
05:53:02 | shashlick | okay folks, ping if you are interested in the libgraphqlparser wrapper - need some expertise to validate that it does what it is supposed to |
05:53:43 | * | jxy_ joined #nim |
05:54:32 | * | gsingh93- joined #nim |
05:54:46 | * | Death916 joined #nim |
05:54:59 | * | Summertime2 joined #nim |
05:55:51 | * | gmpreussner quit (*.net *.split) |
05:55:52 | * | Tongir quit (*.net *.split) |
05:56:09 | * | spookydeath916 quit (*.net *.split) |
05:56:09 | * | Summertime quit (*.net *.split) |
05:56:09 | * | copygirl quit (*.net *.split) |
05:56:09 | * | FromDiscord quit (*.net *.split) |
05:56:09 | * | oky quit (*.net *.split) |
05:56:09 | * | gsingh93 quit (*.net *.split) |
05:56:09 | * | jxy quit (*.net *.split) |
05:56:09 | * | ng0 quit (*.net *.split) |
05:56:09 | * | abeaumont quit (*.net *.split) |
05:56:09 | * | gsingh93- is now known as gsingh93 |
06:02:27 | * | Tongir joined #nim |
06:02:52 | * | copygirl joined #nim |
06:03:26 | * | oky joined #nim |
06:03:59 | * | ng0 joined #nim |
06:04:48 | * | xet7 quit (Remote host closed the connection) |
06:11:15 | * | m712 quit (Quit: bye-nyan!) |
06:11:31 | * | m712 joined #nim |
06:16:19 | * | krux02 joined #nim |
06:17:51 | * | Tongir quit (Remote host closed the connection) |
06:28:31 | * | krux02 quit (Remote host closed the connection) |
06:39:33 | * | krux02 joined #nim |
06:41:29 | * | smt quit (Read error: Connection reset by peer) |
06:44:33 | * | Vladar joined #nim |
07:14:13 | * | xet7 joined #nim |
07:40:36 | * | jacereda joined #nim |
07:43:30 | * | abeaumont joined #nim |
07:47:10 | * | cavariux quit (Ping timeout: 272 seconds) |
07:48:13 | * | cavariux joined #nim |
08:04:42 | jacereda | what am I doing wrong here? https://gist.github.com/jacereda/2461855bd1be85fe2fabdd5688d19771 |
08:05:19 | jacereda | I get: test.nim(11, 16) Error: illformed AST: proc (v: int): string = result = $v |
08:12:55 | FromGitter | <narimiran> hmmm, if you define `proc foo(v: int): string = $v`, and then do `echo a.mapVals(foo)` it works |
08:13:48 | jacereda | so, is it a bug? |
08:15:20 | FromGitter | <alehander42> I am not sure, but overally that API would be a bit verbose |
08:16:17 | FromGitter | <alehander42> you can also have a shorter `echo a.mapVals($v)` if you define mapKeys / mapVals macros similar to mapIt/filterIt from sequtils |
08:17:13 | FromGitter | <alehander42> of course not everybody likes injected variables |
08:19:16 | FromGitter | <narimiran> here is the working version: http://ix.io/1q3L/ |
08:19:25 | jacereda | alehander42, that's another I want to implement and I don't know how to give it a good type. I tried something like `template mapVals*[A,B,C](t : Table[A,B], op : untyped): Table[A,C]`, but it doesn't compile (I guess I need some way to express the `op` returns a C) |
08:19:40 | FromGitter | <narimiran> notice that i changed `mapVals` to be a proc, not a template |
08:20:08 | FromGitter | <narimiran> style fixes: result is automatically returned, no need to be on the last line, no space before a colon |
08:20:40 | FromGitter | <narimiran> `sugar` import is not needed, that was for some my previous testing. ignore it. |
08:20:45 | FromGitter | <alehander42> @jacereda yes, but is this about the shorter `a.mapVals($v)` ? |
08:20:53 | FromGitter | <alehander42> @narimiran you also tried `->` `=>` didn't ya :D |
08:20:54 | jacereda | narimiran: good, thanks |
08:21:10 | FromGitter | <narimiran> @alehander42 of course, that's the first thing i did :D |
08:21:12 | FromGitter | <alehander42> if it is, you need the return type to be also `untyped` |
08:21:48 | jacereda | alehander42: let me try... |
08:23:38 | FromGitter | <alehander42> the problem is that you'll have a hard time with the `initTable` types |
08:23:48 | FromGitter | <alehander42> that's what I spent most time on in my comprehension macros |
08:24:18 | FromGitter | <alehander42> but it needs a macro, a template wouldn't be sufficient |
08:25:21 | FromGitter | <alehander42> basically there is a good solution I stole from araq's tcollect |
08:25:47 | FromGitter | <alehander42> (last two message should be in reverse order) |
08:26:58 | Araq | alehander42: have you released the code somewhere? |
08:27:09 | jacereda | alehander42, I guess if it was possible to give a return type to the `op` it would be easy... is `untyped` the only possible type for a block? |
08:27:54 | jacereda | My naive attempt failed: https://gist.github.com/jacereda/350221fc6a88d2e9fc313b6537bd6aaf |
08:28:09 | jacereda | test.nim(8, 25) Error: cannot instantiate: 'C' |
08:28:34 | FromGitter | <alehander42> Araq https://github.com/alehander42/comprehension |
08:28:41 | FromGitter | <alehander42> it's pretty ugly for now |
08:29:11 | FromGitter | <alehander42> i have to update it with the `comp(for) / comp{}` versions |
08:29:45 | jacereda | in fact, if I add a dummy parameter of type C it compiles fine |
08:30:40 | FromGitter | <gogolxdong> What does `annot create Vulkan instance. ⏎ /build/vulkan-tools-ZnxIl9/vulkan-tools-1.1.82.0+dfsg1/vulkaninfo/vulkaninfo.c:825: failed with VK_ERROR_INCOMPATIBLE_DRIVER` mean? |
08:33:00 | FromGitter | <gogolxdong> does this simpley mean my gpu doesn't support vulkan API? |
08:36:08 | jacereda | is there something like `op: block[C]` to express that a parameter is a block of code yielding a C? |
08:44:26 | Araq | gogolxdong: seems likely |
08:48:03 | * | rockcavera quit (Ping timeout: 264 seconds) |
08:52:08 | * | PMunch joined #nim |
08:56:33 | jacereda | This does compile: https://gist.github.com/jacereda/c5d643b9850c8d3e00f3f53897cc5e62 is there any way to implement `mapValsIt` without the `dummy` argument and without resorting to macros? |
08:58:55 | FromGitter | <gogolxdong> That's too bad. |
09:00:44 | Araq | jacereda, use proc (v: B): auto |
09:05:31 | jacereda | Araq: do you mean in `mapVals` or in `mapValsIt`? |
09:07:55 | jacereda | in `mapValsIt` I get the `cannot instantiate: 'C'` error |
09:09:01 | Araq | in mapValsIt |
09:09:08 | Araq | you don't need the generic 'C' type |
09:09:48 | Araq | template mapValsIt*[A,B](t: Table[A,B], op: untyped): untyped = |
09:09:48 | Araq | mapVals(t, proc(v: B): auto = (let it{.inject.}=v; op)) |
09:10:15 | jacereda | oh, right! thanks! |
09:10:52 | jacereda | in any case, what about the other question? Is there any way to give `op` a type? |
09:12:31 | * | dom96_w joined #nim |
09:15:15 | Araq | well no, it contains an 'it' the compiler cannot resolve |
09:15:47 | * | dom96_w quit (Changing host) |
09:15:47 | * | dom96_w joined #nim |
09:16:19 | Araq | btw nice solution, but bad for performance, you use closures and a table materialization |
09:20:04 | jacereda | well, I'm only evaluating the feasability of migrating a large python code base, so your bad performance is probably impressive performance when looking through that glass :) |
09:30:35 | FromGitter | <narimiran> jacereda: not necessarily |
09:31:07 | FromGitter | <narimiran> i know i had some lousy performance using nim's tables, comparing to python's dict |
09:31:38 | FromGitter | <narimiran> that's why i said to you yesterday: don't aim for 1:1 translation between python and nim |
09:32:44 | FromGitter | <alehander42> @jacereda in any case it's possible to have zero-overhead abstractions for table operations(and we already have several), it's just a question of what would be the best API for them |
09:35:23 | FromGitter | <alehander42> so if you decide to migrate you'll have choice between different solutions for this particular aspect. Are there any other typical python patterns that you wonder about? |
09:38:41 | jacereda | at this point not really, the code doesn't use many fancy python features... but you have been there before, can you foresee problems? |
09:38:42 | Araq | jacereda, for Python migration TableRef will suit you much better than Table |
09:40:50 | jacereda | right, I'll use that |
09:41:23 | * | Sentreen joined #nim |
09:42:56 | FromGitter | <alehander42> @jacereda often people are trying to simulate python context managers, this is kinda easy with templates |
09:43:39 | FromGitter | <alehander42> the other thing is OOP: you can do OOP in Nim, but it's not the "dominant" paradigm |
09:44:15 | jacereda | no objects at all in that codebase |
09:45:22 | FromGitter | <alehander42> also sometimes very dynamic portions of code can be a bit tricky to port literally, so one needs to just think of a more Nim-ish alternative for them |
09:46:43 | FromGitter | <alehander42> you can get more experience from the nimbus guys, they've ported many python ethereum libs to nim |
09:46:49 | jacereda | I'm disassembling the code produced for test.nim and it includes prologue/epilogue when it could be just imulq/retq... is that due to the c flags used? |
09:47:22 | Araq | we do overflow detection in debug builds and other terrible stuff |
09:47:30 | jacereda | (I'm talking about the _colonanonymous_ instances) |
09:47:54 | jacereda | I'm building in release mode |
09:47:54 | Araq | always use -d:release or the upcoming -d:safe |
09:48:09 | Araq | oh that's your closure then |
09:48:22 | jacereda | yes |
09:48:52 | jacereda | but I mean the frame pointer stuff isn't necessary, I guess it's due to the flags passed to the compiler |
09:49:06 | jacereda | how can I specify additional flags? |
09:49:11 | jacereda | to clang? |
09:50:32 | Araq | not sure but if you're into it, try to enable profile guided optimizations :-) |
09:50:53 | Araq | I never did, shows how much I really care about performance, I guess |
09:53:02 | Araq | btw I'd like to have some "naive" Nim code with lines(), split stings and tables, somebody got some code handy for that? |
09:53:42 | Araq | something I'll turn into a Nim benchmark we try to make faster with every release :P |
09:55:13 | FromGitter | <alehander42> something calculating the frequency of "words" in a text file might be a good example |
09:56:19 | Araq | yeah, so lines + split + CountTable |
09:56:46 | Araq | well I can write that on my own easily enough |
09:57:40 | jacereda | Araq: using --passC=-fomit-frame-pointer makes the closure 2 instructions vs 5 |
10:03:34 | jacereda | I normally use 3 opt levels (debug/optimized/release), optimized keeps the frame pointer to help when using gdb/lldb, release uses something like -Ofast |
10:05:03 | Araq | with PGO it should inline through the function pointer indirection |
10:06:30 | jacereda | Araq: but PGO is very difficult to use for us, it's an interactive app with lots of code paths |
10:14:34 | Araq | alright |
10:24:31 | * | kapil____ quit (Quit: Connection closed for inactivity) |
10:40:36 | FromGitter | <kaushalmodi> Araq: That dumpLisp PR is now good to merge; passes everything. |
10:42:41 | FromGitter | <kaushalmodi> All: @PMunch did an awesome job making the parsetoml library pass all the tests in the toml-test test suite (it's a language agnostic TOML decoder validator). In the process, parsetoml added support for more TOML syntax. If you haven't yet used TOML config files for your projects, use it. It's beautiful :) |
10:50:08 | * | Snircle joined #nim |
11:04:19 | FromGitter | <narimiran> @kaushalmodi link to @PMunch's lib? |
11:13:08 | FromGitter | <kaushalmodi> It's a nimble package: parsetoml. Here's the link: https://github.com/NimParsers/parsetoml |
11:17:45 | FromGitter | <arnetheduck> @Araq, what's `-d:safe`? |
11:19:43 | Araq | a sane configuration, optimizations but plus important runtime checks |
11:19:59 | FromGitter | <arnetheduck> re overflow checks, with the right code gen, they're actually quite cheap.. ie in `nlvm` it uses the carry flag of operations - that put together with hinting and potentially coalescing multiple integer ops, would mean that it's "practically" free |
11:20:30 | Araq | cool :-) |
11:21:20 | FromGitter | <arnetheduck> ah nice. looking forward to that. can we go with `-O2`? `-O3` is often broken in gcc, like in 8.x where it causes a runtime explosion for the m&s gc for whatever reason |
11:21:37 | Araq | yeah, consider it done |
11:21:57 | Araq | though I will switch to clang on windows, produces better code |
11:22:04 | Araq | and works without setting a PATH |
11:22:51 | FromGitter | <arnetheduck> latter sounds like the winning reason.. clang vs gcc depends a lot on the code, no clear winners there, from what I've seen when pushing both (in a previous job) |
11:23:50 | FromGitter | <arnetheduck> wdyt of making -d:safe not throw on overflow, but abort instead? |
11:24:41 | FromGitter | <narimiran> @kaushalmodi re: "If you haven't yet used TOML config files for your projects, use it. It's beautiful": i haven't, and i've just checked it. it looks quite nice. now i need to find where to use it :) |
11:25:03 | FromGitter | <arnetheduck> @narimiran +1 for toml ;) |
11:31:37 | FromDiscord_ | <Sabena Sema> @araq: I need --genDeps to work while compiling (and in makefile format like gcc -MM), with absolute paths. Looks like gendeps is used for generating boot files? Should I just add a parameter for gendeps or should there be a new option |
11:31:51 | * | jacereda quit (Ping timeout: 252 seconds) |
11:35:02 | FromGitter | <kaushalmodi> @narimiran Any time you want to make anything runtime configurable for the user, think of TOML. :) |
11:35:23 | FromGitter | <narimiran> so, what did we say, is there way to make *everything* in some file exported/visible? (or should i put asterisks everywhere and there's nothing else i can do) |
11:37:39 | * | smt joined #nim |
11:40:46 | Araq | Sabena Sema: nim produces $project.json in nimcache with the produced C(++) codefiles and whether they only need to be linked or recompiled |
11:41:45 | Araq | seems to be better for your task than --genDeps |
11:42:53 | * | cavariux quit (Ping timeout: 246 seconds) |
11:43:25 | * | cavariux joined #nim |
11:48:16 | * | vlad1777d_ joined #nim |
12:02:26 | * | poopBot joined #nim |
12:03:06 | poopBot | PMunch, does each gtk window run in seperate thread or not |
12:04:51 | poopBot | i want to shoot updates in other threads so it dosent block UI wile it downloads info from web |
12:05:42 | poopBot | plan was to spawn 1 new window ontop to show progress of update, tought duno if that can work from seperate thread |
12:25:16 | * | Vladar quit (Remote host closed the connection) |
12:26:07 | * | Vladar joined #nim |
12:33:25 | dom96_w | if you use async you won't need threads |
12:34:11 | PMunch | kaushalmodi, thanks for the kind words :) |
12:34:25 | PMunch | poopBot, no all Gtk Windows by the same program run in the same thread |
12:34:33 | * | vlad1777d_ quit (Ping timeout: 252 seconds) |
12:35:14 | PMunch | The way to have a long running task is to spin that up in a separate thread, and then use something like GLib.idle_add to add an event to the event queue of the main thread |
12:36:49 | poopBot | dom96_w, but async uses wait for and i dont want to wait anything, and i will just shoot in background thread go fetch for each episodede img disc ect , then stroe in sqlite , so dont think i need async for this |
12:37:15 | dom96_w | async is concurrency |
12:37:18 | dom96_w | threads is parallelism |
12:37:22 | dom96_w | you don't need parallelism for this |
12:37:37 | dom96_w | using async will be much easier for you too |
12:37:49 | poopBot | PMunch, thats the plan, just am trying to figure out how to desplay progress of other thread on gui |
12:38:33 | poopBot | hmm how so, writing spawn FetchAllData() does all for me |
12:38:40 | dom96_w | Just use idle_add (or one of the timeout_add functions) and call asyncdispatch.poll in them |
12:38:58 | dom96_w | You can then just run async procs with `asyncCheck myAsyncProc` |
12:39:46 | poopBot | oh thats nice , i was wtf why they make it like i have to waitFor aysic function |
12:42:29 | poopBot | only benefint from async is i can easyer desply progress |
12:42:45 | poopBot | from what i understund |
12:43:47 | poopBot | i read little Nim in Action yesterday :) |
12:49:10 | FromDiscord_ | <Sabena Sema> @araq, no I need gendeps, the project.json does not list the nim files that were used to generate the C files / output executable. Also it only lists the set of C files for an incremental build, not all of them. I don't want to compile the C myself anyway, I want to invoke the nim compiler, but I want to be able to propagate the dependency information (which nim files should trigger a rebuild) to ninja. Currently I'm doing this with a |
12:50:42 | FromDiscord_ | <Sabena Sema> @poopBot: You probably want something like https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-events-pending |
12:52:43 | dom96_w | poopBot: All `waitFor` does is call `asyncdispatch.poll` until the future returned by the async procedure finishes |
12:54:00 | PMunch | poopBot: http://ix.io/1q4C/ |
12:54:04 | PMunch | If you want to use threads |
12:54:15 | FromGitter | <nothratal> Wow, here is quite a lot going on! Hello together! |
12:54:55 | PMunch | That's how you can send an event to the main threads event loop to access Gtk widgets safely |
12:55:57 | PMunch | Note that I use a channel instead of passing the pointer to idleAdd, this is because after the last round in the loop the mockWork thread might stop and release the memory of any internal data which would cause it to fail |
12:56:33 | dom96_w | yeah, trust me, threads + channels + unsafe GTK is not fun |
12:58:24 | shashlick | Anyone interested in a libgraphqlparser wrapper - need some expertise to validate that it does what it is supposed to - please get in touch |
12:58:41 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
13:00:26 | Araq | Sabena Sema: It does list all of them in the linking command |
13:00:44 | FromDiscord_ | <Sabena Sema> that's all the C object files though right? |
13:00:59 | Araq | well yes |
13:01:14 | Araq | this has come up before so please enlighten me |
13:01:18 | FromDiscord_ | <Sabena Sema> so if I use include ..... |
13:01:27 | Araq | how does Nim work with e.g. Ninja? |
13:01:44 | dom96_w | shashlick: a pure Nim parser would be awesome, we could use it at compile-time then |
13:01:46 | FromDiscord_ | <Sabena Sema> not well.... |
13:01:47 | FromDiscord_ | <Sabena Sema> https://gist.github.com/barcharcraz/9ec04ca3a3a0f6f20df44659878d3ad5 |
13:01:53 | Araq | currently if a single Nim file changes in your project you need to rerun 'nim c myproject' |
13:02:16 | Araq | you don't run 'nim c someNimFile', Nim doesn't work this way |
13:02:22 | FromDiscord_ | <Sabena Sema> no I know |
13:02:39 | FromDiscord_ | <Sabena Sema> let me link to an example build def |
13:03:09 | * | stefanos82 quit (Quit: Quitting for now...) |
13:03:29 | FromDiscord_ | <Sabena Sema> https://github.com/barcharcraz/meson/blob/nim-support/test%20cases/nim/1%20basic/meson.build |
13:04:06 | FromDiscord_ | <Sabena Sema> that's a single file, but the idea is you'd never specify more than one nim file in the executable() statement (except maybe if you're trying to use rod files, but those don't work so it's a moot point) |
13:06:30 | FromDiscord_ | <Sabena Sema> rust works similarly, however the test cases don't demonstrate it very well |
13:08:00 | * | Snircle joined #nim |
13:09:06 | poopBot | PMunch, hmm i can bend this to my will , but firsty will go read little abut Channels and Gpointer |
13:10:17 | poopBot | oh so Gpointer and Gboalen come from gtk thats why this {.cdec1.} |
13:10:22 | Araq | Sabena: ok, what's the feature request again? "Make --gendepend work"? |
13:10:58 | shashlick | @dom96: that would be cool but beyond what I can do |
13:11:07 | FromDiscord_ | <Sabena Sema> Umm gendeps. I can submit a PR. Give me a moment to type up the current situation. |
13:11:30 | PMunch | poopBot, yeah those are just Glib types |
13:11:41 | FromDiscord_ | <Sabena Sema> Gpointer is just a void* |
13:11:43 | PMunch | But as you see I don't really use them for anything in my example |
13:11:54 | FromGitter | <mratsim> @dom96 I was quite interested in tree-sitter for parsing: https://github.com/tree-sitter/tree-sitter |
13:12:44 | FromGitter | <mratsim> In a talk they presented that as an alternative to language server that can be embedded as it’s pure C |
13:13:47 | FromDiscord_ | <Sabena Sema> oh, for LSP you may want to check out what gnome-builder does. It does some neat tricks |
13:15:03 | FromGitter | <mratsim> oh yeah that was this talk: https://www.youtube.com/watch?v=Jes3bD6P0To |
13:15:32 | FromGitter | <mratsim> I guess we can just c2nim it and we have a parser in pure Nim :D |
13:21:56 | FromDiscord_ | <Sabena Sema> OK so the current gendeps status: |
13:21:56 | FromDiscord_ | <Sabena Sema> |
13:21:56 | FromDiscord_ | <Sabena Sema> 1) --genDeps implies --compileOnly |
13:21:57 | FromDiscord_ | <Sabena Sema> 2) --genDeps implies --genScript |
13:21:57 | FromDiscord_ | <Sabena Sema> 3) --genScript causes extccomp.noAbsolutePaths to return True |
13:21:59 | FromDiscord_ | <Sabena Sema> 4) noAbsolutePaths means that the generated command lines are different and makes compilation fail even if (1) is fixed. |
13:21:59 | FromDiscord_ | <Sabena Sema> 5) Fixing 1-4 changes how --genScript and --genDeps work, potentially breaking the generation of csources for booting |
13:22:01 | FromDiscord_ | <Sabena Sema> |
13:22:02 | FromDiscord_ | <Sabena Sema> Additionally: |
13:22:06 | FromDiscord_ | <Sabena Sema> 1) --genDeps outputs to a file that's one dependency per line, now I don't mind this but it's not how other languages do it (they imitate -MM and output a makefile snippet). Ninja actually doesn't strictly require a makefile snippet, you just have to be kinda close. |
13:22:08 | FromDiscord_ | <Sabena Sema> 2) Ninja reads dependency files directly after invoking the compiler and caches the results |
13:22:11 | FromDiscord_ | <Sabena Sema> 3) adding nim format support into ninja isn't hard, however actually getting it merged is, because ninja isn't really maintained very well. |
13:22:12 | FromDiscord_ | <Sabena Sema> |
13:22:16 | FromDiscord_ | <Sabena Sema> My core question is whether I can just fix genDeps and make it do what I want, maybe adding an option for no absolute paths, or if there should be a new option, or perhaps allow something like --gendeps:makefile or --gendeps:gcc |
13:26:18 | * | endragor quit (Remote host closed the connection) |
13:29:15 | Araq | --gendeps isn't used by niminst at all |
13:29:47 | Araq | and genscript is something else I think |
13:30:19 | Araq | --gendeps is used to produce these nice GraphViz based graphs |
13:30:37 | Araq | iirc |
13:32:14 | Araq | I dunno, go for --gendeps:gcc, I'm allergic to makefiles |
13:34:58 | dom96_w | mratsim, shashlick: #ParseUtils4Life |
13:35:17 | dom96_w | My book has a good chapter on parsing ;) |
13:35:47 | FromGitter | <mratsim> I dread when I have to implement a parser for natural language processing ... |
13:36:11 | FromGitter | <mratsim> especially when supporting emojis and non-ASCII characters |
13:40:27 | FromDiscord_ | <Sabena Sema> I think genDepend is for graphviz |
13:40:43 | FromDiscord_ | <Sabena Sema> --genDeps produces a .deps file |
13:42:49 | Araq | or maybe patch Nim so that $project.json also includes the nim files |
13:43:20 | Araq | I'm not a fan of adding more and more output formats to the compiler |
13:43:39 | Araq | better produce json and have some external tools to translate it further |
13:46:35 | * | endragor joined #nim |
13:49:09 | FromDiscord_ | <Sabena Sema> hmm yeah, that still needs a compiler wrapper in meson though, since ninja doesn't support doing any kind of postprocessing. |
13:49:28 | FromDiscord_ | <Sabena Sema> it's a good solution though, and I'm all for not letting any make into nim |
13:50:08 | FromDiscord_ | <Sabena Sema> ninja is going to be forked eventually anyways unless the maintainership situation gets better |
13:51:20 | * | endragor quit (Ping timeout: 272 seconds) |
13:53:16 | FromDiscord_ | <Sabena Sema> yeah that's ideal. The compiler wrapper can use the msvc /showIncludes syntax as well, which should avoid make even more |
13:59:27 | * | revere quit (Ping timeout: 264 seconds) |
14:00:02 | * | revere joined #nim |
14:08:00 | * | onionhammer quit (Read error: Connection reset by peer) |
14:08:50 | * | kapil____ joined #nim |
14:09:06 | * | onionhammer joined #nim |
14:11:01 | UNIcodeX | question. how to generate a range of numbers with a step. there appears to be no way to specify a step using {n .. n} |
14:11:03 | * | revere quit (Ping timeout: 250 seconds) |
14:11:23 | * | revere joined #nim |
14:12:43 | UNIcodeX | I see countup() and countdown(), but when trying to call them I get "Error: attempting to call undeclared routine" |
14:13:07 | * | onionhammer1 joined #nim |
14:14:29 | * | narimiran joined #nim |
14:15:08 | * | onionhammer quit (Ping timeout: 246 seconds) |
14:16:05 | poopBot | PMunch, i think i got evrything exepct idleAdd, i got what you talked about memory and fail(or i think :)) but dont know from where idleAdd comes from, it that form gtk somwere? |
14:17:50 | FromGitter | <mratsim> @UnicodeX, countup and countdown are iterators, you can only use them in a for loop |
14:18:13 | FromGitter | <mratsim> for i in countup(0, 10, 2) |
14:18:25 | UNIcodeX | would this not work -- "for i in countup(0, 500, 3): echo(i)" |
14:18:35 | FromGitter | <mratsim> yes it would |
14:18:38 | UNIcodeX | it's not |
14:18:47 | FromGitter | <mratsim> !eval for i in countup(0, 500, 3): echo(i) |
14:18:51 | NimBot | 0↵3↵6↵9↵12↵15↵18↵21↵24↵27↵30↵33↵36↵39↵42↵45↵48↵51↵54↵57↵60↵63↵66↵69↵72↵75↵78↵81↵84↵87↵90↵93↵96↵99↵102↵105↵108↵111↵114↵117↵120↵123↵126↵129↵132↵135↵138↵141↵144↵147↵150↵153↵156↵159↵162↵165↵168↵171↵174↵177↵180↵183↵186↵189↵192↵195↵198↵201↵204↵207↵210↵213↵216↵219↵222↵225↵228↵231↵234↵237↵240↵243... |
14:18:59 | FromGitter | <mratsim> ^ works |
14:19:19 | UNIcodeX | https://hastebin.com/xapehikomo.bash |
14:19:37 | UNIcodeX | error - https://hastebin.com/zobacunugi.apache |
14:19:56 | FromGitter | <mratsim> it works here: https://play.nim-lang.org/ |
14:20:18 | narimiran | works at my end |
14:20:24 | UNIcodeX | @mratsim, I installed Nim 0.19 from the main website yesterday |
14:20:29 | UNIcodeX | not sure why it wouldn't be working |
14:20:54 | dom96_w | did you name your file `countup.nim`? |
14:20:55 | PMunch | poopBot, idleAdd comes from Glib. Gtk uses the Glib event system for it's events, idleAdd adds an event to t he queue of events to process |
14:21:02 | UNIcodeX | dom96_w, negative. :) |
14:21:40 | dom96_w | weird |
14:22:11 | narimiran | works both in 0.19 and devel |
14:22:33 | * | krux02_ joined #nim |
14:23:06 | UNIcodeX | I'm trying it on windows. https://hastebin.com/yivojunelo.css |
14:23:14 | * | krux02 quit (Read error: Connection reset by peer) |
14:24:18 | UNIcodeX | I mean to say, that's where I'm getting the error. |
14:24:18 | FromGitter | <kaushalmodi> UNIcodeX: as an aside, if you use ptpb.pw instead of hastebin, you can get Nim syntax highlighting by appending "/nim" to the generated paste URL |
14:24:52 | dom96_w | Something must be wrong with your installation |
14:25:04 | dom96_w | or you've added some invisible characters into your file by accident |
14:25:21 | UNIcodeX | fresh file. all typed by hand. no pasting |
14:25:23 | dom96_w | Try compiling hello world and other simple scripts |
14:25:31 | UNIcodeX | I have. they work fine |
14:25:40 | narimiran | try `countdown` |
14:25:55 | UNIcodeX | This is the only thing that's given me an error that you confirm as a "shouldn't happen" |
14:25:58 | UNIcodeX | ok |
14:26:12 | dom96_w | also try `1 .. 5` |
14:26:16 | dom96_w | that's an alias for countup |
14:26:19 | UNIcodeX | countdown works fine... wtf |
14:26:27 | UNIcodeX | but what about the step |
14:26:28 | * | revere quit (Ping timeout: 246 seconds) |
14:26:36 | poopBot | PMunch, ty :) |
14:26:58 | * | revere joined #nim |
14:27:15 | narimiran | UNIcodeX: try everything: `1 .. 5`, then `countup(1, 5)`, then `countup(1, 10, 2)` |
14:27:51 | FromGitter | <mratsim> There’s is a shroedinger cat inside your computer |
14:28:25 | dom96_w | Are you perhaps within the vicinity of a nuclear reactor? |
14:29:30 | UNIcodeX | narimiran, `1 .. 5` (without backticks) works, countup(1, 5) worked, then countup(1, 10, 2) worked. I CTRL-Z'd back to the code I pasted and you confirmed as evaluating above, and it worked this time. |
14:29:44 | * | UNIcodeX throws up hands.... |
14:30:00 | narimiran | it works every other time. try it again and it won't work :P :D |
14:30:07 | FromGitter | <kaushalmodi> UNIcodeX: So what doesn't work? What's the error you are getting? |
14:30:28 | FromGitter | <kaushalmodi> May be you ended up with a weird mix of some old and new Nim stdlibs? |
14:30:49 | UNIcodeX | I don't know why it gave me the error. It's working fine now. I swear I ran it like 20 times and got the error. after i tried 1 .. 5 and countdown(), countup() started working.... |
14:31:20 | krux02_ | for me personally I have very good experience to not use anything but the `..<` iterator |
14:31:37 | UNIcodeX | what's the < part do? |
14:31:47 | krux02_ | no inclusive upper bound |
14:31:52 | krux02_ | 0 ..< 10 |
14:31:53 | narimiran | UNIcodeX: "until to, not including" |
14:32:01 | krux02_ | 0, 1, 2, ... , 9 |
14:32:02 | UNIcodeX | oh. so 1 .. 10 < would be 1 - 9 |
14:32:05 | UNIcodeX | k |
14:32:22 | UNIcodeX | err... 0 - 9 |
14:32:36 | UNIcodeX | NM... i had it right |
14:32:38 | krux02_ | not really |
14:32:49 | krux02_ | 1 .. 10 is 1 .. 10 |
14:32:58 | krux02_ | 1 .. 10 < is invalid |
14:33:03 | UNIcodeX | I'm still new to Nim. |
14:33:08 | UNIcodeX | obviously |
14:33:18 | krux02_ | ..< is a signle token |
14:33:25 | krux02_ | it's the name of the iterator |
14:33:32 | UNIcodeX | gotcha |
14:33:35 | krux02_ | it is implemented as an operator |
14:33:44 | krux02_ | in the past there was an unary < |
14:33:58 | krux02_ | but that got removed |
14:34:25 | FromGitter | <kaushalmodi> UNIcodeX: don't worry, looks like many people stumble across that (I did :P): https://scripter.co/notes/nim/#space-around-dot-dot |
14:36:39 | UNIcodeX | @kaushalmodi, nice resource. thanks |
14:44:57 | * | PMunch quit (Quit: Leaving) |
14:47:03 | * | rockcavera joined #nim |
14:48:01 | * | poopBot quit (Remote host closed the connection) |
14:50:22 | * | xet7 quit (Read error: Connection reset by peer) |
14:53:16 | UNIcodeX | I'm getting an error about indentation now. I'm using VSCode to edit this file. https://gist.github.com/UNIcodeX/07283d417e2107dbe466eab9d6d7b8a1 |
14:54:39 | * | Calinou quit (Ping timeout: 264 seconds) |
15:04:27 | Araq | UNIcodeX, (n: int): int |
15:04:33 | Araq | you missed a colon |
15:04:49 | UNIcodeX | ah shit. lol |
15:04:50 | UNIcodeX | thanks |
15:07:22 | UNIcodeX | Araq, trying to change it to return a sequence. says got seq[int] but expected seq[int]. lol. looks like it got what it was expecting to me. :shrugs: |
15:08:54 | UNIcodeX | nevermind. since result is a special varable within the proc, turns out I was unnecessarily instantiating it as seq[int]. the return type takes care of that for me it seems. I was repeating myself in essence. |
15:09:23 | UNIcodeX | I'm getting the hang of it. Nim is different than Python, but not too different. It's been exciting thus far. |
15:09:35 | narimiran | UNIcodeX: this might be useful to you: https://narimiran.github.io/nim-basics/ (disclaimer: i'm the author) |
15:09:53 | UNIcodeX | narimiran, thank you! |
15:10:21 | UNIcodeX | I've done tons of programming in Python, but I'm trying to broaden my horizen. |
15:11:09 | UNIcodeX | I've evaluated Go, Rust, and Nim. I do plan to dabble in the other two as well, but I'm trying to focus on one at a time so as to minimize confusion between language syntax, etc... |
15:11:21 | narimiran | UNIcodeX: nim at first seems like python's cousin (because of significant whitespace and similar syntax), both the more you learn nim, the more you'll see differences and the power of nim |
15:11:36 | narimiran | *both = but |
15:12:02 | UNIcodeX | I see power and potential already. Nim compiles to multiple other languages. That right there is very powerful. |
15:12:07 | UNIcodeX | I know what you mean though |
15:12:22 | UNIcodeX | the kind of epiphany that only usage can afford |
15:13:09 | narimiran | i come from python, and i had multiple "why is this not the same way like in python", because i falsely thought the two languages are more similar than they really are |
15:13:23 | UNIcodeX | I bet |
15:14:19 | narimiran | i hope that "Nim Basics" will be enough to get you on your feet with nim. your feedback would be welcome |
15:14:33 | * | Vladar quit (Remote host closed the connection) |
15:15:28 | UNIcodeX | I am interested in cross-platform coding. Nim seems like it would handle that with relative ease. I saw a couple of blog articles about building Android apps. Of course it requires the Android SDK / NDK, and I don't know what GUI toolkit / library I'd have to use, so input on that would be welcome. The other alternative is Kivy, which looks pretty, but will be much less performant than native code. |
15:15:37 | Araq | to be fair though, a lot of times we took a feature from Python and re-thought it for how it would fit a systems programming language |
15:15:39 | UNIcodeX | narimiran, for sure. I'll go through it and let you know what I think. |
15:16:42 | UNIcodeX | I've also done some stuff in micropython on ESP chips. That's pretty cool capability. Is there anything for microcontrollers and Nim? |
15:17:18 | UNIcodeX | I know I'm kind of in multiple directions at the moment, but it's got me excited. :) |
15:17:24 | narimiran | i think there is something called "ardunimo", but i don't know anything about it |
15:19:05 | narimiran | re: multiple directions: start slow :) get to know nim first ;) |
15:19:51 | UNIcodeX | :) |
15:20:07 | UNIcodeX | indeed. |
15:35:41 | FromGitter | <zacharycarter> UNIcodeX - not to throw a wrench in your plans or anyhting |
15:35:54 | FromGitter | <zacharycarter> but android native development - whether you're using Nim or Rust or C/C++ - sucks |
15:36:17 | FromGitter | <zacharycarter> because the android team seems to care very little about native development |
15:36:44 | FromGitter | <zacharycarter> as far as x-platform GUI - I believe there are a few options there but none that are that great |
15:36:58 | FromGitter | <zacharycarter> nothing like Qt |
15:37:14 | FromGitter | <zacharycarter> webview or CEF might be an optoin |
15:37:18 | FromGitter | <zacharycarter> there's always electron too |
15:37:31 | UNIcodeX | @zacharycarter, what's good to use then? I have no idea where to start. |
15:37:41 | UNIcodeX | oh. i see. |
15:37:45 | UNIcodeX | you answered already |
15:37:52 | UNIcodeX | multiple chat windows open. |
15:38:04 | FromGitter | <zacharycarter> :P np - it depends a lot on what you want to build tbh |
15:38:22 | FromGitter | <zacharycarter> you might start with this search - https://nimble.directory/search?query=gui |
15:38:46 | UNIcodeX | and there's the other part of it. Lots of things I've thought to build for mobile, already exists. |
15:39:34 | FromGitter | <zacharycarter> btw - here's that ardunimo project narimiran mentioned - https://github.com/gokr/ardunimo |
15:39:46 | FromGitter | <zacharycarter> if you just want to get started with Nim - and at the same time build something fun |
15:39:59 | FromGitter | <zacharycarter> hmmm let me think for a tick - and I'll try to come up with an idea |
15:41:33 | dom96_w | Plenty of project ideas here https://github.com/nim-lang/needed-libraries/issues |
15:41:39 | dom96_w | Also https://forum.nim-lang.org/t/1672 |
15:41:47 | FromGitter | <zacharycarter> well - I think he's looking for something rather specific |
15:41:48 | UNIcodeX | dom96_w, cool |
15:42:08 | FromGitter | <zacharycarter> something related to mobile dev, that's beginner level and will also involve some x-compilation |
15:42:22 | FromGitter | <zacharycarter> but those are good suggestions as well - maybe there's an idea on there that fits the bill already |
15:46:54 | FromGitter | <yyyc514> InstantiationInfo |
15:46:58 | FromGitter | <yyyc514> isn’t instantion info in system? |
15:47:04 | FromGitter | <yyyc514> Error: undeclared identifier: 'InstantiationInfo' |
15:53:59 | * | Trustable joined #nim |
15:54:30 | * | darithorn joined #nim |
15:55:39 | FromGitter | <yyyc514> is `private` a reserved word? |
15:58:28 | FromGitter | <yyyc514> ah i figured it out… my string iterpolation is breaking in the template because i’m not working with real variables, hmmm |
15:59:11 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
15:59:52 | * | enthus1ast joined #nim |
16:01:57 | enthus1ast | im wondering if `spawn(getMD5(req.body))` getMD5 runs in the thread or if i must wrap `getMD5(req.body)` in a proc |
16:02:20 | enthus1ast | because it *seems* to block the main thread |
16:02:27 | * | Lord_Nightmare joined #nim |
16:09:09 | enthus1ast | oh man it seems it does, then its something else, i should have become an gardener or so |
16:12:37 | * | nsf quit (Quit: WeeChat 2.2) |
16:13:09 | * | federico3_ is now known as federico3 |
16:13:36 | * | krux02_ quit (Remote host closed the connection) |
16:26:36 | FromGitter | <Mobilpadde> Hey! Got a question. Is there a way to use strings as indices in sequences? |
16:26:58 | shashlick | you want a table |
16:27:16 | FromGitter | <Mobilpadde> Oh, thanks! :D |
16:27:19 | FromGitter | <Mobilpadde> Saved my day! |
16:35:05 | FromGitter | <alehander42> ok |
16:41:30 | narimiran | @Mobilpadde if char (instead of string) would work for you: you can use arrays with char indices |
16:41:37 | FromGitter | <kaushalmodi> Critbits work great if you want strings as indices |
16:41:49 | narimiran | e.g. `var foo: array['a'..'c', int]` |
16:47:45 | FromGitter | <zacharycarter> https://github.com/filcuc/nimqml - https://www.vandenoever.info/blog/2017/02/17/a-simple-rust-gui-with-qml.html - wonder if we could write a similar post for Nim |
16:47:54 | FromGitter | <zacharycarter> I haven't played w/ Nim's QML bindings yet |
16:53:38 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:58:19 | xace | I'm trying to store a proc in a variable to use it later, can someone help me figure it out? https://pastebin.com/raw/gEZMVQvb |
17:00:48 | narimiran | xace: `var cbp: proc(s: string)` |
17:01:43 | shashlick | https://github.com/genotrance/nimgraphql |
17:01:46 | xace | narimiran: is the `var` required? |
17:02:03 | * | PrimHelios_ joined #nim |
17:02:22 | narimiran | well, you need to declare it, so: yes, it is required |
17:02:44 | FromGitter | <zacharycarter> so many people have wrapped that library already :P myself included |
17:02:57 | FromGitter | <zacharycarter> I'm guessing you did it with nimgen though shashlick? |
17:03:09 | FromGitter | <zacharycarter> now we just need a gql server impl :P |
17:03:14 | xace | narimiran: is the `(s: string)` parameter name important there or can I just state there is a string there? |
17:03:44 | shashlick | @zacharycarter: well, I had tried some months ago but nimgen wasn't good enough back then |
17:03:49 | shashlick | didn't realize it was done already |
17:04:07 | narimiran | xace: you can have `anything: string` |
17:04:20 | shashlick | I found https://github.com/samdmarshall/GraphQL.nim but it wasn't functional |
17:05:02 | FromGitter | <zacharycarter> meh - probably better to have them produced with nimgen - more maintainable I'm thinking |
17:05:05 | xace | narimiran: oki, thank you :) |
17:05:24 | shashlick | @zacharycarter: please check it out if you get a chance |
17:05:32 | FromGitter | <zacharycarter> well - the parser is mostly useless until we get a gql server impl I think |
17:05:41 | FromGitter | <zacharycarter> okay - I should have some time later this afternoon / evening |
17:10:53 | * | enthus1ast quit (Ping timeout: 276 seconds) |
17:23:53 | * | PrimHelios_ quit (Ping timeout: 252 seconds) |
17:28:59 | FromGitter | <iffy> How do I pass additional flags to `nimble build` and `nimble install`? I've read the Nimble readme, but I guess I'm missing it |
17:30:31 | FromGitter | <iffy> Rather, I want to put something in my `.nimble` file so that when I run `nimble build` in includes my additional flags |
17:30:43 | * | enthus1ast joined #nim |
17:31:07 | shashlick | use a nim.cfg |
17:31:14 | shashlick | or use pragmas |
17:31:41 | FromGitter | <iffy> I thought I'd used a pragma for that before. Which one is it? |
17:31:51 | FromGitter | <iffy> to pass a -d:something |
17:32:28 | narimiran | `define:"something"` in nim.cfg |
17:33:40 | shashlick | i don't think there's a define pragma, it was deprecated, though I am hoping Araq brings it back |
17:34:04 | FromGitter | <iffy> oh, okay; the `nim.cfg` option works for now; thank you! |
17:38:06 | * | PrimHelios_ joined #nim |
17:52:13 | * | rockcavera quit (Remote host closed the connection) |
17:52:56 | * | rockcavera joined #nim |
17:54:03 | * | rockcavera quit (Remote host closed the connection) |
17:54:26 | * | rockcavera joined #nim |
17:58:51 | * | enthus1ast quit (Ping timeout: 264 seconds) |
17:59:15 | * | enthus1ast joined #nim |
18:06:14 | * | Perkol joined #nim |
18:11:25 | Summertime2 | ok so I have bin = @["bin/some_such"], which the result wants to be placed in ./bin/some_such, the bin folder doesn't exist so this is an error, I can't use a `before build` because it won't apply before install |
18:12:30 | Summertime2 | I tried `mkDir binDir / "bin"` with binDir should be the root of the project by default with before install but that causes an error |
18:14:55 | * | elrood joined #nim |
18:17:31 | Summertime2 | oh right, this is with a srcDir defined as src |
18:18:03 | * | enthus1ast quit (Ping timeout: 264 seconds) |
18:18:17 | FromGitter | <iffy> @zacharycarter on that QML stuff, I'm always confused by Qt's license. Would I have to follow Qt's LGPL/GPL/Commercial license if I made an app using that nimqml library? |
18:18:47 | FromGitter | <recloser> does anyone know how long the `--nilseqs:on` transition period is supposed to be? is it going to get removed in v0.20? |
18:20:36 | * | wildlander joined #nim |
18:27:36 | Summertime2 | https://travis-ci.org/Summertime/splatter-kit/jobs/446826109#L523 @ https://github.com/Summertime/splatter-kit/tree/7db918f for my issue |
18:35:20 | * | jjido joined #nim |
18:36:31 | shashlick | Summertime2: you could create an empty 'bin' directory |
18:37:56 | Summertime2 | would be a bit more trouble than worth, since git doesn't like blank directories (I could put in a blank file and then add an exception to my gitignore I guess) |
18:38:37 | copygirl | Anyone know why `proc test*[T](foo: T; other: typedesc): other = {.fatal: $other.}` doesn't work ("cannot evaluate at compile time: other"), while if I remove `[T]` and make `foo` an integer, it does? |
18:38:52 | Summertime2 | what am I complaining about I guess, it'll work well enough ay, thanks for the guidance |
18:39:08 | copygirl | (I can also fix it by using a template instead of a proc.) |
18:39:31 | shashlick | Summertime2: i've seen some repos with an empty.txt |
18:40:39 | narimiran | shashlick: nim repo is one of them ;) |
18:41:29 | Summertime2 | oof |
18:46:02 | * | PrimHelios_ quit (Ping timeout: 246 seconds) |
19:04:15 | * | jjido quit (Ping timeout: 264 seconds) |
19:05:34 | * | dddddd joined #nim |
19:10:08 | Araq | recloser: 0.20 will still have it |
19:13:04 | FromGitter | <iffy> Is the warning on getTempDir still valid? https://nim-lang.org/docs/ospaths.html#getTempDir%2C It seems like https://github.com/nim-lang/Nim/issues/5260 fixed it, no? |
19:17:44 | FromGitter | <recloser> @Araq: that's too bad, a bunch of bugs i found in jsgen would be easier to fix if it could be assumed that the strings/seqs are never null |
19:17:54 | * | nsf joined #nim |
19:18:09 | Araq | I think you misunderstand this switch |
19:18:31 | Araq | strings/seqs of length 0 is mapped to JS's null and that's unlikely to change |
19:19:17 | * | zachk joined #nim |
19:19:21 | FromGitter | <recloser> it would be easier if they were initialized as normal objects, otherwise a ton of temporaries have to be made because of dereferencing |
19:20:11 | * | zachk quit (Changing host) |
19:20:11 | * | zachk joined #nim |
19:20:22 | FromGitter | <recloser> like you could just push something to a seq with just "$1.push($2)" |
19:21:00 | copygirl | So here's my `Either` types: https://gist.github.com/copygirl/60d5446bdcfe305d70a2c17a8c199790 |
19:21:02 | FromGitter | <recloser> right now there's a ton of bugs in jsgen because temps aren't properly generated and the code evaluates exprs multiple times |
19:21:28 | copygirl | Araq, you seemed to be confused by my goal for them, so.. not sure, maybe you'd be interested in taking a quick look at it? |
19:21:54 | FromGitter | <recloser> like from impl of mAppendSeqElem: `r.res = "if ($1 != null) { $1.push($2); } else { $1 = [$2]; }" % [x.rdLoc, y.rdLoc]` |
19:22:02 | FromGitter | <recloser> double evaling `$1` |
19:27:24 | FromGitter | <kaushalmodi> Has anyone tried to read an env var in Nim code that compiles to JS? |
19:27:27 | copygirl | Oh and someone suggested `node.strVal` instead of `$node.ident` but that didn't seem to work in my case. |
19:28:12 | FromGitter | <kaushalmodi> About getting env var in JS, this works `greeting = $(process.env.GREETING.to(cstring))`, but I cannot check if that var exists or not |
19:28:29 | FromGitter | <kaushalmodi> I was hoping `getEnv` would Just Work (TM) for JS export too |
19:28:31 | FromGitter | <kaushalmodi> :) |
19:29:09 | * | PrimHelios_ joined #nim |
19:33:36 | FromGitter | <alehander42> which var exists or not? |
19:34:10 | FromGitter | <kaushalmodi> I am continuing my exercise from yest |
19:34:25 | FromGitter | <alehander42> I use `proc isNone*T (a: T): bool {.importcpp: "(# == null)", noSideEffect, tags: [].}` |
19:34:31 | FromGitter | <alehander42> which matches undefined and null |
19:34:35 | FromGitter | <alehander42> but might not be the best name |
19:35:33 | FromGitter | <kaushalmodi> may be I can compare with https://nim-lang.org/docs/jsffi.html#jsNull ? |
19:35:39 | FromGitter | <kaushalmodi> or jsUndefined? |
19:41:27 | * | PrimHelios_ quit (Ping timeout: 264 seconds) |
19:55:54 | FromGitter | <kaushalmodi> @alehander42 got this to work: https://ptpb.pw/bkz3/nim |
20:06:47 | * | PrimHelios_ joined #nim |
20:13:44 | * | Jesin quit (Quit: Leaving) |
20:19:48 | Araq | recloser: double evals can be dealt with by transforming f(a) into tmp = f(a); tmp |
20:22:36 | * | PrimHelios_ quit (Ping timeout: 252 seconds) |
20:23:02 | FromGitter | <recloser> i know, the thing is it's just doing that everywhere is pretty error prone |
20:23:33 | FromGitter | <recloser> also that doesn't really work for ptrs/refs right now |
20:24:11 | FromGitter | <kaushalmodi> What does `nodecl` pragma do? Example: `var console {. importc, nodecl .}: JsObject` from https://nim-lang.org/docs/jsffi.html |
20:27:29 | * | Perkol quit (Quit: Leaving) |
20:32:15 | FromGitter | <yyyc514> so can i pass an array instead of varargs? |
20:32:40 | FromGitter | <kaushalmodi> you mean pass to a proc? |
20:34:48 | * | nsf quit (Quit: WeeChat 2.2) |
20:38:32 | FromGitter | <alehander42> it tells it shouldn't generate a declaration according to an old tutorial |
20:38:46 | FromGitter | <alehander42> but I thought importc does this too, maybe its an old pragma |
20:39:26 | FromGitter | <kaushalmodi> oh.. I was reading "nodecl" as "node cl".. I was wondering what that meant |
20:39:32 | FromGitter | <kaushalmodi> so the docs need updating? |
20:40:11 | FromGitter | <alehander42> I wonder if `nodecl` is still useful, I can't understand what's the difference between `importc` and `nodecl` right now (Araq ?) |
20:40:36 | FromGitter | <alehander42> actually it is in the manual |
20:40:38 | FromGitter | <kaushalmodi> I just found it in manual too: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-nodecl-pragma |
20:40:42 | FromGitter | <kaushalmodi> yeah :) |
20:41:09 | FromGitter | <kaushalmodi> that still doesn't exactly explain me what it does |
20:41:16 | Araq | it's also kinda obvious, if you import from C you still want to generate some declaration for it, unless it is either .nodecl or .header |
20:41:45 | FromGitter | <alehander42> yeah, I've used importc in the JS backend most of the time |
20:42:27 | FromGitter | <kaushalmodi> I don't see different between imported vars with and without nodecl |
20:42:50 | * | Jesin joined #nim |
20:43:09 | FromGitter | <kaushalmodi> Example: https://ptpb.pw/Eyas/js ; `exports` var doesn't have nodecl, `console` has |
20:47:33 | FromGitter | <kaushalmodi> ? |
20:47:47 | FromGitter | <kaushalmodi> Araq: So nodecl doesn't do anything for JS export? |
20:48:43 | * | jsonfrost joined #nim |
21:20:51 | * | Calinou joined #nim |
21:26:44 | * | narimiran quit (Quit: Konversation terminated!) |
21:29:23 | * | Jesin quit (Quit: Leaving) |
21:34:47 | FromGitter | <zacharycarter> @iffy not 100% sure on that |
21:35:31 | FromGitter | <zacharycarter> interesting - I just recently used nodecl all over the place |
21:35:33 | FromGitter | <zacharycarter> in a JS project |
21:36:05 | * | Trustable quit (Remote host closed the connection) |
21:36:56 | FromGitter | <zacharycarter> shashlick: another library I wrapped a while ago - but I think would be a good one to use nimgen on is - https://github.com/jarikomppa/soloud |
21:38:11 | FromGitter | <kaushalmodi> @zacharycarter would you be up for few Nim->JS 101 Q's from me? |
21:38:53 | FromGitter | <kaushalmodi> ~~few~~ may be just 1 |
21:40:22 | FromGitter | <zacharycarter> sure |
21:40:28 | FromGitter | <zacharycarter> at least I can try to answer them |
21:41:02 | FromGitter | <kaushalmodi> In JS, there is `import querystring from "querystring";`. What do I write in Nim that exports to that? |
21:41:38 | FromGitter | <kaushalmodi> it's a different issue to figure out if querystring is an internal node module or something I'll need to provide |
21:42:27 | shashlick | @zacharycarter: will check it out |
21:43:31 | FromGitter | <iffy> Can someone on Windows tell me if this fails for them? ⏎ ⏎ ```import os ⏎ doAssert normalizedPath("C:\\a\\b") == "C:\\a\\b"``` [https://gitter.im/nim-lang/Nim?at=5bd38a83ae7be94016bfc3e0] |
21:44:02 | FromGitter | <zacharycarter> @kaushalmodi - do you mean you want to import the querystring proc from the querystring module, and export it as something else? |
21:44:12 | FromGitter | <zacharycarter> not 100% understanding your question |
21:44:30 | FromGitter | <zacharycarter> or are you saying you want to export something as querystring? |
21:44:32 | FromGitter | <kaushalmodi> @zacharycarter I want to write Nim code that effectively exports to https://github.com/kaushalmodi/nim-netlify-functions/blob/master/src/lambda/to_be_converted/hello_name_post.js#L1 |
21:44:51 | FromGitter | <zacharycarter> hmm |
21:45:20 | FromGitter | <kaushalmodi> e.g. https://github.com/kaushalmodi/nim-netlify-functions/blob/master/src/lambda/hello_env.nim translates to https://github.com/kaushalmodi/nim-netlify-functions/blob/master/src/lambda/orig_js_funcs/hello_env.js |
21:46:04 | FromGitter | <yyyc514> can i give a macro access to a routine if i declare is compileTime? |
21:46:49 | FromGitter | <zacharycarter> I see what you mean |
21:47:07 | FromGitter | <zacharycarter> import statements are tough |
21:47:13 | FromGitter | <zacharycarter> because they have to go at the top of the JS file if I'm not mistaken |
21:47:27 | FromGitter | <zacharycarter> this is why I've generally stuck with commonjs modules and used require instead of import |
21:48:38 | FromGitter | <zacharycarter> I've tried to do something similar by doing like - `proc importJS(importName: cstring, moduleName: cstring): JsObject {.importcpp: "import # from '#'".}` |
21:48:57 | FromGitter | <zacharycarter> but that doesn't work really - because it's unlikely that the statement will get hoisted to the top of the JS file |
21:49:09 | FromGitter | <zacharycarter> that's why I've commonly used required - does that make sense @kaushalmodi ? |
21:49:23 | FromGitter | <zacharycarter> I know there is SOMETHING somewhere in the stdlib to hoist nim expressions to the top of the source file |
21:49:43 | FromGitter | <zacharycarter> but, it says it should only be used for development / debugging purposes - not even sure how it'd help in that scenario |
21:49:54 | shashlick | @iffy: Error: unhandled exception: C:\Users\..\ctest.nim(3, 10) `normalizedPath("C:\\a\\b") == "C:\\a\\b"` [AssertionError] |
21:49:56 | FromGitter | <zacharycarter> should probably be some kind of issue / RFC for this and the JS backend |
21:50:18 | FromGitter | <iffy> thanks; I'll file a bug (and hopefully a fix) |
21:50:54 | FromGitter | <kaushalmodi> @zacharycarter I don't understand the "have to go to the top of the JS file" |
21:50:59 | FromGitter | <kaushalmodi> But I'll see what I can do |
21:51:05 | shashlick | normalizedPath("C:\\a\\b") returns \C:\a\b |
21:51:20 | FromGitter | <kaushalmodi> I have https://ptpb.pw/GPLN/nim.. the only missing piece (I think ) is that import statement at the top |
21:51:27 | FromGitter | <iffy> shashlick: That's what I'm seeing, too but it shouldn't, right? |
21:51:40 | shashlick | I agree |
21:52:51 | shashlick | broken on 0.19.0 and #head |
21:52:56 | FromGitter | <iffy> k, submitted a PR -- I don't have a handy windows machine (just AppVeyor where I noticed the bug) |
21:52:58 | shashlick | proc isn't there in 0.18.0 |
21:55:06 | FromGitter | <zacharycarter> @kaushalmodi - https://medium.com/@jakewies/you-must-import-all-es6-modules-at-the-top-level-of-your-javascript-files-67888dfad66 |
21:56:27 | FromGitter | <zacharycarter> not sure how you get around that restriction |
21:59:01 | FromGitter | <zacharycarter> http://exploringjs.com/es6/ch_modules.html#sec_basics-of-es6-modules - might further clarify |
21:59:21 | FromGitter | <zacharycarter> from my understanding the statements will be hoisted by your ES6 transpiler |
21:59:29 | FromGitter | <zacharycarter> so they need to be declared at a top level scope |
21:59:31 | FromGitter | <kaushalmodi> @zacharycarter OK, looks like I have a lot of reading to do |
22:00:03 | FromGitter | <kaushalmodi> your suggested snippet does create that import at top level: https://ptpb.pw/kYaG/js |
22:00:06 | FromGitter | <zacharycarter> those imports are a ES6 proposal - they are not actually available in most all browsers without having a pollyfil |
22:00:07 | FromGitter | <kaushalmodi> but not at top of the file |
22:00:17 | FromGitter | <zacharycarter> or having some type of transpiler like babel |
22:00:55 | FromGitter | <kaushalmodi> As I don't know JS at all, it's a huge info overload |
22:01:04 | FromGitter | <zacharycarter> https://auth0.com/blog/javascript-module-systems-showdown/ - probably a good article to view |
22:01:38 | FromGitter | <kaushalmodi> may be that code works (the last link I pasted), but now I need to figure out where the querystring module is coming from |
22:02:12 | FromGitter | <kaushalmodi> here is the original source: https://github.com/netlify/netlify-functions-example |
22:02:31 | FromGitter | <kaushalmodi> querystring is probably coming from one of those packages in packages.json |
22:03:36 | FromGitter | <kaushalmodi> I just want to make that small script run, and as I am not familiar with yarn, package.json, I am slowly trying to figure out the bare min dependencies needed to make that JS example work |
22:03:50 | FromGitter | <zacharycarter> yup |
22:04:05 | FromGitter | <zacharycarter> okay yarn is facebook's JS package manager |
22:04:14 | FromGitter | <zacharycarter> NPM is the open source one |
22:04:21 | FromGitter | <zacharycarter> package.json is equivalent to a nimble file in Nim |
22:04:32 | FromGitter | <kaushalmodi> yes, I only got that last part :P |
22:04:49 | FromGitter | <kaushalmodi> but it's not clearly where querystring is coming from |
22:05:05 | FromGitter | <zacharycarter> actually |
22:05:08 | FromGitter | <kaushalmodi> It would have been nice to just know a .js I need to put in the site footer to make that thing work |
22:05:09 | FromGitter | <zacharycarter> I think it's a NodeJS module |
22:05:24 | FromGitter | <zacharycarter> https://nodejs.org/api/querystring.html |
22:05:38 | FromGitter | <kaushalmodi> oh, thanks |
22:05:40 | FromGitter | <zacharycarter> so that nim code probably needs to get compiled with the nodeJS define |
22:05:40 | FromGitter | <zacharycarter> np |
22:05:42 | FromGitter | <kaushalmodi> *how do you know?* |
22:05:50 | FromGitter | <zacharycarter> you don't |
22:06:02 | FromGitter | <zacharycarter> you just throw your hands in the air and say CURSE YOU JAVASCRIPT |
22:06:09 | FromGitter | <zacharycarter> YOU ARE ALL THAT IS EVIL AND BAD IN THE WORLD! |
22:06:31 | * | PrimHelios_ joined #nim |
22:06:34 | FromGitter | <kaushalmodi> "with the nodeJS define"? |
22:06:37 | FromGitter | <zacharycarter> or you install a bunch of VSCode intellisense plugins and hope you can ctl + click through |
22:06:41 | FromGitter | <kaushalmodi> you mean `-d:nodeJS`? |
22:06:44 | FromGitter | <zacharycarter> yes |
22:07:59 | FromGitter | <kaushalmodi> no luck.. |
22:08:02 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd39042ab17df2631f6b3f4] |
22:08:36 | FromGitter | <kaushalmodi> compiles fine without that define |
22:08:41 | FromGitter | <zacharycarter> hmmm |
22:08:50 | FromGitter | <kaushalmodi> nim code: https://ptpb.pw/_kb5/nim |
22:09:58 | FromGitter | <zacharycarter> I'll take a stab at it |
22:11:13 | FromGitter | <kaushalmodi> I am able to convert 4/7 JS funcs from https://github.com/netlify/netlify-functions-example/tree/master/src/lambda |
22:11:49 | FromGitter | <kaushalmodi> remaining: hello_name_post, hello_fetch, and hello_slack (I'll give up on this as I don't use slack :P) |
22:12:11 | FromGitter | <zacharycarter> @kaushalmodi - with nim 0.19.0 that compiles fine for me |
22:12:19 | FromGitter | <zacharycarter> `A-TD1EQGTFM:sell-my-car zachcarter$ nim js -d:nodejs foo.nim` |
22:12:47 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd3915eab17df2631f6bb24] |
22:13:08 | FromGitter | <kaushalmodi> huh.. I am on latest devel built yest |
22:13:19 | FromGitter | <zacharycarter> let me upgrade to devel |
22:15:06 | FromGitter | <kaushalmodi> ok, found the problem.. nim bug |
22:15:14 | FromGitter | <kaushalmodi> I had to remove all config.nims that came in the search path |
22:15:20 | FromGitter | <zacharycarter> ahhh okay |
22:15:24 | FromGitter | <zacharycarter> 👍 |
22:15:31 | FromGitter | <zacharycarter> now you get to open the JS file and see the JS errors :P |
22:16:44 | FromGitter | <kaushalmodi> adding the define didn't actually change the js |
22:16:52 | FromGitter | <kaushalmodi> except for the random name changes |
22:18:33 | FromGitter | <kaushalmodi> ok, I need to chase this later |
22:18:39 | FromGitter | <kaushalmodi> thanks for your time! |
22:19:13 | FromGitter | <zacharycarter> np! |
22:19:22 | FromGitter | <zacharycarter> I mean the JS produced by the import statement thing |
22:19:33 | FromGitter | <zacharycarter> @kaushalmodi - ping me when you're working on it again if you're having trouble - glad to help whenever I can |
22:19:40 | FromGitter | <kaushalmodi> thanks! |
22:19:48 | FromGitter | <zacharycarter> are these AWS lambda jobs? |
22:19:50 | FromGitter | <zacharycarter> btw? |
22:19:51 | FromGitter | <kaushalmodi> this is where I am right now |
22:20:03 | FromGitter | <kaushalmodi> Netlify runs AWS lambda jobs in the backend |
22:20:07 | FromGitter | <kaushalmodi> but it errors with https://nim-lambda-functions.netlify.com/.netlify/functions/hello_name_post |
22:20:39 | FromGitter | <kaushalmodi> and this is the JS code generated with nim js -d:nodejs ..: https://github.com/kaushalmodi/nim-netlify-functions/blob/master/src/lambda/nimcache/hello_name_post.js |
22:21:11 | FromGitter | <zacharycarter> well - I know you can create lambda jobs using Nim's C target |
22:21:18 | FromGitter | <zacharycarter> although it requires a Python bridge - but I've done it before |
22:21:35 | FromGitter | <kaushalmodi> that's another blackhole for me |
22:21:39 | FromGitter | <zacharycarter> I think it's probably possible now to create a Nim C target for lambda jobs - the same way AWS implemented Golang's |
22:21:56 | FromGitter | <zacharycarter> but using the nodejs backend is perfectly viable as well |
22:22:00 | FromGitter | <kaushalmodi> in any case got to go for now |
22:22:05 | FromGitter | <zacharycarter> okay - talk soon! |
22:27:37 | FromGitter | <Mobilpadde> Hey, got another question :D - How do I mark an exported variable (is a seq with procedures in) as gcsafe? Because with `--threads:on`my program won't compile :/ |
22:31:15 | FromGitter | <recloser> is it a global var? |
22:31:31 | FromGitter | <Mobilpadde> Yea |
22:31:37 | FromGitter | <recloser> "We call a proc p GC safe when it doesn't access any global variable that contains GC'ed memory (string, seq, ref or a closure) either directly or indirectly through a call to a GC unsafe proc." |
22:31:57 | FromGitter | <Mobilpadde> Oh |
22:32:08 | FromGitter | <Mobilpadde> How do I make it not global? :D |
22:32:46 | FromGitter | <Mobilpadde> Still exported for *one* other module to use |
22:33:08 | FromGitter | <recloser> hmm |
22:33:32 | FromGitter | <recloser> does it actually need to be a seq or can it be an array? |
22:33:53 | FromGitter | <Mobilpadde> Can be an array :D |
22:34:14 | FromGitter | <Mobilpadde> Sorry, I' |
22:34:53 | FromGitter | <recloser> so this is just a constant array like `var blah = @[someproc1, someproc2]`? |
22:35:11 | FromGitter | <recloser> i mean, a constant seq, right now |
22:35:27 | FromGitter | <Mobilpadde> `let stuff = @[proc1, proc2]` |
22:35:33 | FromGitter | <Mobilpadde> Yea |
22:36:58 | FromGitter | <recloser> just drop the `@` to make it an array |
22:37:40 | FromGitter | <recloser> and make sure the procs have a `{.nimcall.}` pragma |
22:37:40 | FromGitter | <Mobilpadde> Okay, fixed by removing the `@`, now I have another problem though, with an array of regexii |
22:38:07 | FromGitter | <Mobilpadde> Or whatever it is in plural |
22:38:08 | FromGitter | <Mobilpadde> :D |
22:38:54 | FromGitter | <recloser> regexes |
22:39:09 | FromGitter | <Mobilpadde> :D |
22:39:32 | FromGitter | <Mobilpadde> Though, do you know how I can get it to be gcsafe? |
22:40:08 | * | PrimHelios_ quit (Remote host closed the connection) |
22:40:31 | FromGitter | <recloser> an array of regexes? |
22:40:36 | * | vlad1777d_ joined #nim |
22:40:37 | FromGitter | <recloser> i think that involves gc allocated memory |
22:40:49 | FromGitter | <Mobilpadde> Yea |
22:41:01 | FromGitter | <recloser> so i don't think you can make that gcsafe |
22:41:09 | FromGitter | <Mobilpadde> Like: `re"\w+"` |
22:41:13 | FromGitter | <Mobilpadde> Hmm |
22:41:22 | FromGitter | <recloser> make it a threadvar? |
22:41:23 | FromGitter | <Mobilpadde> Do you know a work-a-round? |
22:41:35 | FromGitter | <Mobilpadde> Sec. |
22:41:57 | FromGitter | <Mobilpadde> Getting this error `thread var cannot be initialized explicitly; this would only run for the main thread` |
22:42:14 | FromGitter | <Mobilpadde> Only care about it for the main thread, though |
22:42:23 | FromGitter | <Mobilpadde> But it won't compile :/ |
22:42:51 | FromGitter | <recloser> i think it should compile if you aren't accessing it from outside the main thread |
22:43:43 | FromGitter | <Mobilpadde> Maybe because I'm using it in asynchttpserver? |
22:44:25 | FromGitter | <recloser> not sure, i've never used that |
22:45:41 | FromGitter | <Mobilpadde> :/ |
22:47:11 | FromGitter | <zacharycarter> maybe check out the gcsafe / threadvar pragmas @Mobilpadde - https://nim-lang.org/docs/manual.html#threads-gc-safety |
22:47:21 | FromGitter | <zacharycarter> not sure what you're trying to do exactly - if you can share some code, that could help |
22:47:58 | FromGitter | <recloser> are you trying to access the regexes from the async callback passed into asynchttpserver serve? |
22:49:27 | FromGitter | <Mobilpadde> Yea |
22:54:54 | FromGitter | <recloser> maybe instead just do something like ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ and access the regexes through `getRegexes`? [https://gitter.im/nim-lang/Nim?at=5bd39b3eef4afc4f28d912cf] |
22:56:01 | FromGitter | <Mobilpadde> Hmm, will try! :D |
23:01:00 | FromGitter | <Mobilpadde> Thank you so, so much! It's working! :D |
23:01:55 | FromGitter | <recloser> np |
23:07:49 | * | kapil____ quit (Quit: Connection closed for inactivity) |
23:07:54 | * | elrood quit (Quit: Leaving) |
23:09:16 | FromGitter | <Mobilpadde> 'nother question, why does this ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ throw this: `'parallel' section without 'spawn'`? [https://gitter.im/nim-lang/Nim?at=5bd39e9c271506518d76c70b] |
23:10:06 | FromGitter | <Mobilpadde> I think it's much like what they do in their manual? https://nim-lang.org/docs/manual.html#parallel-amp-spawn-parallel-statement |
23:12:26 | FromGitter | <Mobilpadde> What I'm trying to do is run another thread/process in parallel with main. Checking for something every hour |
23:13:50 | FromGitter | <Mobilpadde> Not sure I understand parallel right :p |
23:14:11 | FromGitter | <zacharycarter> parallel is just adding some extra checks to the compiler I believe |
23:14:28 | FromGitter | <zacharycarter> so it enforces a certain set of rules in the block that follows it |
23:15:30 | * | Elronnd quit (Ping timeout: 264 seconds) |
23:15:56 | FromGitter | <Mobilpadde> Ohh |
23:16:10 | FromGitter | <Mobilpadde> Got it working, though. Without parallel :D |
23:17:56 | FromGitter | <zacharycarter> I've rarely used parallel / spawn |
23:18:27 | FromGitter | <zacharycarter> maybe once or twice in projects - and I find the threadpool module to be more of a headache to work with, than the value I get from it - but I'm not an expert on its implementation or usage either |
23:19:05 | FromGitter | <Mobilpadde> Understandable :p |
23:19:12 | FromGitter | <Mobilpadde> Much the same here :D |
23:21:03 | FromGitter | <zacharycarter> :) |
23:36:30 | * | endragor joined #nim |
23:40:53 | * | endragor quit (Ping timeout: 245 seconds) |