00:01:24 | * | Jjp137 joined #nim |
00:25:50 | * | leorize joined #nim |
00:33:41 | FromGitter | <dandevelo> More details here: https://forum.nim-lang.org/t/4581 |
00:46:38 | leorize | Instead of linking staticlib with Nim, you could just do the ordinary "import" |
00:47:09 | leorize | currently the lib generation options only generate libs for use outside of Nim |
00:54:51 | FromGitter | <dandevelo> @leorize what if I need to use multiple libs created with Nim in the same application outside of Nim? |
00:55:11 | leorize | that's not possible atm, sadly |
00:55:42 | leorize | the GC has to be shared, so we have to wait until someone manage to split the GC to a lib of it's own |
00:57:04 | * | Tyresc quit (Quit: WeeChat 2.4-dev) |
01:04:34 | rayman22201 | https://nim-lang.org/docs/nimc.html#dll-generation |
01:04:39 | rayman22201 | use nimrtl |
01:04:49 | rayman22201 | that is literally the GC split into it's own lib |
01:05:01 | * | zachk quit (Quit: Leaving) |
01:05:27 | * | abm quit (Ping timeout: 244 seconds) |
01:05:38 | rayman22201 | or use one of the no GC options. --gc:none, --gc:regions, or --gc:destructors |
01:06:52 | rayman22201 | idk what's up with the noMain issue. That seems like a bug, but I'm not sure. |
01:07:02 | leorize | NimMain is used to initialize the Gc |
01:07:08 | leorize | it'll always be there |
01:07:39 | leorize | nimrtl is bigger than just the GC however |
01:07:49 | leorize | and it's a shared lib :/ |
01:09:29 | rayman22201 | it's a valid option, what ever your opinion of shared libs. |
01:10:19 | leorize | well, the person asking want to use static libs |
01:10:40 | leorize | with a bit of modification it might be possible to generate static nimrtl however |
01:10:52 | rayman22201 | that's a good point. I missed that. :-/ |
01:12:20 | rayman22201 | this makes the no gc options seem more attractive. |
01:13:30 | leorize | well NimMain also inits the module, should there be any initialization code |
01:15:49 | rayman22201 | true |
01:17:20 | * | skellock joined #nim |
01:25:05 | JnR | I have a good question. I thought of the idea of a cross platform compiler being run strictly as a liveboot on my Raspberry Pi and acting like a cross-platform translator for running virtual machines and x64 programs on Arm7. I found out that Nim actually has a cross-platform function built into it. Has anyone tried anything like this? |
01:26:15 | JnR | Obviously the Arm7 device would have to have a significant amount of memory but I think it can be done |
01:32:22 | * | darithorn quit (Quit: Leaving) |
01:35:25 | rayman22201 | Nim just spits out C. So if you have a C compiler for a platform, you can cross compile to it. In theory anyway... Cross compiling is a bit of an art in practice. |
01:37:33 | rayman22201 | Your bigger problem is not memory. Arm is notoriously bad at x86/x64 emulation (same going the other way as well. This is why android emulators typically have crap performance). It's very slow. Not because of memory, just because the assembly languages and architectures are so different. |
01:41:18 | * | ghost64 quit (Read error: Connection reset by peer) |
01:42:13 | FromGitter | <JasperJenkins> Is this a bug or is their some logic I'm not seeing? ```proc returnsInt(): int {.compileTime.} = ⏎ var x = 1 ⏎ ⏎ proc noReturn() {.compileTime.} = ⏎ var x = 2 ... [https://gitter.im/nim-lang/Nim?at=5c47c675cb47ec300088470f] |
01:46:12 | * | ghost64 joined #nim |
01:47:04 | rayman22201 | better: https://pastebin.com/raw/RrKEhDDQ |
01:47:14 | rayman22201 | You are trying to run a compileTime proc at runtime |
01:49:40 | JnR | rayman22201 Yeah that's pretty much the answer I was expecting. I only want to use the Arm device as a remote host but I guess you can't just float over top of the architecture |
01:50:19 | rayman22201 | @JasperJenkins, does that make sense? |
01:50:19 | * | xace quit (Ping timeout: 246 seconds) |
01:51:15 | rayman22201 | @JnR, yeah. Still neat idea though :-P |
02:50:15 | * | darithorn joined #nim |
03:01:55 | * | JnR quit (Remote host closed the connection) |
03:02:06 | * | banc quit (Quit: Bye) |
03:10:57 | * | skellock quit (Quit: WeeChat 2.3) |
03:22:46 | * | banc joined #nim |
03:37:26 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:44:49 | * | darithorn quit (Remote host closed the connection) |
03:50:58 | * | darithorn joined #nim |
04:00:28 | * | smitop quit (Quit: Connection closed for inactivity) |
04:07:38 | * | xace joined #nim |
04:21:26 | FromGitter | <kaushalmodi> I am trying to get `gzgets` from `zip/zlib` to work for a while, but am out of ideas: https://ptpb.pw/Tpe-/nim |
04:24:33 | FromGitter | <kaushalmodi> If I replace `gzgets` with a `gzgetc` loop, it works. I had a typo in the earlier link, but even after fixing it (see updated in https://ptpb.pw/DDTl/nim), I have the same issue |
04:24:50 | FromGitter | <kaushalmodi> the `line` read is always an empty string and the file pointer never increments |
04:25:52 | * | nsf joined #nim |
04:30:18 | FromGitter | <kaushalmodi> arghh, sorry folks, that version had another mistake .. was making mistake in creating this minimal version.. |
04:31:08 | FromGitter | <kaushalmodi> so here are the tested version: the version with gzgetc works ( https://ptpb.pw/JheU/nim ), and this same code with gzgets does not ( https://ptpb.pw/s12O/nim ) |
04:36:18 | * | oculux quit (Quit: blah) |
04:37:11 | * | oculux joined #nim |
04:47:26 | FromGitter | <kaushalmodi> got some interesting results after I tweaked the `gzgets` mapping with the header file |
04:47:32 | FromGitter | <kaushalmodi> https://ptpb.pw/WuFB/nim |
04:48:03 | FromGitter | <kaushalmodi> after that tweak, I get this output: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c47f203ba355012a4820a0d] |
04:48:23 | FromGitter | <kaushalmodi> can someone explain the reason behind this? |
04:49:10 | FromGitter | <kaushalmodi> zlib.h has ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c47f246dab15872ceda4e14] |
04:51:27 | leorize | you didn't initialize Pbytef |
04:51:40 | * | darithorn quit (Quit: Leaving) |
04:51:54 | FromGitter | <kaushalmodi> *what's that -- looking into zlib.nim* |
04:51:55 | leorize | cstring is nil by default lol |
04:52:12 | leorize | look at your old example |
04:52:26 | leorize | the pointer didn't increment because you passed a nil cstring in |
04:53:06 | leorize | ```Pbytef = cstring``` |
04:53:24 | FromGitter | <kaushalmodi> right, but I didn't understand the initialization part |
04:54:05 | leorize | your old example did: `var line: Pbytef` |
04:54:12 | leorize | this is `nil` by default |
04:54:38 | leorize | `gzgets` work on an preallocated buffer, not an empty one |
04:54:52 | FromGitter | <kaushalmodi> how do I do that? |
04:55:38 | FromGitter | <kaushalmodi> I could preallocate that char array |
04:55:57 | FromGitter | <kaushalmodi> but the `gzgets` signature does not like that |
04:56:22 | leorize | pass in the pointer to the first variable |
04:56:29 | leorize | first index* |
04:56:59 | leorize | `addr lineArr[0]` |
04:58:13 | leorize | if the compiler complain, just cast that expression to cstring |
04:58:23 | leorize | interfacing with C is never a nice thing :P |
04:59:09 | FromGitter | <kaushalmodi> finally! https://ptpb.pw/YrZg/nim |
04:59:15 | FromGitter | <kaushalmodi> thank you! |
04:59:24 | FromGitter | <kaushalmodi> I wasted about 2-3 hours on this |
04:59:25 | FromGitter | <kaushalmodi> :( |
05:00:07 | FromGitter | <kaushalmodi> *Learning C the hard way* |
05:00:20 | leorize | there's a book with that name ;) |
05:00:27 | FromGitter | <kaushalmodi> I know |
05:00:33 | * | leorize quit (Remote host closed the connection) |
05:00:39 | FromGitter | <kaushalmodi> but never took up learning C |
05:01:09 | FromGitter | <kaushalmodi> I thought that the difference between cstring and string was that one ended in null and other didn't |
05:01:26 | FromGitter | <kaushalmodi> has no idea that cstring had to be manually initialized |
05:01:51 | FromGitter | <kaushalmodi> I reread this so many times: https://github.com/madler/zlib/blob/master/zlib.h#L1491 |
05:02:20 | FromGitter | <kaushalmodi> I thought that `gzgets` would populated the `buf` with the contents from file |
05:15:59 | FromGitter | <kaushalmodi> leorize: this was really enlightening, thanks again! |
05:34:07 | * | oculux quit (Ping timeout: 244 seconds) |
05:41:25 | * | NimBot joined #nim |
05:44:30 | Tanger | Is AndreiRegiani on IRC? |
06:13:03 | * | oculux joined #nim |
06:23:38 | * | miran joined #nim |
06:38:16 | * | oculux quit (Quit: blah) |
06:39:24 | * | oculux joined #nim |
06:47:43 | * | leorize joined #nim |
06:54:16 | * | kapil____ joined #nim |
07:04:46 | * | oculux quit (Quit: blah) |
07:05:43 | * | oculux joined #nim |
07:13:24 | * | krux02 joined #nim |
07:16:33 | * | oculux quit (Quit: blah) |
07:22:10 | * | dddddd quit (Remote host closed the connection) |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:43 | * | gmpreussner joined #nim |
08:15:01 | FromGitter | <gogolxdong> httpbeast.nim(287) eventLoop ⏎ httpbeast.nim(203) processEvents ⏎ httpbeast.nim(140) bodyInTransit ⏎ system.nim(3877) failedAssertImpl ⏎ system.nim(3870) raiseAssert ... [https://gitter.im/nim-lang/Nim?at=5c48228535350772cf76a2cf] |
08:15:14 | FromGitter | <gogolxdong> got jester exception |
08:24:03 | * | Vladar joined #nim |
08:26:49 | Zevv | not sure if an assert would be appropriate there - if i understand correctly the remote has lied about its content-length. |
08:29:13 | FromGitter | <gogolxdong> What's the purpose of this assertion? |
08:30:26 | FromGitter | <gogolxdong> to filter out suspicious request? |
08:31:46 | Zevv | that was probably the intention, but asserting on received data is never the right thing to do. |
08:31:53 | Zevv | I can reproduce here |
08:31:59 | * | oculux joined #nim |
08:32:00 | Zevv | by making curl lie |
08:35:03 | Zevv | https://github.com/dom96/httpbeast/issues/21 |
08:38:04 | Zevv | You could catch the assert exception for now to prevent the crash |
08:38:35 | FromGitter | <gogolxdong> sure. |
08:39:32 | * | BigEpsilon joined #nim |
08:42:29 | * | PMunch joined #nim |
08:42:39 | Araq | no, fix httpbeast already |
08:42:44 | Araq | terrible. |
08:43:00 | Zevv | "for now" |
08:51:45 | Tanger | What do you guys use for handling temporary files? I see the getTempDir is not advised in the docas |
09:03:44 | * | krux02 quit (Remote host closed the connection) |
09:10:43 | * | abm joined #nim |
09:16:25 | livcd | Is the only "production" option for a cross platform http server asynchttpserver with a reverse proxy ? |
09:38:00 | Araq | yes, unless you feel adventurous, asynchttpserver was reviewed for security problems fwiw |
09:38:07 | * | OrganicAnywhere joined #nim |
09:43:56 | * | kapil____ quit (Quit: Connection closed for inactivity) |
09:44:04 | * | OrganicAnywhere quit () |
10:05:00 | * | OrganicAnywhere joined #nim |
10:13:23 | * | OrganicAnywhere quit () |
10:28:37 | * | vonHabsi quit (Ping timeout: 244 seconds) |
10:29:27 | * | vonHabsi joined #nim |
10:33:26 | * | lritter joined #nim |
10:36:56 | * | vonHabsi quit (Ping timeout: 246 seconds) |
10:43:38 | Araq | I think we should put generic methods under .experimental until their issues have been resolved |
10:43:52 | Araq | people walk into it, https://forum.nim-lang.org/t/4566 |
10:44:10 | Araq | and this feature was poorly implemented from the beginning |
10:44:11 | * | vonHabsi joined #nim |
10:46:07 | FromGitter | <mratsim> I used to use generics methods in Arraymancer for like 6 months |
10:46:16 | FromGitter | <mratsim> I removed them completely in November |
10:46:32 | Araq | and now you're much happier, right? |
10:46:45 | FromGitter | <mratsim> well I had a major hard stop |
10:46:47 | FromGitter | <mratsim> so yeah :p |
10:47:32 | FromGitter | <mratsim> they couldn't resolve the fields in a object variant |
10:47:39 | Araq | I know how to "fix" them, we don't have to remove the 'method' keyword. But the 'multi' aspect from them |
10:48:36 | Araq | and ... I dunno, the implementation should produce a vtable somehow |
10:48:44 | FromGitter | <mratsim> see here: https://github.com/mratsim/Arraymancer/issues/327 |
10:49:39 | Zevv | I'm still threading on thin ice here because I don't understand the underlying mechanisms; but the issue I ran into for which the final conclusion was "multi methods and generics are broken beyond repair" (##10038) did not actually use *multi* methods, right? |
10:49:43 | FromGitter | <mratsim> If I don't use a generic, the generic method doesn't see the field |
10:50:16 | Araq | Zevv, right but the 'multi' aspect doesn't help, it makes everything even more complex |
10:50:31 | Araq | in C++ you cannot have a virtual template function. |
10:50:43 | Araq | interesting, isn't it. |
10:52:10 | Zevv | From a user perspective, please put it behind and .exerimental then, because I'd rather have none then something that mostly works but sometimes is broken |
10:52:37 | Araq | yeah. |
10:53:52 | Araq | I could also give it a try and fix it but then it's unclear what other problems may exist |
10:55:01 | Araq | originally methods did not support generics and the world was sane |
10:55:22 | Araq | same as C++, you cannot have virtual templates |
10:55:24 | Zevv | yes, but we want generic everythings. |
10:55:31 | Zevv | I even like my generics generic |
10:56:04 | Araq | well if everything is generic, there is little to no need for dynamic dispatch |
10:56:23 | Araq | these features overlap and yet don't work well together. |
10:57:09 | Zevv | and there lies the problem. But it took me a while before I properly grasped that, lacking proper education in this field |
10:59:35 | * | abm quit (Ping timeout: 250 seconds) |
10:59:37 | Araq | in fact, when I introduced the .base annotation I should have stepped back already |
11:00:06 | Araq | why is .base required? what does it do? why do the other languages not require it? |
11:00:20 | Zevv | yes, these were my questions |
11:00:27 | Araq | .base is already patching a broken design :-) |
11:02:48 | * | absolutejam joined #nim |
11:03:52 | * | PMunch quit (Ping timeout: 250 seconds) |
11:08:05 | * | PMunch joined #nim |
11:10:07 | FromGitter | <mratsim> Actually you still need dynamic dispatch + generics |
11:10:27 | FromGitter | <mratsim> when you want dynamic containers of float32/float64 etc ;) |
11:10:59 | FromGitter | <mratsim> generics generics, aka Higher Kinded type would be useful for me |
11:11:44 | absolutejam | mornin' all |
11:11:56 | FromGitter | <mratsim> I can't do `proc fooT; V: Variable[Tensor[T (v: V, t: T): T =` for example |
11:12:32 | FromGitter | <mratsim> I have to use a `subtype` macro to extract subtypes, and macro + generics are also a pain to work with |
11:12:38 | FromGitter | <mratsim> Hi abosultejam |
11:13:35 | * | OrganicAnywhere joined #nim |
11:13:40 | * | OrganicAnywhere quit (Client Quit) |
11:49:47 | * | zachcarter quit (Ping timeout: 240 seconds) |
11:51:12 | leorize | is it just me or CI is getting slower? |
11:51:21 | absolutejam | rewrite it in Nim ;) |
11:52:23 | * | abm joined #nim |
11:54:52 | Araq | its queue is too long |
11:54:55 | Zevv | leorize: run time or queue time? |
11:54:58 | Zevv | that |
11:55:10 | leorize | queue time |
11:55:27 | leorize | did we got more contributors or something? :p |
11:55:51 | * | ng0 joined #nim |
11:56:42 | federico3 | https://robert-mcdermott.gitlab.io/posts/speeding-up-python-with-nim/ is the author around here? Having an RSS feed would be a nice addition to planet.nim-lang.org |
12:02:01 | * | zachcarter joined #nim |
12:03:26 | miran | leorize: it is not just you (unfortunately :)) |
12:21:23 | PMunch | federico3, TIL planet.nim-lang.org |
12:21:27 | PMunch | What is that page? |
12:29:32 | miran | (rss) blog aggregator |
12:32:05 | * | dddddd joined #nim |
12:33:01 | * | stefanos82 joined #nim |
12:35:01 | PMunch | Hmm interesting |
12:35:59 | PMunch | I should add per-tag RSS feeds to my site and PR it with a Nim tag filter :) |
12:36:07 | federico3 | please do! |
12:45:17 | * | OrganicAnywhere joined #nim |
12:45:30 | * | OrganicAnywhere quit (Client Quit) |
12:51:23 | FromGitter | <kaushalmodi> federico3: Just noticed that the planet hasn't used my new feed |
12:51:42 | FromGitter | <kaushalmodi> It still has the whole Nim notes from my old feed |
12:52:07 | FromGitter | <arnetheduck> > but asserting on received data is never the right thing to do ⏎ ⏎ aww, don't kill the fun of having a remote-induced crash possibility ;) |
12:52:17 | livcd | same here |
12:52:22 | livcd | TIL planet.nim-lang.org Oo |
12:53:10 | FromGitter | <kaushalmodi> federico3: The Nim notes (and few other Nim notes) are no longer on https://scripter.co/tags/nim/atom.xml |
12:53:19 | FromGitter | <kaushalmodi> May be you need to clear the cache? |
12:53:31 | federico3 | https://github.com/FedericoCeratto/nim-planet/pull/1/files is this up to date? |
12:53:55 | FromGitter | <kaushalmodi> Yes, the link I posted above is the same |
12:54:53 | federico3 | https://github.com/FedericoCeratto/nim-planet/blob/master/nim_planet.ini this is the current conf |
12:57:20 | federico3 | I don't get it. Try to load https://scripter.co/tags/nim/atom.xml in a browser. I'm seeing whole posts. |
13:03:37 | * | zachcarter quit (Ping timeout: 244 seconds) |
13:09:40 | FromGitter | <kaushalmodi> federico3: the posts are still whole, but I removed the big "Nim notes" posts |
13:10:38 | FromGitter | <kaushalmodi> The world around me is moving towards RSS with whole posts, as they like to get all info from their RSS readers, and not have a link indirection to see the whole thing. |
13:11:12 | PMunch | Yeah, full post RSS is way better |
13:11:16 | PMunch | As a user |
13:11:32 | FromGitter | <kaushalmodi> Yep |
13:11:53 | FromGitter | <kaushalmodi> federico3: what happens if you empty that `cache` directly? |
13:12:04 | FromGitter | <kaushalmodi> s/directly/dir |
13:14:15 | FromGitter | <kaushalmodi> federico3: to summarize, earlier my feed had short "posts" and long "notes" (like Nim notes). Now it has only the "posts". So my feed will be less flooding now :) |
13:16:57 | * | skellock joined #nim |
13:21:11 | federico3 | I don't see much benefit in removing posts from the planet once they are published. The way RSS feeds are consumed is more like a stream. |
13:28:38 | * | Snircle joined #nim |
13:34:19 | FromGitter | <mratsim> many pulled back on full RSS due to copy websites that steal organic traffic coming from Google searches |
13:36:03 | FromGitter | <kaushalmodi> @mratsim that's a good problem to have ;) |
13:36:38 | FromGitter | <kaushalmodi> federico3: but this is a special case, the planet right now is flooded with Nim notes. No one would scroll past that to see more posts. |
13:37:04 | federico3 | ok, I'll try to clear the cache |
13:37:17 | FromGitter | <kaushalmodi> Actually the planet should auto add "Read more" expansion links, but that's a different problem to tackle. |
13:38:02 | federico3 | somebody should write an aggregator in Nim ;) |
13:38:10 | FromGitter | <kaushalmodi> :) |
13:39:23 | miran | @kaushalmodi re .rst vs _doc.nim — i think that is bikeshedding ;) |
13:40:55 | FromGitter | <kaushalmodi> It's actually not bikeshedding |
13:41:16 | FromGitter | <kaushalmodi> It affects in practise how you view docs vs code |
13:41:50 | FromGitter | <kaushalmodi> In the current PR, docs are pasted in a .nim file that's exclusively for docs. |
13:42:02 | FromGitter | <kaushalmodi> Then why not just have a .rst file? |
13:42:29 | FromGitter | <kaushalmodi> The nim doc should be fixed to just expand the includes of rsts before evaluating runnableExamples |
13:42:54 | miran | let's see if Araq changed his mind about that ;) ^ |
13:42:59 | FromGitter | <kaushalmodi> it's nicer to find only true code files if I look for *.nim files |
13:43:14 | FromGitter | <kaushalmodi> If you want docs, look for *.rst |
13:43:21 | FromGitter | <kaushalmodi> How is that bikeshedding? |
13:43:24 | FromGitter | <Vindaar> @miran: I agree with @kaushalmodi, because if such a file is only docs anyway, `.rst` allows to view the files properly by themselves |
13:43:48 | FromGitter | <kaushalmodi> For others, ref: https://github.com/nim-lang/Nim/pull/10429#issuecomment-456801417 |
13:44:10 | miran | ok, i'll wait for you to discuss and decide before taking any further steps about it :) |
13:44:24 | FromGitter | <kaushalmodi> With .rst files, you automatically get rst support in editors (Emacs at least) :) |
13:46:10 | * | nsf quit (Quit: WeeChat 2.3) |
13:46:29 | federico3 | @kaushalmodi: cache refreshed |
13:46:41 | * | vlad1777d joined #nim |
13:47:09 | federico3 | interesting behavior... |
13:58:58 | Araq | bah, we are never allowed to take shortcuts |
13:59:12 | Araq | rst also supports runnable examples via the custiom :test: annotation |
13:59:18 | Araq | but it's not optimized yet |
13:59:46 | Araq | alternatively we can use foo.nimdoc as 'include' supports custom file extensions |
13:59:56 | Araq | for example: |
14:00:02 | Araq | strutils.nim: |
14:00:10 | Araq | include "strutils.nimdoc" |
14:01:17 | * | PMunch quit (Remote host closed the connection) |
14:01:28 | * | PMunch joined #nim |
14:02:14 | * | krux02 joined #nim |
14:02:20 | FromGitter | <alehander42> But why do we need a custom file for top level docs |
14:02:40 | FromGitter | <alehander42> Why would one need to maintain two files for the same module |
14:02:59 | absolutejam | are there any plans for the compiler to not require type/proc definitions in the right order? |
14:04:20 | * | salewski joined #nim |
14:04:53 | Araq | alehander42: because excessive docs annoy me, that's why |
14:05:08 | Araq | there is no technical reason to split them up |
14:05:42 | Araq | absolutejam, yes, and we have a pragma .reorder: on for this |
14:06:08 | Araq | it kinda sucks but it's better than nothing until we wait for the more complete solution |
14:06:24 | miran | absolutejam: in the mean time you could use forward declarations |
14:07:15 | salewski | If someone of you is using Windows7, maybe you can give him a hint: |
14:07:24 | salewski | If someone of you is using Windows7, maybe you can give him a hint: https://github.com/StefanSalewski/gintro/issues/38#issuecomment-456768187 |
14:08:26 | FromGitter | <alehander42> Araq, but why: they're much more useful near the code: and one always needs to jump to the function he needs anyway, what is on top of the file is usually irrelevant otherwise |
14:08:27 | salewski | Maybe he does the PATH update wrong? Has he to rebbot? |
14:08:30 | absolutejam | ah cool |
14:08:50 | absolutejam | Never realised how much I relied on it until I started with Nim |
14:12:07 | salewski | Reboot or reopen terminal after export PATH=/mingw64/bin:$PATH on Windows7? |
14:12:42 | FromGitter | <gogolxdong> import karax / [jstrutils, kajax, vdom, karaxdsl, karax, kdom, kbase] ⏎ ⏎ proc reverse(e:Event, n: VNode) = ⏎ ⏎ ```result = buildHtml(tdiv()): ⏎ button(onclick = reverse): text "submit"``` ... [https://gitter.im/nim-lang/Nim?at=5c48765a9bfa375aab49646e] |
14:12:50 | salewski | I can not help him, bye. |
14:13:12 | FromGitter | <gogolxdong> How to change the text of the VNode onclick? |
14:13:35 | FromGitter | <gogolxdong> Is there anywhere I misunderstood? |
14:14:30 | Araq | salewski, PATH updates don't require an OS restart |
14:14:38 | Araq | but a terminal restart |
14:15:35 | Araq | gogolxdong: you don't change the text of a VNode, you put what to render into a variable that is changed in your onclick handler |
14:16:58 | Araq | probably should have made the virtual DOM immutable. |
14:17:09 | salewski | Thanks araq, I will tell him. (I have to admit that I am not sure if PATH is used for DLL lookup on windows.) |
14:19:09 | Araq | it is. |
14:19:39 | Araq | and tell him to get "Rapid Environment Editor" to get a sane UI for envvars |
14:19:47 | * | aguspiza joined #nim |
14:19:53 | Araq | (No, they don't pay me. It's sad.) |
14:20:26 | Araq | and usually "cannot load x.dll" is also caused by 32 vs 64bit problems |
14:21:04 | salewski | Thanks, good hint! |
14:21:31 | Araq | and tell him to use real Windows tools, not this msys clusterfuck |
14:22:27 | salewski | Will send him a link to this IRC log. |
14:22:33 | Araq | uh oh |
14:22:35 | Araq | :D |
14:23:24 | FromGitter | <mratsim> real windows tool are also buggy ... |
14:23:46 | FromGitter | <mratsim> I can't install directX 9 on windows for example |
14:24:00 | FromGitter | <mratsim> windows 10 |
14:24:23 | FromGitter | <mratsim> or you can't prevent windows from hoarding 20% of your GPU memory |
14:24:50 | FromGitter | <mratsim> sorry 15% |
14:25:12 | FromGitter | <mratsim> with GPU with 8+GB of vram that's dumb |
14:25:29 | * | salewski quit (Quit: WeeChat 2.3) |
14:25:58 | Araq | isn't direct 9 quite old? |
14:26:19 | FromGitter | <mratsim> yeah but it was the defacto standard from 2005 to 2011 or something |
14:26:25 | Araq | and the GPU memory problems sounds like a driver problem |
14:26:55 | FromGitter | <mratsim> no it's WDDM 2.0 issue |
14:27:00 | Araq | ofc nothing beats the good ol' XP |
14:27:05 | FromGitter | <mratsim> (windows driver model ...) |
14:27:18 | FromGitter | <mratsim> yeah directx 9 long life was due to XP |
14:27:41 | FromGitter | <mratsim> Nvidia drivers on Linux doesn't reserve more than what they need |
14:28:05 | Araq | no, they don't work at all instead :P |
14:28:09 | miran | :D :D |
14:28:29 | FromGitter | <mratsim> they do |
14:28:35 | FromGitter | <mratsim> and they work well :p |
14:28:45 | * | miran was also surprised to see someone speaks positively about gpu drivers on linux |
14:28:47 | Araq | they never did when I still had Linux |
14:28:49 | FromGitter | <mratsim> I even have kernel mode settings with the proprietary driver |
14:29:38 | FromGitter | <mratsim> though somehow, I have 2 GPUs and on windows I need to connect the screen on a different GPU from Linux |
14:29:58 | miran | #firstworldproblems |
14:30:48 | skellock | man_holding_too_many_limes.tga |
14:32:48 | FromGitter | <gogolxdong> @Araq, I have to read your each word carefully to make it right. I think I haven't got the spirit of Karax yet. |
14:36:32 | Araq | https://github.com/pragmagic/karax#event-model |
14:37:15 | Araq | it's always state -> VNode. The state is *not* in the VNode, it comes from somewhere else to drive your UI. |
14:38:57 | FromGitter | <alehander42> Imagine that the only way to change anything in the ui is by rerunning redraw |
14:39:15 | FromGitter | <gogolxdong> yeah, my usage is a variant and a bit more complicated. |
14:39:16 | FromGitter | <alehander42> (which is ran automatically after each event handler) |
14:39:33 | FromGitter | <alehander42> So it should reflect a change in your state |
14:39:53 | FromGitter | <alehander42> Vnode is |
14:40:10 | FromGitter | <alehander42> Just an implementation detail for the end user imo |
14:50:51 | FromGitter | <zacharycarter> Update on the playground - I just wrote the service unit file and the service is starting |
14:51:04 | FromGitter | <zacharycarter> I need to add nginx rules to route requests to the backend appropriately - and then do some testing |
14:51:14 | FromGitter | <zacharycarter> after that it should be back up - so I'm hoping by this evening at the latest |
14:51:29 | miran | @zacharycarter which nim version does/will playground use? |
14:53:53 | FromGitter | <zacharycarter> miran: whatever the latest official nim docker image is |
14:54:35 | skellock | that docker image could use an update btw --- i think it's 19.0 |
14:54:47 | skellock | *0.19.0 |
14:54:48 | FromGitter | <zacharycarter> https://hub.docker.com/r/nimlang/nim this one I believe |
14:55:09 | FromGitter | <mratsim> it's from moigagoo iirc |
14:55:30 | FromGitter | <mratsim> https://github.com/moigagoo/nimage |
15:03:30 | * | aguspiza quit (Ping timeout: 250 seconds) |
15:06:05 | Araq | we have 0.19.2 and can release 0.19.4 any day |
15:10:03 | * | lritter quit (Ping timeout: 245 seconds) |
15:12:48 | FromGitter | <mratsim> why not today? |
15:13:34 | Araq | too easy, need to work on something harder today. |
15:14:03 | miran | towards 0.20 release. hard enough? :P |
15:15:07 | FromGitter | <mratsim> I'm impressed with that PR btw: https://github.com/nim-lang/Nim/commit/d9ee377517fe22e307592f4d6c019388600b5e57 @Vindaar |
15:16:11 | Araq | we're getting lots of good PRs these days |
15:18:01 | skellock | 2019 - the year of nim (on the desktop) |
15:18:44 | FromGitter | <mratsim> on the server |
15:18:55 | FromGitter | <mratsim> for desktop we need a cross platform gui toolkit :p |
15:19:27 | skellock | mratsim: sounds straight forward >.> |
15:20:11 | FromGitter | <Vindaar> @mratsim Thanks! But TheLemonMan deserves most of that credit :) I mainly extracted a test case from laser |
15:20:27 | FromGitter | <zacharycarter> NiGui |
15:20:29 | FromGitter | <zacharycarter> go! |
15:21:05 | FromGitter | <mratsim> that has been very annoying because it completely blocked me on Laser parallel stuff |
15:25:03 | FromGitter | <Vindaar> I figured it'd be an annoying bug for you |
15:25:38 | * | darithorn joined #nim |
15:27:27 | * | ng0_ joined #nim |
15:29:07 | * | ng0 quit (Ping timeout: 256 seconds) |
15:29:15 | * | ng0_ is now known as ng0 |
15:33:51 | * | seni joined #nim |
15:36:21 | * | nsf joined #nim |
15:43:56 | FromGitter | <mratsim> yeah it is, because I needed devel for OpenMP but not a too recent one due to that regression |
15:44:27 | FromGitter | <mratsim> also now I can use the normal parameters to pass static objects instead of being forced to use the generics syntax. |
15:45:36 | FromGitter | <mratsim> but I guess there are other pitfalls with static object. I'm pretty sure I found one with `when` condition for an object field |
15:53:56 | * | PMunch quit (Ping timeout: 240 seconds) |
15:57:41 | * | PMunch joined #nim |
16:00:58 | * | PMunch quit (Remote host closed the connection) |
16:13:00 | FromGitter | <Vindaar> more pitfalls -> more issues -> more fixes --> ... --> no* issues? ⏎ ⏎ 1) in practical terms |
16:14:02 | FromGitter | <mratsim> yeah, but it's very distracting from what you're working on |
16:14:15 | FromGitter | <Vindaar> oh, that is certainly true |
16:14:28 | Araq | https://youtu.be/DmYOPkI_LzU |
16:16:20 | * | Trustable joined #nim |
16:20:03 | FromGitter | <kaushalmodi> Araq: About the .nimdoc .. |
16:20:10 | FromGitter | <kaushalmodi> why do we want one more file type? :) |
16:20:40 | FromGitter | <kaushalmodi> we already have .rst. Do you think that it will be too difficult to do the .. include expansion of the RST files before evaluating runnableExamples? |
16:22:01 | * | skellock quit (Ping timeout: 244 seconds) |
16:22:59 | Araq | ok, whatever, will speed it up |
16:23:15 | FromGitter | <kaushalmodi> .nimdoc will lead to more fragmentation |
16:23:20 | miran | @kaushalmodi btw, we can also keep everything like it is currently (in the same file), if Araq gives in :) |
16:23:32 | FromGitter | <kaushalmodi> miran: that works too |
16:24:01 | FromGitter | <kaushalmodi> but please no fragmentation (like a new .nimdoc) or having doc-only code files (foo_doc.nim). |
16:24:21 | FromGitter | <mratsim> +1 |
16:24:28 | FromGitter | <kaushalmodi> the including of rst files is a nice to have feature |
16:24:49 | FromGitter | <kaushalmodi> then folks can write in md/Org/whatever and have pandoc generate those rst files |
16:25:03 | * | absolutejam quit (Ping timeout: 245 seconds) |
16:26:37 | Araq | you can already write in .md, Nim's docgen supports markdown features now |
16:27:06 | FromGitter | <kaushalmodi> Araq: there needed to be a big announcement for that :) |
16:27:11 | FromGitter | <kaushalmodi> I'll try that out later |
16:27:17 | FromGitter | <arnetheduck> ```code paste, see link``` ⏎ ⏎ while working on this.. can you do something about `runnableExamples` as well? in snippets like above, it's really hard to tell example from implementation [https://gitter.im/nim-lang/Nim?at=5c4895e4ba355012a4867089] |
16:27:48 | FromGitter | <kaushalmodi> use a newline before `return c in Letters`? |
16:28:28 | FromGitter | <arnetheduck> well, I'm taking that from the std lib.. it's a silly example, but the lib is littered with it - the feature encourages it |
16:28:37 | Araq | it's wrong to consider runnableExample "not really part of the code" |
16:28:54 | Araq | they are as important as every other code if not moreso. |
16:28:57 | miran | @arnetheduck that is relatively frequently discussed. one idea is to have an empty line. what i use in my private project is to have runnable examples indented with 4 spaces |
16:29:03 | Araq | which is why they stick out from the ## docs. |
16:29:14 | Araq | I know you hate it. I like it very much. |
16:29:31 | FromGitter | <arnetheduck> you can keep it and try to address this concern? |
16:29:43 | Araq | add a newline? |
16:29:51 | FromGitter | <arnetheduck> not enough |
16:30:17 | miran | @arnetheduck http://ix.io/1yBh/ |
16:30:25 | Araq | what would be enough then? |
16:30:26 | FromGitter | <arnetheduck> extra indent or a comment line between or something would make it stand out ("the noise ends here") |
16:30:33 | miran | here are three ways of doing it, from the other day |
16:30:42 | Araq | it is NOT noise. |
16:30:47 | Araq | that's where we disagree. |
16:30:59 | FromGitter | <arnetheduck> it is, when you're looking for the implementation |
16:31:03 | miran | 2nd is the current, 1st is the current+newline, 3rd is what i use |
16:31:21 | Araq | it's a poor *spec*. |
16:31:48 | Araq | "hide the spec for me" is not something you should ask for constantly. |
16:32:02 | FromGitter | <arnetheduck> well whatever, it's different and distinct in "what problem does this piece of text solve"? |
16:32:10 | FromGitter | <kaushalmodi> how about: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c489709f780a1521f587bc3] |
16:32:17 | Araq | then teach your editor to fold it. |
16:32:21 | FromGitter | <arnetheduck> @kaushalmodi brilliant |
16:32:23 | miran | i really like 4-space indentation for runnable examples, but the last time i brought it up, Araq was against it (did you change your mind maybe?) |
16:32:36 | FromGitter | <kaushalmodi> *I don't know if that would work though ..* |
16:32:43 | FromGitter | <arnetheduck> I prefer @kaushalmodi's.. |
16:32:56 | FromGitter | <kaushalmodi> i.e. not sure if nim doc will read in that runnableExamples .. need to try out |
16:32:58 | Araq | 4 spaces is nothing nimpretty would understand |
16:33:45 | miran | @kaushalmodi further documentation after runnable example works, so a single ## should too |
16:33:59 | FromGitter | <kaushalmodi> yup it works |
16:34:07 | FromGitter | <kaushalmodi> Araq, miran: are you fine with that? |
16:34:21 | Araq | I don't like it all but it's a compromise, so go for it. |
16:34:31 | FromGitter | <kaushalmodi> As I updated few of the code blocks with this style in my project, I like it |
16:34:57 | FromGitter | <arnetheduck> point is, at times (quite often), *I'm looking for the implementation*, for whatever reason.. I don't want the spec, I don't want the docs, I don't want anything else.. at that stage, all the other stuff *is noise* |
16:35:38 | FromGitter | <kaushalmodi> Araq: thanks |
16:35:44 | miran | btw, vscode can fold runnable examples, should help with the noise cancelling |
16:35:51 | FromGitter | <kaushalmodi> miran: what do you think of that `##` doc-ender? |
16:35:56 | FromGitter | <arnetheduck> it can't fold them automatically |
16:36:53 | miran | @kaushalmodi i don't have a strong opinion about it. i might give it a try and report back at you tomorrow, after some docs written like that |
16:37:15 | FromGitter | <kaushalmodi> miran: cool, thanks for considering |
16:37:46 | miran | yeah, it is not automatic, but it is one keyboard shortcut away |
16:37:52 | Araq | though I wonder if we could patch the docgen to allow a complete (foo.nim foo.rst) split |
16:38:37 | miran | while at it, make it a (foo.nim, foo.md) split ;) |
16:38:59 | FromGitter | <kaushalmodi> miran: +1 on .md :) |
16:39:06 | Araq | but in practice it'll probably as bad as C++'s .h/.cpp split |
16:39:27 | Araq | so better teach vscode how to fold things properly |
16:39:36 | miran | @kaushalmodi it is 4284218:1 in .md's favor (with Araq being the only one on .rst's side :D) |
16:39:40 | FromGitter | <arnetheduck> @miran well, sort of.. it can't fold `runnableExamples` *and nothing else* |
16:40:14 | Araq | it cannot fold anything useful IME, it always folds way too much |
16:40:45 | FromGitter | <arnetheduck> and it works in vscode only.. it doesn't work when reviewing a PR on github.. sometimes you're not in control over the way the text is displayed |
16:41:21 | miran | @arnetheduck well, i was thinking more about the situation where you're "looking for the implementation" of a function, you see a runnable example and just press ctrl+shift+[ so you make it gone. i didn't think it could be done for a whole document/project |
16:41:22 | Araq | well a diff is a diff, it tries to keep the diffs small |
16:41:56 | FromGitter | <arnetheduck> I usually `ctrl-k ctrl-1` to fold to function prototypes.. mostly because nim's basic module support means you have to make large modules |
16:42:35 | miran | @kaushalmodi i can already say that i like ## better than the empty newline |
16:42:56 | FromGitter | <arnetheduck> @miran now add that as a warning to the compiler ;) |
16:43:15 | FromGitter | <kaushalmodi> miran: It already looked better in Gitter at https://gitter.im/nim-lang/Nim?at=5c489709f780a1521f587bc3 when I pasted that sample |
16:43:31 | FromGitter | <Vindaar> +1 to `##` there |
16:43:44 | FromGitter | <kaushalmodi> I agree to the point that @arnetheduck made.. this needs to look good without relying on VSCode folding |
16:44:22 | FromGitter | <arnetheduck> text is king, it's the stuff we do all day, looking at text.. less tooling needed for that default case, the better |
16:44:30 | miran | 4-spaces look good without folding, wherever you look at it (e.g. github) |
16:44:59 | Araq | text is always bullshit, code is in trees. |
16:45:20 | Araq | diff would work better on trees too. |
16:45:40 | Araq | everything would be better with trees. |
16:45:47 | FromGitter | <arnetheduck> you know any good tree-diff? have looked for them without success |
16:46:17 | Araq | well it's a stillborn as long as all PLs are stored in text without a common tree representation |
16:46:26 | FromGitter | <arnetheduck> structural diffs in general are hard to get right and inherently become less generic.. |
16:46:56 | Araq | the diff is often completely off and doesn't reflect the real editing steps |
16:49:05 | FromGitter | <Vindaar> @Araq, isn't a filesystem with /directories/ a tree, too? :P |
16:49:36 | Araq | ha, good one |
16:50:02 | Araq | if it is a tree then why does it have symlinks |
16:50:21 | FromGitter | <Vindaar> fair point |
16:50:44 | FromGitter | <kaushalmodi> See https://github.com/nim-lang/Nim/pull/10432/files |
16:51:20 | miran | haha, you didn't waste any time, did you :D |
16:51:21 | FromGitter | <arnetheduck> actually, that's something really cool vscode does now - functions in a file (anything foldable I think), are just part of the path just like the filename is.. pretty nifty |
16:51:32 | FromGitter | <kaushalmodi> The `##` also helped fix an easily introducible bug: https://github.com/nim-lang/Nim/pull/10432/files#diff-3890ade26b30222078b05cab885646faL198 :) |
16:51:36 | FromGitter | <arnetheduck> I've seen that in a few editors already |
16:52:03 | FromGitter | <kaushalmodi> well.. you will see that fix if that line, line 198 is not highlighted |
16:52:31 | FromGitter | <kaushalmodi> essentially not a bug, but a compile failure annoyance |
16:54:01 | Zevv | "If you change the stdlib (anything under lib/, eg lib/pure/os.nim), put a test in the file you changed.". Is that still relevant, tests don't go in the file iself but in tests? |
16:54:31 | Araq | we don't know, Zevv |
16:54:32 | * | BigEpsilon quit (Quit: WeeChat 2.3) |
16:55:14 | Araq | the guideline is "runnableExamples are examples" and further excessive tests might go into a dedicated test file |
16:55:43 | FromGitter | <arnetheduck> @kaushalmodi indeed, it's exactly that kind of stuff I don't like with runnableExamples.. indent / spacing is invisible, it doesn't give any visual clues... if I've scrolled the file a bit, and it looks like below, I have no clue and have to scroll up: ⏎ ⏎ ``` echo "blabla" ⏎ ⏎ result = 2 * x``` ⏎ ⏎ it's distracting because in an example, the echo is ok, but in implementation, it's a |
16:55:44 | FromGitter | ... side-effect, so I lose the train of thought when analyzing the implementation.. when reviewing code, every distraction increases the potential for other things to slip through [https://gitter.im/nim-lang/Nim?at=5c489c8f0721b912a5c80a01] |
16:59:17 | Araq | everything is always distracting and confusing. Today it's indentation, tomorrow it's long string literals in an editor that doesn't understand Nim's lexing rules. And then it's some incredibly useful default rule like "on error unwind the stack". |
17:02:47 | FromGitter | <arnetheduck> well, yeah, and when things are distracting and confusing, you try to isolate them and solve the problems separately.. "now I'm writing examples, the primary objective is to be helpful to the reader of the examples and show the code in the best possible light so as to introduce them to the utility of the function", "now I'm writing the implementation - it has to be efficient and deal with corner cases and do the |
17:02:47 | FromGitter | ... task in the least surprising way" |
17:04:19 | Araq | "Now I updated the implementation and the runnableExamples are failing and I don't see why..." |
17:05:46 | FromGitter | <arnetheduck> I guess maybe I read more code than I change then.. |
17:14:07 | Araq | btw you don't have to use runnableExamples, you can use ##[ ]## with .. code-block:: nim :test: |
17:14:49 | Araq | except that it's slower but I'm working on it |
17:15:46 | Araq | correction: it doesn't work at all, but should :-) |
17:18:13 | FromGitter | <arnetheduck> oh, yeah, but I want to use code that others have written, and if we as a community can come up with a solution that works for more people, there's a beautiful future ahead for everyone involved |
17:21:25 | FromGitter | <mratsim> *Unicorns galloping into the sunset |
17:44:34 | * | skellock joined #nim |
17:52:32 | shashlick | Hehe my last github issue comment probably reads like that too |
18:01:15 | * | Trustable quit (Remote host closed the connection) |
18:13:36 | * | nsf quit (Quit: WeeChat 2.3) |
18:28:45 | * | stefanos82 quit (Remote host closed the connection) |
18:40:19 | * | krux02 quit (Remote host closed the connection) |
18:43:20 | * | brainproxy joined #nim |
18:56:32 | * | a_b_m joined #nim |
18:59:36 | * | abm quit (Ping timeout: 244 seconds) |
19:02:19 | FromGitter | <iffy> I've been trying to solve a gcassert problem in my code. I'm trying to get some better tools to give me better visibility into what's going on. How do I use `--memTracker:on`, `-d:leakDetector` and `-d:memProfiler`? |
19:14:40 | * | zachcarter joined #nim |
19:14:46 | * | PMunch joined #nim |
19:16:00 | rayman22201 | completely off topic, but does anybody happen to know the equivalent of the linux tool `nm` for windows? I need to get the exposed symbols of a dll |
19:18:41 | * | OrganicAnywhere joined #nim |
19:18:52 | * | OrganicAnywhere quit (Client Quit) |
19:20:50 | rayman22201 | It's dumpbin. if anybody cares lol.... linux dev on windows. Like a fish out of water. |
19:21:06 | Zevv | "If you change the stdlib (anything under lib/, eg lib/pure/os.nim), put a test in the file you changed.". Is that still relevant, tests don't go in the file iself but in tests? |
19:21:12 | Zevv | oh sorry |
19:32:27 | * | zachcart1r joined #nim |
19:34:26 | * | zachcarter quit (Ping timeout: 240 seconds) |
19:35:58 | FromGitter | <iffy> Right here in gc.nim it says that black means "in use or free" https://github.com/nim-lang/Nim/blob/devel/lib/system/gc.nim#L35 |
19:36:13 | FromGitter | <iffy> Isn't that contradictory? Shouldn't black mean only that it's in use? |
19:37:08 | FromGitter | <iffy> Oh wait... nm |
19:37:18 | Araq | you don't have a gc problem, you have a memory corruption |
19:37:32 | Araq | most likely caused by a wrong C wrapper |
19:37:56 | Araq | running with valgrind can help, checking every 'cast' can help |
19:38:15 | FromGitter | <iffy> Araq: meaning, whatever's using my nim-made C library is messing with the nim-owned memory? |
19:38:16 | Araq | check that int and cint didn't get mixed up, check 32 vs 64 bit builds |
19:38:40 | FromGitter | <iffy> and by "whatever" I mean Node.JS |
19:39:33 | * | Tyresc joined #nim |
19:39:33 | Araq | do you call nimGC_setStackBottom() ? |
19:39:49 | FromGitter | <iffy> Araq: no, I don't call any GC functions in my current version of code |
19:39:57 | FromGitter | <iffy> not even GC_ref or GC_unref |
19:40:56 | Araq | you use node.js with a Nim extension and don't setup Nim's GC? |
19:41:07 | FromGitter | <iffy> I call NimMain, but that's it |
19:43:05 | * | OrganicAnywhere joined #nim |
19:43:39 | Araq | ok that should cover setStackBottom |
19:43:53 | Araq | do you pass strings to C? |
19:44:14 | FromGitter | <iffy> Yes, strings are the main thing I'm passing from JS -> my C++ code -> Nim and back |
19:44:36 | FromGitter | <iffy> And all my segfaults seem to happen when doing something with strings |
19:45:07 | Araq | then maybe you should start to use GC_ref/unref |
19:46:11 | FromGitter | <iffy> I started to. As a debugging move, I only used GC_ref and didn't ever unref, but I still got segfaults. |
19:47:32 | FromGitter | <iffy> Currently, in Nim, I make a copy of every incoming string using copyMem and I append every outgoing string to a global sequence of strings (which I think is sort of equivalent to GC_ref) |
19:49:26 | Araq | ha, na that doesn't work, when you append to a global sequence it creates a copy and the old string is subject to garbage collection |
19:49:36 | FromGitter | <iffy> oh, hehe |
19:50:01 | Araq | use GC_ref instead, but you can also play with GC_disable and GC_enable |
19:50:26 | Araq | so that the GC doesn't collect when strings are still flying around language boundaries |
19:50:37 | FromGitter | <iffy> k, I'll try that, and check my ints/cints and also see if I can get valgrind to run this |
19:50:52 | Araq | or you use --gc:regions and custom regions memory management |
19:50:53 | FromGitter | <iffy> How does Nim know where to set the stack bottom, btw? |
19:51:09 | FromGitter | <iffy> Cause I could see Node not honoring it, maybe? |
19:51:34 | * | OrganicAnywhere quit () |
19:51:41 | Araq | yeah, it's possible |
19:53:50 | FromGitter | <iffy> Araq: GC_disable() made it work without errors |
19:54:13 | Araq | unfortunately that doesn't mean much. |
19:54:27 | FromGitter | <iffy> That's what I was just concluding :) |
19:54:42 | FromGitter | <arnetheduck> check this out btw, nim is featured in the `libp2p` roadmap: https://docs.google.com/document/d/1Rd4yNw1TNQBvfRrKeEMSTseb6fvPzS-C--obOn0nul8/edit#heading=h.81ihj7mrpz4p |
19:55:12 | Araq | iffy if you could share some code I could say more |
19:55:46 | Zevv | Araq: if you have a minute, can you explain to me what the if line 232 in asyncmacro checks for? retval should either be nothing or Future[T], but allows something else |
19:56:06 | FromGitter | <iffy> Araq: Yeah; I think I'm going to trim this down to a reproducible, shareable snippet. It's mostly proprietary stuff unfortunately |
19:57:25 | Araq | Zevv: there are 2 AST representations for A[B] |
19:57:33 | Araq | that's what this code is checking for |
19:58:05 | Zevv | I expected something like that, but how does that trigger in real life? I see this never happening in all of the tests |
19:58:10 | Araq | it's either nkBracketExpr(A, B) or nkCall("[]", A, B) |
19:58:13 | dom96 | hey guys, what's new? |
19:58:33 | Araq | dom96: we released a Nim music video |
19:58:54 | Araq | Zevv: well it's defensive code :P |
19:59:04 | Zevv | Fair enough, thanks |
19:59:39 | dom96 | This one? https://www.youtube.com/watch?v=DmYOPkI_LzU&t=0s |
20:00:06 | Araq | yeah |
20:01:10 | dom96 | No tweets about it? |
20:03:07 | Araq | feel free |
20:04:31 | dom96 | done |
20:04:36 | xace | thats great, i wanted to ask at the last video about how to use krux's gdb script but I guess this answers it |
20:04:55 | rayman22201 | Just watching the video. Araq sounds much more clear ;-) |
20:05:07 | * | aguspiza joined #nim |
20:05:58 | dom96 | Cool, so we've got two talks about Nim at FOSDEM (even if one is indirectly about Nim) https://fosdem.org/2019/schedule/event/nimbus/ |
20:07:42 | rayman22201 | Araq quote of the day, "in my experience debugging in releaese mode with GDB is the same..." except when it's not lol. "Cannot access this local variable. It has been optimized away." DAMNIT XP |
20:08:29 | * | Araq shrugs |
20:08:54 | Zevv | If I would make a PR to do the async implicit Future[T] return transformation, would it make sense to change all code in stdlib and tests hat that now returns a Future[T] as well? |
20:08:56 | Araq | "Variable has been optimized away" was a Delphi problem |
20:09:04 | Araq | not a GDB one, but ymmv |
20:09:36 | Araq | Zevv: this PR requires you won the RFC fight first |
20:09:51 | Zevv | It's hypothetical :) |
20:10:39 | dom96 | We've discussed this already, explicit Future[T] is the way |
20:11:06 | dom96 | Unless you've got a different argument than "I hate typing", I won't be swayed :) |
20:11:36 | rayman22201 | True, optimized local variables is a general aggressive optimizer problem. It's great, until you need to debug. It happens to me all the time at my job with C++ code. I'm just venting my frustration. |
20:13:20 | Zevv | dom96: I made some arguments here https://tinyurl.com/ya8exu7s. I naively assumed the "thumbs up" from araq on that was good news |
20:14:51 | * | zachk joined #nim |
20:15:57 | * | zachk quit (Read error: Connection reset by peer) |
20:16:02 | Araq | rayman22201: do you use GDB? |
20:16:19 | * | zachk joined #nim |
20:16:23 | rayman22201 | yes... for better or worse |
20:17:35 | Araq | Zevv: I like this change, yes. |
20:18:01 | Araq | but I don't use my BDFL status all the time. |
20:18:12 | * | zachk quit (Changing host) |
20:18:12 | * | zachk joined #nim |
20:18:49 | Zevv | I had to look that one up :) |
20:19:00 | Zevv | and its not the Bund Deutscher Fußball-Lehrer |
20:19:11 | Araq | lol |
20:19:29 | dom96 | I replied |
20:20:37 | Zevv | sweet |
20:20:53 | Araq | ah hmmm, This should not leave existing code working, but might cause confusion with nested Future return types like Future[Future[int]]." |
20:21:03 | dom96 | yeah... |
20:21:07 | Araq | that's why we didn't do it iirc |
20:21:09 | dom96 | yet another reason |
20:21:40 | dom96 | btw, please ping me about async RFCs |
20:21:55 | Zevv | Araq: that's a typo, it *should* leave existing code working of course |
20:22:00 | dom96 | also, can we force people to write proper PR RFCs? |
20:22:09 | dom96 | I don't have time to go through all RFC issues :( |
20:22:32 | Araq | Zevv: not my point |
20:22:34 | Zevv | :) |
20:22:58 | Araq | Future[Future[T]] vs Future[T] is confusing when T is short for Future[T] |
20:23:13 | Araq | and c# too uses Task<T> explicitly. |
20:23:42 | dom96 | wouldn't be surprised if other languages with async await do too |
20:23:46 | dom96 | Bet you Python does as well |
20:23:56 | Araq | and every newer C# feature got extensive usability testing. |
20:24:10 | Araq | or at least "some". :P |
20:24:13 | dom96 | I know that Hack does too |
20:25:09 | Araq | however we could have sugar, ^T for Future[T] and ^ for await... :P |
20:25:18 | dom96 | noooo |
20:25:34 | dom96 | It's hard enough to explain async await to people |
20:25:37 | dom96 | don't make it harder |
20:25:40 | Araq | I'm not serious. |
20:26:06 | dom96 | Great |
20:26:11 | dom96 | Araq: You coming to FOSDEM? |
20:26:30 | Araq | no. |
20:26:49 | dom96 | pity |
20:27:31 | federico3 | pity indeed :( |
20:37:03 | FromGitter | <zacharycarter> dom96: why is it hard to explain async await to people? |
20:37:40 | FromGitter | <zacharycarter> do you mean idiosyncacies in Nim's implementation? |
20:37:46 | FromGitter | <zacharycarter> or the concept in general? |
20:37:53 | dom96 | Two reasons: it's not easy for people to understand what goes on "under the hood" and there are multiple symbols (await, waitFor, runForever, poll, etc.) |
20:38:04 | FromGitter | <zacharycarter> so the former - gotcha |
20:38:23 | dom96 | Many people find it hard to understand what the difference between `await` and `waitFor` are |
20:38:37 | dom96 | many also don't understand what a Future is I think |
20:38:57 | FromGitter | <zacharycarter> maybe we could create some analogous references to other popular PLs? |
20:38:59 | Zevv | promises are pretty common these days |
20:39:03 | FromGitter | <zacharycarter> so like - Future = Promise |
20:39:07 | Zevv | ^ |
20:39:08 | dom96 | Not sure it is idiosyncracies, how can we merge these symbols? |
20:39:17 | FromGitter | <zacharycarter> well - we can't |
20:39:21 | FromGitter | <zacharycarter> but we can explain them in JS terms |
20:39:36 | FromGitter | <zacharycarter> which many people doing async/await programming are familiar with |
20:39:37 | FromGitter | <zacharycarter> or C# terms |
20:39:44 | dom96 | Sure |
20:39:57 | FromGitter | <zacharycarter> that's why I was a bit confused at first - because I know a lot of people are already familiar with these concepts |
20:40:02 | dom96 | I wonder what the C#/JS equivalents are actually |
20:40:04 | FromGitter | <zacharycarter> but they're used to them in a JS or C# context |
20:40:14 | FromGitter | <zacharycarter> well - I know for sure that Promises are JS's version of Futures |
20:40:20 | dom96 | we need someone who knows C#/JS well to write these |
20:40:22 | FromGitter | <zacharycarter> I'm sure JS has a waitFor |
20:40:27 | FromGitter | <zacharycarter> they definitely have an await |
20:40:42 | FromGitter | <zacharycarter> C# - I can't help with |
20:40:56 | FromGitter | <zacharycarter> I have a co-worker I could tap though - who loves to talk about C# |
20:41:10 | dom96 | Do it, get them to contribute to Nim :D |
20:41:18 | FromGitter | <zacharycarter> okay - I will talk to him tomorrow about it |
20:41:41 | FromGitter | <zacharycarter> btw - interview with Riot's engineering leads is tomorrow night |
20:41:50 | FromGitter | <zacharycarter> send me good karma everyone plz :P |
20:41:55 | Zevv | ffiw: for me the async magic only made sense once I grokked the way it ends up in C. |
20:42:18 | dom96 | zacharycarter: All the best :) |
20:42:52 | FromGitter | <zacharycarter> well - I'm not sure comparing and contrasting terminology will necessarily provide insight into implementation |
20:43:13 | FromGitter | <zacharycarter> but I would presume - that most languages are handling it in a comparable fashion |
20:43:21 | FromGitter | <zacharycarter> but that's coming out of my butt - I have no real assurance there |
20:43:27 | FromGitter | <zacharycarter> thank's dom96 :D |
20:47:43 | * | smitop joined #nim |
20:49:44 | Zevv | yay for #10385, great stuff with all the documentation initatives |
20:50:35 | dom96 | yeah, awesome job to narimiran and the brilliant contributors! |
20:50:38 | FromGitter | <arnetheduck> I'm happy with future[t] - let's me know what I can do with the return value, and the accompanying costs (dynamic allocation, etc) |
20:50:49 | * | oculux quit (Quit: blah) |
20:51:16 | * | oculux joined #nim |
20:52:47 | Zevv | Yeah but I have to watch my learning colluegues try to return a newFuture[int]() from their .async procs :) |
20:54:42 | FromGitter | <arnetheduck> well, I just had the opposite case where a function was returning nothing and therefore caused a compile fail for a missing `discard` on the return value, because someone had created a smart macro that did this transformation.. when the future is returned, you know what to look for in the manual, at least |
20:57:23 | dom96 | Yeah, the explicit return type also aids in discoverability |
20:57:47 | dom96 | If no async functions mention Future then nobody will have any clue that they're used behind the scenes |
20:57:55 | dom96 | I do feel your pain though, Zevv |
20:58:13 | Zevv | I'll stop complaining about it, I promise ;) |
20:58:13 | dom96 | Sadly not everything can be intuitive :) |
20:59:07 | * | def- quit (Ping timeout: 240 seconds) |
20:59:23 | * | def- joined #nim |
20:59:44 | * | Gertm joined #nim |
21:00:01 | Zevv | in the end both solutions are just as good/bad: there is simply a serious transformation being done on the proc, and you really have to know all the details to see all the consequences |
21:03:25 | smitop | What is idiomatic: `Port 80`, `Port(80)`, or `80.Port`? |
21:04:49 | dom96 | bah, why did I `git pull` nim |
21:05:18 | dom96 | smitop: Either of the last two |
21:08:54 | dom96 | https://github.com/nim-lang/Nim/issues/10433 :/ |
21:10:38 | dom96 | Looks like a bisect is in order |
21:11:00 | dom96 | What I get for grabbing HEAD D: |
21:11:40 | Araq | 1. runnableExamples run in their own module and import the current module. |
21:12:01 | dom96 | "Maybe only when importing the module?" |
21:12:03 | Araq | 2. it's now strings = nums.mapIt($(4 * it)) |
21:12:19 | Araq | we removed deprecated stuff, that's all |
21:12:28 | Araq | apparently the error message suffers from this. |
21:12:28 | dom96 | oh |
21:12:32 | dom96 | bahhhh |
21:12:39 | Araq | :-) |
21:12:41 | dom96 | That's a piss poor error message |
21:14:01 | dom96 | Pardon my language :P |
21:14:54 | Araq | I have no idea why it doesn't say "invalid number of parameters" |
21:15:03 | Araq | or something along those lines |
21:15:30 | dom96 | Okay, well, feel free to reopen my issue |
21:15:34 | dom96 | or just fix the error message |
21:15:42 | dom96 | I'm guessing there may be a few people who run into this |
21:15:51 | Araq | but again, "Maybe only when importing the module?" doesn't apply, runnableExamples "emulate" the import |
21:16:07 | * | mops_ joined #nim |
21:16:43 | * | miran quit (Ping timeout: 245 seconds) |
21:17:03 | Araq | hmm it tries to typecheck before deciding there is no variant of mapIt that can match, tough nut |
21:17:49 | Araq | we can turn the .deprecated into an .error |
21:18:02 | Araq | so that people get a nice error message |
21:20:26 | dom96 | Yeah, let's do that |
21:22:19 | mops_ | Hi everyone! I'm quite new nim user. Can anyone recommend some good dependency injection container for nim? |
21:22:46 | xace | mops_: dependency injection manager? as in package manager? |
21:23:28 | xace | nim comes with `nimble` which lets you install and set project dependencies etc... |
21:24:05 | mops_ | No I mean dependency injection IOC for concrete classes and interfaces. For example for .NET: https://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx |
21:24:13 | Araq | no it's some "interfaces for everything" paradigm from the OO people who don't understand programming. |
21:24:43 | rayman22201 | @araq @dom96 It tries to typecheck the argument expression before it typechecks the function right? damn. This is the problem with macros injecting symbols. Why are good error messages so hard? |
21:25:27 | Araq | You have procs operating on data. You create test data and pass it to your procs. No framework required. |
21:26:34 | Araq | no need to monkey patch your procs, no dynamic binding everywhere, test your code with test data, separate your code from your data. |
21:27:24 | Araq | rayman22201: the error message is precise but misleading :P |
21:27:52 | rayman22201 | lol. yes, you are correct. |
21:29:04 | dom96 | Araq: What are your thoughts on mocking frameworks? :) |
21:29:55 | Araq | never needed one and I prefer my "goto implementation" to work and not to point me to some interface declaration shit |
21:31:17 | Araq | "Do you want to go to the interface implementing class instead?" Yes, ffs, and not to the one that's mocking me. |
21:31:31 | mops_ | Yes thats fine. But how would you create this class graph A -> B -> C -> D (A depends on B, B depends on C, C depends on D). With DI container I can register instances of classes and then I can easily create for example A class without creating dependencies by hand. It is super convenient when system grows and there are more dependencies between entities. This of course one use case of DI. But I'm not sure how it will look in nim... |
21:33:09 | Araq | I don't have a class graph. |
21:33:19 | mops_ | :) |
21:35:32 | mops_ | Thats fine. Thanks for your time ;) I wish nim all the best! Bye :) |
21:35:44 | rayman22201 | OOP is not very popular in Nim land. |
21:35:52 | mops_ | I see |
21:36:38 | rayman22201 | You would probably use some sort of macro to accomplish a DI system. There isn't really any existing project for it though. |
21:36:42 | mops_ | unfortunetely it is easier for me to design in OOP way |
21:37:35 | mops_ | Maybe I should learn to design systems in FP way? Do you know any good resoruces to learn it? |
21:38:09 | * | shashlick quit (Remote host closed the connection) |
21:38:40 | rayman22201 | Nim is more old school imperative. |
21:39:21 | FromGitter | <arnetheduck> become good at nim: write nim programs. become good at programming: write different programs :) |
21:40:03 | Araq | mops_: you can use inheritance in Nim and closures give you much of what DI would give you |
21:40:27 | Araq | but it's hardly the idiomatic solution |
21:40:55 | mops_ | nim has single or multiple inheritance (like C++)? |
21:41:28 | Araq | at the same time I'm still researching how to write stateful UIs without OOP (*cough*) |
21:41:58 | Araq | single inheritance. |
21:42:29 | mops_ | och, thats very exciting! because I always thought that UI is so natural in OOP |
21:42:48 | mops_ | very interesting :) |
21:43:22 | Zevv | immediate mode UIs are hip these days |
21:43:45 | Araq | really? |
21:44:12 | mops_ | reactive approach seems one option. In haskell they use reactive programming for UI |
21:44:32 | rayman22201 | reactjs and the bunch is basically (lets take our stateful UI and pretend it' immediate mode) |
21:44:50 | rayman22201 | Haskell as well, true |
21:45:01 | rayman22201 | but Haskell doesn't really have a choice lol |
21:45:10 | mops_ | :D |
21:45:13 | * | shashlick joined #nim |
21:45:13 | * | shashlick quit (Read error: Connection reset by peer) |
21:45:14 | Araq | reactjs is full of state, they wrap it in "components" |
21:45:33 | rayman22201 | I didn't say it was good at it's job lol |
21:46:02 | Araq | reactjs is not "reactive programming" either |
21:46:19 | Araq | btw. |
21:46:37 | rayman22201 | cyclejs or elm are more proper "reactive programming" with stream abstractions and such |
21:46:53 | Araq | elm is not reactive |
21:47:33 | Araq | for "reactive" you need a dependency graph, elm is just FP + DOM diffing. |
21:48:01 | Araq | and React is OO + DOM diffing. |
21:48:27 | Araq | Vue.js is reactive. |
21:48:33 | rayman22201 | :shrugs: |
21:48:53 | dom96 | oh, is that why I'm getting the impression that so many people are hyped up about Vue? |
21:49:00 | dom96 | btw you really need to invest time marketing karax |
21:49:17 | dom96 | It really is a great framework, but unless it gets exposure it won't get far |
21:50:05 | Araq | you're probably right but it got as far as I need it to go. |
21:51:20 | Araq | it's at v1 and nim isn't. |
21:51:40 | dom96 | Argh, I wish I could use my supertype constructor and just cast it to the subtype |
21:52:12 | dom96 | Do we have a way to handle this? |
21:54:22 | dom96 | TIL https://nim-lang.org/docs/system.html#procCall%2Cuntyped |
21:54:33 | FromDiscord_ | <exelotl> I've used Vue and it's really freaking nice, it's so powerful and Just Makes Sense, you can get the basics down in 30 mins |
21:54:39 | Araq | not really. Use a factory proc |
21:54:39 | dom96 | procCall is an odd name for this |
21:54:56 | * | aguspiza quit (Ping timeout: 240 seconds) |
21:55:02 | dom96 | exelotl: basics meaning what? :) |
21:56:17 | Araq | exelotl: I will never use it again. I'd rather write down programs with own blood until I bled to death |
21:56:42 | FromDiscord_ | <exelotl> haha wow xD |
21:57:21 | dom96 | Now that's a quote to put on a T-shirt |
21:58:49 | FromDiscord_ | <exelotl> dom96: like, the basic structure of having a page where elements are bound to javascript variables, conditional rendering |
21:59:06 | * | stefanos82 joined #nim |
22:00:31 | Araq | dom96: it turns a "method call" into a "proc call". |
22:00:44 | dom96 | yeah, meh, not what I want anyway |
22:00:59 | Araq | we could use "staticCall" instead except that 'static' already some a completely different meaning in Nim |
22:01:04 | dom96 | I'll probably end up refactoring this to use composition eventually |
22:01:12 | * | mops_ left #nim (#nim) |
22:01:12 | Araq | good boy. :-) |
22:01:41 | * | shashlick joined #nim |
22:01:57 | dom96 | lol |
22:08:52 | shashlick | test |
22:09:11 | FromGitter | <kaushalmodi> works |
22:09:54 | shashlick | just upgraded matterbridge to latest - had to move to new slack tokens |
22:10:21 | shashlick | i hope to update koch xz and ship linux binaries before 0.19.4 comes out |
22:12:33 | shashlick | anyone knows the answer to this - https://stackoverflow.com/questions/54313875/how-to-redirect-output-to-file-if-no-console-detected-in-nim/54314090?noredirect=1#comment95448507_54314090 |
22:19:03 | shashlick | @kaushalmodi - that branch name change didn't work on nightlies |
22:19:10 | rayman22201 | hard to say without seeing more code. Maybe stdout is getting shadowed? There are two assigments in that example. Is the open failing or the stdout? |
22:20:07 | shashlick | i think it is better to tag with vVERSION-date since that will always be new and on the top |
22:23:06 | FromGitter | <kaushalmodi> shashlick: the problem is to find the HEAD built version |
22:23:23 | FromGitter | <kaushalmodi> the version for HEAD right now is 0.19.9, but that won't be the case always |
22:23:48 | FromGitter | <kaushalmodi> wondering why the branch name addition wouldn't work .. |
22:24:34 | shashlick | again it won't help with sorting |
22:24:39 | FromGitter | <kaushalmodi> it has worked: https://github.com/nim-lang/nightlies/releases/tag/v0.19.9-f0be575 |
22:24:40 | shashlick | since it will not change |
22:24:59 | FromGitter | <kaushalmodi> I added the branch name to the `name` field |
22:25:43 | FromGitter | <kaushalmodi> (https://files.gitter.im/nim-lang/Nim/V388/image.png) |
22:25:46 | shashlick | yes but it won't be sorted correctly since the tags and the name will still be random due to the hash |
22:26:12 | FromGitter | <kaushalmodi> in the api, the last updated release becomes index 0 |
22:26:15 | FromGitter | <kaushalmodi> of the JSON |
22:26:34 | FromGitter | <kaushalmodi> JSON -> https://api.github.com/repos/nim-lang/nightlies/releases |
22:27:06 | FromGitter | <kaushalmodi> I believe that fixing of sorting on the releases page is a separate issue |
22:27:09 | shashlick | tag needs to be `v0.19.9-2019-01-23` and name needs to be `v0.19.9-2019-01-23 nightly build` |
22:27:21 | shashlick | using the build hash in tag and name won't help with sorting |
22:27:28 | shashlick | why do you need the branch name when it is already part of the version name |
22:27:31 | FromGitter | <kaushalmodi> ah, now I get it |
22:27:41 | FromGitter | <kaushalmodi> version name is 0.19.9 |
22:27:51 | FromGitter | <kaushalmodi> it will change after the next major release |
22:28:24 | FromGitter | <kaushalmodi> I am thinking of how someone would reliably get the latest build of HEAD without knowing the version number |
22:28:28 | shashlick | ok then remove the v0.19.9 part and instead use `devel-2019-01-23` and `version-0-19-2019-01-23` instead |
22:29:06 | FromGitter | <kaushalmodi> the only catch is that we won't get multiple releases on the same day |
22:29:24 | FromGitter | <kaushalmodi> if we attempt to rebuild, all the releases will club under the same release |
22:29:41 | shashlick | that's fine - nightly is nightly 😄 |
22:29:47 | FromGitter | <kaushalmodi> :) |
22:29:54 | shashlick | and if manually initiated, it is probably to replace the older one |
22:30:03 | FromGitter | <kaushalmodi> makes sense |
22:30:20 | FromGitter | <kaushalmodi> do you want me to change name and tag as you suggested? |
22:30:31 | shashlick | one other change we need to do is kick off all devel first and then all stable jobs |
22:30:40 | shashlick | right now it orders by OS |
22:30:53 | shashlick | that way, most jobs for a given branch will start around the same time |
22:31:03 | shashlick | avoiding building of different hashes |
22:31:06 | shashlick | ya please if you can |
22:35:50 | FromGitter | <iffy> Araq: If you're interested and have Node installed on your computer, here's my sscce https://github.com/iffy/node-nim-memory-bug |
22:36:35 | dom96 | why not devel-commit_hash? |
22:36:45 | dom96 | Not using the latest commit might be nice in some cases |
22:36:48 | FromGitter | <kaushalmodi> dom96: sorting |
22:36:55 | dom96 | sorting for what? |
22:37:12 | shashlick | since hashes are random, releases show up randomly on the page |
22:37:14 | FromGitter | <kaushalmodi> sorting of releases on https://github.com/nim-lang/nightlies/releases |
22:37:29 | shashlick | look at the page and you'll see how the first posted isn't the latest always |
22:40:17 | dom96 | devel-2019-01-23-commit_hash then? |
22:40:31 | dom96 | or just create a page that lists these properly |
22:40:48 | FromGitter | <kaushalmodi> shashlick: remembered something .. |
22:40:53 | FromGitter | <kaushalmodi> you will need to uniquify tags |
22:41:03 | FromGitter | <kaushalmodi> else update on the same day won't get deployed |
22:41:36 | FromGitter | <kaushalmodi> so let's just do `<BRANCH>-<DATE>-<HASH>` as dom96 suggested |
22:45:00 | shashlick | that's fine with me |
22:49:17 | * | PMunch quit (Remote host closed the connection) |
22:49:25 | FromGitter | <kaushalmodi> shashlick: not sure how to fix the order of builds in Travis |
22:49:35 | FromGitter | <kaushalmodi> probably need to manually add matrix / include? |
22:51:11 | dom96 | Thank you for working on this by the way guys! |
22:51:21 | shashlick | i was hoping switching order of env and os would do it |
22:52:41 | shashlick | declaring env before os in the yaml |
22:52:45 | shashlick | hopefully it is that simple |
22:52:55 | * | Marumoto joined #nim |
22:52:56 | shashlick | else not worth it, rather work on moving to koch CI |
22:53:20 | shashlick | dom96 - absolutely |
22:53:50 | shashlick | dom96 - pinging again on that init.sh PR |
23:03:26 | * | skellock quit (Ping timeout: 240 seconds) |
23:15:17 | Araq | yeah, write Nim programs instead of Bash scripts |
23:15:53 | * | vlad1777d quit (Ping timeout: 245 seconds) |
23:24:11 | shashlick | you need to install nim first 😄 |
23:24:57 | shashlick | this is the choosenim init.sh script to install it |
23:25:07 | shashlick | does nim doc support cross references? |
23:25:40 | * | Vladar quit (Remote host closed the connection) |
23:25:53 | shashlick | nm |
23:38:46 | * | skellock joined #nim |
23:42:30 | FromGitter | <iffy> If I did: `var res:string = "something"; GC_ref(res); result = addr res[0]` earlier, and now I want to `GC_unref` that string but I only have the result cstring. How do I go from cstring to something I can `GC_unref`? |
23:43:08 | FromGitter | <iffy> `var to_unref:string = $mycstring` seems to make a copy |
23:43:34 | FromGitter | <iffy> dom96: ^ you suggested that first part a few days ago |
23:46:40 | rayman22201 | `cast[string](mycstring)` maybe? If you know for sure it's the same string. |
23:49:20 | FromGitter | <iffy> Hmm... that's giving me an out-of-memory error. Maybe the cstring isn't null-terminated? mycstring.repr seems fine, though |
23:50:27 | rayman22201 | Nim strings are no longer null terminated iirc |
23:51:05 | FromGitter | <iffy> `var toUnref:string = caststring (mycstring)` is causing the out of memory error |
23:53:59 | rayman22201 | Hrmm. Can you copy the nim string to cstring first and then pass it to c? |
23:54:32 | leorize | you can't `cast[cstring]` because string has a totally different structure in memory |
23:54:44 | FromGitter | <iffy> In one function, I create a var string, then return it as a cstring to the calling C code. |
23:54:56 | FromGitter | <iffy> (and GC_ref it before I return it) |
23:55:02 | leorize | usually you would pass your string to C like this: `cstring(string)` |
23:55:25 | FromGitter | <iffy> Once the calling C code has made a copy, the calling C calls another function to tell my Nim code to release the string |
23:55:47 | leorize | then I suggest passing the real string itself |
23:55:58 | rayman22201 | That makes sense. That is what I thought @leorize. But since he was passing a nim string through from the start, I thought c might respect the memory layout and it might work. |
23:56:01 | FromGitter | <iffy> back to C? |
23:56:33 | leorize | yep |
23:56:40 | leorize | pass it as a pointer of sort |
23:56:45 | leorize | then a proc to get the cstring |
23:56:55 | leorize | then a proc to remove the passed string |
23:57:24 | FromGitter | <iffy> Is the return type of my function (it's called `echo`) `string` then? Or `ptr string`? |
23:59:01 | FromGitter | <iffy> I'll be back tomorrow; got to go |