00:15:28 | Chuang-Tzu | Nim on HackerRank (Hacker_rank)? As I'm in the process of learning Nim, it occurred to me to upload the .c file. However, "solution.c:34:10: fatal error: nimbase.h: No such file or directory" Any thoughts? |
00:16:20 | GitDisc | <treeform> Varriount, yes it should I will change that. |
00:17:08 | GitDisc | <treeform> Varriount, I could do calender + 1.minute, but I don't know if its that useful. It does look cool though. |
00:17:51 | * | jdhorwitz joined #nim |
00:24:50 | dom96 | flyx: just saw your post on https://www.reddit.com/r/programming/comments/7ctwi7/yaml_sucks/. Nice :) |
00:27:04 | * | Jesin quit (Quit: Leaving) |
00:28:32 | * | vlad1777d_ quit (Ping timeout: 260 seconds) |
00:34:19 | * | libman joined #nim |
00:34:54 | * | jsgrant joined #nim |
00:43:02 | GitDisc | <treeform> cool post, we I kind of knew YAML sux as it so hard to remember the syntax. |
00:43:20 | GitDisc | <treeform> Some one linked to similar post on why JSON sux, http://seriot.ch/parsing_json.php |
00:43:30 | GitDisc | <treeform> and because I like JSON it feels more eye opening. |
01:09:45 | * | jsgrant quit (Remote host closed the connection) |
01:11:59 | * | jdhorwitz quit (Ping timeout: 248 seconds) |
01:22:56 | FromGitter | <Varriount> I work with both JSON and YAML on a daily basis. I prefer YAML. |
01:23:45 | * | marenz__ quit (Ping timeout: 248 seconds) |
01:24:06 | FromGitter | <Varriount> What's really neat is YAML's tagging syntax, which allows you to tag elements with metadata |
01:25:13 | GitDisc | <treeform> I am sure you can get used to YAML, but when ever I have to touch it I always have to have to have the YAML docs open. Not so with JSON. |
01:28:38 | FromGitter | <Varriount> treeform: Do you work with Python at all? |
01:29:57 | GitDisc | <treeform> Yes I do. |
01:35:53 | * | jinshil joined #nim |
01:38:15 | * | JappleAck quit (Quit: Leaving) |
01:38:46 | * | kalkin-- joined #nim |
01:42:25 | * | kalkin--- quit (Ping timeout: 248 seconds) |
02:15:59 | * | MJCaley joined #nim |
02:25:52 | * | jsgrant joined #nim |
02:40:51 | * | yglukhov joined #nim |
02:45:20 | * | yglukhov quit (Ping timeout: 268 seconds) |
02:58:07 | * | chemist69 quit (Disconnected by services) |
02:58:12 | * | chemist69_ joined #nim |
02:58:54 | * | craigger quit (Ping timeout: 246 seconds) |
02:59:41 | * | craigger joined #nim |
03:00:07 | * | endragor joined #nim |
03:01:22 | * | SenasOzys quit (Ping timeout: 268 seconds) |
03:11:07 | * | endragor quit (Remote host closed the connection) |
03:11:38 | * | endragor joined #nim |
03:12:20 | GitDisc | <awr> is there a proc in the nim standard lib way to check if the OS is amd64 (whether or not the executable is 32-bit) |
03:14:03 | FromGitter | <Varriount> awr: https://nim-lang.org/docs/system.html#hostCPU |
03:14:19 | FromGitter | <Varriount> There might also be a symbol defined, but that's the publically documented way. |
03:14:49 | FromGitter | <Varriount> You can do `when hostCPU == "...":` |
03:14:50 | GitDisc | <awr> thanks! |
03:15:19 | FromGitter | <Varriount> Actually, that's something that should be documented - the conditional symbols that one can use at compile time. |
03:16:03 | FromGitter | <Varriount> awr: Looks like you can also do "when defined(amd64):", although it's not documented. |
03:17:08 | FromGitter | <Varriount> awr: What are you trying to do? |
03:19:49 | GitDisc | <awr> making a build system thing |
03:20:00 | GitDisc | <awr> with nake |
03:21:51 | GitDisc | <awr> there are some variables i have for CPU, OS to compile for, etc. and when they are undefined i want them to match the system it's being built on |
03:26:02 | GitDisc | <awr> when defined(amd64) won't really work as i'm trying to tell if the OS is amd64, not the executable |
03:30:19 | GitDisc | <awr> if i recall nim compiler will just build automatically for the CPU arch it's being compiled on when --cpu is not specified, which would be fine |
03:30:45 | GitDisc | <awr> but i want i386 and amd64 builds to be put in different directories |
03:51:00 | GitDisc | <awr> idk if that made any sense |
03:53:49 | GitDisc | <awr> i'm an idiot |
03:54:03 | GitDisc | <awr> i should just use defined(amd64) instead of this OS detection nonsense |
03:54:05 | * | libman quit (Quit: Connection closed for inactivity) |
03:54:14 | * | sz0 joined #nim |
03:55:53 | * | mwbrown quit (Ping timeout: 250 seconds) |
03:58:06 | * | mwbrown joined #nim |
05:01:04 | * | dddddd quit (Remote host closed the connection) |
05:02:41 | * | jdhorwitz joined #nim |
05:07:10 | * | jdhorwitz quit (Ping timeout: 268 seconds) |
05:17:49 | Chuang-Tzu | Is there an option to generate a .c file w/out the dependency on nimbase.h? |
05:32:14 | FromGitter | <Varriount> Chuang-Tzu: Why? |
05:32:34 | FromGitter | <Varriount> nimbase.h contains the low-level C definitions requires for Nim programs to compile. |
05:38:13 | Chuang-Tzu | FromGitter, I want to upload the .c file to hakerrank.com, since they don't have Nim support. |
05:38:15 | FromGitter | Chuang-Tzu, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
05:39:45 | Chuang-Tzu | Varriount: |
05:42:46 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
06:02:18 | * | jdhorwitz joined #nim |
06:06:25 | * | jdhorwitz quit (Ping timeout: 248 seconds) |
06:11:49 | * | skrylar joined #nim |
06:27:35 | * | endragor quit (Remote host closed the connection) |
06:39:44 | * | nsf joined #nim |
06:43:37 | FromGitter | <vegansk> Hello everybody. I'm glad to introduce the library for database schema migrations, similar to flywaydb :-) https://github.com/vegansk/dbschema |
06:44:28 | skrylar | neat. |
07:03:01 | * | endragor joined #nim |
07:03:27 | * | sz0 quit (Quit: Connection closed for inactivity) |
07:07:21 | * | endragor quit (Ping timeout: 240 seconds) |
07:21:51 | * | endragor joined #nim |
07:27:52 | skrylar | seems to be a bit of database work going on in nim as of late |
07:36:41 | * | Arrrr joined #nim |
07:36:41 | * | Arrrr quit (Changing host) |
07:36:41 | * | Arrrr joined #nim |
07:39:31 | * | PMunch joined #nim |
07:42:01 | * | lurker joined #nim |
07:42:42 | FromGitter | <Varriount> Chuang-Tzu: They don't support multiple files? If not, you can just include it by hand |
07:43:17 | * | yglukhov joined #nim |
08:01:04 | * | arnetheduck quit (Ping timeout: 268 seconds) |
08:02:33 | * | gokr joined #nim |
08:07:39 | * | arnetheduck joined #nim |
08:10:57 | * | arecaceae quit (Remote host closed the connection) |
08:11:16 | * | arecaceae joined #nim |
08:23:23 | FromGitter | <mratsim> Also you must use the same OS as them or cross compile since Nim C is platform specific |
08:24:28 | * | claudiuinberlin joined #nim |
08:24:29 | FromGitter | <mratsim> Btw toml seems nicer than YAML for config |
08:27:43 | * | cspar quit (Ping timeout: 248 seconds) |
08:51:42 | FromGitter | <Varriount> @mratsim TOML doesn't have metadata tags. |
08:51:53 | FromGitter | <Varriount> Does it have ordered maps? |
08:53:37 | couven92 | Araq, regarding PR #6640, i merged in origin/devel, but there still seem to be issues with the httpclient tests on AppVeyor (ref.: https://ci.appveyor.com/project/Araq/nim/build/2261/tests ) |
08:54:27 | Araq | couven92: we need to disable this test for appveyor then |
08:54:32 | Araq | it's flaky |
08:54:47 | couven92 | should I create a new PR for that then? |
08:55:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
08:58:41 | * | yglukhov joined #nim |
08:58:52 | skrylar | well, i like yaml. the difference between yaml and toml, though, is that toml's spec is maybe ~20 pages in pdf, while yamls is 100 |
08:59:15 | skrylar | the division seems to be (these days) TOML for user-edited configs, and JSON for machine data |
08:59:48 | skrylar | although Godot has switched entirely over to toml now, for some reason. think it had to do with storing data in git? |
09:00:16 | * | endragor quit (Remote host closed the connection) |
09:00:19 | skrylar | they're also doing hashmaps that remember insertion order for the same reason; to minimize the size of git diffs |
09:01:40 | * | jinshil quit (Quit: Good-bye!) |
09:05:07 | FromGitter | <alehander42> toml seems just a bit limited currently tho |
09:05:51 | FromGitter | <alehander42> I've used yaml even for generated/intermediate data format, just because it's so much easier to read than json |
09:07:06 | skrylar | it's not meant to be all-inclusive |
09:09:10 | skrylar | nimble says we have a yaml implementation. should check it out and see how good that is |
09:09:28 | skrylar | One thing of note is that simpler data formats = smaller code = less wasted resources and smaller attack surface |
09:19:14 | * | endragor joined #nim |
09:23:24 | Araq | couven92: ok but copy what I did for 'travis' in the tester |
09:23:41 | FromGitter | <mratsim> NimYAML is top notch since it's made by flyxwho was promoted to core YAML dev |
09:23:56 | Araq | ^^ indeed. |
09:24:02 | couven92 | Araq, what did you do for travis in the tester? I was gonna branch of current origin/devel for new PR |
09:24:13 | Araq | just grep for it |
09:24:20 | couven92 | okay |
09:24:46 | Araq | how does C++'s __compressed_pair work? |
09:25:44 | * | willc joined #nim |
09:25:57 | Araq | never mind, I know how it works |
09:27:15 | couven92 | Araq, nimgrep does not return anything for travis (did `nimgrep travis .`) |
09:27:45 | Araq | nimgrep travis --ext:nim --recursive tests/testament |
09:28:02 | couven92 | thx! |
09:28:32 | Araq | http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2554.pdf so ... in order to support "allocators" C++ only had to inject this concept into every STL container |
09:28:53 | crem | I once travelled with HDD and at border control I was asked to show how it works! |
09:29:09 | crem | Luckily I didn't travel with __compressed_pair. |
09:29:23 | FromGitter | <alehander42> HAHAH |
09:29:39 | Araq | the similarities to what I attempted to do with regions are stunning |
09:33:11 | couven92 | Araq, for tests: how to disable for multiple things? comma-separated list of strings, or two disabled statements? |
09:33:37 | Araq | disabled: ["travis", "appveyor"] iirc |
09:33:42 | couven92 | great! |
09:33:53 | Araq | or maybe your solution, can't remember |
09:34:32 | Araq | crem: it seems much better to distinguish between memory and resources... |
09:35:05 | Araq | we need the concept of an "important destructor" |
09:36:04 | Araq | free() # an unimportant destructor |
09:36:13 | Araq | close() # an important destructor |
09:36:48 | Araq | when I use a memory region for allocations I can skip every unimportant destructor call |
09:37:06 | Araq | but must still care about the important destructors |
09:40:03 | * | salewski joined #nim |
09:40:27 | crem | Not sure that I have all the context. When I complained about missing of the destructors, I indeed mostly meant non-memory resources, as GC would more or less care about the memory. |
09:43:06 | salewski | Does someone know what that expandArgs means, mentioned yesterday as "expandArgs setCol(context), Color" |
09:43:28 | salewski | I can not find expandArgs in stdlib or manual. |
09:47:41 | Araq | salewski: it's what Nim allows to be implemented, today |
09:47:47 | Araq | it doesn't exist yet |
09:48:08 | Araq | variations are also possible like |
09:48:18 | Araq | setCol(context)**Color |
09:48:22 | Araq | setCol(context)*Color |
09:48:40 | salewski | OK, thanks. |
09:48:41 | Araq | unpack setCol, context, Color |
09:49:27 | Araq | but not |
09:49:39 | Araq | setCol(context, unpack Color) ;-) |
09:50:03 | Araq | I tried to explain why yesterday |
09:50:05 | salewski | OK, bye. |
09:50:11 | * | salewski quit (Quit: WeeChat 1.9.1) |
09:50:59 | couven92 | okay Araq new PR https://github.com/nim-lang/Nim/pull/6744, test running now. The solution was to have two disabled statements, doing the array notation breaks |
09:51:29 | couven92 | running the GitHub CI tests now |
09:57:44 | * | jsgrant quit (Ping timeout: 255 seconds) |
10:00:52 | * | salewski joined #nim |
10:03:25 | salewski | Porting some Ruby code, I still wonder why direct multiplication of int with float is not supported: |
10:03:30 | salewski | pda.hadjustment.setUpper(pda.darea.allocatedWidth.float * pda.userZoom) |
10:03:48 | salewski | Why have I to write .float ? |
10:03:57 | * | xkapastel quit (Quit: Connection closed for inactivity) |
10:04:31 | salewski | It may be about precision, but when result of multiply is float we do not expect exact precision. |
10:04:42 | * | marenz__ joined #nim |
10:04:53 | salewski | Is it about possible overflow? |
10:05:27 | crem | That's called Starke Typisierung! |
10:06:11 | * | chemist69_ quit (Ping timeout: 240 seconds) |
10:06:35 | * | chemist69 joined #nim |
10:06:41 | salewski | Unfortunately I have some expresions with ints and floats, I can not really avoid it, so many .float looks not that nice. |
10:07:24 | salewski | Of course I can define my own * proc for that... |
10:07:33 | crem | I don't know nim well, but I guess you can define the *, yes. |
10:08:11 | Araq | the paradigm of system.nim is generally, operator: T * T -> T |
10:08:26 | salewski | Yes I can, but I would like to know why it is not available by default. Just in case someone ask me. |
10:08:33 | Araq | not T * U -> GuessType(T, U) |
10:08:54 | FromGitter | <mratsim> Only int32 can be fully represented as float64 |
10:09:03 | Araq | salewski: integers do not convert to float because it's impossible without losing information |
10:09:21 | Araq | yes, what mratsim said |
10:09:25 | crem | I wonder if FPU has double*int as a separate instruction (I guess not). But if it does, it would make sense to enable that in language. |
10:09:38 | Araq | crem: pretty sure it doesn't |
10:09:49 | FromGitter | <mratsim> It doesn't |
10:10:04 | salewski | Yes, but when floats are involved we all know that we have no exact precision, so we expect loosing information. |
10:10:25 | FromGitter | <mratsim> There is imul for integer (1 cycle) and another instruction I don't remember for double |
10:10:31 | Araq | implicit conversions must not lose information in Nim. |
10:11:07 | salewski | OK, I will try to remember that. Not a real problem for me. |
10:11:16 | Araq | converter toFLoat*(x: int): float # maybe you want that |
10:11:45 | salewski | Yes I know that that is possible. |
10:11:48 | crem | There is some FIMUL 8087 instruction.. |
10:12:19 | crem | I cannot find the description for it so far though. |
10:12:30 | Araq | I could also live with a lenient.nim stdlib module that adds more pluses and muls etc |
10:12:49 | crem | http://x86.renejeschke.de/html/file_module_x86_id_104.html <- so it seems that there is double*int instruction in FPU |
10:13:13 | FromGitter | <mratsim> If Intel/AMD could remove all the hardware support for useless instructions we could have at least 20~30% more die space I guess ;) technical debt at its shiniest. |
10:13:53 | Araq | mratsim: I think it was 3% |
10:14:21 | Araq | the caches take up most of the space anyway |
10:14:43 | FromGitter | <mratsim> FIMUL works only for int32 @crem |
10:14:51 | FromGitter | <mratsim> Oh :/ |
10:16:11 | * | salewski quit (Quit: WeeChat 1.9.1) |
10:18:36 | FromGitter | <mratsim> Tail call optimization (2009 article) gets discussed again on HN: https://news.ycombinator.com/item?id=15694633 |
10:18:47 | Araq | "When the i7 detects a loop and if the loop can fit all of its converted micro-code into the instruction cache, it will shut down the decoder to save power." |
10:18:52 | Araq | https://www.anandtech.com/show/3593 |
10:26:02 | * | floppydh joined #nim |
10:31:31 | * | Vladar joined #nim |
10:34:11 | couven92 | Araq, okay commit https://github.com/nim-lang/Nim/pull/6744 that disables thttpclient is ready to merge, and with that PR merged, I can also complete the `asArray` macro and make that one green as well |
10:40:22 | skrylar | mratsim: arguably if we just used risc then we would save even more :> |
10:50:42 | hohlerde | how would you model an opaque C type in nim, so that you can use it for c library calls? |
10:50:43 | hohlerde | e.g. typedef struct libusb_device libusb_device; |
10:50:44 | hohlerde | and the function's parameter is libusb_device *** list |
10:51:26 | * | beatmox quit (Remote host closed the connection) |
10:52:34 | Araq | type libusb_device = object |
10:56:22 | * | hohlerde sent a long message: hohlerde_2017-11-15_10:56:22.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/kBnPOHpxqUbLgxdVZJCKteSC> |
10:56:39 | hohlerde | is that the way one would do it or is there a better way? |
10:57:41 | hohlerde | I am asking because I am experiencing memory problems with the list returned by the libusb library |
10:58:39 | hohlerde | and only when compiling for 32bits (using libusb 32bit binary distribution) on windows |
11:03:21 | Araq | libusb is broken on 32bits |
11:03:36 | Araq | and Nim has nothing to do with it, looked at it years ago ... |
11:10:23 | couven92 | Hmmm... I am putting a char to Rune converter into the unicode module... writing `'_'.Rune` is a bit inconvenient |
11:11:19 | couven92 | I am also thinking of wrting a string to Rune converter, to simplify doing `"å".runeAt(0)` |
11:12:37 | couven92 | Although, the string to unicode is kina dangerous... maybe that should be a macro that accepts a string? |
11:12:45 | couven92 | a static string I mean |
11:14:21 | skrylar | Araq, admittedly 32 bit systems are awkward to find these days |
11:24:58 | Arrrr | I-i don't agree |
11:26:42 | * | jdhorwitz joined #nim |
11:31:13 | * | jdhorwitz quit (Ping timeout: 248 seconds) |
11:33:43 | skrylar | Arrrr, where are you finding them? |
11:34:09 | skrylar | Mobile? Old point of sale terminals? |
11:36:22 | crem | I have some 32-bit fit-pcs running at home. Annoyingly hard to find a linux distro for them. |
11:37:05 | federico3 | embedded / SBCs |
11:37:36 | Arrrr | In my heart |
11:42:37 | * | SenasOzys joined #nim |
11:43:33 | * | floppydh quit (Quit: WeeChat 1.9.1) |
11:44:23 | * | floppydh joined #nim |
11:55:55 | hohlerde | araq: thx and I am glad I'm not the only experiencing these problems |
11:56:28 | crem | Being glad for others having problems is not nice! |
12:02:42 | hohlerde | crem: sorry, I don't mean it that way. |
12:07:48 | FromGitter | <mratsim> I think he was just messing with you |
12:08:25 | crem | Yep I wasn't serious, sorry. |
12:10:55 | FromGitter | <mratsim> The end is near: Python2 is on it dying bed: https://github.com/numpy/numpy/blob/master/doc/neps/dropping-python2.7-proposal.rst |
12:15:10 | skrylar | crem: doesn't debian still target i386 |
12:15:43 | crem | Yes, that's why I have to use it and not, say, arch. |
12:16:23 | skrylar | I appreciate how much easier pacman is to use than apt |
12:16:46 | skrylar | Making debs isn't super hard from what i can tell, but there's more to it than just "copy pkgbuild snippet, done" |
12:16:53 | FromGitter | <mratsim> I’m always confused by apt-get, apt-search, apt-cache, apt-whatever ... |
12:17:16 | skrylar | i 'downgraded' to sid on a laptop, going to on the desktop when the files are in order |
12:17:24 | couven92 | @mratsim, when in an interactive shell, use simply `apt` |
12:17:30 | skrylar | Arch never detonated my desktop, but i like sharing packages between computers |
12:17:44 | FromGitter | <mratsim> detonated? |
12:18:04 | skrylar | i keep getting arch updates that bork the install on a laptop and requires dropping to shell to deal with !FUN! |
12:21:57 | FromGitter | <mratsim> Ah, the last one for me was due to systemd. Systemd revealed a bug in a kernel driver and eth0 did not autostart anymore. Fun time for a server …. |
12:22:22 | skrylar | debian almost ended up not using systemd ._. |
12:22:24 | FromGitter | <mratsim> https://bugs.archlinux.org/task/55993 |
12:33:07 | FromGitter | <mratsim> is there a extension convention for file serialized through marshal? .marshal? |
12:33:52 | FromGitter | <mratsim> maybe soldier since they are file and rank and not marshal ;) |
12:35:06 | Araq | .json ... |
12:36:46 | skrylar | or something that identifies it as what you're storing |
13:00:58 | * | Snircle joined #nim |
13:06:19 | * | elrood joined #nim |
13:29:58 | skrylar | bleh, need a nap. next chunk of firebird stuff is the weird datatypes like their date/times and blobs |
13:33:04 | skrylar | I have no idea how many people will actually use this. It's a back and forth debate over letting parts of the API remain C-like because meh, or trying to use macros to make it better. Like the XSQLVAR types |
13:33:39 | skrylar | its easy enough to have shortcut templates that just set the type and replace a pointer to a local value in one neat "set variable 2 to this long var" |
13:34:00 | Araq | C-lovers will use nothing but C anyway, give us Nim specific things :-) |
13:42:14 | * | dddddd joined #nim |
13:47:56 | * | floppydh quit (Quit: WeeChat 1.9.1) |
13:48:02 | * | Arrrr1 joined #nim |
13:48:02 | * | Arrrr quit (Disconnected by services) |
13:53:48 | hohlerde | omg, found the problem |
13:55:14 | hohlerde | libusb binary distributions for windows are compiled with stdcall convention. the nim wrapper for libusb uses cdecl hardcoded. |
14:00:17 | crem | There is/will be nothing like unique_ptr in nim, is there? I'm trying to use sdl2 wrapper, and it's easy to forget to release resources, I miss RAII. |
14:00:18 | Araq | hohlerde: nice catch :-) |
14:00:38 | Araq | crem: it's in the works |
14:02:21 | * | jdhorwitz joined #nim |
14:03:02 | * | floppydh joined #nim |
14:03:24 | dom96 | hohlerde: oh man |
14:03:30 | dom96 | I was going to suggest that... |
14:04:05 | hohlerde | you already did by mentioning the corrupted stack |
14:04:13 | dom96 | But I didn't because you said it worked with the previous version of Nim |
14:04:28 | yglukhov | crem: there are finalizers. less deterministic, and require additional allocation, but could be of use. |
14:04:31 | dom96 | I'm still wondering how that could have been |
14:05:38 | yglukhov | crem: actually i found finalizers to be "deterministic enough" for acyclic types. |
14:06:21 | hohlerde | libusb provides mingw and vc binary distributions. maybe I accidentally used the mingw one with the previous nim version |
14:08:52 | hohlerde | mhm, mingw behaves the same. well, I messed it up, that's for sure :) |
14:13:18 | dom96 | AFAIK all Windows libraries in general use stdcall |
14:14:11 | hohlerde | so, now I'll try to set the callconv dynamically |
14:14:56 | yglukhov | hohlerde: why? that's something that should be known statically |
14:15:25 | hohlerde | the wrapper works for mac, linux and windows libs |
14:26:19 | avsej | hi guys. I saw in some places nim tests compare floats using == operation. https://github.com/nim-lang/Nim/blob/devel/lib/pure/stats.nim#L313-L319 Is it done intentionally? It does not look reliable and portable to me. Why not use subtract and compare result in some bounds? |
14:28:15 | * | d10n-work joined #nim |
14:30:00 | * | skrylar quit (Remote host closed the connection) |
14:31:05 | * | redlegion quit (Ping timeout: 240 seconds) |
14:31:11 | * | dddddd quit (Ping timeout: 240 seconds) |
14:31:20 | * | redlegion joined #nim |
14:31:20 | * | redlegion quit (Changing host) |
14:31:20 | * | redlegion joined #nim |
14:31:36 | avsej | proper assertion should do something like this http://floating-point-gui.de/errors/comparison/. If I make patch to fix all float comparisons, would you consider it, @Araq? |
14:32:51 | FromGitter | <andreaferretti> @avsej it depends |
14:33:04 | FromGitter | <andreaferretti> Sometimes you may want to check that some floats are actually equal |
14:33:15 | FromGitter | <andreaferretti> Think of the case where you do not perform any operations on them |
14:33:16 | avsej | you mean bit-to-bit? |
14:33:21 | FromGitter | <andreaferretti> Yup |
14:33:29 | avsej | but in this case you should not compare them as floats |
14:33:39 | FromGitter | <andreaferretti> Say I have a struct person with may fields |
14:33:40 | avsej | but rather convert to some binary strings |
14:33:45 | FromGitter | <andreaferretti> One of them is a float |
14:33:58 | FromGitter | <andreaferretti> Now I have a sequence of such structs |
14:34:06 | FromGitter | <andreaferretti> I perform some operation on the sequence |
14:34:12 | FromGitter | <andreaferretti> And I want to test the result |
14:34:38 | FromGitter | <andreaferretti> For instance, the operation I test selects the first person with some property |
14:34:50 | FromGitter | <andreaferretti> My test checks that this is equal to a given person |
14:34:58 | FromGitter | <andreaferretti> Here I should have equality |
14:35:04 | FromGitter | <andreaferretti> I didn't even touch floats |
14:35:15 | FromGitter | <andreaferretti> At most they were copied inside sequence operations |
14:35:39 | FromGitter | <andreaferretti> My point is - floats *can* be exactly equal for good reaons |
14:35:55 | FromGitter | <andreaferretti> When you are testing something else than floating point operations |
14:36:54 | FromGitter | <andreaferretti> Sometimes you want approximate equality - that is fine, you can use another operator as I do here https://github.com/unicredit/neo#equality |
14:37:35 | * | dddddd joined #nim |
14:38:17 | FromGitter | <andreaferretti> `unittest` could have some custom assertions for floats as well |
14:41:25 | avsej | i see, but right now I'm seeing lots of errors in places like I've pointed above, where tests compare results of some calculation to constants, which does not fall into category of identity comparison |
14:42:08 | avsej | those error triggered when I build with OS-recommended compiler flags (I'm using Fedora) |
14:42:35 | avsej | and fails everywhere except x86_64 :) |
14:43:09 | avsej | which I bet the most popular one and it might be very few people care to run tests on the others |
14:52:48 | * | jsgrant joined #nim |
14:56:09 | * | floppydh quit (Quit: WeeChat 1.9.1) |
14:57:36 | FromGitter | <andreaferretti> can you point to these tests? |
14:57:45 | FromGitter | <andreaferretti> It seems to me it would make more sense to fix those |
14:58:47 | FromGitter | <couven92> @Araq @dom96 |
14:58:58 | avsej | sure, this is the log from i686 platform: https://kojipkgs.fedoraproject.org//work/tasks/4592/23144592/build.log, scroll down to the bottom, or search page for "Error: " |
15:00:26 | avsej | slightly different but from the same ballpark on ppc64: https://kojipkgs.fedoraproject.org//work/tasks/4591/23144591/build.log |
15:02:04 | avsej | it uses default nim.cfg with just two lines added in the bottom |
15:02:06 | avsej | gcc.options.always %= "${gcc.options.always} -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -fasynchronous-unwind-tables" |
15:02:07 | avsej | gcc.options.linker %= "${gcc.options.linker} -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld" |
15:03:26 | FromGitter | <couven92> I have finally gotten back to playing with unicode again... as soon as the disabled httpclient test is merged in, we can merge the asArray macro as well, and then we can use it in unicode! :) |
15:04:05 | * | gokr quit (Ping timeout: 240 seconds) |
15:05:33 | * | lurker quit (Quit: Leaving) |
15:21:54 | FromGitter | <mratsim> Somehow I read that as asAraq |
15:26:04 | avsej | I managed to minimize floats issue this this one: https://gist.github.com/avsej/f0f98bf64a142c9e6e9b988aa054281d |
15:26:33 | avsej | it is sensitive to -O level, -O2 breaks it on all platforms except x86_64 |
15:26:58 | Araq | avsej: please report the failing tests |
15:33:42 | avsej | ok. I will do it |
15:40:25 | avsej | hm, actually this case is documented in GCC: https://gcc.gnu.org/wiki/FAQ#PR323 |
15:40:56 | avsej | Araq, I will just list sensitive tests, and they will be fixed not to use ==? |
15:41:04 | * | PMunch quit (Quit: Leaving) |
15:50:28 | * | joshbaptiste quit (Ping timeout: 240 seconds) |
15:55:45 | federico3 | quiz: q=@["", "foo", "bar"]; q.del(0) what's q now? |
15:56:02 | avsej | @["foo", "bar"]? |
15:57:52 | * | sz0 joined #nim |
15:59:51 | federico3 | https://tio.run/##y8vM/f@/LLFIoVDBVsEhWklJR0EpLT8fRCUlFinFWisU6qWk5mgYaForpCZn5CsU/v8PAA |
16:00:39 | federico3 | !eval var q = @["", "foo", "bar"]; q.del(0); echo q |
16:00:42 | NimBot | @[bar, foo] |
16:04:29 | * | joshbaptiste joined #nim |
16:07:49 | * | nitely joined #nim |
16:08:23 | nitely | can unicode module be removed from nimScript? |
16:10:41 | nitely | I'd like to have a function that can process runes from a stream, but that requires unicode module to import streams |
16:11:05 | nitely | and streams can not be a NimScript |
16:11:14 | nitely | so wondering if that would be an issue in the first place |
16:11:47 | * | Jesin joined #nim |
16:11:56 | Araq | avsej: they will be fixed yes |
16:12:46 | Araq | nitely: you can wrap your new proc/import in 'when not defined(nimscript)' |
16:15:19 | nitely | Araq: awesome, that works! |
16:15:40 | * | nsf quit (Quit: WeeChat 1.9.1) |
16:16:01 | nitely | thanks! |
16:17:54 | * | gokr joined #nim |
16:18:23 | Araq | you're welcome |
16:19:14 | avsej | Araq, btw another issue with tests: https://github.com/nim-lang/Nim/pull/6703 |
16:23:22 | dom96 | yay, got my Nim t-shirt :D |
16:25:35 | * | gokr quit (Ping timeout: 240 seconds) |
16:25:53 | FromGitter | <brentp> does a nimble package have to be at the root git directory? I'd like to have a single repo with a few sub-projects each with their own nimble packge. |
16:28:26 | * | Arrrr1 quit (Quit: Leaving.) |
16:29:39 | * | jdhorwitz quit (Quit: WeeChat 1.9.1) |
16:30:00 | avsej | Araq, it turned out that there are not many such broken float tests :) https://github.com/nim-lang/Nim/issues/6747 |
16:30:04 | avsej | only two |
16:30:18 | * | ShalokShalom joined #nim |
16:33:01 | federico3 | brentp https://github.com/nim-lang/nimble/issues/421 |
16:37:47 | * | enthus1ast- joined #nim |
16:41:33 | FromGitter | <brentp> federico3: cheers |
16:50:30 | * | jsgrant quit (Ping timeout: 246 seconds) |
17:00:24 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
17:02:53 | FromGitter | <mratsim> @federico3 that is surprising |
17:02:57 | FromGitter | <mratsim> !eval var q = @["", "foo", "bar"]; q.del(0); echo q |
17:02:59 | NimBot | @[bar, foo] |
17:03:00 | couven92 | Uhm, can someone force refresh github? I get no stylesheets, javascript or anything... just the regular HTML... Force flushed Browser cache, DNS resolver cache, someone else having this issue right now? |
17:03:13 | * | JappleAck joined #nim |
17:04:06 | federico3 | it is |
17:04:28 | FromGitter | <mratsim> I used to use del and insert to hold dimensions metadata and I didn't have this ordering issue in my tests ^o/ |
17:05:00 | FromGitter | <mratsim> !eval var q = @["1", "foo", "bar"]; q.del(0); echo q |
17:05:02 | NimBot | @[bar, foo] |
17:05:28 | * | Trustable joined #nim |
17:05:28 | federico3 | !eval var q = @["1", "2", "3", "4"]; q.del(0); echo q |
17:05:30 | NimBot | @[4, 2, 3] |
17:05:41 | federico3 | it's adding back the last element |
17:08:07 | FromGitter | <mratsim> !eval var q = @[1, 2, 3]; q.del(0); echo q |
17:08:10 | NimBot | @[3, 2] |
17:08:20 | FromGitter | <andreaferretti> I think the point is making `del` O(1) |
17:08:41 | * | endragor quit (Remote host closed the connection) |
17:08:47 | FromGitter | <mratsim> It should preserve order though |
17:08:50 | FromGitter | <andreaferretti> so it just puts the last element in the slot that remains free |
17:08:59 | FromGitter | <andreaferretti> It cannot without moving everything |
17:09:40 | FromGitter | <freevryheid> hi, trying to format a float to 3 significant digits such that when f = 0.1 then $f = "0.100", any suggestions? |
17:09:49 | FromGitter | <andreaferretti> https://nim-lang.org/docs/system.html#del,seq[T],Natural |
17:10:01 | FromGitter | <andreaferretti> https://nim-lang.org/docs/system.html#delete,seq[T],Natural |
17:10:13 | FromGitter | <andreaferretti> there exist both `del` and `delete` |
17:10:30 | FromGitter | <andreaferretti> !eval var q = @[1, 2, 3]; q.delete(0); echo q |
17:10:32 | NimBot | @[2, 3] |
17:10:45 | * | miran joined #nim |
17:11:10 | FromGitter | <mratsim> Ah I used delete hence I didn't have the bug |
17:12:03 | miran | hi guys, anybody had "No 'nim' binary could be found in PATH: " problem recently in VS Code? |
17:12:08 | FromGitter | <mratsim> Not bug, feature |
17:12:38 | FromGitter | <mratsim> @miran not since April/I switched to choosenim |
17:13:26 | miran | i've installed nim via choosenim, added /nimble/bin to $PATH, terminal recognizes nim |
17:13:55 | couven92 | can someone explain to me why `name` has to be a static string and cannot be `untyped` in this macro? https://gist.github.com/1dea1dcb374256b6e90e5217856de015 |
17:14:27 | FromGitter | <krux02> well it actually can be untyped |
17:14:49 | miran | nimsuggest seems not to be working too |
17:14:54 | couven92 | @krux02 no it cannot, then I get undeclared identifier 'blubb' |
17:14:58 | FromGitter | <krux02> you should just now that untyped is actually of type "NimNode", and static[string] is actually of type "string" |
17:15:27 | FromGitter | <krux02> let me test it |
17:17:28 | miran | @mratsim - my problems *started* with choosenim.... :/ (cc dom96) |
17:17:29 | FromGitter | <krux02> well I did test it |
17:17:36 | FromGitter | <krux02> and it does work with untyped |
17:17:40 | FromGitter | <krux02> you code just works |
17:17:53 | FromGitter | <krux02> I just get problems when both functions are there |
17:18:23 | FromGitter | <krux02> namedFor with ``static[string]`` and ``untyped`` argument |
17:18:24 | FromGitter | <freevryheid> hmm, formatFloat |
17:18:33 | FromGitter | <stisa> @freevryheid use `formatFloat` from strutils https://glot.io/snippets/evisfre31d |
17:18:33 | FromGitter | <krux02> maybe it is a bug in symbol resolution |
17:19:41 | couven92 | @krux02, ah it's the overload that messes it up, okay, that's fine, I didn't want the static-string variant anyways! :) |
17:19:44 | couven92 | Thx! :D |
17:22:54 | * | yglukhov quit (Remote host closed the connection) |
17:27:42 | * | couven92 quit (Quit: Client disconnecting) |
17:28:20 | * | PMunch joined #nim |
17:30:42 | * | yglukhov joined #nim |
17:31:10 | * | fvs joined #nim |
17:34:06 | * | endragor joined #nim |
17:35:01 | * | yglukhov quit (Ping timeout: 240 seconds) |
17:38:10 | * | jaccarmac joined #nim |
17:38:11 | * | endragor quit (Ping timeout: 240 seconds) |
17:57:08 | FromGitter | <Varriount> @miran I had a problem recently where a Nim program inserted a null character in my PATH variable, causing Windows to only read part of the variable when new programs requested it. |
17:58:10 | miran | @varriount it is strange because both system's terminal and vs code terminal do recognize nim |
17:58:30 | FromGitter | <Varriount> Oh, Hm. Not the same problem then. |
17:58:41 | jaccarmac | @Varriount interesting. I've also run into bugs on Windows that involved strings getting cut off |
17:58:51 | jaccarmac | Is there a known source for the null characters? |
17:59:00 | miran | the error that i mentioned lists PATH, but it is "original path", without directories added in .bashrc |
17:59:33 | miran | i'm not sure if it is vscode error or nim extension error |
17:59:36 | FromGitter | <Varriount> The end of Nim strings are null-terminated. |
17:59:55 | * | TjYoco joined #nim |
17:59:58 | FromGitter | <xomachine> Hi, all! ⏎ Is it possible to get type pragmas in declaration returned from getImpl()? ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5a0c809ee606d60e34ca1b14] |
18:00:04 | FromGitter | <Varriount> Strings are both length-prefixed and null terminated |
18:00:20 | jaccarmac | @Varriount: Was aware of null-termination, not the prefix |
18:01:24 | FromGitter | <Varriount> jaccarmac: Well, technically length prefixed |
18:01:37 | * | Sentreen quit (Ping timeout: 248 seconds) |
18:01:50 | miran | i'm thinking this is vscode issue - similar thing happens if i use python - it doesn't recognize python path i added, it usses system's python |
18:01:50 | FromGitter | <Varriount> It's not actually mixed with the string data, it's in a structure member |
18:04:28 | jaccarmac | miran: How are you setting your path? |
18:04:38 | FromGitter | <Varriount> miran: Could vscode be only reading from the system path environment? |
18:04:54 | FromGitter | <Varriount> Not the user path variable? |
18:04:54 | miran | @Varriount yes, this might be |
18:05:21 | miran | jaccarmac: `export PATH=/home/miran/.nimble/bin:$PATH` in .bashrc |
18:06:20 | miran | jaccarmac: as i said, system recognizes new directories added to PATH, but vscode, it seems, uses just a system path (as @Varriount just mentioned) |
18:07:12 | FromGitter | <Varriount> Are you running on Windows, or *nix? |
18:07:19 | miran | linux |
18:08:55 | * | yglukhov joined #nim |
18:09:30 | jaccarmac | bashrc will only run in a terminal |
18:09:49 | jaccarmac | So unless you are launching X from a shell that variable isn't going to affect applications you launch from X |
18:10:04 | * | drs joined #nim |
18:10:14 | jaccarmac | Sorry if this is known to you, it's low hanging fruit on Linux and sounded somehwat likely |
18:11:23 | miran | OMG, this might be it jaccarmac |
18:11:42 | miran | i've tried to run vscode from terminal and it seems it is ok now |
18:13:19 | * | yglukhov quit (Ping timeout: 248 seconds) |
18:15:30 | * | Sentreen joined #nim |
18:15:39 | miran | jaccarmac: any way to make those added directories widely available? |
18:19:08 | enthus1ast- | jaccarmac: i've added nim to my /etc/environment |
18:20:58 | enthus1ast- | ^ miran |
18:21:13 | FromGitter | <mratsim> @miran check this, it was on OSX but you might find some inspiration: https://github.com/pragmagic/vscode-nim/issues/46 |
18:21:40 | FromGitter | <alehander42> is the stackTrace option on or off by default ? |
18:22:12 | FromGitter | <alehander42> it seems that it's on when I am compiling my Nim compiler |
18:22:32 | FromGitter | <alehander42> but I can't really find out why, only thing in config cfg |
18:22:33 | FromGitter | <alehander42> is stacktrace:off |
18:22:36 | FromGitter | <alehander42> for release |
18:23:19 | miran | enthus1ast-: ok, i'll try to see that |
18:25:51 | * | claudiuinberlin joined #nim |
18:26:50 | FromGitter | <alehander42> ah I found a connection nvm |
18:27:58 | * | Trustable quit (Remote host closed the connection) |
18:30:12 | * | nsf joined #nim |
18:32:05 | * | Arrrr joined #nim |
18:32:05 | * | Arrrr quit (Changing host) |
18:32:05 | * | Arrrr joined #nim |
18:33:03 | * | ofelas joined #nim |
18:35:49 | * | lurker joined #nim |
18:40:15 | * | miran quit (Quit: Konversation terminated!) |
18:40:54 | * | nitely quit (Ping timeout: 260 seconds) |
18:45:56 | * | jsgrant joined #nim |
18:47:45 | * | miran joined #nim |
18:50:41 | miran | guys, thanks for the help! i've added nim bin via /etc/profile.d - now everything works as it should |
18:55:43 | * | ofelas quit (Remote host closed the connection) |
19:13:30 | * | miran quit (Quit: Konversation terminated!) |
19:22:51 | * | drs left #nim (#nim) |
19:25:47 | * | couven92 joined #nim |
19:27:12 | * | Mat4 joined #nim |
19:28:17 | * | yglukhov joined #nim |
19:33:39 | * | fvs left #nim ("ERC (IRC client for Emacs 25.3.1)") |
19:36:06 | couven92 | Araq, dom96: okay, the `asArray` macro is now running tests green. #6640 ready to merge! :) |
19:38:39 | GitDisc | <treeform> What does asArray macro do? |
19:39:25 | GitDisc | <treeform> oh this: https://github.com/nim-lang/Nim/issues/6563 |
19:39:27 | GitDisc | <treeform> I see now. |
19:39:38 | couven92 | @treeform: yup! :) |
19:40:02 | couven92 | since I play a lot with the `unicode`, this is a real must-have for me! ;) |
19:46:53 | * | SenasOzys quit (Read error: Connection reset by peer) |
19:47:05 | * | SenasOzys joined #nim |
19:50:50 | Araq | so many PRs... :-) |
19:51:53 | Araq | couven92: shouldn't targetType be of type 'typedesc'? |
19:52:12 | couven92 | Araq, you said not to |
19:53:03 | * | Mat4 quit (Ping timeout: 248 seconds) |
19:53:48 | couven92 | Araq, https://github.com/nim-lang/Nim/pull/6640#discussion_r149011944 |
19:54:20 | Araq | getType != typedesc |
19:56:35 | * | ofelas joined #nim |
19:57:06 | * | BitPuffin|osx joined #nim |
19:57:26 | * | dyce[m] quit (Ping timeout: 276 seconds) |
19:57:26 | * | ehmry quit (Ping timeout: 276 seconds) |
19:57:37 | couven92 | Well, the fun part about using untyped, is that we can use any proc that takes one argument here :) |
19:58:04 | couven92 | Like I do in the test where I apply the `$` proc on an array of floats |
19:59:57 | * | Mat4 joined #nim |
20:01:24 | avsej | having =~ for floats helps with comparing floats in tests (just like with Complex). What do you think, Araq? I can make PR |
20:02:02 | couven92 | avsej, well, what is the tolerance? |
20:02:39 | avsej | if constant acceptable for Complex, why can't it be acceptable for floats? https://github.com/nim-lang/Nim/blob/v0.17.2/lib/pure/complex.nim#L22 |
20:03:08 | * | Vladar quit (Quit: Leaving) |
20:03:52 | couven92 | avsej, good point, I don't really care, I stay away from floats as much as possible (apart from NaN appearently) |
20:04:01 | avsej | :) |
20:04:38 | avsej | having constant epsilon with =~ operator is better than nothing :) I will make PR |
20:04:59 | FromGitter | <mratsim> the const is not exported but the approximate comparison is, hum. I really think everyone that cares about float precision should define it’s own |
20:05:06 | FromGitter | <mratsim> its* |
20:05:35 | Araq | avsej: go ahead but mratsim is right, the epsilon or =~ cannot be part of the stdlib |
20:05:36 | avsej | another solution is to have 3-argument assertion template for floats |
20:05:39 | * | Mat4 quit (Ping timeout: 268 seconds) |
20:05:40 | FromGitter | <mratsim> 1e-7 is great around 0 but completely useless in place where ulp is big |
20:06:23 | * | ehmry joined #nim |
20:06:29 | * | dyce[m] joined #nim |
20:06:53 | FromGitter | <mratsim> iirc float tests define eps and =~ for tests but do not export it |
20:11:27 | avsej | Araq, platform detection in makefile was broken too: https://github.com/nim-lang/Nim/pull/6751 |
20:12:23 | * | vlad1777d_ joined #nim |
20:12:58 | couven92 | avsej, what was broken? |
20:14:21 | avsej | 1) it didn't detect arm platform correctly; 2) when it didn't detected it incorrecly reported $uos, but should show actual $myos to help debugging this makefile |
20:21:43 | * | NimBot joined #nim |
20:23:31 | avsej | better now (I've updaed PR)? |
20:23:54 | couven92 | great! thanks! :) |
20:26:20 | Araq | makefile.tmpl is not as important, the official docs don't mention 'make' |
20:28:20 | federico3 | was this meant to allow the {} syntax? "$animal eats $food." % ["animal", "The cat", "food", "fish"] |
20:28:52 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:29:20 | * | Arrrr quit (Read error: Connection reset by peer) |
20:29:23 | * | xkapastel joined #nim |
20:32:36 | * | claudiuinberlin joined #nim |
20:34:45 | FromGitter | <mratsim> There is no Nim option :/ Bomberman battle of the bots with programming languages: https://booking.riddles.io/competitions/ms.-hack-man/how-to-play |
20:38:54 | dom96 | mratsim: I bet they accept contributions :) |
20:39:23 | Araq | federico3: no, it predates the {:} syntax :-( |
20:39:33 | * | couven92 quit (Quit: Client Disconnecting) |
20:40:04 | * | couven92 joined #nim |
20:40:29 | federico3 | pity. I'd be happy to have a slightly more powerful formatter in the stdlib |
20:41:04 | * | Trustable joined #nim |
20:42:55 | couven92 | Anyways, Araq, dom96, is it evil that my asArray accepts untyped or should I revert back to typedesc? If I should revert Araq has to tell me how to use typedesc without getType |
20:43:35 | Araq | federico3: there is a pending PR for that |
20:44:29 | * | yglukhov joined #nim |
20:48:55 | * | ShalokShalom quit (Remote host closed the connection) |
20:56:13 | avsej | are talking about this one? https://github.com/nim-lang/Nim/pull/6507 |
20:56:19 | federico3 | yep |
20:58:20 | * | lurker quit (Quit: Leaving) |
21:00:20 | FromGitter | <brentp> how can I create a `set[char]` from a string? |
21:01:37 | FromGitter | <brentp> there is not a constructor? |
21:03:06 | FromGitter | <brentp> ok. I just use sets module and toSet. thought I could use the builtins |
21:03:44 | Araq | huh? generally you start with the set[char] directly |
21:04:00 | Araq | like {'A'..'Z', '_', '0'..'9'} |
21:22:58 | * | Trustable quit (Remote host closed the connection) |
21:23:32 | * | jsgrant quit (Ping timeout: 255 seconds) |
21:33:06 | Chuang-Tzu | What's with this? "Error: undeclared identifier: 'spawn'" This is from sample code in "Nim in Action". spawn is in listed in the docs. |
21:35:28 | * | BitPuffin|osx quit (Ping timeout: 248 seconds) |
21:37:13 | * | vivus joined #nim |
21:37:45 | Chuang-Tzu | Never mind, I found the problem. |
21:39:51 | dom96 | hello Chuang-Tzu :) |
21:39:56 | * | ofelas quit (Quit: shutdown -h now) |
21:42:59 | Chuang-Tzu | howdy, dom96 |
22:02:00 | * | yglukhov quit (Remote host closed the connection) |
22:05:00 | * | fvs joined #nim |
22:05:52 | * | jaccarmac quit (Ping timeout: 260 seconds) |
22:06:39 | fvs | hi, any way to save and restore a large seq to/from disk? |
22:08:19 | * | lurker joined #nim |
22:08:40 | Araq | mratsim: does '=sink' work for you? |
22:09:58 | Araq | fvs: for loops and file IO do the job. currently it's hard to use memory mapped files for this |
22:10:12 | FromGitter | <mratsim> @Araq I didn’t try yet, took the week off Arraymancer and did some Project Euler instead |
22:11:24 | Araq | well try it |
22:13:04 | * | jsgrant joined #nim |
22:13:15 | dom96 | I wonder if it would be possible to just save addr(mySeq[0]), sizeof(mySeq[0]) |
22:13:28 | dom96 | *sizeof(mySeq[0])*len(mySeq) |
22:13:37 | Araq | dom96: if the elements are blobs, yes |
22:14:58 | dom96 | cool |
22:15:58 | FromGitter | <mratsim> building a bench for it |
22:18:32 | * | Mat4 quit (Quit: leaving) |
22:18:49 | fvs | emi, what's a blob? A seq[object]? |
22:19:56 | * | gokr joined #nim |
22:22:04 | Araq | dom96: is this ok with Nimble https://github.com/nim-lang/Nim/pull/6750 ? |
22:22:24 | Araq | fvs: a pointer-free data structure |
22:22:52 | dom96 | Araq: I think so, can you think of any reasons why it wouldn't be? |
22:22:54 | Araq | seqs and strings could as pointers |
22:23:19 | Araq | dom96: because I'm not sure what APIs Nimble uses it could mess up Nimble's output |
22:24:38 | dom96 | well |
22:24:40 | * | yglukhov joined #nim |
22:25:11 | dom96 | https://gist.github.com/dom96/fe0559cd6fcc6e0df1cc3f76de907629 |
22:25:34 | dom96 | It would be nice to turn this output off I guess |
22:25:44 | dom96 | This warning is also worrying |
22:25:53 | dom96 | but I bet that's because Nimble was compiled with an older compiler |
22:27:03 | * | nsf quit (Quit: WeeChat 1.9.1) |
22:28:57 | * | yglukhov quit (Ping timeout: 240 seconds) |
22:33:33 | avsej | is there some nim release schedule already? |
22:34:15 | GitDisc | <treeform> fvs, speaking about blobs, I stored strings in fixed width char arrays, for my TimeZone data, just so that I can dump the easily. |
22:34:48 | GitDisc | <treeform> fvs: https://github.com/treeform/chrono/blob/master/chrono/timezones.nim#L57 |
22:35:13 | GitDisc | <treeform> Then i used toArray and toString on those "packed" strings. |
22:39:14 | FromGitter | <brentp> Araq (re sets) yeah. Realized that after. |
22:40:28 | Araq | avsej: I still dream about v0.18 being RC v1 ... |
22:41:39 | Araq | christmas would be nice |
22:42:01 | Araq | but it's unrealistic -.- |
22:56:07 | * | lurker quit (Quit: Leaving) |
23:00:33 | * | fvs left #nim ("ERC (IRC client for Emacs 25.3.1)") |
23:01:08 | * | PMunch quit (Quit: leaving) |
23:12:26 | FromGitter | <mratsim> @Araq it’s not working as expected: ⏎ ⏎ ```nim c --newruntime -d:newruntime -d:native -d:release``` ⏎ ⏎ I get the following results: 9.5 sec with old and new runtime, and 1.5 sec by using “unsafeView” directly in the loop [https://gitter.im/nim-lang/Nim?at=5a0cc9d9505b630c05ea242e] |
23:12:30 | * | jsgrant quit (Ping timeout: 268 seconds) |
23:12:46 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/cnhj/2017-11-15_23-51-16.png) |
23:13:01 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/4KBb/2017-11-16_00-09-47.png) |
23:13:02 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/r8i3/2017-11-15_23-52-37.png) |
23:14:31 | Araq | that's totally not how '=sink' works, read my blog post :P |
23:14:57 | FromGitter | <mratsim> lol okay :P |
23:15:21 | Araq | you can only *move* if you don't access it afterwards |
23:15:44 | Araq | you access it plenty of times since the usage is in a loop... |
23:16:38 | avsej | what is newruntime? |
23:18:02 | * | d10n-work quit (Quit: Connection closed for inactivity) |
23:18:23 | Araq | "Nim v2" *cough* |
23:18:40 | Araq | Nim with move semantics, destructors and memory regions |
23:18:53 | Araq | vaporware |
23:19:27 | Xe | nim 2 is like go 2? |
23:19:34 | Araq | but it's good to have a longterm vision IMO. |
23:20:34 | dom96 | heh, I just re-watched Linus' TED talk where he says he's not a visionary |
23:20:38 | dom96 | Are you a visionary Araq? :) |
23:20:43 | Araq | yes. |
23:20:57 | Araq | I don't reinvent Unix. |
23:21:15 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
23:22:58 | FromGitter | <mratsim> Trying this but it doesn’t move mmm ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a0ccc51cc1d527f6b7667b3] |
23:23:38 | Araq | do you seriously think I do a whole program analysis to figure this out? |
23:24:19 | Araq | don't write toys, use a 'main' proc at least, seriously. |
23:26:13 | * | elrood quit (Quit: Leaving) |
23:26:46 | FromGitter | <mratsim> still not working, I’ll try with custom seqs |
23:28:06 | * | yaiyan quit (Ping timeout: 246 seconds) |
23:28:17 | Araq | you might need to add a dummy =destroy |
23:28:28 | Araq | (that's a bug then that I'll fix) |
23:29:57 | * | yaiyan joined #nim |
23:32:07 | * | jsgrant joined #nim |
23:32:10 | FromGitter | <mratsim> ah |
23:32:23 | FromGitter | <mratsim> I got a stack trace: ⏎ ⏎ Error: internal error: (filename: ccgexprs.nim, line: 972) ⏎ No stack traceback available ⏎ To create a stacktrace, rerun compilation with ./koch temp c <file> [https://gitter.im/nim-lang/Nim?at=5a0cce86540c78242d0b441a] |
23:32:35 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a0cce9371ad3f8736ecaab7] |
23:33:53 | FromGitter | <mratsim> oh it’s because I have a [T] generic leftover and CustSeq doesn’t need generics |
23:34:16 | FromGitter | <mratsim> I will open a bug |
23:36:27 | * | ketralnis quit (Quit: Coyote finally caught me) |
23:37:50 | FromGitter | <mratsim> I can =sink with the custom seq |
23:38:35 | * | arnetheduck quit (Ping timeout: 240 seconds) |
23:39:44 | FromGitter | <mratsim> but for value returned by functions (rule 2), rule 3 doesn’t seem to work (last read of) |
23:41:15 | FromGitter | <mratsim> I’ve added some echo to the gist to show that |
23:41:45 | Araq | ok |
23:45:07 | * | bkerin joined #nim |
23:46:20 | bkerin | I don't understand what macros.quote is doing |
23:46:59 | bkerin | o maybe I do |
23:47:01 | bkerin | sort of |
23:48:05 | bkerin | repr just does something odd with its output |
23:48:25 | Araq | macros.repr needs to be deprecated |
23:48:33 | Araq | it should have been $ instead |
23:48:40 | Araq | another issue for v0.18... |
23:49:23 | bkerin | ok |
23:50:32 | FromGitter | <mratsim> quote do allows you to use the normal proc/template syntax in a block instead of having to use the AST syntax |
23:50:53 | * | MJCaley1 joined #nim |
23:51:08 | bkerin | I got that mostly |
23:52:34 | bkerin | macros.repr says undefined identifier, so it's system.repr that's doing odd thing, it represents a quote of a simple declaration like this: var foo141227 = 42 |