00:00:07 | * | ftsf joined #nim |
00:07:55 | * | endragor joined #nim |
00:19:52 | * | endragor quit (Remote host closed the connection) |
00:55:03 | * | chimez joined #nim |
00:58:28 | * | sealmove joined #nim |
01:17:08 | * | MightyJoe quit (Ping timeout: 245 seconds) |
01:17:21 | * | cyraxjoe joined #nim |
01:18:37 | * | Snircle joined #nim |
01:21:14 | * | rnrwashere quit (Remote host closed the connection) |
01:22:07 | * | sealmove quit (Quit: WeeChat 2.4) |
01:28:25 | * | rnrwashere joined #nim |
01:29:13 | * | cyraxjoe quit (Remote host closed the connection) |
01:37:11 | * | lritter quit (Ping timeout: 268 seconds) |
01:51:50 | * | chimez quit (Quit: chimez) |
02:00:29 | * | rnrwashere quit (Read error: Connection reset by peer) |
02:01:04 | * | rockcavera quit (Ping timeout: 255 seconds) |
02:13:39 | * | theelous3_ joined #nim |
02:35:24 | * | dddddd quit (Remote host closed the connection) |
02:37:07 | * | theelous3_ quit (Ping timeout: 245 seconds) |
02:39:38 | * | vlad1777d quit (Ping timeout: 245 seconds) |
02:40:21 | * | rockcavera joined #nim |
02:53:29 | * | rnrwashere joined #nim |
03:02:34 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:05:54 | * | banc quit (Quit: Bye) |
03:26:29 | * | banc joined #nim |
04:16:35 | * | noeontheend joined #nim |
04:21:17 | * | chemist69 quit (Ping timeout: 250 seconds) |
04:21:47 | * | nsf joined #nim |
04:23:33 | * | chemist69 joined #nim |
05:57:37 | * | narimiran joined #nim |
06:11:47 | * | ryukoposting quit (Quit: WeeChat 1.6) |
06:12:33 | * | rnrwashere quit (Remote host closed the connection) |
06:26:00 | * | rnrwashere joined #nim |
06:57:06 | * | solitudesf joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:20 | * | rnrwashere quit (Remote host closed the connection) |
07:04:15 | * | PMunch joined #nim |
07:05:03 | * | gmpreussner joined #nim |
07:08:40 | * | ftsf quit (Ping timeout: 246 seconds) |
07:21:58 | * | vlad1777d joined #nim |
07:23:11 | * | krux02 joined #nim |
07:42:59 | * | jjido joined #nim |
07:45:26 | * | Vladar joined #nim |
07:59:56 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:13:41 | * | JustASlacker joined #nim |
09:41:25 | * | ephja joined #nim |
09:49:38 | * | ephja quit (Quit: Page closed) |
10:07:34 | * | solitudesf quit (Quit: Leaving) |
10:10:27 | * | solitudesf joined #nim |
10:12:17 | * | ng0 joined #nim |
10:29:50 | * | leorize quit (Quit: WeeChat 2.4) |
10:33:02 | * | abm joined #nim |
10:49:26 | * | neceve joined #nim |
10:59:26 | Zevv | I must say I havent had this much fun coding for years - Nim hooray! |
10:59:44 | FromGitter | <alehander42> parser generators are pretty fun |
10:59:45 | FromGitter | <alehander42> indeed |
10:59:49 | FromGitter | <alehander42> how far are you |
11:00:01 | FromGitter | <alehander42> i've wanted to write one for a long time but i didnt get to the dsl yet |
11:02:08 | Zevv | PEG compilation and parsing is complete and robust. I'm now working on getting stuff out of the parser in a friendly way. I use JsonNodes to collect stuff and return it to the caller, that works pretty well. |
11:02:26 | Zevv | Performance is amazing, I didn't expect to get this far without spending any effort on optimization. |
11:03:20 | Zevv | but the most importan is that it is *really* enjoyable to do this in Nim. |
11:03:31 | Zevv | I need to do C++ at daytime, which is getting more cumbersome each day. |
11:18:50 | * | stefanos82 joined #nim |
11:34:30 | * | solitudesf quit (Quit: Leaving) |
11:34:45 | * | solitudesf joined #nim |
11:45:48 | * | solitudesf quit (Quit: Leaving) |
11:45:56 | * | a_ joined #nim |
11:46:06 | * | solitudesf joined #nim |
11:51:38 | * | dddddd joined #nim |
11:51:46 | * | a_ quit (Quit: Page closed) |
12:04:46 | * | Snircle joined #nim |
12:11:18 | FromGitter | <alehander42> is it modern c++ |
12:11:59 | FromGitter | <alehander42> @cooldome hey are you working on renderer as a part of any of your projects? |
12:12:25 | FromGitter | <alehander42> i might need to fix some things, but i wanted to see if they are in your issue list or something |
12:41:19 | * | solitudesf quit (Quit: Leaving) |
12:42:25 | * | solitudesf- joined #nim |
12:44:55 | FromGitter | <zacharycarter> Has anyone had a chance to play with hot code reloading for the C backend yet? |
12:45:23 | FromGitter | <zacharycarter> I'm going to try to pick back up my game engine project I stalled out on this week |
12:52:47 | * | solitudesf- quit (Quit: Leaving) |
12:53:15 | * | solitudesf joined #nim |
12:59:47 | * | solitudesf- joined #nim |
13:00:35 | * | solitudesf quit (Remote host closed the connection) |
13:00:51 | * | solitudesf joined #nim |
13:01:04 | * | solitudesf quit (Remote host closed the connection) |
13:01:06 | * | zahary joined #nim |
13:01:06 | * | solitudesf- quit (Client Quit) |
13:01:30 | * | solitudesf joined #nim |
13:04:37 | * | solitudesf- joined #nim |
13:04:45 | * | solitudesf quit (Remote host closed the connection) |
13:04:46 | * | solitudesf- quit (Client Quit) |
13:05:01 | * | solitudesf joined #nim |
13:27:02 | * | leorize joined #nim |
13:30:29 | avanderneut | Is there some way to use choosenim with local clone of my nim-lang/Nim fork? I cloned to ~/.choosenim/toolchains (next to to the nim-#devel clone choosenim creates) and then did `choosenim update "nim-#mydevelop". But that crashes. |
13:34:28 | FromGitter | <SolitudeSF> you can just `choosenim path/to/your/nim`, but i dont think that you can use `choosenim update` with that |
13:39:06 | * | neceve quit (Ping timeout: 258 seconds) |
13:47:56 | * | vlad1777d quit (Ping timeout: 268 seconds) |
13:52:01 | avanderneut | But then I probably need to compile that by hand first, other wise it complains about nim not found. Going to try... |
14:00:38 | Araq | zacharycarter: try it, I broke its tests and then fixed them |
14:00:47 | Araq | so ... it should work, it's tested :P |
14:04:13 | shashlick | avanderneut - maintain your clone per usual with koch |
14:04:49 | shashlick | Choosenim will simply allow you to switch between devel and stable |
14:06:39 | avanderneut | shashlick: Yes I noticed and putting things under ~/.choosenim/toolchains/nim-#mydevelop doesn't really help it doesn't get recognised when you do choosenim "nim-#mydevelop", I have to specify the path .. |
14:07:45 | shashlick | Ya we could extend choosenim to manage an existing repo, interesting idea |
14:10:18 | FromGitter | <zacharycarter> Araq: sounds good, will do. |
14:14:18 | * | cgfuh joined #nim |
14:16:18 | * | tefter quit (Ping timeout: 245 seconds) |
14:25:49 | * | aguspiza joined #nim |
14:30:51 | * | bmaxa joined #nim |
14:30:53 | * | theelous3_ joined #nim |
14:31:22 | * | bmaxa quit (Client Quit) |
14:42:43 | shashlick | I'm getting a nilaccesserror on alloc, any ideas |
14:51:16 | Araq | shashlick, go up in the stack trace |
14:52:32 | shashlick | well, it randomly occurs so i have some memory corruption somewhere |
14:52:50 | shashlick | likely suspect is where i'm casting and playing with pointers |
14:52:56 | shashlick | but the fact that it is random isn't helping |
15:04:20 | FromGitter | <liquid600pgm> compiling Nim on a raspberry pi is slow -_- |
15:04:33 | FromGitter | <liquid600pgm> I can't blame it on the language tho |
15:04:44 | * | clyybber joined #nim |
15:05:06 | Zevv | i |
15:05:09 | FromGitter | <liquid600pgm> the slow performance is due to the slow CPU and storage of a Raspberry Pi |
15:05:21 | FromGitter | <liquid600pgm> so I'll just have to be patient |
15:05:27 | narimiran | liquid600pgm: is it some toy hello-world or are you doing something more serious/interesting? |
15:05:29 | Zevv | compiling c is just slow on the pi |
15:05:55 | Zevv | avoid "nim cpp" if you can |
15:06:30 | * | lritter joined #nim |
15:06:34 | FromGitter | <liquid600pgm> narimiran: I was going to play around with the Linux framebuffer, mainly because I have an NVIDIA card on my main PC and it only allows for 640x480 ttys |
15:06:51 | shashlick | `len(a) == L` seq modified while iterating over it [AssertionError] <= how do I find out which seq? stack doesn't tell me |
15:07:09 | FromGitter | <liquid600pgm> I couldn't find a way to change that, unfortunately, and the Pi displays the tty in full 1080p properly |
15:07:35 | FromGitter | <mratsim> I don't think nim cpp is slower than nim c |
15:07:46 | FromGitter | <mratsim> Nim C++ doesn't produce the slow headers |
15:08:23 | FromGitter | <liquid600pgm> oh wait it's already finished |
15:08:31 | FromGitter | <liquid600pgm> that was fast for a Pi |
15:08:48 | FromGitter | <liquid600pgm> it took maybe a minute or two |
15:25:46 | * | Trustable joined #nim |
15:32:20 | * | PMunch quit (Remote host closed the connection) |
15:34:49 | * | JustASlacker quit (Remote host closed the connection) |
15:34:59 | * | neceve joined #nim |
15:37:20 | FromGitter | <liquid600pgm> how do you `importc` a constant? |
15:39:47 | leorize | var CONSTNAME {.importc.}: type |
15:40:32 | leorize | or tbh just add it as a `const` to whatever use it |
15:43:09 | shashlick | #define or const char * type |
15:45:15 | Araq | the var .importc hack doesn't work with NLVM and in general doesn't play well |
15:46:48 | * | rnrwashere joined #nim |
15:51:44 | shashlick | Araq: will emit work to pull in dmalloc? |
15:54:20 | * | natrys joined #nim |
15:54:35 | Araq | who knows |
15:57:54 | shashlick | narimiran - nightlies are failing on Windows devel 32/64 |
15:58:11 | shashlick | htmlparser_snippet_101.nim(1, 13) Error: expected a hex digit, but found: s; maybe prepend with 0 |
15:59:05 | * | nsf quit (Quit: WeeChat 2.4) |
15:59:45 | narimiran | shashlick: when did that start failing? |
16:00:05 | narimiran | the last change in htmlparser.nim was 2 weeks ago |
16:00:53 | shashlick | yep since then looks like |
16:08:46 | * | sealmove joined #nim |
16:09:38 | * | abm quit (Ping timeout: 245 seconds) |
16:13:41 | * | rnrwashere quit (Remote host closed the connection) |
16:15:55 | * | rnrwashere joined #nim |
16:21:39 | Araq | sorry about it, tried to reproduce but couldn't |
16:27:29 | Araq | can't we just revert this commit to fix nightlies? |
16:31:13 | sealmove | Sorry for bringing this up again (not looking for long discussion), but how do you really go about modeling something similar to an interface in Nim, that is, types depending on behavior? |
16:35:12 | FromGitter | <Varriount> sealmove: Do you need compile-time polymorphism, or runtime? |
16:37:59 | FromGitter | <Varriount> If you need runtime polymorphism, using either methods, or structures containing procedural types is what you want |
16:38:30 | FromGitter | <Varriount> Otherwise, you can use generics and concepts for compile-time interfaces |
16:39:28 | * | elrood joined #nim |
16:41:07 | sealmove | I understand Nim methods. What I can't seem to figure out is how to associate procs with types in Nim. Concepts seems to be the answer but I don't really understand them.. |
16:42:42 | FromGitter | <Varriount> sealmove: By "associate", do you mean storing procedures in types |
16:44:00 | sealmove | Sorry no, I mean having a type that can hold values of different types, but requires these types to "implement" some specific proc |
16:46:57 | * | rnrwashere quit (Remote host closed the connection) |
16:49:23 | sealmove | Rephrasing: make a constrained generic type, with the constrain being a specific proc (or more). Can't figure out the syntax.. |
16:51:35 | clyybber | Yeah concepts are the answer |
16:51:37 | FromGitter | <Varriount> sealmove: I assume you've tried the first example from the manual? https://nim-lang.org/docs/manual.html#generics-concepts |
16:52:14 | sealmove | yes, I am reading the manual and feel dumb :( this is the second time I revisit this topic too. |
16:53:09 | clyybber | You just write: |
16:53:12 | clyybber | type |
16:53:48 | clyybber | ImplementingSomeProc = concept s |
16:53:58 | clyybber | s.someproc() |
16:54:42 | clyybber | where someproc is the proc that the type has to implement |
16:55:21 | FromGitter | <Varriount> And if you then want a type to contain That concept as a member, you do |
16:55:49 | FromGitter | <Varriount> type ContainingConcept = object |
16:56:19 | FromGitter | <Varriount> fieldName: ImplementingSomeProc |
16:57:40 | FromGitter | <mratsim> concepts are pretty new anyway |
16:58:07 | FromGitter | <mratsim> they are coming in C++20 and I don't think any language has concepts. |
16:58:53 | sealmove | yeah but the lack of "classical" interfaces and classes make them more important |
16:59:54 | FromGitter | <mratsim> yes, that has been pending for 1.5 years unfortunately :/ |
17:00:06 | FromGitter | <mratsim> Nim does have classes though. |
17:00:37 | FromGitter | <mratsim> what has been pending is heterogenous collections of types implementing the same concept. |
17:00:39 | sealmove | not with the "common" sense I think |
17:00:55 | FromGitter | <Varriount> But no multiple inheritance |
17:01:15 | FromGitter | <mratsim> what is multiple inheritance? |
17:01:28 | FromGitter | <mratsim> inherits from 2 different classes? |
17:01:32 | FromGitter | <Varriount> Yes |
17:01:43 | sealmove | In the example... is `ImplementingSomeProc` a type that I can assign values to? |
17:02:03 | FromGitter | <mratsim> No, it's not a concrete type |
17:02:27 | FromGitter | <Varriount> It can be a parameter type or a field type |
17:02:31 | FromGitter | <mratsim> proc defined on a specific concept will work on all types that implements the concept API |
17:04:28 | FromGitter | <Varriount> sealmove: perhaps you can post a link to what you have so far? That might be more enlightening. |
17:06:23 | sealmove | okay. though I suspect Nim doesn't work like I had in mind. I'm too used to Go's structural typing :/ |
17:06:55 | Araq | not really, it's just that you think you want concepts when you truely wanted interfaces |
17:07:13 | Araq | and in Nim the replacement is a proc with a closure |
17:07:22 | Araq | or a tuple of procs with closures |
17:07:50 | Araq | it's not hard to do in Nim but most people have surprising struggles with the idea |
17:12:33 | * | Jesin quit (Quit: Leaving) |
17:17:57 | FromGitter | <mratsim> Well, to be fair it's very hard to change ingrained behavior. Studies have showned that if a cat was always exposed to the same vertical striped wall, they cannot adapt to horizontal stripes after a couple of years: https://www.psychologytoday.com/us/blog/brain-food/201404/the-cat-nobel-prize-part-ii |
17:19:16 | FromGitter | <mratsim> and I think interfaces would be quite useful (even if it's just macros, pragmas or concept maggic behind) |
17:20:33 | sealmove | I don't care for interfaces as long as I can model similarly with what Nim provides, just struggling to figure it out. |
17:20:47 | sealmove | maybe just better tutorials |
17:21:07 | FromGitter | <mratsim> sounds good cc @narimiran |
17:21:14 | FromGitter | <mratsim> "tutorial needed" :p |
17:22:59 | FromGitter | <samdmarshall> @dom96 hey are you around? |
17:26:17 | sealmove | @Araq: Can you give a tiny bit more info on this idea of modeling interfaces? |
17:26:41 | sealmove | "tuple of procs with closures" not enough to figure it out |
17:27:31 | * | Jesin joined #nim |
17:28:41 | clyybber | bbl cya |
17:28:44 | * | clyybber quit (Quit: WeeChat 2.4) |
17:31:23 | Araq | sealmove, https://github.com/nim-lang/Nim/blob/devel/tests/closure/tclosure.nim#L573 |
17:31:30 | * | rnrwashere joined #nim |
17:31:37 | Araq | (unfortunately the relevant test was merged into a bigger one) |
17:32:03 | Araq | note that this seems more cumbersome than it usually is in practice, ymmv |
17:33:38 | * | stefanos82 quit (Remote host closed the connection) |
17:34:33 | FromGitter | <liquid600pgm> is it possible to modify a pointer like an array? `point[2] = 3` |
17:35:34 | * | stefanos82 joined #nim |
17:36:35 | * | abm joined #nim |
17:38:05 | shashlick | cast it to an array of something |
17:38:55 | shashlick | checkout UncheckedArray as well |
17:42:56 | shashlick | right now, my alloc crash is always string related |
17:43:19 | sealmove | @Araq: wow! okay this is totally unconvential but solves my problem |
17:43:42 | shashlick | either in strip() which calls substr() which creates a newString or in split() which also does string allocs |
17:44:01 | shashlick | alloc.nim - rawAlloc |
17:44:17 | shashlick | returns a NilAccessError with segfaults |
17:44:20 | Araq | shashlick, try valgrind on it |
17:44:28 | Araq | or clang's sanitizers |
17:44:31 | shashlick | stuck on Windows |
17:44:47 | shashlick | with mingw |
17:46:21 | shashlick | i've commented out all my pointer shenanigans, save for windows SendMessage |
17:47:22 | * | neceve quit (Remote host closed the connection) |
17:54:41 | FromGitter | <liquid600pgm> shashlick: I can't cast it to an array, as I don't know its size at compile time |
17:54:55 | FromGitter | <liquid600pgm> what's an UncheckedArray? |
17:58:12 | shashlick | UncheckedArray* {.unchecked.}[T] = array[0, T] |
17:59:22 | * | theelous3_ quit (Ping timeout: 250 seconds) |
17:59:56 | shashlick | here's an example - https://github.com/genotrance/nim7z/blob/master/nim7z.nim#L6 |
18:01:26 | Araq | liquid600pgm: cast[ptr UncheckedArray[ElemTypeHere]] |
18:01:49 | Araq | keep in mind that arrays are not pointers, not even "unchecked" arrays are pointers, in Nim pointers are pointers |
18:02:06 | * | pacujo joined #nim |
18:02:48 | shashlick | Araq - there's no reference to malloc/free in any of the generated C code - how do you do memory allocs? |
18:03:21 | FromGitter | <mratsim> mmap |
18:04:24 | Araq | shashlick, proc `=destroy`(svnz: var SvnzFileObj) = ... your destructor is so dangerous that's likely wrong |
18:04:49 | Araq | it doesn't protect against double destroys, there are no =sink and = operators either |
18:05:52 | shashlick | I'm not surprised, that whole file was leftfield for me |
18:06:00 | shashlick | any recommendation on how to do that right? |
18:06:51 | Araq | for now your best option is 'proc close' as this feature is still in heavy development and we only figured out missing parts of the spec last week or so |
18:07:33 | shashlick | makes sense - will fix that |
18:09:11 | pacujo | Hello. I ran into nim accidentally some days back and got excited. You may be onto something big here. I definitely want to find out. |
18:11:25 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
18:11:49 | pacujo | First, it seems like nim modules are released in source code format. There's no analogue for C's .o or .a files, is there? |
18:12:05 | shashlick | welcome pacujo |
18:12:26 | shashlick | nim => .c/.cpp => .o |
18:13:21 | pacujo | Yes, but if I build a nim module package and want to hand it to you, would the package contain .nim files or some "bytecode" equivalent? |
18:13:46 | pacujo | I don't suppose the .o files contain the full module ABI spec, do they? |
18:13:48 | shashlick | just nim files - they will get compiled on the target machine |
18:14:26 | pacujo | Ok, just like I thought. It's good news and bad news. |
18:14:51 | shashlick | bad in what way |
18:15:45 | * | noeontheend quit (Ping timeout: 252 seconds) |
18:16:25 | pacujo | Bad news: (1) difficulty making proprietary software and (2) having to compile everything Gentoo-style. (1) is the lesser issue for me right now, but (2) could become a problem if you had to build huge applications ultimately from the sources. |
18:17:05 | shashlick | you can always distribute .o files and pull them in with passL |
18:17:14 | pacujo | Good news: Modules don't have to worry about ABI compatibility in the face of implementation changes. |
18:17:55 | shashlick | but you are talking about making a library/module so you can always just build a dll/so file |
18:18:40 | pacujo | Are you saying the .o/.so/.a file contains everything the application needs to build? Methods, templates, types etc? |
18:20:34 | shashlick | it will be the compiled executable |
18:20:42 | shashlick | you can distribute a header file and your binary |
18:20:48 | shashlick | standard C/C++ stuff |
18:21:05 | rayman22201 | The Nim ABI == the C ABI |
18:21:27 | Araq | proprietary software on Linux? is that what you do? |
18:21:51 | pacujo | Yes, that's my profession. |
18:21:57 | Araq | because it surely is uncommon I regard Linux as source-only OS. |
18:22:38 | Araq | and that's when I'm having a good day and regard it as an OS at all. |
18:23:20 | Araq | anyhow, I heard good things about linking Nim code with 'musl' |
18:23:36 | pacujo | So I got these two .nim files: an app ("project") and a module. I know how to compile it. My .cache/nim directory contains some generated files. |
18:23:44 | Araq | to provide binaries that are dependency free |
18:24:19 | pacujo | If I deleted the module .nim file, what command would I use to build my app? |
18:24:52 | Araq | nim jsonbuild $nimcache/$project.json iirc |
18:25:13 | pacujo | Let's try it... |
18:25:21 | Araq | but don't quote me on that :P |
18:25:52 | shashlick | i think it is worth asking what exactly you want to do here - who is writing the app/project and who is doing the module - which is closed source and which is open |
18:26:34 | pacujo | The module is "closed". |
18:27:19 | pacujo | (I'm simplifying the picture here a bit to keep my questions focused.) |
18:28:14 | Araq | well Nim doesn't do much, you can build a lib*.so file and distribute it. And it works quite like C, which is not very well at all. |
18:28:38 | shashlick | just build your module as a library using --app:lib and publish a header |
18:28:55 | shashlick | then any C/C++/Nim/XYZ language can use your module assuming they have a FFI |
18:29:26 | shashlick | closed source == compiled so that's your option |
18:30:09 | sealmove | After studying the tinterf example, I realized this is a way to make "classic" classes in Nim ;O |
18:30:42 | Araq | sealmove, hardly, there is no nominal typing involved |
18:31:45 | * | banc quit (Ping timeout: 246 seconds) |
18:32:44 | Araq | it's very much like Go's interfaces with a very different memory layout (the closure is duplicated) |
18:34:13 | pacujo | My direct attack failed. First I had "test.nim" as my app and "nimlib/xyz.nim" as my module. Everything worked. Then, I compiled xyz.nim with "nim c --app:lib xyz.nim" and deleted xyz.nim. I got libxyz.so but now compiling "test.nim" failed with "test.nim(1, 8) Error: cannot open file: xyz" |
18:34:58 | shashlick | yes - you need to change all that out |
18:35:14 | shashlick | you need to first off export the procs that the app should use using exportc and dynlib |
18:35:33 | shashlick | next, you write a nim wrapper to import those procs |
18:37:02 | shashlick | so you will have a small xyz.nim which just has the proc prototypes so to speak |
18:37:07 | shashlick | similar to an h file |
18:37:29 | shashlick | you will use the importc pragma for that |
18:37:39 | pacujo | Hm, interesting. |
18:37:53 | shashlick | and you will need to either link that so file using passC or load it using loadLib |
18:38:15 | Araq | no, you import it via .dynlib |
18:39:23 | shashlick | oh ya good point |
18:40:01 | pacujo | That'll require some experimentation, but I'm seeing a writing on the wall: just keep it in .nim. |
18:40:09 | shashlick | here's an sqlite wrapper which is a good example - https://github.com/nim-lang/Nim/blob/master/lib/wrappers/sqlite3.nim |
18:40:50 | shashlick | oh it is quite common - you can pull all sorts of C/C++ code in - source or binary |
18:41:48 | pacujo | Still, interesting that you first convert nim sources to binary only to wrap it again in nim. |
18:41:54 | Araq | the writing on the wall is much more like "how are you able to sell native code libs on Linux and survive?" |
18:43:26 | Araq | and the process your describe is exactly what C and C++ also do. You can actually extract the interface Nim code automatically with a macro but I don't want to confuse you too much |
18:44:48 | shashlick | in a nutshell, you can do what you want 🙂 |
18:44:53 | * | tensortom joined #nim |
18:45:23 | pacujo | The proprietary issue is not a biggie since our systems consist of full executables. However, we have a large component infrastructure where the component artifacts (= modules) are stored in a compiled form primarily for speed or compilation. |
18:45:25 | shashlick | the plus is that you will learn how to consume any C/C++ lib |
18:45:30 | rayman22201 | to be fair, wouldn't it be the same problem on Windows? |
18:45:53 | pacujo | s/or/of/ |
18:46:53 | Araq | rayman22201, there are not many DLLs you can/have to buy. True. |
18:47:06 | pacujo | Our C components are stored as .h/.a files. |
18:47:13 | shashlick | Araq: I ran my test case with --gc:none and don't see the crash anymore, is that useful info in any sense? |
18:48:01 | Araq | shashlick, unfortunately not, the dealloc()s always introduce the memory safety problems and with --gc:none you don't have any deallocs |
18:48:23 | Araq | you might as well call GC_disable() at program start and then your crashes may disappear too. Or not. |
18:48:35 | Araq | GC_disable() is more useful information |
18:48:42 | shashlick | ok i'll try that |
18:48:55 | shashlick | meanwhile, here's my crash https://pastebin.com/GBuQYA7x if it provides any useful info |
18:49:00 | Araq | also what is this code doing: |
18:49:01 | Araq | var |
18:49:01 | Araq | g_Alloc = ISzAlloc(Alloc: SzAlloc, Free: SzFree) |
18:49:02 | Araq | allocImp = g_Alloc |
18:49:02 | Araq | allocTempImp = g_Alloc |
18:49:27 | shashlick | oh I'm not debugging that, i'm working on my editor |
18:49:48 | shashlick | but ya, it has its own allocator that you have to initialize |
18:49:53 | shashlick | that's the nim7z wrapper |
18:52:49 | shashlick | ok probable elephant in the room - feud.exe has a gc and all plugins also have their own gc - I'm not using nimrtl - it is probably why i'm crashing |
18:53:06 | tensortom | need fully automated c2nim. let's make that happen |
18:53:09 | pacujo | Then there's this slight pitfall: ~/.cache/nim/<project> assumes you only have a single <project>.nim file you need to work on. |
18:53:45 | pacujo | Easy to overcome, though: --nimcache:someotherdir |
18:54:11 | shashlick | cache is a cache, you will have a binary to distribute |
18:54:25 | shashlick | tensortom - what are you missing? |
18:54:43 | sealmove | @Araq: I see the potential of the pattern shown in tinterf, but can't see how it is similar to this https://tour.golang.org/methods/9 |
18:55:09 | shashlick | tensortom - have you seen nimgen and nimterop |
18:55:32 | tensortom | shashlick, just trolling based on experience from like a year ago. will check those out thx |
18:56:24 | tensortom | lol "Nimgen is a helper for c2nim to simplify and automate the wrapping of C libraries" well then... |
18:56:40 | pacujo | If I'm working on two versions of the same project in parallel, files with identical names get compiled all the time. Better keep the caches apart. |
18:56:58 | Araq | shashlick, compile with -d:useGcAssert -d:useSysAssert |
18:57:09 | Araq | that works on Windows and adds tons of sanity checks |
18:57:13 | tensortom | shashlick, how would you contrast the two? |
18:57:22 | Araq | so it will quickly detect where your pointers cross DLL boundaries |
18:57:31 | shashlick | Araq - will do, thanks! |
18:57:40 | shashlick | tensortom: depends what you want to wrap |
18:58:22 | shashlick | nimterop automates everything but is limited to C |
18:58:42 | shashlick | c2nim is far more capable as you know and can do c++ |
18:59:07 | shashlick | nimgen is a precursor to nimterop |
18:59:22 | tensortom | ah |
18:59:35 | shashlick | so what do you want to wrap |
19:00:43 | * | tensortom quit (Remote host closed the connection) |
19:01:41 | * | tensortom joined #nim |
19:05:09 | tensortom | shashlick, probably several things now that I'm less likely to have to root around through C code |
19:05:17 | tensortom | nothing in particular though |
19:05:29 | shashlick | Araq: didn't get very far - https://pastebin.com/UHP7WRSW - I'm not even in plugin land yet |
19:06:07 | shashlick | let me push my latest code and give a link to the line |
19:06:09 | tensortom | I was going to wrap blake2 but I see someone has done it ahead of me |
19:06:28 | tensortom | we could use some torrent code wrapped |
19:07:18 | tensortom | libtorrent is one |
19:07:51 | tensortom | or yabtorrent |
19:07:54 | shashlick | i've had https://github.com/willemt/yabtorrent on my backlog for a while, never got around to it |
19:08:38 | tensortom | i will have a go at it and ping you here if trouble |
19:10:18 | tensortom | more nimbles brings more ppl to nim. Most programmers I mention Nim to have never heard of it but admire Go. Then they see the light |
19:12:17 | shashlick | awesome, let me know if you need any help |
19:14:21 | shashlick | there's also a gitter channel for nimterop if its too noisy for here - https://gitter.im/nimterop/Lobby |
19:15:26 | tensortom | thx |
19:18:20 | shashlick | Araq: with gcAssert, I'm dying right here - https://github.com/genotrance/feud/blob/master/src/plugin.nim#L283 |
19:18:54 | Araq | classic Nim gotcha |
19:19:18 | Araq | locks don't make threadsafe Nim code |
19:21:21 | Araq | I have good news and bad news for you. |
19:21:57 | shashlick | all news is good |
19:22:14 | Araq | good news: it's not hard to make your code correct |
19:22:31 | Araq | bad news: you need to rewrite it quite a bit |
19:22:57 | shashlick | that's okay, not getting paid for this hobby 😉 |
19:23:48 | Araq | it is not that easy to explain but |
19:23:52 | Araq | start with |
19:23:53 | Araq | var |
19:23:53 | Araq | gThread: Thread[ptr PluginMonitor] |
19:23:57 | Araq | and instead use |
19:24:07 | Araq | var gThread: Thread[void] |
19:25:06 | Araq | and then you have something like |
19:25:27 | Araq | var requests: Channel[PluginMessage] |
19:25:44 | Araq | var responses: Channel[PluginResponse] # maybe not required though? |
19:25:58 | shashlick | so basically no more shared mem, use channels instead? |
19:26:03 | tensortom | I wonder if I could put together something in tensorflow using nimterop to learn to approximate wrapping |
19:26:29 | Araq | and then instead of lock: obj.foo() you do requests.send(Foo(...)) |
19:26:51 | tensortom | rather, I know I could. I wonder if it would succeed |
19:27:21 | shashlick | I was using channels and threadpool before but didn't like inventing a bogus exchange language |
19:27:44 | Araq | there is also --gc:boehm if you can find a boehm.dll (I cannot) |
19:27:48 | shashlick | i can move back to that system, but main question is why shared mem with locks doesn't work |
19:28:11 | Araq | because the memory is not shared, it's threadlocal for strings/seqs and refs and closures |
19:28:42 | Araq | and you cannot make threadlocal heaps safe with locks which is we have not much multi-threaded Nim code out there |
19:29:07 | shashlick | even though I used allocShared0()? |
19:29:20 | Araq | you didn't use it for @[] did you |
19:29:47 | shashlick | oh I see what you are saying |
19:30:11 | shashlick | PluginMonitor* = object is shared, but the random stuff i'm throwing in there isn't shared |
19:30:48 | Araq | there is more good news though: I'm removing thread local heaps |
19:31:04 | * | kapil____ quit (Quit: Connection closed for inactivity) |
19:31:15 | shashlick | so let me ask this - https://github.com/genotrance/feud/blob/master/src/globals.nim#L23 |
19:31:35 | shashlick | if I make PluginMonitor and allocShared every element in it, will it avoid this issue? |
19:31:47 | Araq | well look at it |
19:32:15 | Araq | it requires SharedHashSet[SharedString] and sharedSeq[SharedString] |
19:32:29 | Araq | which we don't have in the stdlib |
19:32:45 | shashlick | ya, i'll have to change all that |
19:33:02 | shashlick | but if I utilize shared memory correctly, the lock should work right |
19:33:17 | Araq | right. you should try to use --gc:boehm |
19:33:40 | Araq | and then switch to --newruntime in 0.20 |
19:33:47 | shashlick | would the current code work with gc:boehm? |
19:33:56 | shashlick | it still looks fundamentally wrong now that you pointed it out |
19:34:28 | Araq | yeah, gc:boehm just works with all of this |
19:34:36 | Araq | if you can find a DLL on windows |
19:35:31 | Araq | and in the longer run this also will work, we figured it out, memory safety without a GC, with shared heaps and much easier to use than Rust |
19:36:52 | * | nsf joined #nim |
19:37:01 | shashlick | ok so sounds like I should get it working with shared mem for now |
19:37:06 | shashlick | rather than moving to channels |
19:37:39 | Araq | yeah |
19:37:48 | Araq | especially since you also want to avoid nimrlt.dll |
19:37:56 | shashlick | ok i'll work on this |
19:38:15 | * | natrys quit (Quit: natrys) |
19:38:18 | shashlick | while you are in here, can you also review pluginapi.nim - https://github.com/genotrance/feud/blob/master/src/pluginapi.nim |
19:38:52 | shashlick | all plugins have a global pointer where they can save stuff - i'm concerned if that is done right |
19:39:11 | shashlick | basically getCtxData() and getPlgData() |
19:40:33 | * | cgfuh quit (Quit: WeeChat 2.3) |
19:40:48 | shashlick | thanks for the insights, really appreciated |
19:41:45 | * | aguspiza quit (Ping timeout: 246 seconds) |
19:42:37 | sealmove | okay I managed to make something similar in Nim: https://termbin.com/j64i |
19:46:10 | sealmove | it uses generics but still it looks quite nice |
19:52:31 | * | rnrwashere quit (Remote host closed the connection) |
19:53:25 | Araq | sealmove, there are also libraries that use macros to do these things |
19:54:01 | Araq | shashlick, GC_ref/unref can have problems with shared heaps too but boehm's GC will work |
19:54:07 | sealmove | yeah well, just playing around basically |
19:54:21 | sealmove | so hyped about newruntime :)) |
19:54:57 | shashlick | Araq: no cross-thread sharing going on with plugins |
19:55:02 | Araq | and you should, I'm too. Also spent months researching this and just when it seemed impossible a nice solution turned up |
19:55:04 | shashlick | all in the same thread |
19:55:28 | Araq | shashlick, ok |
19:55:30 | shashlick | i'm trying to replace my seq and hashset with sharedlist |
19:55:43 | shashlick | i think even the string field will have to be shared right |
19:55:44 | Araq | no, try to compile boehm.dll on Windows |
19:56:02 | shashlick | https://github.com/ivmai/bdwgc |
19:56:07 | Araq | yeah, even the strings should be and then you're fighting the language moreso than working with it |
19:57:27 | Araq | also, Boehm GC wins on some benchmarks over Nim's GC. Sad but true |
19:58:08 | shashlick | Ok will try that first |
19:58:57 | Araq | if you manage, please share this .dll with me |
19:59:27 | Araq | I'd like to ship it with Nim |
20:00:05 | Araq | currently we disabled the Boehm tests on Windows |
20:00:14 | Araq | because we don't have the DLL |
20:01:32 | shashlick | Seems it should build with mingw |
20:01:36 | shashlick | https://github.com/ivmai/bdwgc/blob/master/doc/README.win32 |
20:01:44 | shashlick | I'll try it out and let you know |
20:16:03 | * | rnrwashere joined #nim |
20:19:18 | * | Vladar quit (Remote host closed the connection) |
20:21:03 | shashlick | ok I have libgc-1.dll |
20:22:58 | shashlick | my word it just works |
20:23:01 | shashlick | no more crash |
20:27:03 | shashlick | Araq: I can send you a 32-bit and 64-bit boehmgc.dll |
20:27:23 | shashlick | but the code just looks for same filename - do we need a code change for boehmgc64.dll |
20:27:49 | * | ptdel joined #nim |
20:30:56 | * | nsf quit (Quit: WeeChat 2.4) |
20:35:20 | * | jjido joined #nim |
20:38:55 | Araq | shashlick, yeah a small mmdisp.nim patch is required |
20:41:34 | sealmove | Varriount: I tried your original example of Concepts and it fails with "Error: 'ImplementingSomeProc' is not a concrete type". https://termbin.com/tioe |
20:41:35 | shashlick | okay cool |
20:45:26 | sealmove | Are Concepts only for matching proc/template parameters? |
20:45:40 | shashlick | Araq: is it possible to compile boehm in as a static lib - do we need code changes for that |
20:46:12 | Araq | why would we want to do that? |
20:46:24 | Araq | as a DLL is also solves the DLL problems |
20:46:43 | shashlick | single binary |
20:47:20 | Araq | but who cares about that on Windows, you put the .dll next to the .exe, done |
20:48:56 | * | Trustable quit (Remote host closed the connection) |
20:49:02 | shashlick | i typically did since I can ship one exe with everything in it, but ya |
20:49:32 | ptdel | I had a question about concepts would the be considered analogous or similar to haskell typeclasses? |
20:49:37 | ptdel | they* |
20:51:01 | sealmove | ptdel: I think they are pretty similar |
20:51:16 | Araq | they are constraints for generics |
20:51:24 | ptdel | perfect :D |
20:51:48 | ptdel | I was talking to my coworkers about trying to use concepts to implement a "policy as code" framework for resources we deploy |
20:52:00 | ptdel | the idea we could use concepts as policies in a sense was very attractive |
20:52:15 | Araq | I doubt it works out |
20:52:18 | ptdel | :-p |
20:52:40 | ptdel | Araq: any reason for thinking it might be a bad idea? |
20:53:08 | ptdel | we would be attempting to typify things like a Virtual Machine (for amazon) |
20:53:10 | sealmove | Araq doesn't like Concepts :P |
20:53:24 | ptdel | ah lol |
20:53:44 | ptdel | fwiw i think they are a cool idea |
20:53:53 | ptdel | but i come from a place that has things like them |
20:53:57 | Araq | years of experience. People think they could use concepts for this and that and then they cannot even write 'myObjectField: MyConcept' and begin to understand what "constraints for generics" means |
20:54:16 | sealmove | they are, but rarely needed/useful, and they scare away or confuse less experienced ppl |
20:54:35 | sealmove | (like me :P) |
20:54:42 | ptdel | so if I'm trying to apply constraints to just types in general, try another approach eh? |
20:55:42 | * | noeontheend joined #nim |
20:55:43 | Araq | usually Nim is better at codegen-like abstractions than at type based abstractions |
20:55:58 | * | cyraxjoe joined #nim |
20:56:35 | Araq | that means: macros! |
20:56:57 | ptdel | I've liked macros and templates quite a bit. somebody that lurks here often and myself have been using macros to automate API operations from a very nasty IDL |
20:57:19 | ptdel | (a java idl) Nim has been reliably making procedures from the IDL thus far best i can tell |
20:59:00 | Araq | thanks |
21:00:36 | * | rnrwashe_ joined #nim |
21:01:24 | * | vlad1777d joined #nim |
21:01:28 | sealmove | random thought I had recently: I trully think Nim is the best scripting language. Scripting languages have been associated with interpreters and dynamic typing, but this is totally false imo. What you actually need is a shebang, top-level execution, and nice syntax. Being statically typed is actually a plus since we have type inference, and the compilation speed is not an issue for small scripts. |
21:02:28 | sealmove | Pretty much a better Python for that matter if you ask me. |
21:03:00 | Araq | I would go further than that and claim that static typing in a scripting setting is more important than for production code that has a test suite anyway |
21:03:23 | Araq | I mean, ok, static typing is great, it also helps readability and performance |
21:03:39 | * | rnrwashere quit (Ping timeout: 264 seconds) |
21:03:53 | ptdel | my work is primarily Python, you (probably have some) idea of how refreshing Nim is to me x_x |
21:04:31 | Araq | but this idea to run *stringly typed* code that accesses my filesystem nilly willy is idiotic |
21:05:03 | * | narimiran quit (Ping timeout: 245 seconds) |
21:05:57 | ptdel | simply having a compiler between operations and deployments is a huge plus. otherwise easy errors proliferate all over the place |
21:06:04 | sealmove | I think dynamic typing is rarely useful, if at all today. |
21:08:39 | * | elrood quit (Remote host closed the connection) |
21:16:42 | xace | oh wow, termux finally included nim in their packagemanager :) |
21:17:26 | xace | anyone know if the termux-api has a interface or something that can be used to have nim utilize ? |
21:23:50 | ptdel | not sure what to make of this: if I have array[18, char] it shows up in errors as array[0..17, char] but if i have array[20, char] it shows up as array[0..27, char] is it using a different base or anything? |
21:24:26 | BaldEagleX02 | @shashlick Could you join ##nim-iot? We are discussing about using nimterop |
21:24:31 | Araq | never seen anything like it |
21:24:47 | BaldEagleX02 | me neither |
21:29:31 | * | rnrwashe_ quit (Read error: Connection reset by peer) |
21:30:13 | * | rnrwashe_ joined #nim |
21:32:30 | ptdel | nevermind, I need to refresh myself on pointers :-p |
21:34:04 | shashlick | @BaldEagleX02 - is that on irc |
21:37:44 | shashlick | Araq: https://www.dropbox.com/sh/g77an3wvuarvl7o/AACodadNdWPovrNeMd0nuOQWa?dl=0 |
21:39:01 | ptdel | given that openArray is only suitable for parameters, whats the ideal type to refer to in inferences when returning arrays of variable length? dealing with some cryptographic hashing of strings |
21:39:56 | * | pacujo left #nim ("Killed buffer") |
21:44:47 | Araq | ptdel, either you let the caller deal with it by a parameter result: var openArray[] |
21:45:16 | Araq | or you return a seq. or you return a fixed size array and use static T to compute the array sizes at compile-time |
21:45:27 | Araq | shashlick, ah excellent |
21:45:29 | BaldEagleX02 | @shashlick Yes |
21:46:11 | ptdel | Araq: thank you that works, I needed var openArray[] |
21:48:57 | * | arecacea1 quit (Remote host closed the connection) |
21:49:15 | * | arecacea1 joined #nim |
21:50:02 | sealmove | Araq: After literally hours of staring at the screen I finally understand how that closure pattern works exactly like Go interfaces \o/ |
21:51:11 | * | ptdel quit (Remote host closed the connection) |
22:02:00 | sealmove | https://termbin.com/75cw |
22:03:02 | Araq | shashlick, you have Nim repo commit rights, can you undo the change that made nightlies fail? |
22:03:04 | sealmove | It's a little weird because you write `proc` but really what you are defining is a type. And the return type of that `proc` is actually the interface that you are implementing |
22:03:41 | Araq | sealmove, told ya most people struggle with it. |
22:03:42 | FromDiscord | <moerm> Hello |
22:04:07 | shashlick | Araq: busy evening, will look into it tomorrow |
22:04:08 | FromDiscord | <moerm> Anyone from the Nim team here? I have a very weird Nim bug/problem(?) |
22:04:25 | sealmove | yeah it's unintuitive, but u're right, once understood it's nothing special |
22:04:42 | FromDiscord | <moerm> details are here -> https://forum.nim-lang.org/t/4726#29491 |
22:07:36 | sealmove | 19.9 is out?? |
22:08:07 | FromDiscord | <moerm> Nope. It's a nightly. The current release is 19.4 iirc |
22:10:11 | * | tensortom quit (Remote host closed the connection) |
22:10:39 | * | tensortom joined #nim |
22:12:43 | Araq | moerm: 0 .. -1 is the empty range and 0 is not in it |
22:14:13 | FromDiscord | <moerm> Araq Oops. I supoosed -1 means last element. But still, why does Nim throw ? |
22:15:07 | Araq | var somebuf: array[MEG64, char] is array[0..MEG64-1, char] and so passing MEG64 to 'start' seems to be wrong |
22:16:04 | FromDiscord | <moerm> The array contains valid data |
22:16:06 | * | shashlick quit (Remote host closed the connection) |
22:16:27 | * | shashlick joined #nim |
22:16:39 | FromDiscord | <moerm> (btw: First: Thanks for looking into it!) Uhm, I don't pass MEG64 to start. |
22:16:59 | BaldEagleX02 | @shashlick How do I import multiple libraries at once with Nimterop? |
22:17:00 | FromDiscord | <moerm> The problem happens in the first call whith start being 0 |
22:18:34 | FromDiscord | <moerm> Nim throws when k == 0 (so when I try to assign bufx[0] to c (a char) |
22:19:54 | Araq | btw instead of .. code-block:: nim |
22:20:05 | sealmove | moerm: it runs fine on my machine |
22:20:07 | Araq | use ```nim ``` on the forum |
22:20:20 | Araq | so avoid the indentation hell |
22:21:05 | FromDiscord | <moerm> Just "nim" on a line by itself? Great! Thanks a lot for that tip |
22:22:10 | Araq | no, with the triple backticks |
22:22:17 | sealmove | you need the three backquotes before and after "nim" |
22:22:23 | Araq | markdown style |
22:22:48 | FromDiscord | <moerm> Ah, OK. |
22:25:17 | * | rnrwashere joined #nim |
22:25:59 | dom96 | hey shashlick, you around? |
22:27:40 | * | rnrwashe_ quit (Ping timeout: 264 seconds) |
22:27:50 | FromDiscord | <moerm> (dom96 Hello, and: saw him just some minutes ago) |
22:28:11 | dom96 | yeah, I see he was around 20 minutes ago |
22:29:13 | Araq | moerm: don't allocate your large buffer on the stack |
22:29:48 | Araq | apart from that, I don't know why you would get a crash, never seen Nim getting basic index checks wrong |
22:30:37 | FromDiscord | <moerm> Araq Me neither. I have learned to trust Nim. But here it throws with a simple index 0 op |
22:31:19 | * | bobby quit (Ping timeout: 244 seconds) |
22:31:38 | FromDiscord | <moerm> I'll try to alloc it one the heap, but: I have a very similar proc that works with bytes (instead of char) and does work flawlessly. Really, really strange |
22:32:30 | Zevv | Araq, I'm trying the assign the result of a a macro with code block to a const, but Nim says "invalid indentation". Is that a bug or a feature? |
22:34:56 | Zevv | http://paste.debian.net/1073678/ |
22:35:16 | shashlick | I'm here kind of |
22:35:56 | dom96 | shashlick: Since you'll be working on this `nim e` Nimble integration, would you like write access to the repo? :) |
22:36:02 | * | bobby joined #nim |
22:40:12 | dom96 | I have so little time these days that it would be helpful to have someone taking a more active role in maintaining Nimble (that includes reviewing PRs and merging them) |
22:41:13 | FromDiscord | <moerm> @Araq Sorry, but it throws with a (heap alloc'd) ref too 😦 |
22:41:25 | FromDiscord | <moerm> (same exception) |
22:43:38 | * | bobby quit (Ping timeout: 252 seconds) |
22:43:53 | * | Bob- joined #nim |
22:44:33 | FromDiscord | <moerm> I also made the array smaller (just 1024 bytes) - and it still throws |
22:45:50 | shashlick | Sure @dom96 that will be great |
22:47:28 | dom96 | Done! |
22:48:56 | * | bobby joined #nim |
22:49:52 | * | Bob- quit (Ping timeout: 252 seconds) |
22:55:03 | * | solitudesf quit (Ping timeout: 245 seconds) |
22:55:10 | shashlick | Awesome! Now to live up to it :D |
22:57:53 | FromGitter | <deech> @dom96: Out of curiosity are you working full time on Nim? |
22:58:07 | dom96 | Sadly no |
22:58:21 | * | bobby quit (Remote host closed the connection) |
22:59:56 | * | lf-araujo joined #nim |
23:01:19 | * | bobby joined #nim |
23:01:43 | FromGitter | <deech> Ah, ok. I thought you were part of that core team that was hired by Status (?, I forget now). |
23:04:54 | * | ftsf joined #nim |
23:06:11 | Araq | moerm: well the compiler tells you there is no 0th element in your openarray |
23:06:49 | Araq | so recheck your logic once again and if you think the compiler is wrong reproduce the problem in a smaller test program that we can run |
23:07:03 | Araq | that's all I can say, sorry |
23:07:42 | Araq | Zevv, how strange, bug report please |
23:10:51 | * | bobby quit (Remote host closed the connection) |
23:11:34 | dom96 | deech: AFAIK Status hasn't hired anyone to work on Nim directly. They, along with others, are contributing money to the Nim project and that allows Araq to hire people to help with the development |
23:11:48 | * | lf-araujo quit (Ping timeout: 250 seconds) |
23:13:01 | FromDiscord | <moerm> Araq I'll try |
23:13:37 | FromDiscord | <moerm> But I'm absolutely certain (and verified that) that there *is* a 0'th element |
23:16:07 | FromGitter | <deech> @dom96: Ah, didn't know that. Thanks, appreciate the info! |
23:16:11 | Araq | well ignore the exact error message but assume an index is off |
23:17:43 | FromGitter | <kayabaNerve> dom96: I thought you were part of the team hired by Araq with Status money :thinking: |
23:20:44 | dom96 | I've got another full-time job :) |
23:21:32 | FromGitter | <kayabaNerve> I thought Nim was your full time job, :thinking: |
23:21:44 | FromGitter | <kayabaNerve> Joking :p I understand it all now. |
23:22:26 | FromDiscord | <moerm> @Araq, sorry, nope. I've checked it and checked it again and debugEcho'ed. The index is *not* off. It's 0 and there *is* an elem[0] |
23:23:54 | sealmove | how do you test for type equality? |
23:27:10 | Araq | moerm: how do you know there is elem[0]? what does len say? what does high say? |
23:27:46 | Araq | what if you disable index checking ( {.push checks: off.}proc ... {.pop.} ) |
23:28:57 | * | bobby joined #nim |
23:29:10 | FromDiscord | <moerm> I expressly tested for low, in fact I set my index via low. len says the true length. |
23:29:26 | FromDiscord | <moerm> I'll try your tip to turn off index checking |
23:30:06 | sealmove | is doAssert type(x) == type(y) possible atm? |
23:34:30 | * | rnrwashere quit (Read error: Connection reset by peer) |
23:35:02 | * | rnrwashere joined #nim |
23:35:10 | * | Bob- joined #nim |
23:36:20 | * | bobby quit (Ping timeout: 258 seconds) |
23:37:40 | FromDiscord | <moerm> I guess I'll have to look at the generated C code |
23:38:46 | * | vlad1777d quit (Remote host closed the connection) |
23:40:41 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:41:13 | * | vlad1777d joined #nim |
23:42:04 | * | Bob- quit (Ping timeout: 264 seconds) |
23:42:41 | * | bobby joined #nim |
23:52:22 | FromDiscord | <moerm> @Araq I closed in. After de-inlining a (unrelated) proc that gets called elsewhere my code works with index checking disabled. Well, that's a start |
23:53:25 | FromDiscord | <moerm> (And I completely forgive the Nim compiler to throw up with heavily inlined (albeit unrelated) code in the module. After all, Nim isn't yet 1.0. All in all I'm very happy and find Nim quite reliable) |