00:01:24 | * | wildlander quit (Quit: Konversation terminated!) |
00:03:53 | PMunch | Yay, my part 2 had finished :P |
00:04:04 | PMunch | 141m9.331s runtime :P |
00:04:21 | FromDiscord_ | <technicallyagd> lol, you used seq for it? |
00:04:36 | PMunch | Yup, I started the part1 with just the basic |
00:04:46 | PMunch | Seq with insert and delete |
00:04:49 | FromDiscord_ | <technicallyagd> I also did that at first |
00:05:05 | PMunch | And I've been out of the house all day so I didn't have time to rewrite it for part 2 |
00:05:19 | PMunch | So I just added *100 to the input and let it run while I was gone :P |
00:05:23 | FromDiscord_ | <technicallyagd> lol |
00:06:20 | FromDiscord_ | <technicallyagd> I spent 2.5 hours looking for patterns behind the scores |
00:06:36 | FromDiscord_ | <technicallyagd> then realized I just needed to use doublylinked ring |
00:06:37 | PMunch | I tried to throw together a solution with a DoublyLinkedRing before I had to leave, but didn't have time to finish it |
00:06:45 | PMunch | Haha, exactly |
00:06:48 | * | martin__ quit (Ping timeout: 246 seconds) |
00:06:52 | PMunch | How fast did that actually run? |
00:07:05 | FromDiscord_ | <technicallyagd> in a blink |
00:07:10 | PMunch | Oh wow, nice |
00:07:14 | FromDiscord_ | <technicallyagd> yeah |
00:07:16 | PMunch | So I had the right idea then :P |
00:07:34 | FromDiscord_ | <technicallyagd> I almost wanted to punch myself in the face after seeing that |
00:08:02 | FromDiscord_ | <technicallyagd> yeah, you had the right idea |
00:12:21 | FromDiscord_ | <technicallyagd> @dom96 I thought I made a PR about the `--nimblePath` a while back. |
00:12:41 | PMunch | Did you get the lists module DoublyLinkedRing to work? |
00:13:04 | M37[m] | PMunch: Yeah, it works. |
00:13:20 | FromDiscord_ | <technicallyagd> @dom96 ah yes, is there any problem with it? https://github.com/nim-lang/nimble/pull/554 |
00:13:23 | dom96 | a PR for what? |
00:13:44 | xace | Thanks dom, ill look it up |
00:13:58 | dom96 | still didn't fix what I asked |
00:14:24 | * | fthe joined #nim |
00:14:29 | FromDiscord_ | <technicallyagd> @dom96 really? |
00:14:40 | FromDiscord_ | <technicallyagd> which part? |
00:15:00 | FromDiscord_ | <technicallyagd> @PMunch yes I got it to work |
00:15:13 | PMunch | Hmm, I feel like it could have some better support for insert and delete |
00:15:37 | PMunch | Well remove works fine |
00:16:27 | PMunch | And I guess I could just set the ring head to get prepend/append to work as insert.. |
00:16:37 | FromDiscord_ | <technicallyagd> yeah |
00:18:30 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:18:55 | FromDiscord_ | <technicallyagd> insert and delete with index is quite inefficient on linked lists |
00:19:27 | PMunch | Yeah that's true |
00:19:36 | PMunch | I guess it's a good thing they don't exist |
00:20:29 | dom96 | see my comments |
00:21:24 | M37[m] | PMunch: I think it's okay, but somebody should probably add some examples to the docs. |
00:21:32 | M37[m] | I didn't see any tests in the source file either. |
00:25:05 | M37[m] | Which meant that ring.head = ring.head.next wasn't completely trivial to work out. |
00:25:12 | dom96 | technicallyagd: oh, oops, I never submitted my review. Apologies |
00:25:19 | dom96 | should see it now |
00:25:21 | dom96 | good night |
00:25:55 | FromDiscord_ | <technicallyagd> @dom96 I see. Good night! |
00:27:20 | PMunch | Aah, that's a better runtime 0m0.572s |
00:28:43 | M37[m] | PMunch: Did you try --gc:boehm or --gc:regions? Was noticably faster for me. |
00:30:58 | PMunch | boehm: 0m0.346s, regions: 0m0.189s |
00:31:21 | PMunch | markAndSweep seemed like it just spun forever |
00:31:25 | PMunch | Killed it after 25s |
00:31:53 | M37[m] | Yup. |
00:32:27 | PMunch | Huh, curiously none takes longer than regions |
00:32:47 | PMunch | And of course doesn't clean memory |
00:33:32 | * | lritter quit (Remote host closed the connection) |
00:33:49 | PMunch | Oh well, time for bed :) |
00:34:42 | PMunch | M37[m], I guess those makes sense when you've worked with linked lists before |
00:35:01 | PMunch | Would be cool to try some pseudo-seq |
00:35:35 | PMunch | A DoublyLinkedRing of seqs |
00:35:53 | PMunch | Starts as just the one seq, but for every delete it splits into two seqs |
00:35:57 | PMunch | Or something like that |
00:36:04 | PMunch | Inserts would still be pretty bad though.. |
00:36:34 | PMunch | Or well, depends on the split-factor I guess |
00:36:52 | * | PMunch quit (Remote host closed the connection) |
00:38:31 | FromDiscord_ | <technicallyagd> https://github.com/technicallyagd/ringDeque |
00:39:03 | FromDiscord_ | <technicallyagd> I actually wrote a package yesterday to make working with deque a bit easier |
00:39:45 | M37[m] | PMunch: I mean, I knew enough about lists and rings to recognise it on my first look at today's problem. |
00:39:55 | M37[m] | And my new friend the list module seems great. |
00:40:35 | M37[m] | It just felt noticably under-documented compared to all the other modules I've used this AoC. |
00:40:54 | M37[m] | (algorithm, intsets, math, sequtils, sets, strscans, strutils, tables, times). |
00:41:27 | M37[m] | And in the past: md5, deques |
00:41:34 | FromDiscord_ | <technicallyagd> yeah, took me a bit to realize how to use it correctly |
00:42:25 | M37[m] | Just a one-line example would've been enough, pretty much |
00:43:57 | M37[m] | Anybody feel free if you wanna make a pull request for it. Otherwise I'll get round to it eventually. |
00:44:35 | FromDiscord_ | <technicallyagd> haha, I was thinking of doing that, but ended up making a separate package instead. |
00:47:48 | * | jakob0094 quit (Remote host closed the connection) |
00:47:57 | * | ftsf joined #nim |
00:49:42 | M37[m] | I wonder who has the best nim AoC speedrunning library by now. |
00:50:04 | M37[m] | I made toDeque() yesterday :D |
00:51:32 | FromDiscord_ | <technicallyagd> speed as in performance or coding speed? |
00:52:05 | M37[m] | The latter. Leaderboard speed. |
00:53:36 | M37[m] | Maybe the answer is "nobody", since nobody has really been placing on the global leaderboard. |
00:54:34 | FromDiscord_ | <technicallyagd> but some people got on the global leader boards on individual tasks though |
00:57:44 | M37[m] | Mostly jamie. He got 5th on part 1 for day 9, which I thought was pretty impressive. |
00:58:16 | M37[m] | I guess I want some confirmation that he actually did it in nim, though. |
00:58:24 | FromDiscord_ | <technicallyagd> ah that's right |
00:59:01 | FromDiscord_ | <technicallyagd> well, this task is not that hard if you knew how to use DoublyLinkedRing though |
00:59:49 | FromDiscord_ | <technicallyagd> But seeing him took 27+ min for second part, I am guessing he also solved the first part with seq |
01:00:08 | FromDiscord_ | <technicallyagd> or something similar in other language |
01:00:33 | * | vlad1777d joined #nim |
01:02:10 | M37[m] | Yeah, other days have been harder for me. |
01:02:55 | * | fthe quit (Ping timeout: 246 seconds) |
01:03:00 | M37[m] | I'm watching this pull request pretty closely https://github.com/nim-lang/Nim/pull/9881 |
01:03:53 | M37[m] | Because that'd really help for AoC. |
01:04:09 | FromDiscord_ | <technicallyagd> It helps with EVERYTHING lol |
01:04:24 | FromDiscord_ | <technicallyagd> This is great! |
01:06:40 | M37[m] | Yeah. Would be a great quality-of-life improvement. |
01:10:03 | M37[m] | Gotta go. See ya. |
01:10:15 | M37[m] | Hope you get to #1 globally tomorrow with ringDeques :D |
01:11:49 | FromDiscord_ | <technicallyagd> nah, it probably won't be useful for a while now |
01:12:05 | FromDiscord_ | <technicallyagd> but thank you, and see you! |
01:34:58 | * | lucasb quit (Quit: Connection closed for inactivity) |
02:11:29 | FromGitter | <zacharycarter> It confuses me why everyone wants to compare Nim and Rust and D, to the degree that they do... |
02:12:02 | FromGitter | <zacharycarter> these languages are trying to evolve modern systems programming languages |
02:12:23 | FromGitter | <zacharycarter> so wouldn't a better comparison be Nim vs C/C++ |
02:13:59 | FromGitter | <zacharycarter> I don't care about D and I don't really care about Rust - I'm not looking at existing Rust apps and trying to figure out if Nim is a suitable language to move to |
02:14:28 | FromGitter | <zacharycarter> one is generally looking at Nim from two perspectives - Python programmer that wants more performance or C++ programmer that's tired of C++ |
02:15:07 | FromGitter | <zacharycarter> and lately I feel that Nim suits the former much better than the latter |
02:15:22 | FromGitter | <zacharycarter> due to GC / TLS |
02:18:50 | * | martin__ joined #nim |
02:24:05 | FromGitter | <zacharycarter> a D vs Nim topic is near the top of the forum though - and the discussion no longer seems fruitful... it'd be nice though to stop having the mentality that languages and their communities are at odds with one another and appreciate problem solving |
02:25:04 | * | martin2 joined #nim |
02:26:44 | * | dddddd quit (Quit: Hasta otra..) |
02:27:47 | * | martin__ quit (Ping timeout: 240 seconds) |
02:43:32 | * | martin2 quit (Ping timeout: 250 seconds) |
03:08:44 | * | banc quit (Quit: Bye) |
03:10:42 | * | matti joined #nim |
03:10:42 | * | matti quit (Changing host) |
03:10:42 | * | matti joined #nim |
03:25:09 | * | banc joined #nim |
04:12:02 | * | nsf joined #nim |
04:31:27 | * | vlad1777d quit (Ping timeout: 240 seconds) |
04:49:36 | * | endragor joined #nim |
04:50:53 | * | snowolf quit (Ping timeout: 268 seconds) |
04:58:05 | * | narimiran joined #nim |
05:05:12 | * | snowolf joined #nim |
05:14:50 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
06:57:54 | * | narimiran quit (Ping timeout: 250 seconds) |
07:02:03 | Zevv | That's a nice thought for christmas :/ |
07:02:34 | * | krux02 joined #nim |
07:23:54 | * | snowolf quit (Ping timeout: 252 seconds) |
07:41:02 | * | Gertm left #nim ("Leaving") |
07:43:39 | * | snowolf joined #nim |
07:48:06 | * | snowolf quit (Ping timeout: 252 seconds) |
07:51:34 | * | snowolf joined #nim |
07:57:19 | * | snowolf quit (Ping timeout: 250 seconds) |
08:00:54 | * | ftsf quit (Quit: Leaving) |
08:10:16 | * | stefanos82 joined #nim |
08:19:16 | * | kapil____ quit (Quit: Connection closed for inactivity) |
08:33:55 | FromGitter | <gogolxdong> ping @mratsim , what do you think of the implementation of HKDF? I think I' v done exactly the same as the RFC instructs, but haven't solved this issue by far. |
08:34:43 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c0e2523e4787d16e372af17] |
08:44:50 | FromGitter | <gogolxdong> http://ix.io/1vGE |
08:45:11 | FromGitter | <gogolxdong> There is expected result and got result. |
08:47:04 | FromGitter | <gogolxdong> initialSecret and qlabel is the same as expected, only expand result varies. |
08:52:32 | * | Vladar joined #nim |
09:00:01 | * | dom96_w joined #nim |
09:06:27 | * | dom96_w quit (Ping timeout: 240 seconds) |
09:06:44 | * | ng0 joined #nim |
09:10:52 | Araq | https://blogs.msdn.microsoft.com/vcblog/2016/05/04/new-code-optimizer/ yay VCC is getting SSA... I wonder if they really lacked it before |
09:18:53 | * | lucasb joined #nim |
09:22:18 | Araq | oh it's from 2016, my bad |
09:34:17 | * | dddddd joined #nim |
09:34:51 | stefanos82 | lol |
09:43:27 | * | PMunch joined #nim |
09:46:08 | * | floppydh joined #nim |
09:55:33 | FromGitter | <gogolxdong> @mratsim you were right, I remember you mentioned using the array value instead of string, which I am aware of what you meant. |
09:56:37 | FromGitter | <mratsim> ah it’s been a while and I had a long weekend I don’t remember :P |
09:57:13 | FromGitter | <gogolxdong> no problem. |
09:58:57 | FromGitter | <alehander42> of course, that's if you dont actually need to store normal text in it, e.g. unicode text |
10:08:41 | FromGitter | <gogolxdong> It's just subtle, and didn't cause any side effect except different result. |
10:27:07 | * | abm joined #nim |
10:50:02 | * | hoijui joined #nim |
10:57:04 | sendell[m] | is there a compile-time boolean used to know if asserts are enabled? I need it for "when assertsEnabled:" blocks |
10:59:09 | FromGitter | <narimiran> @technicallyagd are you here maybe? |
11:04:09 | Araq | when compileOption("assertions") or similar, check system.nim |
11:05:52 | * | martin2 joined #nim |
11:07:19 | * | platoff joined #nim |
11:10:06 | * | martin2 quit (Ping timeout: 250 seconds) |
11:21:29 | FromGitter | <narimiran> lets say i have `tuple[x, y, z: int]`, can i somehow pass to a proc which field i would like to operate on? |
11:22:38 | FromGitter | <narimiran> e.g. i want to print `myTuple.y`, can i have something like `proc printField(a: MyTuple, b: TupleField) = echo a.b`? |
11:24:25 | * | NimBot joined #nim |
11:25:20 | Araq | template printField(a: MyTuple; b: untyped) = echo a.b |
11:31:23 | FromGitter | <narimiran> thanks Araq! i've managed to make it work in my (a bit more complicated) example. |
11:37:14 | * | kapil____ joined #nim |
11:46:37 | sendell[m] | Thx Araq :) |
12:03:03 | * | vlad1777d joined #nim |
12:18:07 | Zevv | Hi; I'd like to map a given type passed to a generic to an int. I now use the long way with a Table[string,int] and using 'var.type.name' as key. Is there a way to do this without the string conversion? |
12:24:46 | leorize | Zevv: I can't imagine your usecase, do you have an example? |
12:27:08 | Zevv | I'm serializing objects into a protocol (using msgpack4nim, but that's not relevant). Each message is serialized into a binary blob, which also needs a header indicating what the serialized type is. |
12:27:44 | Zevv | msgpack4nim has a generic 'pack[T]()' which does the hard work for me, but I also need to lookup the index for each T |
12:28:20 | Zevv | and bail out when trying to add a type which is not known in the protocol |
12:29:25 | leorize | well, since typedesc are strictly compile time values, you'd have to use it in a `const` context, or convert it to string... |
12:30:13 | Zevv | right, that makes sense |
12:30:52 | leorize | for runtime type info, there's the typeinfo module |
12:31:01 | leorize | it's unsafe though |
12:31:41 | Zevv | ok, I'll do some reading up. I'll stick to strings for now, thanks for the pointer! |
12:31:48 | FromGitter | <alehander42> sounds interesting! |
12:37:57 | * | hoijui quit (Ping timeout: 252 seconds) |
12:38:56 | * | Snircle joined #nim |
12:39:15 | * | tiorock joined #nim |
12:39:15 | * | tiorock quit (Changing host) |
12:39:15 | * | tiorock joined #nim |
12:39:15 | * | rockcavera is now known as Guest17804 |
12:39:15 | * | Guest17804 quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
12:39:15 | * | tiorock is now known as rockcavera |
12:56:33 | * | fthe joined #nim |
12:58:50 | * | jakob0094 joined #nim |
12:59:09 | * | fthe quit (Remote host closed the connection) |
13:08:45 | * | Vladar quit (Remote host closed the connection) |
13:10:16 | * | PrimHelios joined #nim |
13:21:57 | * | Perkol joined #nim |
13:23:03 | Perkol | https://bpaste.net/show/1bfd46bc9054 So i wanna repeat dostuff function for three times (if it returns errors). Am I doing it right? |
13:23:57 | leorize | no |
13:24:17 | leorize | you `break` after `dostuff()`, which will stop the loop immediately |
13:24:57 | leorize | oops, re-read the thing :P |
13:25:08 | leorize | seems fine |
13:25:12 | * | hoijui joined #nim |
13:26:27 | * | dom96_w joined #nim |
13:56:47 | * | nsf quit (Quit: WeeChat 2.3) |
14:02:10 | FromDiscord_ | <j$> Im trying to use the stb_image pkg and there's a compilation error, some missing file in nimcache, I was wondering if anyone was having this issue or I'm just brain dead |
14:03:43 | * | endragor quit (Remote host closed the connection) |
14:07:36 | FromGitter | <mratsim> not brain dead, I struggled for a couple hours to get it to compile as well |
14:08:03 | FromGitter | <mratsim> basically and that’s true for all header only library, Nim doesn’t copy them to nimcache |
14:08:47 | FromGitter | <mratsim> so either you use a dummy .c file that just includes the header and then in your nim file you do {.compile “your dummy.c”.} |
14:09:35 | FromGitter | <mratsim> or you {.passL: “pathToHeader”.} |
14:10:16 | FromGitter | <mratsim> now regarding the stb package, for me the following as been working for months: https://github.com/mratsim/Arraymancer/blob/master/src/io/io_image.nim#L5-L37 |
14:14:32 | Araq | there is no such thing as a "header only library" as far as Nim is concerned |
14:14:45 | Araq | but I agree, it should probably copy the header files around just in case |
14:18:54 | FromGitter | <arnetheduck> Araq, what do we do with the ast rename branch? it's the kind that doesn't age well.. `handleX` is short, sweet, and distinct - `genNode` works well for `nlvm` (but I'll update `nlvm` to follow whatever the cgen does...) |
14:19:42 | * | hoijui quit (Ping timeout: 252 seconds) |
14:19:56 | Araq | still want genX, it's in my finger muscles |
14:20:21 | Araq | but you're right we should merge it already |
14:21:44 | FromGitter | <arnetheduck> know the feeling :) like that box of cables you keep in the attic, knowing exactly where in the spaghetti the one you need is |
14:24:56 | FromGitter | <mratsim> I call that Last Used First Out :P |
14:25:57 | FromGitter | <arnetheduck> anyway, I included the sed needed to change it to anything you'd like, really.. it works as long as you use a unique prefix.. also, having separate and unique prefixes for ast and magics should be nice for the future, so that the magic implementations can be grouped together - that creates a nice implicit bonding between what you see in the std lib code and what goes on in the cgen and elsewhere |
14:26:03 | FromGitter | <mratsim> “This is a mess” - “No I know exactly where things are, the more I use them the more rpobable they are at the top" |
14:26:39 | shashlick | Didn't need anything special for nimfuzz which is also a single header lib |
14:26:52 | shashlick | You need to set STB_IMAGE_IMPLEMENTATION at compile time |
14:27:35 | shashlick | See https://github.com/genotrance/nimfuzz/blob/master/nimfuzz.nimble |
14:28:19 | FromGitter | <mratsim> you don’t have any compile or passC:”-L…”? |
14:28:41 | FromGitter | <mratsim> just proc foo {.importc, header: “bar.h”.} is enough? |
14:30:17 | * | rokups joined #nim |
14:33:25 | FromDiscord_ | <j$> mratsim, I tried your solution (or at least what I understood from it) and no luck, am I supposed to put the compile pragma somewhere specific |
14:50:45 | FromDiscord_ | <j$> okay so I tried what I think you meant shashlick via command line but I dont think I did it correctly |
14:57:03 | * | hwallann quit (Remote host closed the connection) |
14:58:37 | shashlick | @mratsim: it was good enough to have the -D set - I presume it could be added with {.passC.} as well |
14:59:11 | FromGitter | <mratsim> @j$ if you can post a gist that would help |
15:00:36 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:04:17 | * | dom96_w joined #nim |
15:08:37 | * | PrimHelios quit (Quit: Leaving) |
15:09:21 | shashlick | @j$: http://nimgen.genotrance.com/nimfuzz/fts_fuzzy_match.nim.html is how the wrapper looks like |
15:12:02 | FromGitter | <mratsim> so there is a passC with the includes: {.passC: "-I\"" & sourcePath & "\"".} |
15:12:19 | FromGitter | <mratsim> if you remove it you should see the same error as j$ |
15:14:17 | * | snowolf joined #nim |
15:15:25 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:19:16 | * | snowolf quit (Ping timeout: 268 seconds) |
15:19:55 | FromDiscord_ | <j$> I gotta sleep been up for like 20 hours can no longer mentally function, I did find this tho, which leads me to believe there's a way without the workaround https://forum.nim-lang.org/t/2668 |
15:29:10 | FromGitter | <mratsim> either the 2 solutions I gave you, or using {.emit: “”” pasteyourheader “””.} |
15:35:37 | * | kapil____ quit (Quit: Connection closed for inactivity) |
15:48:04 | edcragg | a simple question... i have a problem with mutability of struct (tuple) members, for which i'm not sure why they can't be modified (yes, aoc again ;)) http://paste.debian.net/1055157/ |
15:48:41 | edcragg | s/struct/type/ |
15:49:47 | leorize | the default items() iterator does not allow modifying |
15:50:01 | leorize | use `for p in mitems points:` instead |
15:50:41 | * | narimiran joined #nim |
15:51:46 | edcragg | ah, nice, thanks :) couldn't find an alternative iterator, but probably needed to look beyond sequtils |
15:52:43 | leorize | the mitems() iterator is a part of `system` ;) |
15:52:52 | edcragg | yep, that did the trick |
15:56:31 | edcragg | hmm :P |
16:01:37 | * | dom96_w joined #nim |
16:08:29 | * | Trustable joined #nim |
16:11:36 | FromGitter | <arnetheduck> @zacharycarter the reason why it's more interesting to compare nim to rust and D is because there exists a large base of c++ developers that are curious about other languages and are shopping around for the next language to learn - it's a given that c++ is a rational language to learn, but not so with the "startups" |
16:12:32 | FromGitter | <yglukhov> Araq: can you remind me if there's a 2000 functions stack limit? Can't find it in the code... |
16:12:39 | FromGitter | <zacharycarter> @arnetheduck - makes sense |
16:13:37 | FromGitter | <yglukhov> My major stops on the way to nim were C++ and D as well. :) |
16:13:48 | Araq | yglukhov: it exists in excpt.nim, proc nimFrame |
16:14:32 | FromGitter | <yglukhov> right. thanks. |
16:33:22 | * | Perkol quit (Ping timeout: 250 seconds) |
16:34:19 | stefanos82 | @arnetheduck: I personally believe that most C++ developers want to test other tools as well for simpler reasons, such as better toolchain, less code used that more or less produces the same speed and output, and to borrow schematic logic for their own craft that could help them become wiser engineers. |
16:34:23 | stefanos82 | that's my thought though |
16:39:03 | FromGitter | <arnetheduck> @stefanos82 for sure! but there are a lot of attractive languages out there and limited time to try them, so ideally you want to optimize that process somehow |
16:39:16 | stefanos82 | definitely |
16:40:18 | shashlick | i've been fortunate enough to avoid C++. C# and Java for most of my career, too lazy for the verbosity they demand |
16:42:43 | FromGitter | <mratsim> ugh, the C++ build system … CMake is a mess. |
16:46:32 | FromGitter | <arnetheduck> what doesn't kill you makes you stronger |
16:46:46 | * | endragor joined #nim |
16:47:19 | * | Perkol joined #nim |
16:48:05 | stefanos82 | meson builder is a lot cleaner than CMake |
16:48:28 | stefanos82 | *build system that is |
16:50:14 | FromGitter | <arnetheduck> similar to languages, build systems generally need to provide a 10x advantage at least to be worth the leap.. ie modern cmake+ninja is decent enough and has enough of a network effect going for it that switching to anything else is a hurdle |
16:50:37 | FromGitter | <arnetheduck> modern being 3.x+ when they changed a lot of how library deps are expressed |
16:51:51 | * | endragor quit (Ping timeout: 268 seconds) |
16:52:32 | FromGitter | <mratsim> There is hunter as well in C++ |
16:53:41 | * | hoijui joined #nim |
17:12:17 | * | Vladar joined #nim |
17:15:55 | * | Vladar quit (Remote host closed the connection) |
17:19:07 | * | snowolf joined #nim |
17:19:21 | * | Ven`` joined #nim |
17:21:44 | * | gmpreussner_ quit (Ping timeout: 246 seconds) |
17:21:45 | * | gmpreussner joined #nim |
17:28:43 | * | Tyresc joined #nim |
17:29:02 | * | kapil____ joined #nim |
17:30:42 | FromGitter | <zurs> Hi all, I'm currently building a small web application using httpbeast, but there is one thing I can't seem to figure out. I want a table which stores some data, and this table should be "global"(all threads should be able to access this in some way). But obviously the gc-safety gets in the way and httpbeast creates the threads for me which means I don't control what data is sent to the threads. How should I proceed to |
17:30:42 | FromGitter | ... solve this problem? Is it even possible without modifying the httpbeast code in some way? |
17:34:17 | shashlick | you could try https://nim-lang.org/docs/sharedtables.html |
17:39:47 | FromGitter | <zacharycarter> the HCR fork seems to be coming along nicely |
17:39:54 | FromGitter | <zacharycarter> I might try to play around with it this evening if I can get it to build |
17:41:54 | FromGitter | <zetashift> HCR? |
17:41:54 | FromGitter | <zurs> I found that after a while but haven't tried it yet. Won't the compiler complain about gc-safety when accessing the sharedtable in the main thread from the httpbeast thread? I did try a similar solution at first with locks and stuff, but maybe I messed up the ref-objects or something |
17:44:27 | dom96_w | AFAIK sharedtable is specifically created to be shared across threads |
17:44:55 | shashlick | it does the locking/unlocking for you |
17:45:50 | leorize | but the module description discourage you from using GC-ed values as key and/or value... |
17:46:55 | FromGitter | <mratsim> because GC is thread local |
17:48:27 | shashlick | @zurs: a simpler way to do this, if it makes sense, is to build the table at startup and pass it to every thread on startup |
17:48:35 | shashlick | on startup of that thread |
17:48:50 | FromGitter | <zurs> Hmm, so a shared heap is the solution in this case |
17:49:28 | FromGitter | <zurs> Yeah, but httpbeast makes the threads, so haven't found a way to pass my own variables |
17:49:31 | shashlick | of course, you probably don't get to create the thread - httpbeast does, so maybe you could use a channel to pass the data over, but there too it might not work since you might not be able to tell when a thread is created |
17:50:06 | shashlick | what is this shared content? is it on the file system? |
17:51:18 | FromGitter | <zurs> How do you mean? It's just a key-value table that all threads should be able to access |
17:52:10 | shashlick | are you just reading the content in each thread or exchanging data between threads (i.e. threads write to the table) |
17:52:56 | FromGitter | <zurs> Threads do writes to the table too |
17:56:05 | FromGitter | <zurs> This is how it goes when one is just jumping into a language without reading stuff. Had no idea about a shared heap :P |
17:56:37 | FromGitter | <mratsim> Well, some lang don’t give you threading, that eliminates a big class of problems ;) |
17:57:44 | FromGitter | <mratsim> others hide the complexity, so it’s easy to get started with a baseline. And some like Nim are pretty raw, but once you get right it’s good. And also you don’t need to fight the “common case” when you have exceptional need. |
17:57:54 | FromGitter | <mratsim> i.e. pick your tiger |
18:02:33 | FromGitter | <zurs> Yeah, PHP is my main language, but async, threads and a good type-system is very appealing. I really like Nim so far, that's for sure |
18:11:55 | * | Ven`` quit (Ping timeout: 246 seconds) |
18:16:54 | * | Ven`` joined #nim |
18:21:02 | * | floppydh quit (Quit: WeeChat 2.3) |
18:22:50 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:27:46 | * | Ven`` quit (Ping timeout: 250 seconds) |
18:34:36 | * | gangstacat quit (Ping timeout: 252 seconds) |
18:38:22 | * | platoff quit (Read error: Connection reset by peer) |
18:38:54 | * | Ven`` joined #nim |
18:50:13 | * | gangstacat joined #nim |
18:59:53 | * | nsf joined #nim |
19:04:20 | FromDiscord_ | <Virepri> but yeah responding to older messages I pretty much had my C++ and my golang phases before I got to nim, though I did try a couple JVM languages in between |
19:04:30 | FromDiscord_ | <Virepri> I was hesitant to try nim because of the more python like syntax |
19:04:41 | FromDiscord_ | <Virepri> but so far I'm rather liking it |
19:05:44 | * | lucasb left #nim (#nim) |
19:07:17 | * | Vladar joined #nim |
19:11:58 | FromGitter | <arnetheduck> stuff like `sharedtable`/ collection-level locking is rarely the right solution, in general |
19:13:11 | * | masquino quit (Quit: WeeChat 1.9.1) |
19:18:06 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:22:48 | * | Ven`` joined #nim |
19:22:52 | * | Ven`` quit (Remote host closed the connection) |
19:26:06 | FromGitter | <mratsim> no borrow for generics is really annoying :/ |
19:30:14 | FromGitter | <arnetheduck> I thought it was the other way around.. that borrow is annoying and should go away :) |
19:35:18 | FromGitter | <mratsim> I think it’s good. |
19:35:51 | FromGitter | <mratsim> that’s actually one of the loved feature in Ada, and I would guess it would be very useful for physics of to model currencies |
19:35:58 | FromGitter | <mratsim> or* |
19:36:06 | FromGitter | <mratsim> i.e. don’t add miles and meters |
19:36:22 | FromGitter | <Vindaar> Heh, AoC day 10 was fun :D |
19:44:01 | FromGitter | <arnetheduck> oh, that kind of borrow.. I was thinking about the seq-borrow kind that let's you create aliases |
19:52:01 | narimiran | @Vindaar i liked the previous days more |
19:52:32 | * | Perkol quit (Ping timeout: 268 seconds) |
19:53:23 | * | dom96_w joined #nim |
19:58:03 | * | rokups quit (Quit: Connection closed for inactivity) |
19:59:47 | * | dom96_w quit (Ping timeout: 240 seconds) |
20:05:35 | * | nsf quit (Quit: WeeChat 2.3) |
20:08:10 | * | Trustable quit (Remote host closed the connection) |
20:09:46 | FromGitter | <mratsim> that’s the same borrow |
20:10:03 | FromGitter | <mratsim> type MyTree[T] = distinct seq[T] |
20:10:36 | FromGitter | <mratsim> but you can use it to do `type Meters = distinct float` |
20:13:35 | FromGitter | <alehander42> I only think of borrowing a reference to something |
20:13:47 | FromGitter | <alehander42> it's a really confusing term clash :D |
20:14:53 | * | zachk joined #nim |
20:15:21 | * | lritter joined #nim |
20:15:29 | FromGitter | <arnetheduck> oops, nevermind, confused with shallow |
20:15:49 | FromGitter | <Vindaar> @narimiran: I did day 9 und 10 in direct succession. Day 9 was really fun too, but I had some initial problems with the doubly linked ring, which took most of the time to sort out. Slight damper. But I really wondered what the deal was with part 2 of day 9. Long run times in e.g. Python? |
20:16:16 | Zevv | !eval let a = [ int ] |
20:16:18 | NimBot | Compile failed: in.nim(1, 11) Error: internal error: expr(skType); unknown symbol |
20:16:49 | * | zachk quit (Changing host) |
20:16:49 | * | zachk joined #nim |
20:18:43 | FromGitter | <alehander42> Zevv that needs to be a better error message, e.g. "you can't construct an <array> of types" |
20:18:55 | Zevv | Vindaar: my initial part I solution was naive using seqs and modulo arithmatic. Even a -d:release Nim build was not able to spew the part II answer in 15 minutes |
20:19:08 | Zevv | alehander42: that was kind of my point :) |
20:19:32 | FromGitter | <Vindaar> @Zevv: ouch, I wasn't aware a naive solution would be *that* slow. Interesting :) |
20:20:06 | Zevv | kind of limited by memory bandwith I suppose. Every insert or delete is a memcpy |
20:20:33 | Zevv | the list version runs in 500 msec |
20:20:41 | FromGitter | <Vindaar> yep, about the same here |
20:21:16 | Zevv | the seq version with 10 times the marbles takes me about (still waiting....) |
20:21:50 | Zevv | 58 seconds |
20:22:31 | FromGitter | <Vindaar> *know your algorithms....* |
20:22:50 | Zevv | *dont optimize without measuring* |
20:22:54 | FromGitter | <Vindaar> hehe |
20:23:30 | Zevv | wow measuring some timing with the seq code, interesting results |
20:23:32 | Zevv | let me graph that |
20:23:43 | FromGitter | <Vindaar> please do |
20:25:22 | Zevv | https://zevv.nl/div/graph.png. x axis is nr of marbles calculated, y axis is time used in seconds |
20:26:04 | Zevv | is that my L2 cache size showing up, or is this a Nim thing? |
20:26:23 | FromGitter | <Vindaar> interesting shape indeed |
20:31:04 | leorize | Zevv: internal errors are always bugs, so please file an issue for that |
20:31:51 | Zevv | There already is one in github |
20:31:57 | Zevv | albeit more complex example, I added the oneliner |
20:33:25 | Zevv | vindaar: the shape is in the algorithm. If I skip 11 marbles instead of 7, the widht of the curve scales |
20:33:28 | Zevv | funny stuff |
20:34:37 | FromGitter | <Vindaar> hehe, I see |
20:35:38 | * | kapil____ quit (Quit: Connection closed for inactivity) |
20:36:41 | * | miran joined #nim |
20:39:08 | * | narimiran quit (Ping timeout: 246 seconds) |
20:46:36 | * | enthus1ast quit (Ping timeout: 252 seconds) |
20:58:34 | * | miran quit (Ping timeout: 250 seconds) |
20:59:33 | * | enthus1ast joined #nim |
21:40:31 | * | PMunch quit (Remote host closed the connection) |
21:46:54 | * | Jesin joined #nim |
21:48:51 | * | Vladar quit (Remote host closed the connection) |
21:49:42 | * | vlad1777d quit (Ping timeout: 250 seconds) |
21:50:52 | * | Jesin quit (Remote host closed the connection) |
21:57:44 | * | stefanos82 quit (Remote host closed the connection) |
22:07:27 | * | hoijui quit (Remote host closed the connection) |
22:07:48 | * | Jesin joined #nim |
23:24:32 | FromGitter | <zacharycarter> @arnetheduck - what is the right solution then for sharing data across threads? using lock free data structures? |
23:29:10 | * | druonysus quit (Quit: druonysus) |
23:29:26 | * | druonysus joined #nim |
23:29:26 | * | druonysus quit (Changing host) |
23:29:26 | * | druonysus joined #nim |
23:31:03 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:53:02 | * | druonysus quit (Ping timeout: 246 seconds) |
23:59:16 | * | d10n-work joined #nim |