00:01:22 | * | fallback_ joined #nim |
00:28:40 | * | tanami quit (Ping timeout: 276 seconds) |
00:31:00 | * | fallback_ quit (Read error: Connection reset by peer) |
01:06:54 | * | fallback_ joined #nim |
01:14:13 | * | nanxiao joined #nim |
01:14:58 | NimEventer | New post on r/nim by Nerd_mister: Help: code to read text file from Nim basics does not works from Vscodium., see https://reddit.com/r/nim/comments/1247trj/help_code_to_read_text_file_from_nim_basics_does/ |
01:36:05 | * | fallback_ quit (Read error: Connection reset by peer) |
01:52:59 | * | azimut quit (Ping timeout: 255 seconds) |
02:02:15 | * | fallback_ joined #nim |
02:26:04 | FromDiscord | <BobBBob> how can I get the time passed between two DateTimes in a DateTime format? Because I want to show the time since the program began in mins:secs but reading the docs for the times module has me a bit confused |
02:29:00 | FromDiscord | <Nerve> Probably just use `-` |
02:29:15 | FromDiscord | <Nerve> `second_time - first_time` |
02:30:58 | * | fallback_ quit (Read error: Connection reset by peer) |
02:31:43 | FromDiscord | <BobBBob> wow I had typed + by accident when I tried that, that explains a lot |
02:32:13 | FromDiscord | <huantian> Lol |
03:29:43 | * | arkurious quit (Quit: Leaving) |
03:32:35 | * | nanxiao quit (Quit: Client closed) |
03:38:22 | * | nanxiao joined #nim |
04:20:30 | * | nanxiao quit (Quit: Client closed) |
05:37:07 | * | advesperacit joined #nim |
05:46:49 | NimEventer | New thread by arnetheduck: Nim interop with other languages, see https://forum.nim-lang.org/t/10042 |
05:49:27 | * | Goodbye_Vincent quit (Quit: ) |
06:02:08 | * | Onionhammer quit (Quit: Ping timeout (120 seconds)) |
06:02:24 | * | Onionhammer joined #nim |
06:10:35 | * | Goodbye_Vincent joined #nim |
06:26:15 | * | nanxiao joined #nim |
06:38:10 | * | PMunch joined #nim |
07:27:50 | * | rockcavera quit (Remote host closed the connection) |
07:46:14 | * | NimBot joined #nim |
07:57:25 | * | nanxiao quit (Quit: Client closed) |
08:04:51 | * | nanxiao joined #nim |
08:06:30 | * | ltriant quit (Ping timeout: 255 seconds) |
08:09:11 | * | ltriant joined #nim |
08:10:57 | Amun-Ra | I don't see NimMain being called |
08:12:41 | Amun-Ra | I'm not sure how nim types work in exportc functions |
08:12:58 | * | Amun-Ra just wonders out loud |
08:13:14 | PMunch | Tried adding in a call to the library_init, and it doesn't make a difference |
08:13:35 | PMunch | Those `true`/`false` messages in the terminal are not present for me, not sure why they where for @sabrus |
08:22:12 | PMunch | Aha, the reason this fails is that Python seems to pass the strings as UTF-32 |
08:22:40 | PMunch | I did a `echo arg` in `is_end_with` and it just printed "1" |
08:23:27 | PMunch | Then I did a `echo cast[ptr array[8, char]](arg)[]` and it printed `['1', '\x00', '\x00', '\x00', '2', '\x00', '\x00', '\x00']` |
08:25:34 | PMunch | Since C strings are NULL terminated this means that the string as seen by Nim is simply "1" (remember C strings are just a pointer to the first character, with the semantics being that you should read until you find a NULL character) |
08:26:36 | PMunch | By changing the Python code to use `b"1234"` we specify that this is a byte based string, and everything works as it should. |
08:28:44 | PMunch | The final Nim program (hasn't really changed): http://ix.io/4s29/, the final Python program (where the error actually lay): http://ix.io/4s2a/, and the final execution: http://ix.io/4s2b/ |
08:28:50 | PMunch | @sabrus ^ |
08:29:31 | PMunch | Hmm, might not be UTF-32, could just be that it passes it as a uint32 array of some sort |
08:29:56 | PMunch | But the fix is still the same, pass C strings as C strings and not something else. |
08:30:57 | PMunch | Of course this is probably also a good time to mention nimporter: https://github.com/Pebaz/nimporter |
08:50:05 | * | tanami joined #nim |
08:53:12 | * | henrytill joined #nim |
08:55:04 | FromDiscord | <sabrus> sent a long message, see https://paste.rs/h2G |
08:56:44 | * | Phil[m]123 quit (Ping timeout: 250 seconds) |
08:57:05 | * | jmcantrell quit (Ping timeout: 246 seconds) |
08:57:26 | * | frenchboy[m] quit (Ping timeout: 246 seconds) |
08:58:55 | * | derpydoo quit (Ping timeout: 276 seconds) |
09:03:02 | FromDiscord | <sabrus> sent a long message, see http://ix.io/4s2e |
09:03:18 | PMunch | Nim sequences are a small tuple with length, capacity, and a pointer to the data, or something like that |
09:03:44 | PMunch | So Python has no idea how to deal with those, and just guesses something, which in your case ends up printing out the length of the sequence |
09:05:41 | PMunch | Not sure what json_validate does in Python, but my package validates against a compile-time known format (based on typescript), so it won't work for your case. Not sure if anyone has written a JSON schema validator in Nim, but I wouldn't be surprised. Maybe have a look at nimble.directory |
09:13:23 | FromDiscord | <sabrus> i was found what repo, but it is strong outdated for work with 1.6.12, and ...not finished, published to nimble store...↵https://github.com/Vindaar/JsonSchemaValidator↵it's realisation more canonical(for using) |
09:15:36 | PMunch | Hmm, that's a shame |
09:15:51 | PMunch | No sure what that last sentence was supposed to mean |
09:15:52 | * | crem quit (Ping timeout: 265 seconds) |
09:16:21 | FromDiscord | <vindaar> Yeah, I started writing that years ago when I wanted to validate JSON for the plotly and vega-lite schemas. It wouldn't be too much work to get it working on modern nim in case it doesn't right now. |
09:17:35 | FromDiscord | <sabrus> In reply to @PMunch "No sure what that": it mean that ^^canonical^^ jsonschema is .json file, so↵https://json-schema.org/implementations.html#validators↵work with .json files |
09:23:59 | * | Phil[m]123 joined #nim |
09:35:18 | * | Phil[m]123 quit (Quit: Bridge terminating on SIGTERM) |
09:40:23 | * | jmcantrell joined #nim |
09:55:04 | * | nanxiao quit (Quit: Client closed) |
09:55:27 | * | frenchboy[m] joined #nim |
09:55:39 | * | Phil[m]1 joined #nim |
10:15:04 | * | jmcantrell quit (Ping timeout: 252 seconds) |
10:15:08 | * | frenchboy[m] quit (Ping timeout: 246 seconds) |
10:15:19 | * | Phil[m]1 quit (Ping timeout: 265 seconds) |
10:19:55 | * | jmcantrell joined #nim |
10:20:19 | * | frenchboy[m] joined #nim |
10:38:02 | * | Phil[m]1 joined #nim |
10:41:54 | * | nanxiao joined #nim |
10:46:11 | * | nanxiao quit (Client Quit) |
10:51:38 | * | azimut joined #nim |
11:17:10 | * | jmdaemon quit (Ping timeout: 260 seconds) |
12:33:18 | * | derpydoo joined #nim |
12:40:01 | * | Notxor joined #nim |
12:48:37 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/3sp |
12:49:12 | FromDiscord | <sOkam!> (edit) "https://paste.rs/ddT" => "https://play.nim-lang.org/#ix=4s33" |
12:50:35 | * | xet7 quit (Remote host closed the connection) |
12:53:54 | FromDiscord | <Rika> The error seems to be unrelated to the code in your example |
13:16:23 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4s39 |
13:17:12 | FromDiscord | <sOkam!> "instantiation of `default`"... which errors from system |
13:33:51 | * | PMunch_ joined #nim |
13:36:25 | * | PMunch quit (Ping timeout: 252 seconds) |
14:07:02 | * | PMunch_ quit (Quit: Leaving) |
14:10:23 | FromDiscord | <AmjadHD> For anyone interested, can you join the discussion on linguist to help convince the maintainer publish a new version soon to fix nim's syntax highlighting ? https://github.com/github/linguist/discussions/6343. |
14:16:56 | FromDiscord | <djazz> Hmm, getting this on Arch Linux...↵~/.choosenim/toolchains/nim-1.6.12/lib/pure/concurrency/cpuinfo.nim(100, 22) Error: undeclared identifier: 'SC_NPROCESSORS_ONLN' |
14:17:36 | FromDiscord | <djazz> I havent touched nim install or choosenim since update to 1.6.12 a while back, my code was compiling fine yesterday |
14:26:55 | FromDiscord | <djazz> Same on devel |
14:36:32 | FromDiscord | <djazz> hmm |
14:36:45 | FromDiscord | <djazz> seems to be a problem with Futhark. @PMunch XD |
14:37:36 | FromDiscord | <djazz> not sure how you merged my PRs... something broke when doing crosscompile |
14:44:06 | FromDiscord | <djazz> seems to be a problem for #embedded |
14:58:07 | FromDiscord | <djazz> so, importing osproc "my accident" cause it when crosscompiling... |
14:58:13 | FromDiscord | <djazz> by accident |
15:02:21 | FromDiscord | <Zoom> Hey everyone. I need a human-editable config that could be easily decoded into an Object. The only thing that works as-is is YAML, but it's insane and fragile. Can I somehow bend any of our current TOML parsers or maybe even `parsecfg` to read a file with repeating sections to parse them as seq elements? What I need to read looks like this\: https://cpy.pt/WHB526HQ |
15:11:52 | FromDiscord | <Nerve> There's always JSON |
15:12:42 | FromDiscord | <planetis> jsmn had a mode without curly braces but I dont think the port has it |
15:13:32 | FromDiscord | <Zoom> Ok, I'm dumb. The linked text is already a valid TOML, except the first level groups should be in double brackets |
15:14:24 | FromDiscord | <Zoom> Too bad you need quotes for strings in TOML, but I can probably live with it. |
15:16:57 | FromDiscord | <Zoom> Found out status toml\_serializer can't read it's own TOML... |
15:17:36 | * | Notxor quit (Quit: Leaving) |
15:51:43 | * | arkurious joined #nim |
16:37:47 | FromDiscord | <Zoom> Anyone used it? I don't understand how are you supposed deserialize your raw toml into an object, if all value operations on TomlValueRef are not accessible. |
16:43:40 | * | rockcavera joined #nim |
16:45:28 | FromDiscord | <planetis> Its used by nimib |
16:54:15 | FromDiscord | <Zoom> One proglem\: If the toml has interleaved same-named arrays it ignores the nested structure and dumps everything in the same tables. So you must name nested arrays with a `[[parent.name]]`. I think parsetoml doesn't do this. |
16:59:33 | FromDiscord | <Zoom> Nope, it does. It's necessary of course, just my brain melts. |
17:03:26 | FromDiscord | <Zoom> At this point I'm tempted to read TOML, dump it to json and serialize with nimyaml into an object. |
17:06:33 | FromDiscord | <Rika> excuse me |
17:06:39 | FromDiscord | <Rika> that is way too cursed |
17:18:38 | FromDiscord | <auxym> i mostly like TOML but nesting in general is definitely its downside |
17:20:58 | FromDiscord | <Nerve> You know what's good at nesting? |
17:20:59 | FromDiscord | <Nerve> JSON |
17:22:20 | FromDiscord | <auxym> but trailing commas, no comments and all numbers are floats |
17:25:01 | FromDiscord | <Zoom> I fear even TOML might be over the edge for most users, and you suggest JSON. |
17:25:12 | FromDiscord | <Nerve> First is a non issue, second can be overcome with good key name, third is especially a non issue for configs, just parse as ints |
17:25:22 | FromDiscord | <Nerve> (edit) "name," => "naming," |
17:26:03 | FromDiscord | <Zoom> From the link I posted above you can see that what I need is a way to split and annotated CSV into logical blocks \:) |
17:26:16 | FromDiscord | <auxym> json is OK for machine-to-machin ser/deser, but not great for config. config without comments is a no-go for me (there is JSON5 though, I like that) |
17:29:17 | FromDiscord | <Nerve> In reply to @Zoom "From the link I": Like I said, JSON gets you unambiguous nesting. Tabular data might be annoying, but when combining tabular data with deeply nested structure, representing deeply nested structure wins. Just represent your tabular data as structs-of-arrays and parsing can be quite fast. |
17:29:31 | FromDiscord | <Marcus> If I have a type like `Metrics = Table[string, Metric]` shouldn't I be able to call keys() on a variable of this type? 😕 |
17:30:38 | NimEventer | New Nimble package! tigr - A tiny immediate-mode UI library, see https://github.com/angluca/tigr-nim |
17:34:32 | FromDiscord | <Marcus> guess I'm missing something dumb, I see I can iterate over it with `for a in res.keys` but not assign it to a variable with `let foo = res.keys` |
17:35:19 | FromDiscord | <Yardanico> In reply to @Marcus "guess I'm missing something": because keys is an iterator, to iterate over it and get all values in a single line use `toSeq` from sequtils |
17:35:24 | FromDiscord | <Yardanico> `let foo = toSeq(res.keys)` |
17:35:43 | FromDiscord | <Marcus> aaah, thanks! |
17:37:12 | FromDiscord | <Marcus> gonna have to read up on iterators so I actually understand what I'm doing \:) |
17:40:13 | FromDiscord | <Marcus> image.png https://media.discordapp.net/attachments/371759389889003532/1090329511834423367/image.png |
17:40:13 | FromDiscord | <Marcus> that worked great! \:) |
17:47:16 | * | zgasma quit (Quit: leaving) |
17:48:08 | FromDiscord | <sOkam!> @Marcus Might be worth considering `array[MyEnum, Metric]` as an alternative to tables. Don't know the usecase, but checking enums is much simpler than strings, and more efficient. Unless you really really need the strings as identifiers and cannot live with `$MyEnum.Element` as your key stringizer for the output |
17:49:15 | FromDiscord | <sOkam!> or if you need key repeats, that would also rule it out |
17:49:34 | FromDiscord | <Zoom> I already use JSON down the processing chain, but I'm not soulless enough to force it to users as an input format.↵(@Nerve) |
17:50:11 | FromDiscord | <Nerve> I truly never understood what was so difficult about JSON as an input format |
17:50:22 | FromDiscord | <Nerve> So I'm never going to see eye to eye with you there |
17:51:53 | FromDiscord | <Nerve> I appreciate attempts to make nice config formats, but YAML crosses some lines. Simpler is almost always better, JSON and INI are dead-simple. |
17:52:48 | FromDiscord | <Nerve> And yes I know JSON is primarily a data interchange format |
17:52:53 | FromDiscord | <Marcus> I'm getting the strings from a http request tho, would enums work for that?↵(@sOkam!) |
17:52:54 | FromDiscord | <Zoom> YAML is atrocios. No user will ever understand why does he need those dashes and how to put enough spaces for it not to break. |
17:53:58 | FromDiscord | <Zoom> TOML is basically INI and I've been fighting toml\_serialization for almost a day to not crap out on valid TOML |
17:56:25 | FromDiscord | <sOkam!> In reply to @Marcus "I'm getting the strings": should be, but never done it yet. I would imagine there must be a way to map strings to enums, but don't know how |
18:15:07 | FromDiscord | <elucian> I try to learn Go using AI and existing tutorials. I have a blog where I post my progress. Is allowed to share content for other beginners to review and comment my articles? |
18:19:01 | FromDiscord | <Andreas> +1 for CSON for configs. |
18:21:57 | * | Notxor joined #nim |
18:25:52 | FromDiscord | <Zoom> CSON looks reasonable, but we're not exactly have much choice staying strictly in Nim land |
18:27:00 | FromDiscord | <Andreas> In reply to @Zoom "CSON looks reasonable, but": hmm, i missed it so much, i started a nim-parser, and found out, it's really hard to get it right, damn hard.. |
18:27:55 | FromDiscord | <Zoom> BTW, do we have any way to put escaped tripe-quotes into a multiline string besides concatenating? |
18:33:32 | FromDiscord | <Elegantbeef> Make a procedure that converts one to the other |
18:33:40 | FromDiscord | <Elegantbeef> Oh wait misrea |
18:36:15 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4s4L works but implies you do not have `\"` in your stream |
18:37:21 | FromDiscord | <enthus1ast> Since I use more yaml lately for devops or similar, I think that XML is superior \:) |
18:45:01 | FromDiscord | <Rika> I think XML has its uses but not for configuration meant to be handwritten |
18:50:38 | FromDiscord | <enthus1ast> Oh we have, but it's not hcl2\: https://github.com/benumbed/nim-hcl |
18:52:52 | FromDiscord | <planetis> Btw nim json parser already supports comments and its causing a performance issue when parsing formatted data |
19:04:24 | FromDiscord | <Require Support> any idea when nim 2 is planned to be released? |
19:19:12 | FromDiscord | <Andreas> In reply to @Require Support "any idea when nim": according to @ringabout's progress-report https://forum.nim-lang.org/t/10040 i"m confident pretty soon. |
19:19:30 | FromDiscord | <Andreas> (edit) "i"m" => "i''m" |
19:31:24 | FromDiscord | <voidwalker> I'll be really pissed if some basic old bugs don't get fixed in 2.0 |
19:31:26 | FromDiscord | <voidwalker> like https://github.com/nim-lang/Nim/pull/19800 |
19:48:42 | FromDiscord | <Yardanico> @voidwalker it'd be better if you leave a comment on the PR to show your interest |
19:49:15 | FromDiscord | <voidwalker> 1 pending reviewer↵@Varriount↵Varriount was requested for review |
19:49:19 | FromDiscord | <voidwalker> does it depend on this guy now ? |
19:50:08 | FromDiscord | <voidwalker> Not sure what to say and how this works, I thought comments that just bump an issue are not welcomed |
19:54:09 | * | kenran joined #nim |
20:05:40 | * | kenran quit (Remote host closed the connection) |
20:10:05 | * | redj_ is now known as redj |
20:10:15 | * | jmdaemon joined #nim |
20:11:00 | FromDiscord | <dlesnoff> sent a long message, see http://ix.io/4s54 |
20:11:10 | FromDiscord | <dlesnoff> This echoes 0.000s |
20:12:06 | FromDiscord | <dlesnoff> (edit) "http://ix.io/4s54" => "http://ix.io/4s55" |
20:12:18 | FromDiscord | <dlesnoff> (edit) "long message," => "code paste," | "http://ix.io/4s55" => "https://play.nim-lang.org/#ix=4s55" |
20:12:35 | FromDiscord | <dlesnoff> while the same with epochTime echoes 0.100s |
20:12:53 | FromDiscord | <dlesnoff> (edit) "This ... echoes" added "code with `cpuTime`" |
20:13:02 | FromDiscord | <dlesnoff> (edit) "epochTime" => "`epochTime`" |
20:14:05 | FromDiscord | <dlesnoff> but the documentation says that `epochTime` is not suitable for benchmarking |
20:14:20 | FromDiscord | <demotomohiro> You would need to find out how cpuTime was implemented to find out why. |
20:14:30 | FromDiscord | <dlesnoff> (edit) "but the documentation ... says" added "https://nim-lang.org/docs/times.html#epochTime" |
20:14:40 | FromDiscord | <Elegantbeef> I'd suggest using `std/monotimes` anyway |
20:16:02 | FromDiscord | <dlesnoff> When using one over the other ? Do you always use std/monotimes ? |
20:16:37 | FromDiscord | <Elegantbeef> Yes it's low overhead plus you can import `std/[times, monotimes]` and have a nice printout from `getMonoTime() - getMonoTime()` |
20:17:22 | FromDiscord | <demotomohiro> `cpuTime` comment says " Gets time spent that the CPU spent to run the current process in↵ seconds" and your process called `sleep`. So probably your process do nothing while sleep so cpuTime didn't changed |
20:19:19 | FromDiscord | <demotomohiro> `cpuTime` proc calls `clock_gettime(CLOCK_THREAD_CPUTIME_ID, ts)` and it is explained here: https://www.man7.org/linux/man-pages/man3/clock_gettime.3.html |
20:19:20 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4s59 |
20:21:33 | FromDiscord | <dlesnoff> Thank you, I could probably have looked it up myself if I was not tired |
20:22:41 | FromDiscord | <demotomohiro> On posix, `getMonoTime` proc calls `clock_gettime(CLOCK_MONOTONIC, ts)`. |
20:23:43 | FromDiscord | <demotomohiro> So both `cpuTime` proc and `getMonoTime` proc uses same Posix function but the first parameter is different. |
20:29:28 | FromDiscord | <dlesnoff> ok I'll look in my benchmarks to see which one I usually use |
20:31:27 | FromDiscord | <dlesnoff> Yes I use `clock_gettime(CLOCK_MONOTONIC_RAW, &begin);` |
20:44:30 | FromDiscord | <firasuke> how do you group imports from std? |
20:46:22 | FromDiscord | <Elegantbeef> `import std/[...]` |
20:52:14 | * | jjido joined #nim |
20:52:18 | FromDiscord | <firasuke> In reply to @Elegantbeef "`import std/[...]`": on the same line? |
20:52:37 | FromDiscord | <firasuke> also comma separated? |
20:52:55 | FromDiscord | <Elegantbeef> Depends on how many modules, but generally yes same line |
20:53:02 | FromDiscord | <Elegantbeef> Of course comma seperated |
20:53:37 | FromDiscord | <firasuke> oh I thought it would be similar to `let` and `var` |
20:55:13 | * | advesperacit quit () |
20:56:27 | FromDiscord | <voidwalker> Trying to understand all this green threads thing. Looks to me that they're simply manually managed/different semantics async coroutines ? If so, why can't I find a nim library implementing this ? |
20:57:37 | FromDiscord | <Elegantbeef> Async is technically a green thread afaik |
20:57:42 | FromDiscord | <Elegantbeef> > Green threads emulate multithreaded environments without relying on any native OS abilities, and they are managed in user space instead of kernel space, enabling them to work in environments that do not have native thread support. |
20:58:32 | FromDiscord | <Elegantbeef> > When a green thread executes a blocking system call, not only is that thread blocked, but all of the threads within the process are blocked. |
20:58:35 | FromDiscord | <Elegantbeef> Sounds like Async to me |
21:03:10 | FromDiscord | <Gumbercules> In reply to @Rika "I think XML has": was debating this with a couple of people a few weeks ago - apparently XML is pointless now and you should just use JSON (according to the folks I was having the discussion with) |
21:03:28 | FromDiscord | <Gumbercules> In reply to @Elegantbeef "Async is technically a": Not really |
21:04:50 | FromDiscord | <huantian> I think XML is pointless because I don't like XML 😛 ↵nothing else |
21:06:32 | FromDiscord | <Gumbercules> A green thread is a software thread - so it is not scheduled by the operating system kernel. Green threads also don't have their own stack like system threads. |
21:07:19 | FromDiscord | <Gumbercules> Async schedulers generally schedule work on a system thread and they share that system thread. |
21:08:05 | FromDiscord | <Gumbercules> (edit) "Async schedulers generally schedule work on a system thread and they share that system ... thread." added "thread for all scheduled work. Green threads are also typically scheduled on a single system" |
21:08:19 | FromDiscord | <treeform> In reply to @huantian "I think XML is": I support you 100% |
21:08:34 | FromDiscord | <Gumbercules> The big difference is - you can accomplish green threads with a bunch of different concurrency primitives - fibers, closure iterators, continuations etc.... |
21:11:28 | FromDiscord | <Gumbercules> There are no colors when it comes to green threads like with async - green threads can also be moved and yielded to from one system thread to another |
21:11:35 | FromDiscord | <Gumbercules> (edit) "There are no colors when it comes to green threads like with async ... -" added "/ await" |
21:12:46 | FromDiscord | <Gumbercules> Typically with async / await you're going to use a single system thread and that's it - with green threads / fibers / whatever name you like, you will find them most often used in conjunction with a threadpool of some sort and a scheduler that schedules them across these threads |
21:18:12 | FromDiscord | <Gumbercules> It's probably also advisable to use async / await | coroutines for I/O bound work where you'll typically see fibers or software threads utilized for short lived CPU bound tasks |
21:18:37 | FromDiscord | <Gumbercules> if you have long running CPU bound tasks, it's better just to dedicate a worker thread to it |
21:19:28 | FromDiscord | <Gumbercules> In reply to @treeform "I support you 100%": I think it's useful when you want to provide third party extensibility to some specification |
21:22:09 | FromDiscord | <firasuke> how do you hash a file in nim? |
21:22:24 | FromDiscord | <firasuke> (edit) "nim?" => "nim, using std/hashes (Wyhash)?" |
21:24:19 | FromDiscord | <Elegantbeef> Iterate the file accumulating the hash of each line or character |
21:28:48 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
21:31:30 | FromDiscord | <firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4s5u |
21:32:45 | FromDiscord | <Zoom> How do you evaluate it's wrong? |
21:32:45 | FromDiscord | <Zoom> Is it a text or a binary file? |
21:33:16 | FromDiscord | <firasuke> In reply to @Zoom "Is it a text": it's a binary file |
21:33:41 | FromDiscord | <firasuke> or a tarball |
21:34:28 | * | Notxor quit (Quit: Leaving) |
21:36:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4s5w |
21:37:57 | FromDiscord | <firasuke> ok so we're converting the file to a string sequentially and hasing sequentially while accumulating the hash? |
21:38:04 | FromDiscord | <firasuke> (edit) "hasing" => "hashing" |
21:38:23 | FromDiscord | <Elegantbeef> I hear an echo |
21:38:37 | FromDiscord | <firasuke> xD ok cool thanks |
21:39:09 | FromDiscord | <firasuke> also are the symbols `$` and `!$` alike? |
21:39:19 | FromDiscord | <Elegantbeef> There is also md5 in the stdlib |
21:39:36 | FromDiscord | <Elegantbeef> Rtfm std/hashes thanks |
21:40:33 | * | zgasma joined #nim |
21:40:34 | FromDiscord | <firasuke> sigh I read them, I also read the implementation of `secureFileHash`, I just felt very lost |
21:40:48 | FromDiscord | <firasuke> also `std/hashes` doesn't mention what algorithm is being used |
21:41:29 | FromDiscord | <Elegantbeef> Cause it's an internal implementation |
21:41:59 | FromDiscord | <firasuke> so it's not meant to be used the way I am using it |
21:42:24 | FromDiscord | <Elegantbeef> Hash mainly exists to create hash tables/sets |
21:43:08 | FromDiscord | <firasuke> I see |
21:43:23 | FromDiscord | <Elegantbeef> It uses a low collision high speed algorithm, but it does not really matter what it uses internally since it's an implementation detail that is not important |
21:44:18 | * | jjido joined #nim |
21:44:40 | FromDiscord | <Elegantbeef> If you want to have a hash that isnt an implementation detail you use a standard hashing algorithm from a package, the stdlib, or written by yourself |
21:45:07 | FromDiscord | <0ffh> In reply to @huantian "I think XML is": I agree with that sentiment. =) |
21:45:24 | FromDiscord | <firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4s5y |
21:45:37 | FromDiscord | <Elegantbeef> What? |
21:45:37 | FromDiscord | <firasuke> In reply to @Elegantbeef "If you want to": I see, thanks |
21:46:00 | FromDiscord | <firasuke> In reply to @Elegantbeef "What?": we're defining result inside a loop and incrementing it, shouldn't we define it before the loop? |
21:46:13 | FromDiscord | <Elegantbeef> This is Nim a result variable is implicitly declared |
21:46:58 | FromDiscord | <firasuke> oh ok |
21:50:56 | NimEventer | New thread by Angluca: TIGR - tiny graphics library for nim, see https://forum.nim-lang.org/t/10043 |
22:17:06 | * | derpydoo quit (Quit: derpydoo) |
22:29:12 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
22:44:54 | FromDiscord | <sOkam!> What happens in the background if I have a `var myseq :seq[Type]` and then I do `var otherseq = myseq`?↵are the contents given a new reference in the second sequence, or are they copied over one by one? |
22:49:09 | FromDiscord | <Yardanico> nim doesn't do deepcopy by default, so they're just copied normally, references will still point to same memory |
22:52:38 | * | jmdaemon quit (Ping timeout: 250 seconds) |
23:00:31 | * | azimut quit (Remote host closed the connection) |
23:00:57 | * | azimut joined #nim |
23:09:18 | * | jmdaemon joined #nim |
23:15:02 | FromDiscord | <Elegantbeef> Plus cursor inference exists |
23:15:18 | FromDiscord | <Elegantbeef> Which means it's possible `otherseq` is just a pointer to `myseq` |
23:54:31 | * | fallback_ joined #nim |
23:55:28 | * | derpydoo joined #nim |
23:55:52 | * | Guest82 joined #nim |
23:57:09 | * | Guest82 quit (Client Quit) |